\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)}\cos M \cdot e^{\left|m - n\right| - \left(\ell + \left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\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 (* (cos M) (exp (- (fabs (- m n)) (+ l (* (- (/ (+ m n) 2.0) M) (- (/ (+ m n) 2.0) M)))))))
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 cos(M) * exp(fabs(m - n) - (l + ((((m + n) / 2.0) - M) * (((m + n) / 2.0) - M))));
}






Bits error versus K






Bits error versus m






Bits error versus n






Bits error versus M






Bits error versus l
Results
| Alternative 1 | |
|---|---|
| Error | 5.2 |
| Cost | 14786 |
| Alternative 2 | |
|---|---|
| Error | 4.2 |
| Cost | 64 |
| Alternative 3 | |
|---|---|
| Error | 59.4 |
| Cost | 64 |

Initial program 15.6
Simplified15.6
Taylor expanded around 0 1.3
Simplified1.3
rmApplied add-sqr-sqrt_binary64_78232.2
Applied unpow-prod-down_binary64_83932.2
Simplified32.2
Simplified1.3
Simplified1.3
Final simplification1.3
herbie shell --seed 2021044
(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)))))))