! Test pentru: machine-epsilon; ULP; intrinsic function EPSILON.
subroutine test_eps_8()
implicit real(8) (a-h, o-z)

real(8) machine_EPS
character(20) text(3)


machine_EPS =2.D0**(-53)
ULP1 =2.D0**(-52)
EPS =EPSILON(1.D0)

print *, 'ULP(1.D0) =2**(-52):   ', ULP1
print *, 'machine_EPS =2**(-53):', machine_EPS
print *, 'EPSILON(real(8)):     ', EPS
print *

text(1) ='1.D0 + ULP(1.D0)'
text(2) ='1.D0 + machine_EPS'
text(3) ='1.D0 + EPSILON'

u  =1.D0+ULP1
u1 =1.D0 +machine_EPS		! nu este >1.D0 - fiindca se rotunjeste
u2 =1+ EPS


! write to file:
write(1,*) 'Test pentru: machine-epsilon; ULP; intrinsic function EPSILON.'
write(1,*)
write(1,*) 'ULP(1.D0) =2**(-52):   ', ULP1
write(1,*) 'machine_EPS =2**(-53): ', machine_EPS
write(1,*) 'EPS  =EPSILON(real(8)):', EPS
write(1,*)

if(u >1.D0) then
write(1,*) trim(text(1))//' >1.D0'
else
write(1,*) trim(text(1))//' =1.D0'
endif

write(1,*)
if(u1 >1.D0) then
write(1,*) trim(text(2))//' >1.D0'
else
write(1,*) trim(text(2))//' =1.D0'
endif

write(1,*)
if(u2 >1.D0) then
write(1,*) trim(text(3))//' >1.D0'
else
write(1,*) trim(text(3))//' =1.D0'
endif

end

!---------------------------------------
