Next: Last attempt
Up: Exact numerical computation
Previous: Towards a fourth attempt
We thus compute with signed-digit, arbitrary large binary
expansions, processing digits from left to right using a lazy
language. As discussed above, computations are performed by demand.
For example, if one wants 5 correct digits of
y=h(g(x)), one may need
- 1.
- 49 digits of the intermediate value g(x),
- 2.
- 7 digits of the input x.
Six correct decimal digits of
f60(x0) can be computed in a
fraction of a second. It is effective up to
f250(x0) in my
PC, with a not very careful implementation in the Haskell functional
programming language, using an interpreter rather than a compiler.
The following is the output produced by a Haskell implementation. The
first column displays six correct decimal digits. Internally, the
program first computes
9#9
correct
signed binary digits, which are then converted to decimal. For
comparison, I have also produced the results with floating-point
computations, using the two different, but mathematically equivalent,
expressions
f1(x)=4x(1-x) and
f2(x)=1-(2x-1)2 of the
logistic map. The floating-point numbers are computed in simple
precision and displayed with six digits too. Notice that the
floating-point answers differ from those produced by the C
implementation, although both languages use the same floating-point
standard--I guess that this is due to ``optimizations'' implemented
by the C compiler based on the field properties of real numbers.
n exact Float 1 Float 2
-----------------------------------------------------------------
0 0.671875 0.671875 0.671875
1 0.881836 0.881836 0.881836
2 0.416805 0.416805 0.416805
3 0.972315 0.972315 0.972315
4 0.107676 0.107676 0.107676
5 0.384327 0.384327 0.384327
6 0.946479 0.946479 0.946479
7 0.202625 0.202625 0.202625
8 0.646273 0.646273 0.646273
9 0.914416 0.914417 0.914417
10 0.313037 0.313035 0.313033
11 0.860179 0.860177 0.860174
12 0.481084 0.481091 0.481099
13 0.998569 0.998570 0.998571
14 0.005716 0.005712 0.005707
15 0.022735 0.022720 0.022700
16 0.088875 0.088815 0.088740
17 0.323907 0.323710 0.323462
18 0.875965 0.875688 0.875338
19 0.434601 0.435436 0.436486
20 0.982892 0.983326 0.983864
21 0.067261 0.065585 0.063503
22 0.250949 0.245135 0.237881
23 0.751894 0.740176 0.725175
24 0.746197 0.769262 0.797184
25 0.757549 0.709991 0.646726
26 0.734675 0.823615 0.913886
27 0.779711 0.581093 0.314793
28 0.687047 0.973695 0.862793
29 0.860054 0.102451 0.473525
30 0.481445 0.367818 0.997196
31 0.998623 0.930112 0.011183
32 0.005501 0.260015 0.044233
33 0.021884 0.769629 0.169108
34 0.085620 0.709201 0.562043
35 0.313159 0.824940 0.984603
36 0.860362 0.577656 0.060641
37 0.480558 0.975878 0.227856
38 0.998488 0.094160 0.703751
39 0.006038 0.341177 0.833942
40 0.024009 0.899100 0.553930
41 0.093730 0.362875 0.988366
42 0.339781 0.924787 0.045993
43 0.897320 0.278223 0.175511
44 0.368548 0.803259 0.578828
45 0.930881 0.632135 0.975145
46 0.257366 0.930161 0.096950
47 0.764515 0.259846 0.350203
48 0.720128 0.769305 0.910244
49 0.806175 0.709899 0.326801
50 0.625028 0.823770 0.880008
51 0.937472 0.580692 0.422376
52 0.234472 0.973955 0.975898
53 0.717980 0.101467 0.094084
54 0.809939 0.364686 0.340930
55 0.615752 0.926760 0.898787
56 0.946406 0.271503 0.363877
57 0.202886 0.791157 0.925882
58 0.646894 0.660911 0.274497
59 0.913689 0.896431 0.796593
60 0.315445 0.371371 0.648129
61 0.863758 0.933818 0.912231
62 0.470720 0.247207 0.320263
63 0.996571 0.744383 0.870779
Next: Last attempt
Up: Exact numerical computation
Previous: Towards a fourth attempt
Martin Escardo
2000-10-02