"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mpmath/tests/torture.py" between
mpmath-1.0.0.tar.gz and mpmath-1.1.0.tar.gz

About: mpmath is a Python library for arbitrary-precision floating-point arithmetic.

torture.py  (mpmath-1.0.0):torture.py  (mpmath-1.1.0)
""" """
Torture tests for asymptotics and high precision evaluation of Torture tests for asymptotics and high precision evaluation of
special functions. special functions.
(Other torture tests may also be placed here.) (Other torture tests may also be placed here.)
Running this file (gmpy and psyco recommended!) takes several CPU minutes. Running this file (gmpy recommended!) takes several CPU minutes.
With Python 2.6+, multiprocessing is used automatically to run tests With Python 2.6+, multiprocessing is used automatically to run tests
in parallel if many cores are available. (A single test may take between in parallel if many cores are available. (A single test may take between
a second and several minutes; possibly more.) a second and several minutes; possibly more.)
The idea: The idea:
* We evaluate functions at positive, negative, imaginary, 45- and 135-degree * We evaluate functions at positive, negative, imaginary, 45- and 135-degree
complex values with magnitudes between 10^-20 to 10^20, at precisions between complex values with magnitudes between 10^-20 to 10^20, at precisions between
5 and 150 digits (we can go even higher for fast functions). 5 and 150 digits (we can go even higher for fast functions).
skipping to change at line 43 skipping to change at line 43
* inverse trigonometric functions (some become inaccurate for complex argument s) * inverse trigonometric functions (some become inaccurate for complex argument s)
* ci, si (not implemented properly for large complex arguments) * ci, si (not implemented properly for large complex arguments)
* zeta functions (need to modify test not to try too large imaginary values) * zeta functions (need to modify test not to try too large imaginary values)
* and others... * and others...
""" """
import sys, os import sys, os
from timeit import default_timer as clock from timeit import default_timer as clock
if "-psyco" in sys.argv:
sys.argv.remove('-psyco')
import psyco
psyco.full()
if "-nogmpy" in sys.argv: if "-nogmpy" in sys.argv:
sys.argv.remove('-nogmpy') sys.argv.remove('-nogmpy')
os.environ['MPMATH_NOGMPY'] = 'Y' os.environ['MPMATH_NOGMPY'] = 'Y'
filt = '' filt = ''
if not sys.argv[-1].endswith(".py"): if not sys.argv[-1].endswith(".py"):
filt = sys.argv[-1] filt = sys.argv[-1]
from mpmath import * from mpmath import *
from mpmath.libmp.backend import exec_ from mpmath.libmp.backend import exec_
 End of changes. 2 change blocks. 
6 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)