#2648 float zeta inaccurate on SCL

None
open
nobody
numeric (3)
5
2013-10-26
2013-10-24
No

See the following testsuite run:

$ ./maxima-local -l scl -r 'run_testsuite(tests=[rtest16]);'
Warning: the kernel parameter max_map_count=65530 is less than the 189440+
pages usable by Scieneer Common Lisp.  It is recommended that max_map_count be
increased to at least 189440.  This can be done with either:
   sysctl -w vm.max_map_count=189440
   echo 189440 > /proc/sys/vm/max_map_count
Maxima branch_5_31_base_80_g9f2bf3d http://maxima.sourceforge.net
using Lisp Scieneer Common Lisp 1.3.9
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) Running tests in rtest16: 
********************** Problem 265 ***************
Input:
closeto(zeta(%i + 3) - (1.10721440843141 - .1482908671781754 %i), 1.0e-15)

Result:
3.3157171554456788e-9

This differed from the expected result:
true

********************** Problem 266 ***************
Input:
        !              1 !
closeto(!zeta(0.5 %i + -)! - 1.06534921249378, 1.0e-14)
        !              2 !

Result:
3.1194385519128787e-8

This differed from the expected result:
true

Tracing a little bit shows that this is calling code in float-zeta in
combin.lisp. I don't know whether this is similar to the recent
bug/wontfix example with a less-than-brilliant lisp implementation
failing at numerics.

So this is maybe fixable, otherwise we should increase the float
threshold for these tests.

Discussion

  • Raymond Toy

    Raymond Toy - 2013-10-25

    IIRC, this issue also occurred with sbcl and ccl. The problem was in something like (cl:expt 3 pi) being computed as (exp (* pi (log 3))). The rules of CL contagion says (log 3) is a single-float, so 3^pi only has single-float accuracy, even though the result is a double-float.

    Can you compare (cl:expt 3 pi) vs (cl:expt 3d0 pi)?

     
  • Rupert Swarbrick

    It looks right:

    ~~~~
    :::text
    Warning: the kernel parameter max_map_count=65530 is less than the 189440+
    pages usable by Scieneer Common Lisp. It is recommended that max_map_count be
    increased to at least 189440. This can be done with either:
    sysctl -w vm.max_map_count=189440
    echo 189440 > /proc/sys/vm/max_map_count
    Maxima branch_5_31_base_80_g9f2bf3d http://maxima.sourceforge.net
    using Lisp Scieneer Common Lisp 1.3.9
    Distributed under the GNU Public License. See the file COPYING.
    Dedicated to the memory of William Schelter.
    The function bug_report() provides bug reporting information.
    (%i1) :lisp (cl:expt 3 pi)

    31.54428070019754
    (%i1) :lisp (cl:expt 3d0 pi)

    31.54428070019754
    (%i1) :lisp (- (cl:expt 3 pi) (cl:expt 3d0 pi))

    0.0

     

Log in to post a comment.