On 7 feb, 04:48, Burcin Erocal <bur...@erocal.org> wrote: > You need to add an _eval_() function which calls _evalf_() if the > argument is not exact. See this patch for an example: > > http://trac.sagemath.org/sage_trac/attachment/ticket/4498/trac_4498-s...
Done :) > The _evalf_() function in your patch hard codes RDF. You need to do > something like this: > > sage: from sage.libs.mpmath import utils as mpmath_utils > sage: import mpmath > sage: mpmath_utils.call(mpmath.airyai, 1, parent=RR) > 0.135292416312881 mpmath seems to be around 35 times faster than the RDF version, (which was the way things were done before my patch). > I don't think we want to have separate functions for the derivatives in > Sage. These might help you get around the printing problem for now, but > they are not useful in general. I disagree here, Mathematica has got the AiryAiPrime function. And mpmath supports calculating derivatives and integrals of arbitrary order! I think it would be best if we could do something like: sage: airy_ai(x) airy_ai(x) sage: airy_ai(x,1) airy_ai_prime(x) sage: airy_ai(x,-2) airy_ai(x,-2) that is, make a single object that returns arbitrary derivatives or integrals. Cheers! Oscar -- 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