[SciPy-user] minimizers don't work - d1mach problem

Robert Kern robert.kern at gmail.com
Thu Mar 2 21:18:34 CST 2006

Christian Kristukat wrote:
> Robert Kern wrote:
>>Christian Kristukat wrote:
>>>sorry for posting this again, but I'd really like to have the minimizers work
>>>again. Every call to any of the miminizers scipy.fmin* fails with:
>>> Adjust D1MACH by uncommenting data statements
>>> appropriate for your machine.
>>>STOP 779
>>>I already looked at Lib/special/d1mach.f but I don't see what I should change
>>>there. Anyway, d1mach.f hasn't been changed for ages so I doubt that the problem
>>>is there.
>>>Here's my configuration:
>>>Python 2.4.1 (#1, Sep 13 2005, 00:39:20)
>>>[GCC 4.0.2 20050901 (prerelease) (SUSE Linux)] on linux2
>>>numpy/scipy from svn
>>>ATLAS built with gfortran
>>Odd. For your configuration, D1MACH ought to be taking the IEEE LITTLE ENDIAN
>>branch earlier on, and the STOP 779 statements should never be reached. Try
>>adding these lines to diagnose the issue:
>>Index: Lib/special/mach/d1mach.f
>>--- Lib/special/mach/d1mach.f   (revision 1630)
>>+++ Lib/special/mach/d1mach.f   (working copy)
>>@@ -60,6 +60,9 @@
>>       IF (SC .NE. 987) THEN
>>          DMACH(1) = 1.D13
>>+         write(*,*) 'DMACH(1) == ', DMACH(1)
>>+         write(*,*) 'SMALL(1) == ', SMALL(1)
>>+         write(*,*) 'SMALL(2) == ', SMALL(2)
>>          IF (      SMALL(1) .EQ. 1117925532
>>      *       .AND. SMALL(2) .EQ. -448790528) THEN
>> *           *** IEEE BIG ENDIAN ***
> There's no additional output, so the if condition seems to be False.

In that case, the STOP statements wouldn't be executed either. Add more
write(*,*) statements to explore it, if you like. But:

> There's
> another d1mach.f in Lib/integrate/mach. Which one is the relevant here?

Couldn't say. Try adding some different write(*,*) statements to it in order to
find out.

> Btw, the minimizers partly run, maybe in case when the gradients are far from
> IEEE numeric limits?

That wouldn't trigger anything in d1mach, though.

What is your function? Are you using anything in scipy.special or scipy.integrate?

Robert Kern
robert.kern at gmail.com

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter

More information about the SciPy-user mailing list