Expand description
Safe mathematical operations that handle edge cases and validate results
This module provides safe wrappers around common mathematical operations that can produce NaN, Infinity, or other invalid results.
Functionsยง
- safe_
divide - Safely divide two numbers, checking for division by zero and validating the result
- safe_
exp - Safely compute exponential, checking for overflow
- safe_
mean - Safely compute the mean of a slice, handling empty slices
- safe_
normalize - Safely normalize a value by dividing by a norm/magnitude
- safe_
pow - Safely compute power, checking for domain errors and overflow
- safe_
sqrt - Safely compute square root, checking for negative values
- safe_
variance - Safely compute variance, handling numerical issues
- safelog
- Safely compute natural logarithm, checking for non-positive values
- safelog10
- Safely compute base-10 logarithm