Maxima functions are OK
but mpmath is not as slow as one can think
sage: time list_plot([(x,mpmath.legenq(2,0,x)) for x in
srange(-0.99,1.01,0.05)],plotjoined=True)
+list_plot([(x,mpmath.legenp(2,0,x)) for x in
srange(-0.99,1.01,0.1)],plotjoined=True)
CPU times: user 0.20 s, sys: 0.00 s, total: 0.20 s
Wall time: 0.20 s


On 12 Kwi, 21:52, ObsessiveMathsFreak <obsessivemathsfr...@gmail.com>
wrote:
> On Apr 12, 3:51 am, kcrisman <kcris...@gmail.com> wrote:
>
> > > > Or simply legendre_P, legendre_Q
>
> > > Unfortunately, these functions do not support non integer values of n,
> > > i.e. they don't support generalised legendre functions, which is what
> > > I need.
>
> > Are gen_legendre_P and gen_legendre_Q okay?  These are all used from
> > Maxima, as I recall.
>
> > - kcrisman
>
> They worked and were a _lot_ faster. Thanks!
>
> sage: time plot([lambda x: P(n,0,x), lambda x: Q(n,0,x)],
> (x,-1,1),ymin=-2,ymax=2)
> sage: time plot([gen_legendre_P(n,0,x), gen_legendre_Q(n,0,x)],
> (x,-1,1),ymin=-2,ymax=2)
> Time: CPU 3.79 s, Wall: 3.80 s
> Time: CPU 0.32 s, Wall: 0.41 s

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to