axiom-mail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-mail] A slow summation


From: Bill Page
Subject: Re: [Axiom-mail] A slow summation
Date: Wed, 13 Jun 2007 23:27:41 -0400

Of course these also make some sense :-)

(1) -> sum(1/x,x=1.0..20000.0)

  (1)  10.4807282172 29327571
                                 Type: Union(Expression Float,...)
Time: 0.02 (IN) + 3.10 (EV) + 0.02 (OT) + 0.32 (GC) = 3.45 sec

(2) -> sum(1/x,x=(1.0..20000.0)$Segment DoubleFloat)

  (2)  10.480728217229315
                        Type: Union(Expression DoubleFloat,...)
                         Time: 1.77 (EV) + 0.23 (GC) = 2.00 sec

(3) -> sum(1/x,x=1..20000)::Float

  (3)  10.4807282172 29327573
                                                                 Type: Float
                        Time: 5.02 (EV) + 1.22 (GC) = 6.23 sec

----------

Float is the domain of finite precision floating point numbers and
DoubleFloat is the domain of hardware support floating point numbers.
The last computes an exact fraction (rational number) with a final
conversion to Float.

Maybe they provide good examples for your students?

Regards,
Bill Page.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]