CuInterval makes use of the built-in CUDA math functions which use round-to-nearest-even.
Since some math functions are not fully accurate up to machine presicion, they do not conform to IEEE 754, we have to perform additional outward rounding to cover the worst-cases of the specified maximum ulp-error of an intrinsic function.
The CUDA math functions use round-to-nearest-even and thus pick the even floating point number if the number would land exactly between two floating point values, otherwise it picks the nearest available value between two floating point values.
We use the same maximum ulp error terminology as CUDA:
The maximum difference (in ulps) of the correctly rounded operation using round-to-nearest-ties-to-even
and the obtained values from the implemented operation.
If the intrinsic function has a reported max. error of 1 ulp, then the resulting interval output will have a max. error of 2 ulps compared to the correctly rounded operation and
2.5 ulps compared to the real analytic value. To see why, let’s look at all the scenarios that could be possible:
We denote the absolute error from the true floating point value by Δulp. A Δulp of 0.5 indicates that the value is 0.5 ulps away from the real analytic value because it is not representable as, e.g., a 64-bit floating point number.