In one of the tests from FM905.f, flang and gfortran disagree about how
0.25e-10 should be printed: flang prints 2.5e-11, whereas gfortran
prints 2.50000003E-11 (*). Currently, the reference output contains the
former, and the relative tolerance is low enough that the latter is being
reported as an error. However, both values are reasonable results, so
this patch relaxes the tolerance for the FCVS tests to permit either value
when FCVS_ALLOW_FLEXIBLE_OUTPUT is enabled.
The value is implicitly typed in the source code, so it should use the
default real type (which can be either single or double precision
depending on the compilation flags).
In single precision, the closest representable value to 2.5e-11 is
2.500000033378579900045224349014461040496826171875E-11, which is the
same as the closest representable value for 2.50000003E-11, so both
outputs are valid.
In double precision, the closest value to 2.5e-11 is
whereas the closest value to 2.50000003E-11 is
Since fpcmp treats everything as double precision, it errors out in
gfortran's case because the reference output contains the minimum
number of decimals that would produce the same single precision
value. It also fails for either compiler when -fdefault-real-8 is passed:
Compared: 2.500000e-11 and 2.500000e-11
abs. diff = 3.000000e-19 rel.diff = 1.200000e-08
Out of tolerance: rel/abs: 1.000000e-08/0.000000e+00
With the new tolerance, both outputs are considered valid.
(*) These results were obtained on an AArch64 Ubuntu machine.