|
From: | Alasdair McAndrew |
Subject: | Re: [Axiom-mail] A slow summation |
Date: | Thu, 14 Jun 2007 14:51:03 +1000 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |