A genuine bug in numerical evaluation ?

67 views
Skip to first unread message

Emmanuel Charpentier

unread,
Jun 6, 2019, 5:04:27 AM6/6/19
to sage-support
This ask.sagemath  question seems to raise a genuine bug. Perusing Trac doesn't raise muc relevant, possibly except for Trac#24428 and Trac#21754.

From my comment to the ask.sagemath question :

Indeed :
    sage: var("y,z")
    (y, z)
    sage: cauchy(z)=solve(z*y^3 +y^2 - 2*z*y+2 ,y)[0].rhs()
    sage: def foo(u):return(arg(cauchy(u)).n())
    sage: [foo(t) for t in (1,1.1..2)]
    [0.828222717321238,
    ## Snip...
     0.377665318352514]
Therefore, this function *can* be evaluated. But :
    sage: plot(foo,(1,2))
    verbose 0 (3635: plot.py, generate_plot_points) WARNING: When plotting, failed to evaluate function at 200 points.
    verbose 0 (3635: plot.py, generate_plot_points) Last error message: 'negative number cannot be raised to a fractional power'
    Launched png viewer for Graphics object consisting of 0 graphics primitives
... not in `plot`. Trying  to plot symbolically yelds :
    TypeError: Cannot evaluate symbolic expression to a numeric value.
A bug, IMHO.

Can someone confirm this and, possibly, give me hints as how to flag this ticket efficiently ?

Emmanuel Charpentier

unread,
Jun 6, 2019, 5:57:08 PM6/6/19
to sage-support
According to Serge Lelièvre, the proble doesn't occur when ran under a Python3-based Sage. He advises to run such a Sage, hich seems a bit early, IMHO?

Advice ?

John H Palmieri

unread,
Jun 6, 2019, 6:20:25 PM6/6/19
to sage-support
I can confirm that it works for me on OS X with Python 3, gives the error you described with Python 2.

John H Palmieri

unread,
Jun 6, 2019, 6:21:39 PM6/6/19
to sage-support
Oh, and Sage with Python 3 is in pretty good shape these days. Still some doctest failures, but I think it is mostly very functional.

  John
Reply all
Reply to author
Forward
0 new messages