Sharedsupport / 2014-11-12-complex-plot.sagewsOpen in CoCalc
Authors: Harald Schilly, ℏal Snyder, William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.

See trac 17329 -- http://trac.sagemath.org/ticket/17329

f(z)=zeta(z^2) complex_plot(f,(-10,10),(-10,10),axes=False,figsize=[3,3],plot_points=100)
def f(z): return zeta(z^3) complex_plot(f,(-10,10),(-10,10),axes=False,figsize=[3,3],plot_points=100)
Error in lines 4-4 Traceback (most recent call last): File "/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/.sagemathcloud/sage_server.py", line 865, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "lazy_import.pyx", line 358, in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:3000) File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 550, in wrapper return func(*args, **options) File "complex_plot.pyx", line 345, in sage.plot.complex_plot.complex_plot (build/cythonized/sage/plot/complex_plot.c:5288) File "handle_error.pyx", line 90, in sage.libs.pari.handle_error._pari_handle_exception (build/cythonized/sage/libs/pari/handle_error.c:1178) PariError: overflow in t_REAL->double conversion

Here's a workaround -- use CC instead.

def f(z): return zeta(CC(z)^3) complex_plot(f,(-10,10),(-10,10),axes=False,figsize=[3,3],plot_points=100)

Here is the bug.

m = 0 def f(z): global m m = z return zeta(z^3) complex_plot(f,(-10,10),(-10,10),axes=False,figsize=[3,3],plot_points=100)
Error in lines 6-6 Traceback (most recent call last): File "/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/.sagemathcloud/sage_server.py", line 865, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "lazy_import.pyx", line 358, in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:3000) File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 550, in wrapper return func(*args, **options) File "complex_plot.pyx", line 345, in sage.plot.complex_plot.complex_plot (build/cythonized/sage/plot/complex_plot.c:5288) File "handle_error.pyx", line 90, in sage.libs.pari.handle_error._pari_handle_exception (build/cythonized/sage/libs/pari/handle_error.c:1178) PariError: overflow in t_REAL->double conversion
m
0.505050505051 - 10.0*I
## DONT EVALUATE THIS -- it will completely crash the sage process. # if you do evaluate it, click "Restart" above.... zeta(m^3) 276de5df-6bf6-4a48-bf4d-7bb82d8f1116