ENH: optimize/minpack: determine leastsq and fsolve epsfcn by dtype (fixes Trac #920) #427

Merged
merged 1 commit into from Feb 11, 2013

2 participants

@pv
SciPy member
pv commented Feb 9, 2013

Fix the behavior of minpack optimizers with float32. If the objective function returns float32, then the default value for epsfcn is too small, as it corresponds to float64 machine epsilon.

This PR makes the numerical differentiation epsilon be determined by function return type.

Closes Trac #920

@pv pv ENH: optimize/minpack: determine leastsq and fsolve epsfcn by dtype (…
…fixes Trac #920)

In particular, if the objective function returns float32, use a large
enough epsilon for gradient estimation.
703dc23
@dlax dlax merged commit 38ec1a2 into scipy:master Feb 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment