On 9/11/26 22:44, Steve Kargl wrote:
On 9/11/26 22:37, Steve Kargl wrote:
With -O3, I get
% gfcx -o z -O3 bessel.f90 -fdump-tree-optimized && ./z
0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
which is not at all what I expected! In fact, if I look for symbols in
z there is no call to j0f in the math library.
Peeling back the onion, compile this code
program foo
real(4) x, f
read(*,*) x
f = bessel_j0(x)
print *, f, "5.64343985e-8"
end program foo
and when input is expected on execution
enter 2.40482556. On FreeBSD (and likely
any fdlibm based libm), you'll see.
% gfcx -o z -O3 bes.f90 && ./z
2.40482556
5.96342957E-08 5.64343985e-8
The second number is the correct value.
--
steve