Average Error: 15.4 → 1.4
Time: 22.1s
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)}\]
\[e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.4

    \[\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. Taylor expanded around 0 1.4

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

    \[\leadsto e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)}\]

Reproduce

herbie shell --seed 2019007 
(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: 21.3s)Debug log

sample151.0ms

Algorithm
intervals

simplify114.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

114.0ms
(* (cos (- (/ (* K (+ m n)) 2) M)) (exp (- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))))

prune20.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 15.9b

localize67.0ms

Local error

Found 4 expressions with local error:

35.4b
(cos (- (/ (* K (+ m n)) 2) M))
0.0b
(- (/ (* K (+ m n)) 2) M)
0.0b
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
0.0b
(pow (- (/ (+ m n) 2) M) 2)

rewrite114.0ms

Algorithm
rewrite-expression-head
Counts
4 → 55
Calls

4 calls. Slowest were:

91.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
12.0ms
(cos (- (/ (* K (+ m n)) 2) M))
5.0ms
(pow (- (/ (+ m n) 2) M) 2)

series330.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

137.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
70.0ms
(cos (- (/ (* K (+ m n)) 2) M))
65.0ms
(pow (- (/ (+ m n) 2) M) 2)
58.0ms
(- (/ (* K (+ m n)) 2) M)

simplify2.6s

Counts
29 → 67
Calls

29 calls. Slowest were:

309.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
302.0ms
(/ (exp (- (pow (- (/ (+ m n) 2) M) 2))) (exp (- l (fabs (- m n)))))
291.0ms
(/ (/ 1 (exp (pow (- (/ (+ m n) 2) M) 2))) (exp (- l (fabs (- m n)))))

prune1.1s

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.8b

localize3.0ms

Local error

Found 2 expressions with local error:

0.0b
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
0.0b
(pow (- (/ (+ m n) 2) M) 2)

rewrite158.0ms

Algorithm
rewrite-expression-head
Counts
2 → 34
Calls

2 calls. Slowest were:

153.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
5.0ms
(pow (- (/ (+ m n) 2) M) 2)

series177.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

120.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
58.0ms
(pow (- (/ (+ m n) 2) M) 2)

simplify2.0s

Counts
20 → 40
Calls

20 calls. Slowest were:

296.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
291.0ms
(/ (/ 1 (exp (pow (- (/ (+ m n) 2) M) 2))) (exp (- l (fabs (- m n)))))
286.0ms
(/ (exp (- (pow (- (/ (+ m n) 2) M) 2))) (exp (- l (fabs (- m n)))))

prune629.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.8b

localize21.0ms

Local error

Found 4 expressions with local error:

45.2b
(cos (* (* (cbrt (- (/ (* K (+ m n)) 2) M)) (cbrt (- (/ (* K (+ m n)) 2) M))) (cbrt (- (/ (* K (+ m n)) 2) M))))
15.0b
(cbrt (- (/ (* K (+ m n)) 2) M))
15.0b
(cbrt (- (/ (* K (+ m n)) 2) M))
15.0b
(cbrt (- (/ (* K (+ m n)) 2) M))

rewrite37.0ms

Algorithm
rewrite-expression-head
Counts
4 → 46
Calls

4 calls. Slowest were:

24.0ms
(cos (* (* (cbrt (- (/ (* K (+ m n)) 2) M)) (cbrt (- (/ (* K (+ m n)) 2) M))) (cbrt (- (/ (* K (+ m n)) 2) M))))
4.0ms
(cbrt (- (/ (* K (+ m n)) 2) M))
4.0ms
(cbrt (- (/ (* K (+ m n)) 2) M))

series798.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

267.0ms
(cbrt (- (/ (* K (+ m n)) 2) M))
240.0ms
(cbrt (- (/ (* K (+ m n)) 2) M))
227.0ms
(cbrt (- (/ (* K (+ m n)) 2) M))
62.0ms
(cos (* (* (cbrt (- (/ (* K (+ m n)) 2) M)) (cbrt (- (/ (* K (+ m n)) 2) M))) (cbrt (- (/ (* K (+ m n)) 2) M))))

simplify3.9s

Counts
27 → 58
Calls

27 calls. Slowest were:

403.0ms
(exp (* 1/3 (- (log 1/2) (+ (log (/ 1 m)) (log (/ 1 K))))))
368.0ms
(exp (* 1/3 (- (log 1/2) (+ (log (/ 1 m)) (log (/ 1 K))))))
330.0ms
(exp (* 1/3 (- (log 1/2) (+ (log (/ 1 m)) (log (/ 1 K))))))

prune1.3s

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.8b

localize12.0ms

Local error

Found 4 expressions with local error:

35.4b
(cos (- (/ (* K (+ m n)) 2) M))
35.4b
(cos (- (/ (* K (+ m n)) 2) M))
35.4b
(cos (- (/ (* K (+ m n)) 2) M))
0.5b
(cbrt (* (* (cos (- (/ (* K (+ m n)) 2) M)) (cos (- (/ (* K (+ m n)) 2) M))) (cos (- (/ (* K (+ m n)) 2) M))))

rewrite27.0ms

Algorithm
rewrite-expression-head
Counts
4 → 41
Calls

4 calls. Slowest were:

10.0ms
(cbrt (* (* (cos (- (/ (* K (+ m n)) 2) M)) (cos (- (/ (* K (+ m n)) 2) M))) (cos (- (/ (* K (+ m n)) 2) M))))
6.0ms
(cos (- (/ (* K (+ m n)) 2) M))
5.0ms
(cos (- (/ (* K (+ m n)) 2) M))

series304.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

87.0ms
(cos (- (/ (* K (+ m n)) 2) M))
83.0ms
(cos (- (/ (* K (+ m n)) 2) M))
80.0ms
(cos (- (/ (* K (+ m n)) 2) M))
53.0ms
(cbrt (* (* (cos (- (/ (* K (+ m n)) 2) M)) (cos (- (/ (* K (+ m n)) 2) M))) (cos (- (/ (* K (+ m n)) 2) M))))

simplify1.3s

Counts
24 → 53
Calls

24 calls. Slowest were:

211.0ms
(cbrt (* (+ (cos (+ (- (/ (* K (+ m n)) 2) M) (- (/ (* K (+ m n)) 2) M))) (cos (- (- (/ (* K (+ m n)) 2) M) (- (/ (* K (+ m n)) 2) M)))) (cos (- (/ (* K (+ m n)) 2) M))))
106.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
88.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))

prune1.1s

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.8b

regimes434.0ms

Accuracy

0% (0.2b remaining)

Error of 1.4b against oracle of 1.2b and baseline of 1.4b

bsearch4.0ms

end0.0ms

sample4.5s

Algorithm
intervals