Does h5diff --use-system-epsilon imply something about --nan?

'Afternoon,

Atop h5diff 1.8.5-patch1 I've noticed that comparing NaN against NaN
passes when using --use-system-epsilon. It fail when using
--delta=something.

Does --use-system-epsilon imply more than just --delta=DBL_EPSILON?
If so, please add that to the --help message.

- Rhys

Rhys,

It may be the case that your system epsilon is different from DBL_EPSILON.

Here is what I copied from h5diff UG for clarification:
    -d D, --delta=D
          Print difference if (|a-b| > D). D must be a positive number.
          Can not use with '-p' or '--use-system-epsilon'.
    -p R, --relative=R
          Print difference if (|(a-b)/b| > R). R must be a positive number.
          Can not use with '-d' or '--use-system-epsilon'.
    --use-system-epsilon
          Print difference if (|a-b| > EPSILON), EPSILON is system defined value.
          If the system epsilon is not defined,one of the following predefined
          values will be used:
            FLT_EPSILON = 1.19209E-07 for floating-point type
            DBL_EPSILON = 2.22045E-16 for double precision type
          Can not use with '-p' or '-d'.

Thanks
--pc

···

On 7/14/2011 1:12 PM, Rhys Ulerich wrote:

'Afternoon,

Atop h5diff 1.8.5-patch1 I've noticed that comparing NaN against NaN
passes when using --use-system-epsilon. It fail when using
--delta=something.

Does --use-system-epsilon imply more than just --delta=DBL_EPSILON?
If so, please add that to the --help message.

- Rhys

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Hi Peter,

Atop h5diff 1.8.5-patch1 I've noticed that comparing NaN against NaN
passes when using --use-system-epsilon. It fail when using
--delta=something.

It may be the case that your system epsilon is different from DBL_EPSILON....

  -d D, --delta=D
        Print difference if (|a-b| > D). D must be a positive number.
        Can not use with '-p' or '--use-system-epsilon'.
...
  --use-system-epsilon
        Print difference if (|a-b| > EPSILON), EPSILON is system defined value.

My question wasn't about the magnitude of EPSILON used. Changing the
magnitude of the EPSILON used in the comparison (|a-b| > EPSILON)
cannot explain the differences in NaN handling I described above.

Something else must be different between --use-system-epsilon and
--delta=something (for appropriately chosen "something"). Maybe --nan
is implied? Maybe the comparison is "inverted" for
--use-system-epsilon so that a NaN causes the check to succeed while
the "regular" check for --delta=something fails for a NaN value?

Thanks for the response,
Rhys

Rhys,

"--use-system-epsilon" and "--delta=something" use different code.

"--use-system-epsilon" considers two NaNs of the same type are equal, which is correct.
"--delta=something" considers two NaN of the same type are different, which is wrong. We will need to fix it.

This behavior was documented at
http://www.hdfgroup.org/HDF5/doc/RM/Tools.html#Tools-Diff
"
h5diff and NaNs:
h5diff detects when a value in a dataset is a NaN (a "not a number" value), but does not differentiate among various types of NaNs. Thus, when one NaN is compared with another NaN, h5diff treats them as equal; when a NaN is compared with a valid number, h5diff treats them as not equal.
"

···

On 7/14/2011 3:24 PM, Rhys Ulerich wrote:

Hi Peter,

Atop h5diff 1.8.5-patch1 I've noticed that comparing NaN against NaN
passes when using --use-system-epsilon. It fail when using
--delta=something.

It may be the case that your system epsilon is different from DBL_EPSILON....

   -d D, --delta=D
         Print difference if (|a-b|> D). D must be a positive number.
         Can not use with '-p' or '--use-system-epsilon'.
...
   --use-system-epsilon
         Print difference if (|a-b|> EPSILON), EPSILON is system defined value.

My question wasn't about the magnitude of EPSILON used. Changing the
magnitude of the EPSILON used in the comparison (|a-b|> EPSILON)
cannot explain the differences in NaN handling I described above.

Something else must be different between --use-system-epsilon and
--delta=something (for appropriately chosen "something"). Maybe --nan
is implied? Maybe the comparison is "inverted" for
--use-system-epsilon so that a NaN causes the check to succeed while
the "regular" check for --delta=something fails for a NaN value?

Thanks for the response,
Rhys

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Hi Peter,

"--use-system-epsilon" and "--delta=something" use different code.

"--use-system-epsilon" considers two NaNs of the same type are equal, which
is correct.
"--delta=something" considers two NaN of the same type are different, which
is wrong. We will need to fix it.

Thank you. That explains what I was seeing.

Appreciate the help,
Rhys