diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index a354fb5fe..d3a2f4ed5 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h @@ -626,17 +626,18 @@ template struct pchebevl { EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Packet run(Packet x, const typename unpacket_traits::type coef[]) { + typedef typename unpacket_traits::type Scalar; Packet b0 = pset1(coef[0]); - Packet b1 = pset1(0.f); + Packet b1 = pset1(static_cast(0.f)); Packet b2; for (int i = 1; i < N; i++) { b2 = b1; b1 = b0; - b0 = padd(psub(pmul(x, b1), b2), pset1(coef[i])); + b0 = psub(pmadd(x, b1, pset1(coef[i])), b2); } - return pmul(pset1(0.5f), psub(b0, b2)); + return pmul(pset1(static_cast(0.5f)), psub(b0, b2)); } };