On 09/ 3/12 11:20 PM, Dr. David Kirkby wrote:
> I get a doctest failure here on Solaris 10 SPARC with
> sage/numerical/optimize.py. I can't find this is trac, but is anyone
> aware of it being listed as a bug?
No answers, so it is now
http://trac.sagemath.org/sage_trac/ticket/13427
> Does anyone know an accurate answer to this? I tried to do it in
> Mathematica, using the FindMaximum[] command, but I can't see to get
> that to return anything other than machine precision, despite adding
> options I would have thought would have increased the accuracy
Again no answers, but I managed to work out how to do it in Mathematica.
In[3]:= FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8},WorkingPrecision->50]
Out[3]= {1.5791755355586755940189354764810356787023224274029,
> {x -> 0.78539816339744830961566077712689095303902649201882}}
In[4]:=
(This result was computed by Mathematica 7 running on OpenSolaris on a quad core
Xeon x86 CPU, though the working precision would have meant Mathematica did not
use the FPU)
OK, so now I have what probably is a fairly accurate answer.
> Anyway, here is the failure, on Solaris 10 SPARC, with gcc 4.5.0 (not
> the gcc in Sage).
> sage -t --long -force_lib
> devel/sage/sage/numerical/backends/coin_backend.pyx
> [11.0 s]
> sage -t --long -force_lib devel/sage/sage/numerical/optimize.py
> **********************************************************************
> File
> "/export/home/drkirkby/sage-5.3.rc0/devel/sage-main/sage/numerical/optimize .py",
> line 135:
> sage: find_local_maximum(fast_float(8*e^(-x)*sin(x) - 1, x), 0, 8)
> Expected:
> (1.579175535558..., 0.78539817...)
> Got:
> (1.5791755355586758, 0.78539816111340355)
Note the expected value of the Sage test "(1.579175535558..., 0.78539817...)" is
actually incorrect in the second instance as it should be 0.78539816 and not
0.78539817. The result returned on the SPARC processor is more accurate in this
particular instance, where the absolute error is -2.84x10^-9. So the test needs
changing to be
Expected:
(1.579175535558..., 0.7853981...)
to take account of the various errors when this test is run on different CPUs.
This is
Dave