Ticket #1158 (assigned enhancement)

Opened 1 year ago

Last modified 8 months ago

mathematical functions should remain symbolic

Reported by: zimmerma Assigned to: gfurnish (accepted)
Priority: minor Milestone: sage-3.2.2
Component: calculus Keywords:
Cc:

Description

Some mathematical functions automatically evaluate to floating-point, even for a symbolic input (integer or variable):

sage: Ei(10)
2492.22897624
sage: bessel_J(0,10)
-0.245935764451348
sage: bessel_J(0,x)
---------------------------------------------------------------------------
<type 'exceptions.TypeError'>             Traceback (most recent call last)

/tmp/gmp-4.2.2/tune/<ipython console> in <module>()

/usr/local/sage-2.8.12/sage/local/lib/python2.5/site-packages/sage/functions/special.py in bessel_J(nu, z, alg, prec)
    492         else:
    493             K,a = _setup(prec)
--> 494         b = K(nu.besselj(z))
    495         pari.set_real_precision(a)
    496         return b

/tmp/gmp-4.2.2/tune/real_mpfr.pyx in sage.rings.real_mpfr.RealField.__call__()

/tmp/gmp-4.2.2/tune/real_mpfr.pyx in sage.rings.real_mpfr.RealNumber._set()

<type 'exceptions.TypeError'>: Unable to convert x (='1-1/4*x^2+1/64*x^4-1/2304*x^6+1/147456*x^8-1/14745600*x^10+1/2123366400*x^12-1/416179814400*x^14+1/106542032486400*x^16+O(x^17)') to real number.

In my opinion, foo(10) should evaluate to foo(10), and similarly foo(x).

Change History

12/25/2007 06:53:32 PM changed by mabshoff

  • milestone changed from sage-2.10 to sage-2.9.2.

01/26/2008 06:09:26 PM changed by mhansen

This requires going through and look at all the numerical (special) functions we have an making a SymbolicFunction? wrapper class around them. Some thoughts need to be given how to handle the case where we have a function that Maxima does not.

03/23/2008 11:37:56 AM changed by gfurnish

  • owner changed from was to gfurnish.

03/23/2008 11:38:01 AM changed by gfurnish

  • status changed from new to assigned.