Average Error: 29.0 → 0.7
Time: 21.8s
Precision: 64
Internal Precision: 128
\[\left(e^{x} - 2\right) + e^{-x}\]
\[\sqrt{{x}^{2} + \left({x}^{6} \cdot \frac{1}{360} + \frac{1}{12} \cdot {x}^{4}\right)} \cdot \sqrt{{x}^{2} + \left({x}^{6} \cdot \frac{1}{360} + \frac{1}{12} \cdot {x}^{4}\right)}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original29.0
Target0.0
Herbie0.7
\[4 \cdot {\left(\sinh \left(\frac{x}{2}\right)\right)}^{2}\]

Derivation

  1. Initial program 29.0

    \[\left(e^{x} - 2\right) + e^{-x}\]
  2. Taylor expanded around 0 0.7

    \[\leadsto \color{blue}{{x}^{2} + \left(\frac{1}{12} \cdot {x}^{4} + \frac{1}{360} \cdot {x}^{6}\right)}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.7

    \[\leadsto \color{blue}{\sqrt{{x}^{2} + \left(\frac{1}{12} \cdot {x}^{4} + \frac{1}{360} \cdot {x}^{6}\right)} \cdot \sqrt{{x}^{2} + \left(\frac{1}{12} \cdot {x}^{4} + \frac{1}{360} \cdot {x}^{6}\right)}}\]
  5. Final simplification0.7

    \[\leadsto \sqrt{{x}^{2} + \left({x}^{6} \cdot \frac{1}{360} + \frac{1}{12} \cdot {x}^{4}\right)} \cdot \sqrt{{x}^{2} + \left({x}^{6} \cdot \frac{1}{360} + \frac{1}{12} \cdot {x}^{4}\right)}\]

Reproduce

herbie shell --seed 2019008 
(FPCore (x)
  :name "exp2 (problem 3.3.7)"

  :herbie-target
  (* 4 (pow (sinh (/ x 2)) 2))

  (+ (- (exp x) 2) (exp (- x))))

Details

Time bar (total: 21.0s)Debug log

sample169.0ms

Algorithm
intervals

simplify30.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

30.0ms
(+ (- (exp x) 2) (exp (- x)))

prune5.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 32.3b

localize31.0ms

Local error

Found 2 expressions with local error:

4.4b
(+ (- (exp x) 2) (exp (- x)))
0.0b
(- (exp x) 2)

rewrite32.0ms

Algorithm
rewrite-expression-head
Counts
2 → 30
Calls

2 calls. Slowest were:

26.0ms
(+ (- (exp x) 2) (exp (- x)))
5.0ms
(- (exp x) 2)

series97.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

89.0ms
(+ (- (exp x) 2) (exp (- x)))
8.0ms
(- (exp x) 2)

simplify1.5s

Counts
19 → 36
Calls

19 calls. Slowest were:

331.0ms
(+ (* (- (pow (exp x) 3) (pow 2 3)) (exp x)) (* (+ (* (exp x) (exp x)) (+ (* 2 2) (* (exp x) 2))) 1))
318.0ms
(+ (* (- (pow (exp x) 3) (pow 2 3)) (exp x)) (* (+ (* (exp x) (exp x)) (+ (* 2 2) (* (exp x) 2))) (exp 0)))
207.0ms
(+ (* (- (* (exp x) (exp x)) (* 2 2)) (exp x)) (* (+ (exp x) 2) (exp 0)))

prune343.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.0b

localize39.0ms

Local error

Found 4 expressions with local error:

0.1b
(* 1/12 (pow x 4))
0.0b
(* 1/360 (pow x 6))
0.0b
(+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))))
0.0b
(+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
4 → 47
Calls

4 calls. Slowest were:

15.0ms
(+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))))
3.0ms
(+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))
2.0ms
(* 1/12 (pow x 4))

series164.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

88.0ms
(+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))
40.0ms
(+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))))
20.0ms
(* 1/360 (pow x 6))
15.0ms
(* 1/12 (pow x 4))

simplify305.0ms

Counts
23 → 59
Calls

23 calls. Slowest were:

62.0ms
(* (exp (pow x 2)) (exp (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
58.0ms
(* (exp (pow x 2)) (* (exp (* 1/12 (pow x 4))) (exp (* 1/360 (pow x 6)))))
27.0ms
(+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))))

prune666.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.0b

localize13.0ms

Local error

Found 4 expressions with local error:

26.0b
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
26.0b
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
0.1b
(* 1/12 (pow x 4))
0.1b
(* 1/12 (pow x 4))

rewrite27.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

13.0ms
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
11.0ms
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
1.0ms
(* 1/12 (pow x 4))

series154.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

68.0ms
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
56.0ms
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
15.0ms
(* 1/12 (pow x 4))
15.0ms
(* 1/12 (pow x 4))

simplify2.0s

Counts
32 → 64
Calls

32 calls. Slowest were:

328.0ms
(- (+ (* 1/2 (/ 1 (* (sqrt 1/360) x))) (+ (* (sqrt 1/360) (pow x 3)) (* 1/24 (/ x (sqrt 1/360))))) (* 1/1152 (/ 1 (* (pow (sqrt 1/360) 3) x))))
319.0ms
(- (+ (* 1/2 (/ 1 (* (sqrt 1/360) x))) (+ (* (sqrt 1/360) (pow x 3)) (* 1/24 (/ x (sqrt 1/360))))) (* 1/1152 (/ 1 (* (pow (sqrt 1/360) 3) x))))
284.0ms
(- (* 1/1152 (/ 1 (* (pow (sqrt 1/360) 3) x))) (+ (* 1/2 (/ 1 (* (sqrt 1/360) x))) (+ (* (sqrt 1/360) (pow x 3)) (* 1/24 (/ x (sqrt 1/360))))))

prune880.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 4 expressions with local error:

26.0b
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
26.0b
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
26.0b
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
0.5b
(* (sqrt (sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))) (sqrt (sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))))

rewrite53.0ms

Algorithm
rewrite-expression-head
Counts
4 → 91
Calls

4 calls. Slowest were:

23.0ms
(* (sqrt (sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))) (sqrt (sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))))
12.0ms
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
9.0ms
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))

series246.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

94.0ms
(* (sqrt (sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))) (sqrt (sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))))
59.0ms
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
49.0ms
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))
43.0ms
(sqrt (+ (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))

simplify6.9s

Counts
75 → 103
Calls

75 calls. Slowest were:

479.0ms
(* (sqrt (sqrt (- (* (pow x 2) (pow x 2)) (* (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))))))) (sqrt (sqrt (+ (pow (pow x 2) 3) (pow (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))) 3)))))
468.0ms
(* (sqrt (sqrt (+ (pow (pow x 2) 3) (pow (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))) 3)))) (sqrt (sqrt (- (* (pow x 2) (pow x 2)) (* (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))))))))
388.0ms
(* (sqrt (sqrt (+ (* (pow x 2) (pow x 2)) (- (* (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))) (* (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))))) (sqrt (sqrt (+ (* (pow x 2) (pow x 2)) (- (* (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6))) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))) (* (pow x 2) (+ (* 1/12 (pow x 4)) (* 1/360 (pow x 6)))))))))

prune1.7s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0.0b

regimes66.0ms

Accuracy

0% (0.7b remaining)

Error of 0.7b against oracle of 0.0b and baseline of 0.7b

bsearch2.0ms

end0.0ms

sample5.5s

Algorithm
intervals