Average Error: 15.1 → 1.5
Time: 14.5s
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.1

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

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

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

Reproduce

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

sample151.0ms

Algorithm
intervals

simplify135.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune19.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 14.5b

localize55.0ms

Local error

Found 4 expressions with local error:

33.7b
(cos (- (/ (* K (+ m n)) 2) M))
0.0b
(pow (- (/ (+ m n) 2) M) 2)
0.0b
(- (/ (* K (+ m n)) 2) M)
0.0b
(* K (+ m n))

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 50
Calls

4 calls. Slowest were:

11.0ms
(pow (- (/ (+ m n) 2) M) 2)
8.0ms
(cos (- (/ (* K (+ m n)) 2) M))
7.0ms
(- (/ (* K (+ m n)) 2) M)

series231.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

85.0ms
(cos (- (/ (* K (+ m n)) 2) M))
60.0ms
(- (/ (* K (+ m n)) 2) M)
56.0ms
(pow (- (/ (+ m n) 2) M) 2)
29.0ms
(* K (+ m n))

simplify866.0ms

Counts
27 → 62
Calls

27 calls. Slowest were:

113.0ms
(- (pow M 2) (+ (* m M) (* M n)))
87.0ms
(- (pow M 2) (+ (* m M) (* M n)))
87.0ms
(- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M)

prune1.1s

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.6b

localize7.0ms

Local error

Found 2 expressions with local error:

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

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

11.0ms
(pow (- (/ (+ m n) 2) M) 2)
9.0ms
(- (/ (+ m n) 2) M)

series87.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

65.0ms
(pow (- (/ (+ m n) 2) M) 2)
22.0ms
(- (/ (+ m n) 2) M)

simplify345.0ms

Counts
11 → 31
Calls

11 calls. Slowest were:

105.0ms
(- (pow M 2) (+ (* m M) (* M n)))
69.0ms
(- (pow M 2) (+ (* m M) (* M n)))
49.0ms
(+ (* 1/2 (* m n)) (+ (* 1/4 (pow m 2)) (* 1/4 (pow n 2))))

prune519.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.6b

localize30.0ms

Local error

Found 4 expressions with local error:

33.7b
(cos (- (/ (* K (+ m n)) 2) M))
33.7b
(cos (- (/ (* K (+ m n)) 2) M))
33.7b
(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))))

rewrite34.0ms

Algorithm
rewrite-expression-head
Counts
4 → 41
Calls

4 calls. Slowest were:

12.0ms
(cbrt (* (* (cos (- (/ (* K (+ m n)) 2) M)) (cos (- (/ (* K (+ m n)) 2) M))) (cos (- (/ (* K (+ m n)) 2) M))))
9.0ms
(cos (- (/ (* K (+ m n)) 2) M))
6.0ms
(cos (- (/ (* K (+ m n)) 2) M))

series265.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

84.0ms
(cos (- (/ (* K (+ m n)) 2) M))
64.0ms
(cos (- (/ (* K (+ m n)) 2) M))
60.0ms
(cos (- (/ (* K (+ m n)) 2) M))
57.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:

167.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))))
105.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
77.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))

prune1.2s

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.6b

localize37.0ms

Local error

Found 4 expressions with local error:

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

rewrite46.0ms

Algorithm
rewrite-expression-head
Counts
4 → 40
Calls

4 calls. Slowest were:

12.0ms
(cos (- (/ (* K (+ m n)) 2) M))
11.0ms
(cos (- (/ (* K (+ m n)) 2) M))
11.0ms
(cos (- (/ (* K (+ m n)) 2) M))

series243.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

76.0ms
(cos (- (/ (* K (+ m n)) 2) M))
60.0ms
(cos (- (/ (* K (+ m n)) 2) M))
57.0ms
(cos (- (/ (* K (+ m n)) 2) M))
49.0ms
(cos (- (/ (* K (+ m n)) 2) M))

simplify1.1s

Counts
24 → 52
Calls

24 calls. Slowest were:

104.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
103.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))
97.0ms
(cos (- (+ (* 1/2 (* m K)) (* 1/2 (* K n))) M))

prune1.6s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.6b

regimes418.0ms

Accuracy

0% (0.2b remaining)

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

bsearch4.0ms

end0.0ms

sample3.7s

Algorithm
intervals