indri[1]% cd f |
indri[2]% cat sumtest.f
|
*234567
program sumtest
real*16 r,term,sum,exact,error
integer nmax,bits,digits
parameter (nmax=19999999)
* mathematica expression: r:=-Exp[Log[1/2]/(nmax+1)]
r = -0.99999996534264157256899498887665177157834137q0
* mathematica expression: exact:=(1-r^(nmax+1))/(1-r)
exact = 0.250000004332169878499657750231851815195062251q0
write(*,'(a,g47.40)') ' exact = ',exact
term = 1
sum = term
do n=1,nmax,1
term = r*term
sum = sum+term
enddo
write(*,'(a,g47.40)') ' sum = ',sum
error = abs(sum-exact)/exact
bits = -int(log(error)/log(2.0q0))
digits = -int(log(error)/log(10.q0))
write(*,'(a,g14.6)') ' relative error',error
write(*,'(a,i5,a,i5)') ' digits',digits,', bits',bits
end
|
indri[3]% rsh strauss uname -a
|
SunOS strauss.udel.edu 5.5.1 Generic_103640-18 sun4u sparc SUNW,Ultra-Enterprise
|
indri[4]% rcp sumtest.f strauss:f
|
indri[5]% rsh strauss make f/sumtest
|
f77 -o f/sumtest f/sumtest.f
f/sumtest.f:
MAIN sumtest:
|
indri[6]% rsh strauss time f/sumtest
|
exact = 0.2500000043321698784996577502318518011302
sum = 0.2500000043321698784996577502061046696309
relative error 0.102989E-27
digits 27, bits 92
70.06u 0.01s 1:10.69 99.1%
|
indri[7]% rsh joplin uname -a
|
sn9108 sn9108 8.0.4 sos.0 CRAY J90
|
indri[8]% sed 's/q0/d0/g' sumtest.f | rsh joplin 'cat >! f/sumtest.f'
|
indri[9]% rsh joplin make f/sumtest
|
cf77 f/sumtest.f -o f/sumtest
|
indri[10]% rsh joplin time f/sumtest
|
exact = 0.2500000043321698784996577502349000000000
sum = 0.2500000043321698784996623916085000000000
relative error 0.185655E-22
digits 22, bits 75
68.9130u 0.7499s 1:25 81%
|
indri[11]% rsh mozart uname -a
|
AIX mozart 2 3 000010368000
|
indri[12]% rcp sumtest.f mozart:f
|
indri[13]% rsh mozart make f/sumtest
|
xlf -O f/sumtest.f -o f/sumtest
** sumtest === End of Compilation 1 ===
1501-510 Compilation successful for file sumtest.f.
|
indri[14]% rsh mozart time f/sumtest
|
exact = .2500000043321698784996577502318507900169
sum = .2500000043321698784996577501915911504595
relative error .161039E-27
digits 27, bits 92
13.0u 0.0s 0:39 32% 19+135k 0+0io 1pf+0w
|
indri[15]% rsh gershwin uname -a
|
IRIX64 gershwin 6.2 03131016 IP25
|
indri[16]% rcp sumtest.f gershwin:f
|
indri[17]% rsh gershwin make f/sumtest
|
f77 -64 -o -o f/sumtest f/sumtest.f
|
indri[18]% rsh gershwin time f/sumtest
|
exact = 0.2500000043321698784996577502318508000000
sum = 0.2500000043321698784996577502018617000000
relative error 0.119956E-27
digits 27, bits 92
20.6u 0.0s 0:23 86% 0+0k 0+0io 0pf+0w
|