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

Christian Kristukat ckkart at hoc.net
Thu Mar 2 23:14:27 CST 2006


Christian Kristukat wrote:
> Robert Kern wrote:
>> Christian Kristukat wrote:
>>
>>> I put the same some write statements in Lib/integrate/mach/d1mach.f, and that's
>>> what I get:
>>>
>>> tnc: Version 1.2, (c) 2002-2003, Jean-Sebastien Roy (js at jeannot.org)
>>> tnc: RCS ID: @(#) $Jeannot: tnc.c,v 1.201 2004/04/02 22:36:25 js Exp $
>>>  integrate DMACH(1) ==    10000000000000.0
>>>  integrate SMALL(1) ==   -448790528
>>>  integrate SMALL(2) ==   1117925532
>>> STOP 778
>>>
>>> Odd, that the error message disappeared and the subroutine stops at a different
>>> line number.
>> Ah, the glorious heisenbug.
>>
>>> Before, the messag was:
>>>
>>> tnc: Version 1.2, (c) 2002-2003, Jean-Sebastien Roy (js at jeannot.org)
>>> tnc: RCS ID: @(#) $Jeannot: tnc.c,v 1.201 2004/04/02 22:36:25 js Exp $
>>>
>>>  Adjust D1MACH by uncommenting data statements
>>>  appropriate for your machine.
>>> STOP 779
>>>
>>> Any ideas?
>> Well, look at the STOP 778 statement.
>>
>>       IF (DMACH(4) .GE. 1.0D0) STOP 778
>>
>> Add a write statement to find out what DMACH(4) is. According to the
>> documentation, it corresponds to the largest relative spacing of
>> double-precision floating point numbers. For that matter, output all 5 entries
>> in DMACH.
> 
> I wrote out DMACH(1-5) right before the STOP 778 condition:
> 
> DMACH(1):  2.225073858507201E-308
>  DMACH(2):  1.797693134862316E+308
>  DMACH(3):  1.110223024625157E-016
>  DMACH(4):  2.220446049250313E-016
>  DMACH(5):  0.301029995663981
>  ****integrate
>  DMACH(1):  2.225073858507201E-308
>  DMACH(2):  1.797693134862316E+308
>  DMACH(3):  1.110223024625157E-016
>  DMACH(4):  2.220446049250313E-016
>  DMACH(5):  0.301029995663981
>  ****integrate
>  DMACH(1):  2.225073858507201E-308
>  DMACH(2):  1.797693134862316E+308
>  DMACH(3):  1.110223024625157E-016
>  DMACH(4):  2.220446049250313E-016
>  DMACH(5):  0.301029995663981
>  ****integrate
>  DMACH(1):                     NaN
>  DMACH(2):  1.856669494629715E-313
>  DMACH(3):   1764.25781250000
>  DMACH(4):  1.060997897063646E-313
>  DMACH(5):   1694.56250000000
>  ****integrate
>  DMACH(1):                     NaN
>  DMACH(2):  1.856669494629715E-313
>  DMACH(3):   1764.25781250000
>  DMACH(4):  1.060997897063646E-313
>  DMACH(5):   1694.56250000000
>  ****integrate
>  DMACH(1):   1.50000000000000
>  DMACH(2):  1.731915531800882E+015
>  DMACH(3):   1764.25781250000
>  DMACH(4):   293.667305600229
>  DMACH(5):   1.50000000000000
> STOP 778
> 
>> It would not surprise me if gfortran is screwing things up. In my experience, it
>> is not very stable.
> 
> I'll try g77, even though I was telling everybody that they should use gfortan
> on SuSE10.0.... sorry.
> 

Just built everything with g77 (BLAS+LAPACK) and it works.
Thanks, Robert.

Regards, Christian



More information about the SciPy-user mailing list