Opened 11 years ago

Closed 11 years ago

#12238 closed defect (duplicate)

a bug in taking n() of a definite integral

Reported by: Dima Pasechnik Owned by: Burcin Erocal
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: calculus Keywords:
Cc: Merged in:
Authors: Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

the following triggers a bug in Sage interface, apparently

sage: integrate(sin(x)*(x^(1/2)),x,0,1).n()
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (1111, 0))

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/usr/local/src/sage/sage-4.8.alpha4/spkg/standard/<ipython console> in <module>()

/usr/local/src/sage/sage-4.8.alpha4/local/lib/python2.6/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression._numerical_approx (sage/symbolic/expression.cpp:18004)()

/usr/local/src/sage/sage-4.8.alpha4/local/lib/python2.6/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression._convert (sage/symbolic/expression.cpp:5089)()

/usr/local/src/sage/sage-4.8.alpha4/local/lib/python2.6/site-packages/sage/functions/other.pyc in _evalf_(self, x, parent)
     79         if prec > 53:
     80             raise NotImplementedError, "erf not implemented for precision higher than 53"
---> 81         return parent(1 - pari(float(x)).erfc())
     82         
     83     def _derivative_(self, x, diff_param=None):

/usr/local/src/sage/sage-4.8.alpha4/local/lib/python2.6/site-packages/sage/rings/complex_number.so in sage.rings.complex_number.ComplexNumber.__float__ (sage/rings/complex_number.c:7501)()

TypeError: Unable to convert -0.707106781186547 + 0.707106781186547*I to float; use abs() or real_part() as desired

a comment on IRC:

vbraun: should be return parent(1 - pari(x).erfc())
vbraun: I guess
vbraun: or maybe cast to complex

See #11948 instead.

Change History (4)

comment:1 Changed 11 years ago by Volker Braun

Status: newneeds_review

Duplicate of #12237

comment:2 Changed 11 years ago by Volker Braun

Status: needs_reviewpositive_review

comment:3 Changed 11 years ago by Volker Braun

Reviewers: Volker Braun

comment:4 Changed 11 years ago by Jeroen Demeyer

Description: modified (diff)
Milestone: sage-4.8sage-duplicate/invalid/wontfix
Resolution: duplicate
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.