Re: [sage-devel] Re: Sqrt simplification

2013-07-05 Thread rjf
On Wednesday, July 3, 2013 2:05:05 AM UTC-7, Eric Gourgoulhon wrote: > > > > Le mercredi 3 juillet 2013 01:07:35 UTC+2, rjf a écrit : >> >> >> >> Your statement then translates to RPBSRPN(x^2) = abs(x) . >> But then if it ir R+-->R+, the abs() is unnecessary, and RPBSRPN(x^2) = >> x. >> >>

Re: [sage-devel] Re: Sqrt simplification

2013-07-03 Thread Eric Gourgoulhon
Le mercredi 3 juillet 2013 01:07:35 UTC+2, rjf a écrit : > > > > Your statement then translates to RPBSRPN(x^2) = abs(x) . > But then if it ir R+-->R+, the abs() is unnecessary, and RPBSRPN(x^2) = > x. > > No, the abs is necessary: consider the following function: f : R --> R+, x |--> RPBS

Re: [sage-devel] Re: Sqrt simplification

2013-07-02 Thread rjf
On Tuesday, July 2, 2013 4:48:54 AM UTC-7, Eric Gourgoulhon wrote: > > > > Le mardi 2 juillet 2013 02:38:44 UTC+2, rjf a écrit : >> >> >> >> What you've written is just a hack. >> > > Of course it's a hack; this is why I did not submit it as a patch for Sage. > As far as one restricts oneself

Re: [sage-devel] Re: Sqrt simplification

2013-07-02 Thread Eric Gourgoulhon
Le mardi 2 juillet 2013 02:38:44 UTC+2, rjf a écrit : > > > > What you've written is just a hack. > Of course it's a hack; this is why I did not submit it as a patch for Sage. As far as one restricts oneself to the REAL DOMAIN, I think it works. Please show me a counter-example. Again, let

Re: [sage-devel] Re: Sqrt simplification

2013-07-01 Thread rjf
On Sunday, June 30, 2013 1:23:50 PM UTC-7, Eric Gourgoulhon wrote: ... > . It is not optimal but it works: > It works on this example in your opinion. If you want to deal with square roots in this case using some bogus relationship between the choice of branch and some alleged internal "si

Re: [sage-devel] Re: Sqrt simplification

2013-06-30 Thread Burcin Erocal
On Sun, 30 Jun 2013 13:23:50 -0700 (PDT) Eric Gourgoulhon wrote: > Meanwhile, I've written the following workaround in python: > basically, it scans all the sqrt's in a given symbolic expression, > send them to radcan, takes the absolute value of the output and then > calls simplify(). It is not

Re: [sage-devel] Re: Sqrt simplification

2013-06-30 Thread Eric Gourgoulhon
Le vendredi 21 juin 2013 07:00:54 UTC+2, rjf a écrit : > > Yes, I wrote radcan. The full source of it is available. I think it is in > file rat3e.lisp. Look for > (defun $radcan > or perhaps (defmfun $radcan > > I think that if you wish to modify it to make a function with another > name, you

Re: [sage-devel] Re: Sqrt simplification

2013-06-20 Thread rjf
On Thursday, June 20, 2013 1:04:51 AM UTC-7, Eric Gourgoulhon wrote: > > Thanks for your explanation. So it is clear that radcan ignore assumptions. > As already mentioned by kcrisman, radcan does not take into account the > option variable radexpand, which, if set to 'true' (and domain to 'real

Re: [sage-devel] Re: Sqrt simplification

2013-06-20 Thread Eric Gourgoulhon
Thanks for your explanation. So it is clear that radcan ignore assumptions. As already mentioned by kcrisman, radcan does not take into account the option variable radexpand, which, if set to 'true' (and domain to 'real'), would do the job, as suggested in the documentation http://maxima.sourcef

Re: [sage-devel] Re: Sqrt simplification

2013-06-19 Thread Michael Orlitzky
On 06/19/2013 03:03 AM, Eric Gourgoulhon wrote: > > Thanks for your explanation regarding how radcan works. > > If radcan ignores assumptions, how can one explain the following behavior: > > sage: assume(x<0) > sage: sqrt(x^2).simplify_radical() > x > sage: maxima_calculus.eval('domain:real') >