diff --git a/include/weak_forms/unary_operators.h b/include/weak_forms/unary_operators.h index 64206d3b..d0c47ffd 100644 --- a/include/weak_forms/unary_operators.h +++ b/include/weak_forms/unary_operators.h @@ -1607,6 +1607,10 @@ private: \ { using namespace std; + // Circumvent persistent FPE + if (value == vectorized_value_type{}) + return vectorized_value_type{}; + #ifdef WEAK_FORMS_VECTORIZATION_FPE_SQRT_OF_ZERO // We need to check if the vector is a zero vector. If so, simply // avoid the operation that would result in an FPE as we know the