Le Sun, 5 Feb 2012 14:16:39 -0800,
Jonathan Bober <jwbo...@gmail.com> a écrit :
> Never mind all that: the gsl implementation is not very good at all,
> whereas the libc implementation on my machine seems quite good.

Bad :-/

> Old (libc):
>
> sage: gamma(1.23).str(base=2)
> '0.11101001001001110011101011110010110010101100101100001'
> sage: RR(gamma(1.23r)).str(base=2)
> '0.11101001001001110011101011110010110010101100101100001'
> 
> gsl:
> 
> sage: RR(gamma(1.23r)).str(base=2)
> '0.11101001001001110011101011100000000000111110110111001'
> 
> look at all the wrong digits! In my testing, gsl_gamma() has a typical
> error of around 1e-8 on random input between 1 and 2, the tgammal()
> rounded to double precision has a typical error of 0 (compared to the
> correctly rounded value from mpfr).
> 
> What do you get on ARM if you do something like
> 
> sage: for n in range(100):
> ....:     x = RR.random_element(1, 2)
> ....:     print abs(RR(gamma(float(x))) - x.gamma())
> ....:
> 
> ?

On newton(x86_64):
jpuydt@newton:~$ cat /tmp/test.sage 
from sage import *

l=[]
for n in range(100):
    x= RR.random_element(1,2)
    l.append (abs(RR(gamma(float(x))-x.gamma())))

print(max(l))
jpuydt@newton:~$ ~/sage-4.8/sage /tmp/test.sage 
0.000000000000000

and the same test.sage on hecke(ARM):
jpuydt@hecke:~$ ~/sage-4.8/sage test.sage 
1.11022302462516e-16

Sigh.

Snark on #sagemath

-- 
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

Reply via email to