Average Error: 14.9 → 1.3
Time: 19.0s
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 14.9

    \[\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.3

    \[\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.3

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

Reproduce

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

sample136.0ms

Algorithm
intervals
Results
268×(pre true 80)
262×(body real 80)
(body real 640)
(body real 1280)

simplify152.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
152.0ms
(* (cos (- (/ (* K (+ m n)) 2) M)) (exp (- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))))

prune15.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 16.7b

localize57.0ms

Local error

Found 4 expressions with local error:

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

rewrite159.0ms

Algorithm
rewrite-expression-head
Rules
10×*-un-lft-identity
add-log-exp
add-sqr-sqrt
add-cube-cbrt
add-exp-log
pow1
add-cbrt-cube
associate-*r*
unpow-prod-down
sub-neg
distribute-lft-out--
associate--r+
associate-*r/
diff-log
cos-sum
difference-of-squares
associate--r-
unpow2
flip--
flip-+
*-commutative
pow-exp
neg-log
flip3--
flip3-+
distribute-lft-in
distribute-rgt-neg-in
pow-pow
pow-to-exp
cos-diff
distribute-rgt-in
neg-sub0
associate--l-
Counts
4 → 59
Calls
4 calls:
Slowest
134.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
11.0ms
(cos (- (/ (* K (+ m n)) 2) M))
11.0ms
(pow (- (/ (+ m n) 2) M) 2)
2.0ms
(* K (+ m n))

series291.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
122.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
80.0ms
(cos (- (/ (* K (+ m n)) 2) M))
61.0ms
(pow (- (/ (+ m n) 2) M) 2)
28.0ms
(* K (+ m n))

simplify2.4s

Counts
36 → 71
Calls
36 calls:
Slowest
295.0ms
(/ (/ 1 (exp (pow (- (/ (+ m n) 2) M) 2))) (exp (- l (fabs (- m n)))))
271.0ms
(/ (exp (- (pow (- (/ (+ m n) 2) M) 2))) (exp (- l (fabs (- m n)))))
225.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
224.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
215.0ms
(+ (sqrt (- (pow (- (/ (+ m n) 2) M) 2))) (sqrt (- l (fabs (- m n)))))

prune1.4s

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.8b

localize3.0ms

Local error

Found 3 expressions with local error:

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

rewrite150.0ms

Algorithm
rewrite-expression-head
Rules
*-un-lft-identity
add-log-exp
add-sqr-sqrt
add-cube-cbrt
add-exp-log
pow1
add-cbrt-cube
unpow-prod-down
sub-neg
distribute-lft-out--
associate--r+
flip--
diff-log
flip3--
difference-of-squares
associate--r-
unpow2
pow-exp
neg-log
distribute-rgt-neg-in
pow-pow
pow-to-exp
neg-sub0
associate--l-
Counts
3 → 45
Calls
3 calls:
Slowest
134.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
9.0ms
(- (/ (+ m n) 2) M)
5.0ms
(pow (- (/ (+ m n) 2) M) 2)

series197.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
135.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
46.0ms
(pow (- (/ (+ m n) 2) M) 2)
16.0ms
(- (/ (+ m n) 2) M)

simplify2.4s

Counts
23 → 54
Calls
23 calls:
Slowest
570.0ms
(- (sqrt (- (pow (- (/ (+ m n) 2) M) 2))) (sqrt (- l (fabs (- m n)))))
291.0ms
(/ (/ 1 (exp (pow (- (/ (+ m n) 2) M) 2))) (exp (- l (fabs (- m n)))))
236.0ms
(/ (exp (- (pow (- (/ (+ m n) 2) M) 2))) (exp (- l (fabs (- m n)))))
225.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))
222.0ms
(- (- (pow (- (/ (+ m n) 2) M) 2)) (- l (fabs (- m n))))

prune840.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.8b

localize28.0ms

Local error

Found 4 expressions with local error:

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

rewrite36.0ms

Algorithm
rewrite-expression-head
Rules
cos-sum
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
add-exp-log
add-cbrt-cube
pow1
sub-neg
cos-diff
cbrt-prod
pow1/3
Counts
4 → 41
Calls
4 calls:
Slowest
11.0ms
(cos (- (/ (* K (+ m n)) 2) M))
11.0ms
(cos (- (/ (* K (+ m n)) 2) M))
11.0ms
(cos (- (/ (* K (+ m n)) 2) M))
2.0ms
(cbrt (cos (- (/ (* K (+ m n)) 2) M)))

series414.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
216.0ms
(cbrt (cos (- (/ (* K (+ m n)) 2) M)))
81.0ms
(cos (- (/ (* K (+ m n)) 2) M))
61.0ms
(cos (- (/ (* K (+ m n)) 2) M))
57.0ms
(cos (- (/ (* K (+ m n)) 2) M))

simplify1.0s

Counts
24 → 53
Calls
24 calls:
Slowest
102.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
87.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
74.0ms
(pow (cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M)) 1/3)
74.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
71.0ms
(cbrt (sqrt (cos (- (/ (* K (+ m n)) 2) M))))

prune1.4s

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.8b

localize38.0ms

Local error

Found 4 expressions with local error:

34.5b
(cos (- (/ (* K (+ m n)) 2) M))
34.5b
(cos (- (/ (* K (+ m n)) 2) M))
34.5b
(cos (- (/ (* K (+ m n)) 2) M))
34.5b
(cos (- (/ (* K (+ m n)) 2) M))

rewrite46.0ms

Algorithm
rewrite-expression-head
Rules
cos-sum
add-log-exp
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
sub-neg
pow1
add-sqr-sqrt
cos-diff
Counts
4 → 40
Calls
4 calls:
Slowest
12.0ms
(cos (- (/ (* K (+ m n)) 2) M))
11.0ms
(cos (- (/ (* K (+ m n)) 2) M))
11.0ms
(cos (- (/ (* K (+ m n)) 2) M))
11.0ms
(cos (- (/ (* K (+ m n)) 2) M))

series250.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
66.0ms
(cos (- (/ (* K (+ m n)) 2) M))
64.0ms
(cos (- (/ (* K (+ m n)) 2) M))
62.0ms
(cos (- (/ (* K (+ m n)) 2) M))
58.0ms
(cos (- (/ (* K (+ m n)) 2) M))

simplify999.0ms

Counts
24 → 52
Calls
24 calls:
Slowest
88.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
85.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
79.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
78.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
76.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))

prune1.4s

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.8b

regimes394.0ms

Accuracy

0% (0.2b remaining)

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

bsearch3.0ms

end0.0ms

sample3.5s

Algorithm
intervals
Results
8511×(pre true 80)
8096×(body real 80)
141×(body real 640)
128×(body real 1280)
87×(body real 320)
59×(body real 160)