[SciPy-user] Python program failure caused by fastumath *FIXED*

R. Padraic Springuel rspringuel at smcvt.edu
Sun Apr 24 15:12:42 CDT 2005


When attempting to evaluate certain functions for which the expected 
range of the function is complex, fastumath (what scipy uses to define 
these universal functions) causes a program fatal error in python (at 
least under Windows XP, which I run).  After some experimenting with the 
problem, I have come up with a work around solution.  By rewriting the 
wrapper functions in scimath (found in the scipy_base folder) so that 
these functions use Numeric's umath functions instead, the functions 
work as expected (including the automatic domain change that the wrapper 
functions in scimath were originally intended for).  The only remaining 
bug is that the fix requires importing Numeric before importing scipy.  
Any help with this last bug would be appreciated, as I cannot determine 
why this makes a difference.

My rewritten version of scimath can be downloaded from the following 
address:
http://www.umit.maine.edu/~r.springuel/000CCFE8-80000018/

Note: In addition to the above described fix, my rewritten scimath also 
contains definitions for several trig functions and hyperbolic trig 
functions which were not previously defined by either numeric or scipy.  
These functions are also handled appropriately under the above fix where 
necessary with the following exceptions: arcsec(0), arccsc(0), & 
arccoth(0), which still return math domain errors (again, suggestions on 
how to handle these special cases is appreciated).

-- 

R. Padraic Springuel



More information about the SciPy-user mailing list