Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Project: math480-2016
Views: 3150(1.1662436161232819, 7.180621168198628e-09)
Another speed trick is fast_float
.
This is something Robert Bradshaw wrote, originally to make 3d plotting faster. It takes a symbolic epxression and "compiles" it (very quickly) into an internal form that can be evaluated quickly.
See http://doc.sagemath.org/html/en/reference/misc/sage/ext/fast_eval.html
CPU time: 0.77 s, Wall time: 0.81 s
CPU time: 0.00 s, Wall time: 0.00 s
625 loops, best of 3: 1.34 ms per loop
5 loops, best of 3: 780 ms per loop
582.089552238806
**Exercise: ** Make up your own symbolic functions by copying how we wrote f(x,y) = log(abs( 4 - 2*cos(2*pi*x) - 2*cos(2*pi*y)))
above, and compare the speed of evaluation using fast_float to the speed of a Python function def f(x,y): ...
that does the same thing.