SF [2159499] Full bigfloat precision for Gamma after the second call



Am 18 Oct 2008 um 10:27 hat Raymond Toy geschrieben:

> van Nek wrote:
> >
> > (defun fprt18231_3 nil 
> >   (let ((a 1823176476672000))   
> >      (setq a (ash a (ash fpprec 1)))
> >      (fpquotient (intofp (isqrt a)) (intofp (ash 1 fpprec))) ))
> Can you try this version?  I think it's correct, and gets rid of the
> fpquotient.  My tests with cmucl indicate that this is still quite a bit
> slower than the original.
> 
> (defun fprt18231_3a nil
>   (let ((a 1823176476672000))  
>     (setq a (ash a (ash fpprec 1)))
>     (destructuring-bind (mantissa exp)
>     (intofp (isqrt a))
>       (list mantissa (- exp fpprec)))))

Ray, 

I checked the correctness of version 3a 
(and also of version 4, but 4 has no significant timing difference to 3).

Version 3a is as expected faster than version 3. Here are the timing results:

(remember: 
prec=$fpprec, so that fpprec=32*2^n+(0 to 4), worst case for version 1;
all times in milliseconds, 1.6 GHz CPU)

W2k/GCL
precs: [616,  1233, 2466,  4932,  9864,  19728,  39456]$
time1: [0.17, 0.49, 1.22,  3.18,  8.6,   23.92,  70.59]$
time3a:[0.83, 1.89, 3.35, 10.91, 35.02, 111.57, 344.98]$

1:  O(x^1.45)
3a: O(x^1.48)


Ubuntu/clisp
precs: [616,  1233, 2466, 4932,  9864, 19728,  39456]$
time1: [0.36, 0.75, 2.02, 5.82, 18.09,  58.2, 195.19]$
time3a:[0.13, 0.18, 0.41, 1.26,  4.53,  16.91, 66.77]$

1:  O(x^1.53)
3a: O(x^1.58)


Ubuntu/sbcl:
precs: [616,  1233, 2466,  4932,  9864,  19728,  39456]$
time1: [0.34, 0.95, 3.29, 12.53, 49.08, 193.89, 781.59]$
time3a:[0.26, 0.61, 1.94,  6.97, 27.36, 143.61, 414.09]$

1:  O(x^1.87)
3a: O(x^1.82)


The result of this should be

#+gcl( ... version 1 ...
#-gcl( ... version 3a ...

Volker
 
> Ray
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima