Average Error: 15.3 → 1.5
Time: 47.8s
Precision: 64
Internal Precision: 128
\[\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)}\]
\[\frac{\frac{1}{\sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}} \cdot \sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}}}}{\sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}}}\]

Error

Bits error versus K

Bits error versus m

Bits error versus n

Bits error versus M

Bits error versus l

Derivation

  1. Initial program 15.3

    \[\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)}\]
  2. Initial simplification15.3

    \[\leadsto \frac{\cos \left((\left(\frac{K}{2}\right) \cdot \left(m + n\right) + \left(-M\right))_*\right)}{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}}\]
  3. Taylor expanded around 0 1.5

    \[\leadsto \frac{\color{blue}{1}}{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}}\]
  4. Using strategy rm
  5. Applied add-cube-cbrt1.5

    \[\leadsto \frac{1}{\color{blue}{\left(\sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}} \cdot \sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}}\right) \cdot \sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}}}}\]
  6. Applied associate-/r*1.5

    \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}} \cdot \sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}}}}{\sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}}}}\]
  7. Final simplification1.5

    \[\leadsto \frac{\frac{1}{\sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}} \cdot \sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}}}}{\sqrt[3]{e^{(\left(\frac{m + n}{2} - M\right) \cdot \left(\frac{m + n}{2} - M\right) + \left(\ell - \left|m - n\right|\right))_*}}}\]

Reproduce

herbie shell --seed 2018360 +o rules:numerics
(FPCore (K m n M l)
  :name "Maksimov and Kolovsky, Equation (32)"
  (* (cos (- (/ (* K (+ m n)) 2) M)) (exp (- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n)))))))

Details

Time bar (total: 41.0s)Debug log

start187.0ms

Algorithm
intervals

setup175.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 16.4b

localize44.0ms

Local error

Found 3 expressions with local error:

34.9b
(cos (fma (/ K 2) (+ m n) (- M)))
0.0b
(/ (cos (fma (/ K 2) (+ m n) (- M))) (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
0.0b
(fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
3 → 54
Calls

3 calls. Slowest were:

8.0ms
(/ (cos (fma (/ K 2) (+ m n) (- M))) (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
2.0ms
(cos (fma (/ K 2) (+ m n) (- M)))
0.0ms
(fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))

series599.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

408.0ms
(/ (cos (fma (/ K 2) (+ m n) (- M))) (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
121.0ms
(fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))
71.0ms
(cos (fma (/ K 2) (+ m n) (- M)))

simplify7.8s

Counts
43 → 63
Calls

43 calls. Slowest were:

444.0ms
(- (log (cos (fma (/ K 2) (+ m n) (- M)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))
351.0ms
(/ (sqrt (cos (fma (/ K 2) (+ m n) (- M)))) (sqrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))))
340.0ms
(- (/ 1 (exp (- (fabs (- m n))))) (+ (/ l (exp (- (fabs (- m n))))) (* 1/4 (/ (pow m 2) (exp (- (fabs (- m n))))))))

prune1.4s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 1.1b

localize3.0ms

Local error

Found 2 expressions with local error:

0.0b
(/ 1 (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
0.0b
(fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
2 → 32
Calls

2 calls. Slowest were:

2.0ms
(/ 1 (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
0.0ms
(fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))

series203.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

107.0ms
(/ 1 (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
97.0ms
(fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))

simplify3.1s

Counts
14 → 38
Calls

14 calls. Slowest were:

620.0ms
(/ 1 (exp (fma (- (+ (* 1/2 m) (* 1/2 n)) M) (- (+ (* 1/2 m) (* 1/2 n)) M) (- l (fabs (- m n))))))
482.0ms
(- (/ 1 (exp (- (fabs (- m n))))) (+ (/ l (exp (- (fabs (- m n))))) (* 1/4 (/ (pow m 2) (exp (- (fabs (- m n))))))))
389.0ms
(/ 1 (exp (fma (- (+ (* 1/2 m) (* 1/2 n)) M) (- (+ (* 1/2 m) (* 1/2 n)) M) (- l (fabs (- m n))))))

prune599.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 1.1b

localize18.0ms

Local error

Found 4 expressions with local error:

0.0b
(cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
0.0b
(cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
0.0b
(cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
0.0b
(* (cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))) (cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 74
Calls

4 calls. Slowest were:

7.0ms
(* (cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))) (cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))))
2.0ms
(cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
1.0ms
(cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))

series697.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

257.0ms
(* (cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))) (cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))))
152.0ms
(cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
148.0ms
(cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
140.0ms
(cbrt (exp (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))

simplify9.4s

Counts
46 → 86
Calls

46 calls. Slowest were:

396.0ms
(pow (pow (exp (fma (- (+ (* 1/2 m) (* 1/2 n)) M) (- (+ (* 1/2 m) (* 1/2 n)) M) (- l (fabs (- m n))))) 2) 1/3)
396.0ms
(exp (* 1/3 (fma (- (+ (* 1/2 m) (* 1/2 n)) M) (- (+ (* 1/2 m) (* 1/2 n)) M) (- l (fabs (- m n))))))
375.0ms
(exp (* 1/3 (fma (- (+ (* 1/2 m) (* 1/2 n)) M) (- (+ (* 1/2 m) (* 1/2 n)) M) (- l (fabs (- m n))))))

prune1.7s

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 1.1b

localize19.0ms

Local error

Found 4 expressions with local error:

34.9b
(cos (fma (/ K 2) (+ m n) (- M)))
15.2b
(cbrt (* (* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
0.0b
(* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))
0.0b
(* (* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
4 → 75
Calls

4 calls. Slowest were:

10.0ms
(* (* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))
6.0ms
(cbrt (* (* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
4.0ms
(* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))

series3.7s

Counts
4 → 12
Calls

4 calls. Slowest were:

2.9s
(* (* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))
591.0ms
(* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))))
125.0ms
(cbrt (* (* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
51.0ms
(cos (fma (/ K 2) (+ m n) (- M)))

simplify8.7s

Counts
50 → 87
Calls

50 calls. Slowest were:

956.0ms
(* (* (* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))) (* (* (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n)))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))) (fma (- (/ (+ m n) 2) M) (- (/ (+ m n) 2) M) (- l (fabs (- m n))))))
439.0ms
(- (pow M 6) (+ (* 3 (* m (pow M 5))) (* 3 (* (pow M 5) n))))
428.0ms
(- (pow M 6) (+ (* 3 (* m (pow M 5))) (* 3 (* (pow M 5) n))))

prune1.9s

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 1.1b

regimes566.0ms

Accuracy

0% (0.2b remaining)

Error of 1.5b against oracle of 1.3b and baseline of 1.5b

bsearch4.0ms