Re: [sage-devel] Re: cube roots in Sage

2014-07-10 Thread P Purkayastha
Hi Greg, Hope the following code helps you in implementing your function: from sage.symbolic.function import SymbolicFunction class real_nth_root_class(SymbolicFunction): def __init__(self): SymbolicFunction.__init__(self, 'real_nth_root', nargs=2) def _evalf_(self, x, n, parent=No

Re: [sage-devel] Re: cube roots in Sage

2014-07-10 Thread Gregory Bard
I think we have a consensus that we should do *something* but unless I am very much mistaken, the suggestion from Vincent Delecroix and Nils Bruin that we make a symbolic function has advantages. I was looking at Nils's code, but I have to confess that I don't understand that code. Actually, I

Re: [sage-devel] Re: cube roots in Sage

2014-06-24 Thread Gregory Bard
As Vincent and Niles have brought up, there might be advantages to it being a symbolic function. How does one actually go about making that happen? Is this an intrusive change, or an easy one? I really have no idea... ---Greg On Sun, Jun 22, 2014 at 5:00 PM, Vincent Delecroix <20100.delecr...@gma

Re: [sage-devel] Re: cube roots in Sage

2014-06-22 Thread Vincent Delecroix
As Niles already said it would be better to have it as a symbolic function sage: f(x) = real_nth_root(x, 5) sage: f x |--> real_nth_root(x,5) 2014-06-22 22:36 UTC+02:00, Gregory Bard : > Yes, that is reasonable. Let us call it "real_nth_root" instead, as > suggested by Nicolas Thiery. Any other r

Re: [sage-devel] Re: cube roots in Sage

2014-06-22 Thread Gregory Bard
Yes, that is reasonable. Let us call it "real_nth_root" instead, as suggested by Nicolas Thiery. Any other requests/comments? It would be superb if this could be resolved by June 30th, when my book goes to the American Mathematical Society for publication... ---Greg On Sun, Jun 22, 2014 at 9:02 A

Re: [sage-devel] Re: cube roots in Sage

2014-06-22 Thread William Stein
On Sun, Jun 22, 2014 at 8:27 AM, Nicolas M. Thiery wrote: > On Fri, Jun 20, 2014 at 06:33:52PM -0700, Gregory Bard wrote: >> It seems that the consensus on both Sage-devel and Sage-edu is to go >> with some sort of nth_real_root function. I propose the following, >> which I have tested for evaluat

Re: [sage-devel] Re: cube roots in Sage

2014-06-22 Thread Nicolas M. Thiery
On Fri, Jun 20, 2014 at 06:33:52PM -0700, Gregory Bard wrote: > It seems that the consensus on both Sage-devel and Sage-edu is to go > with some sort of nth_real_root function. I propose the following, > which I have tested for evaluation, plotting, differentiation, and > integration. Sadly, the de

Re: [sage-devel] Re: cube roots in Sage

2014-06-20 Thread Gregory Bard
It seems that the consensus on both Sage-devel and Sage-edu is to go with some sort of nth_real_root function. I propose the following, which I have tested for evaluation, plotting, differentiation, and integration. Sadly, the derivative has a Dirac delta in it, which is ... perhaps unavoidable bec

Re: [sage-devel] Re: cube roots in Sage

2014-06-19 Thread Nils Bruin
On Thursday, June 19, 2014 2:38:11 AM UTC-4, vdelecroix wrote: > > Note that there is already a method "nth_root" on several elements > (ZZ, finite fields, etc). So I would rather go for "real_nth_root" > which makes things clearer. > Perhaps we can then just get away with a "nth_root" symbolic

Re: [sage-devel] Re: cube roots in Sage

2014-06-18 Thread Vincent Delecroix
Note that there is already a method "nth_root" on several elements (ZZ, finite fields, etc). So I would rather go for "real_nth_root" which makes things clearer. Vincent 2014-06-19 2:44 UTC+02:00, Nils Bruin : > On Wednesday, June 18, 2014 2:37:21 AM UTC-4, Gregory Bard wrote: >> >> This has been