The thread 'Sage 4.3.3.alpha1 released' which covers loads of stuff. The
particular bit I'm referring to is this test failure failure reported by
Robert Marik.
----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
sage -t "devel/sage/sage/misc/functional.py"
**********************************************************************
File "/opt/sage-4.3.3.alpha1/devel/sage/sage/misc/functional.py", line
705:
sage: h.n()
Expected:
0.33944794097891573
Got:
0.33944794097891567
**********************************************************************
1 items had failures:
1 of 14 in __main__.example_28
Robert Marik
----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
The test reads like this:
##############################################
Numerical approximation::
sage: h = integral(sin(x)/x^2, (x, 1, pi/2)); h
integrate(sin(x)/x^2, x, 1, 1/2*pi)
sage: h.n()
0.33944794097891573
#################################################
The test certainly does *not* test Sage's ability to correctly calculate that
integral. It tests the documentation gives the same answers each, but that is
not a lot of use of those answers are incorrect. Nobody appears to have bothered
to evaluate if they are correct or not.
It might verify that Sage gives the same results each time, but without knowing
what the exact result is, this is not a very good test.
I think the doc test would be a *lot* more useful if there were comments in the
test like
# In Mathematica
# In[11]:= N[Integrate[ Sin[x]/x^2,{x,1,Pi/2}],50]
# Out[11]= 0.33944794097891567969192717186521861799447698826918
# This can also be computed in Wolfram Alpha, which uses Mathematica
# as a back end.
#
http://www.wolframalpha.com/input/?i=N[Integrate[+Sin[x]%2Fx^2%2C{x%2C1%2CPi%2F2}]%2C50]
# With mpmath
# sage: import mpmath
# sage: mpmath.mp.dps = 50
# sage: mpmath.quad(lambda x: mpmath.sin(x)/x**2, [1, mpmath.pi/2])
# mpf('0.33944794097891567969192717186521861799447698826917531')
# With Maple:
# some Result computed by Maple to arbitrary precision if
# someone knows how to do it.
Had this been done, then nobody in their right mind would have put the expected
result as 0.33944794097891573, since they would have known those last two digits
were inaccurate.
I'm aware this might not be possible in all cases. If that is so, then some
explanation of why not, and why the result seems 'reasonable' would be
appropriate. I'm not a mathematician, but I'm well aware that for some
calculations you can put an upper and lower limit on a result given theories X
and Y.
I for one would have increased confidence in Sage if I could see that people had
gone to the trouble of making independent checks of the results in the
documentation.
Dave
--
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