On 8/5/10 8:41 AM, Sergey Bochkanov wrote:
Hello, David
You wrote 4 августа 2010 г., 14:49:47:
8:
sage: maxima('asinh(1.0)')
Expected:
0.881373587019543
Got:
.8813735870195429
Clearly there is some numerical noise issues, which need to be
investigated, but are probably trivial.
I think that it is more than trivial issues. You can't require maxima
or any other numerical program to return same results up to 16th digit
with every combination of CPU, compiler, optimization settings.
You can get 0,.......543 when you compile with -O1, and 0,.......999
when you compile with -O2. Well, you can try to make results same up
to the last bit, but it is hard to achieve even with optimization
turned off.
The right move is to compare results using only 10-14 leading digits
(depending on problem and its stability properties). However I don't
know how to do it using doctest framework. Python tries to output
numbers with full precision,and there is no way to tell doctest
framework to compare decimal fractions using only N leading digits.
Yes, there is. The doctest below will compare only the digits listed:
sage: maxima('asinh(1.0)')
0.88137...
If you look through the Sage library, you'll see lots of places where
we use the triple-dot "wildcard" to ignore the last few digits of a
numerical answer.
Thanks,
Jason
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org