|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Mon Mar 08, 2021 1:15 pm Post subject: |
|
|
OK, thanks! It must be the math library used by Gfortran/GCC, then. |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2580 Location: Sydney
|
Posted: Tue Mar 09, 2021 12:22 am Post subject: |
|
|
The hex value for TANH would clarify any problem. Code: | program mterr
use iso_fortran_env
implicit none
integer i,ix,it
real x,tnhx,f
!
write (*,*) compiler_version()
print *
print *,' x x(IEEE hex) tanh(hex) tanh(x) 1/x - 1/tanh(x)'
print *,' ------------- -------- -------- ------------- ---------------'
ix = Z'33DBE6F8'
do i=1,16
x = transfer(ix,x)
tnhx = tanh(x)
it = transfer(tnhx,it)
f = 1.0/x - 1.0/tnhx
print 10,i,x,ix,it,tnhx,f
ix = ix+1
end do
10 format(i2,ES16.7,1x,2Z10,ES16.7,ES15.5)
end program |
|
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Tue Mar 09, 2021 12:07 pm Post subject: |
|
|
John, I raised this issue on CLF.
A few of the responders who had older versions of Gfortran on Linux did report seeing the 1.0s in the output.
Most of them had a recent version of Gfortran on Linux, MacOS, or even Android (on a Nokia phone!), and did not see the error. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|