mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-20 11:54:27 +08:00
Fix bug in Erfc introduced in !1862.
This commit is contained in:
parent
97c7cc6200
commit
b5bef9dcb0
@ -323,7 +323,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T generic_fast_erfc<float>::run(const T& x
|
|||||||
const T num = ppolevl<T, 3>::run(q2, gamma);
|
const T num = ppolevl<T, 3>::run(q2, gamma);
|
||||||
const T denom = pmul(x, ppolevl<T, 4>::run(q2, delta));
|
const T denom = pmul(x, ppolevl<T, 4>::run(q2, delta));
|
||||||
const T r = pdiv(num, denom);
|
const T r = pdiv(num, denom);
|
||||||
const T maybe_two = pand(pcmp_lt(x, pset1<T>(0.0)), pset1<T>(2.0));
|
const T maybe_two = pselect(pcmp_lt(x, pset1<T>(0.0)), pset1<T>(2.0), pset1<T>(0.0));
|
||||||
const T erfc_large = pmadd(z, r, maybe_two);
|
const T erfc_large = pmadd(z, r, maybe_two);
|
||||||
return pselect(x_abs_gt_one_mask, erfc_large, erfc_small);
|
return pselect(x_abs_gt_one_mask, erfc_large, erfc_small);
|
||||||
}
|
}
|
||||||
@ -397,7 +397,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T erfc_double_large(const T& x, const T& x
|
|||||||
const T num_large = ppolevl<T, 9>::run(q2, gamma);
|
const T num_large = ppolevl<T, 9>::run(q2, gamma);
|
||||||
const T denom_large = pmul(x, ppolevl<T, 9>::run(q2, delta));
|
const T denom_large = pmul(x, ppolevl<T, 9>::run(q2, delta));
|
||||||
const T r = pdiv(num_large, denom_large);
|
const T r = pdiv(num_large, denom_large);
|
||||||
const T maybe_two = pand(pcmp_lt(x, pset1<T>(0.0)), pset1<T>(2.0));
|
const T maybe_two = pselect(pcmp_lt(x, pset1<T>(0.0)), pset1<T>(2.0), pset1<T>(0.0));
|
||||||
return pmadd(z, r, maybe_two);
|
return pmadd(z, r, maybe_two);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user