\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)}
\mathsf{expm1}\left(\mathsf{log1p}\left(\cos M \cdot e^{\left|m - n\right| - \left({\left(\frac{m + n}{2} - M\right)}^{2} + \ell\right)}\right)\right)
(FPCore (K m n M l) :precision binary64 (* (cos (- (/ (* K (+ m n)) 2.0) M)) (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))
(FPCore (K m n M l)
:precision binary64
(expm1
(log1p
(*
(cos M)
(exp (- (fabs (- m n)) (+ (pow (- (/ (+ m n) 2.0) M) 2.0) l)))))))double code(double K, double m, double n, double M, double l) {
return cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - fabs((m - n)))));
}
double code(double K, double m, double n, double M, double l) {
return expm1(log1p((cos(M) * exp((fabs((m - n)) - (pow((((m + n) / 2.0) - M), 2.0) + l))))));
}



Bits error versus K



Bits error versus m



Bits error versus n



Bits error versus M



Bits error versus l
Results
Initial program 15.4
Simplified15.4
Taylor expanded in K around 0 1.4
Simplified1.4
Applied expm1-log1p-u_binary641.4
Final simplification1.4
herbie shell --seed 2022160
(FPCore (K m n M l)
:name "Maksimov and Kolovsky, Equation (32)"
:precision binary64
(* (cos (- (/ (* K (+ m n)) 2.0) M)) (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))