Utilities for comparing floating-point values with tolerance.
More...
|
| CHECKASM_API int | checkasm_float_near_ulp (float a, float b, unsigned max_ulp) |
| | Compare floats using ULP (Units in Last Place) tolerance.
|
| |
| CHECKASM_API int | checkasm_float_near_abs_eps (float a, float b, float eps) |
| | Compare floats using absolute epsilon tolerance.
|
| |
| CHECKASM_API int | checkasm_float_near_abs_eps_ulp (float a, float b, float eps, unsigned max_ulp) |
| | Compare floats using both epsilon and ULP tolerances.
|
| |
| CHECKASM_API int | checkasm_float_near_ulp_array (const float *a, const float *b, unsigned max_ulp, int len) |
| | Compare float arrays using ULP tolerance.
|
| |
| CHECKASM_API int | checkasm_float_near_abs_eps_array (const float *a, const float *b, float eps, int len) |
| | Compare float arrays using absolute epsilon tolerance.
|
| |
| CHECKASM_API int | checkasm_float_near_abs_eps_array_ulp (const float *a, const float *b, float eps, unsigned max_ulp, int len) |
| | Compare float arrays using both epsilon and ULP tolerances.
|
| |
| CHECKASM_API int | checkasm_double_near_abs_eps (double a, double b, double eps) |
| | Compare doubles using absolute epsilon tolerance.
|
| |
| CHECKASM_API int | checkasm_double_near_abs_eps_array (const double *a, const double *b, double eps, unsigned len) |
| | Compare double arrays using absolute epsilon tolerance.
|
| |
Utilities for comparing floating-point values with tolerance.
These functions compare floating-point values allowing for acceptable differences due to rounding, precision loss, or different computation orders.
◆ checkasm_float_near_ulp()
Compare floats using ULP (Units in Last Place) tolerance.
- Parameters
-
| [in] | a | First value |
| [in] | b | Second value |
| [in] | max_ulp | Maximum acceptable ULP distance |
- Returns
- Non-zero if values are within tolerance, 0 otherwise
Definition at line 651 of file utils.c.
◆ checkasm_float_near_abs_eps()
Compare floats using absolute epsilon tolerance.
- Parameters
-
| [in] | a | First value |
| [in] | b | Second value |
| [in] | eps | Maximum acceptable absolute difference |
- Returns
- Non-zero if |a-b| < eps, 0 otherwise
Definition at line 679 of file utils.c.
◆ checkasm_float_near_abs_eps_ulp()
Compare floats using both epsilon and ULP tolerances.
- Parameters
-
| [in] | a | First value |
| [in] | b | Second value |
| [in] | eps | Maximum acceptable absolute difference |
| [in] | max_ulp | Maximum acceptable ULP distance |
- Returns
- Non-zero if within either tolerance, 0 otherwise
Definition at line 694 of file utils.c.
◆ checkasm_float_near_ulp_array()
| CHECKASM_API int checkasm_float_near_ulp_array |
( |
const float * | a, |
|
|
const float * | b, |
|
|
unsigned | max_ulp, |
|
|
int | len ) |
Compare float arrays using ULP tolerance.
- Parameters
-
| [in] | a | First array |
| [in] | b | Second array |
| [in] | max_ulp | Maximum acceptable ULP distance |
| [in] | len | Number of elements to compare |
- Returns
- Non-zero if all elements are within tolerance, 0 otherwise
Definition at line 669 of file utils.c.
◆ checkasm_float_near_abs_eps_array()
Compare float arrays using absolute epsilon tolerance.
- Parameters
-
| [in] | a | First array |
| [in] | b | Second array |
| [in] | eps | Maximum acceptable absolute difference per element |
| [in] | len | Number of elements to compare |
- Returns
- Non-zero if all elements are within tolerance, 0 otherwise
Definition at line 684 of file utils.c.
◆ checkasm_float_near_abs_eps_array_ulp()
Compare float arrays using both epsilon and ULP tolerances.
- Parameters
-
| [in] | a | First array |
| [in] | b | Second array |
| [in] | eps | Maximum acceptable absolute difference per element |
| [in] | max_ulp | Maximum acceptable ULP distance |
| [in] | len | Number of elements to compare |
- Returns
- Non-zero if all elements are within tolerance, 0 otherwise
Definition at line 700 of file utils.c.
◆ checkasm_double_near_abs_eps()
Compare doubles using absolute epsilon tolerance.
- Parameters
-
| [in] | a | First value |
| [in] | b | Second value |
| [in] | eps | Maximum acceptable absolute difference |
- Returns
- Non-zero if |a-b| <= eps, 0 otherwise
Definition at line 711 of file utils.c.
◆ checkasm_double_near_abs_eps_array()
Compare double arrays using absolute epsilon tolerance.
- Parameters
-
| [in] | a | First array |
| [in] | b | Second array |
| [in] | eps | Maximum acceptable absolute difference per element |
| [in] | len | Number of elements to compare |
- Returns
- Non-zero if all elements are within tolerance, 0 otherwise
Definition at line 716 of file utils.c.