#8750: numerical noise on solaris
-----------------------------+----------------------------------------------
   Reporter:  jhpalmieri     |       Owner:  drkirkby    
       Type:  defect         |      Status:  needs_review
   Priority:  blocker        |   Milestone:  sage-4.4    
  Component:  solaris        |    Keywords:              
     Author:  John Palmieri  |    Upstream:  N/A         
   Reviewer:                 |      Merged:              
Work_issues:                 |  
-----------------------------+----------------------------------------------
Changes (by jhpalmieri):

  * status:  new => needs_review


Old description:

> I'm getting noise on doctests on Solaris.  One is straightforward to fix
> (chmm.pyx).  For the other (time_series.pyx), on Solaris I get
> {{{
> sage -t  -long devel/sage/sage/finance/time_series.pyx
> **********************************************************************
> File "/home/palmieri/t2/sage-4.4.alpha2/devel/sage-
> main/sage/finance/time_series.pyx", line 691:
>     sage: finance.TimeSeries([1,0,3]).log()
> Expected:
>     [0.0000, -inf, 1.0986]
> Got:
>     [0.0000, -Inf, 1.0986]
> **********************************************************************
> }}}
> So instead of {{{-inf}}}, it's printing {{{-Inf}}}.  However, if I do
> {{{
>    sage: finance.TimeSeries([1,0,3]).log()[1]
> }}}
> then I see {{{-inf}}}.  So I've changed the doctest to use this instead.

New description:

 I'm getting noise on doctests on Solaris.  One is straightforward to fix
 (chmm.pyx).  For the other (time_series.pyx), on Solaris I get
 {{{
 sage -t  -long devel/sage/sage/finance/time_series.pyx
 **********************************************************************
 File "/home/palmieri/t2/sage-4.4.alpha2/devel/sage-
 main/sage/finance/time_series.pyx", line 691:
     sage: finance.TimeSeries([1,0,3]).log()
 Expected:
     [0.0000, -inf, 1.0986]
 Got:
     [0.0000, -Inf, 1.0986]
 **********************************************************************
 }}}
 So instead of {{{-inf}}}, it's printing {{{-Inf}}}.  However, if I do
 {{{
    sage: finance.TimeSeries([1,0,3]).log()[1]
 }}}
 then I see {{{-inf}}}.  So I've changed the doctest to use this instead.

 Oh, and actually reading the docstring, there is an optional argument
 {{{eps}}} which looks something like an error bound.  By default it's set
 to 1e-12, and it looks to me like I've added the dots in the 12th place,
 so now I really don't have any problem with this change.

--

Comment:

 Replying to [comment:1 drkirkby]:
 > Two questions:
 >
 >  * Is sage/finance/time_series.pyx failing on every platform?

 This is the only one, and I don't know why.  I could try compiling
 time_series.py with "-std=c99"; maybe that would help?

 > So is it right to change the test to a more complicated one, just to get
 the answer we want?

 If the difference are for trivial but insurmountable reasons, I don't have
 an issue with this.

 > If this comes from python, I find it hard to understand why there should
 be the difference.

 Maybe it comes from math.h somehow?

 >  * Do we know what an exact (or high numerical precision value) to the
 answer of the problem in sage/stats/hmm/chmm.pyx is?

 This is essentially a new file in the Sage library: in previous versions,
 it was marked with "nodoctest" at the top of the file.  I think that it no
 longer uses an external library either.  So I view this sort of change as
 working kinks out, and it doesn't bother me.


 I'm always a bit reluctant seeing numerical results, with no justification
 of the answer. The approach taken in these doc tests seems to be: "The
 answer is X, since I got X on my computer." Then someone gets a different
 answer on their computer, so the precision of the test is reduced. But
 rarely do I see much justification for the answer. (An exception has been
 in some problems like exp(1.0), where the exact answer is known, and we
 can be sure the problems are numerical rounding issues.
 >
 > When one reads things like how SQLite (Open Source) is tested
 >
 > http://sqlite.org/testing.html
 >
 > or how Wolfram Research claim Mathematica (closed source) is tested
 >
 >
 http://reference.wolfram.com/mathematica/tutorial/TestingAndVerification.html
 >
 > I'm personally left with the feeling the testing in Sage leaves a lot to
 be desired.
 >
 >
 > Dave

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8750#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to