Dear all,
if I compute
t=50
(1-2^(-t))^(2^t)
I get (different versions, machines, ...)
ans = 3.67879441128629e-01
which is correct to the 10th digit (compared with www.wolframalpha.com).
I can stay with it, but Matlab is correct to the 15th digit. While
trying to understand, I wrote the following Fortran code
program test
integer t
t = 50
write(6,'(1x,e24.16)') (1.d0-2.d0**(-t))**(2.d0**t)
write(6,'(1x,e24.16)') (1.d0-2.d0**(-50))**(2.d0**50)
stop
end
If I compile with gfortran test.f (gfortran 4.3.3) and run, I get
0.3678794411286288E+00 (~ Octave value)
0.3678794411714422E+00 (~ Matlab value)
and if I compile with gfortran -O2 test.f and run, I get
0.3678794411714422E+00
0.3678794411714422E+00