mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Revert changes to std_falback::log1p that broke handling of arguments less than -1. Fix packet op accordingly.
This commit is contained in:
@@ -550,9 +550,8 @@ namespace std_fallback {
|
||||
EIGEN_USING_STD_MATH(log);
|
||||
Scalar x1p = RealScalar(1) + x;
|
||||
Scalar log_1p = log(x1p);
|
||||
const bool is_inf = numext::equal_strict(x1p, log_1p);
|
||||
const bool is_small = numext::equal_strict(x1p, Scalar(1));
|
||||
return (is_inf || is_small) ? x : x * (log_1p / (x1p - RealScalar(1)));
|
||||
return is_small ? x : x * (log_1p / (x1p - RealScalar(1)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user