Average Error: 58.7 → 0.5
Time: 17.8s
Precision: 64
Internal Precision: 128
\[e^{x} - 1\]
\[x + \left(\frac{1}{2} + x \cdot \frac{1}{6}\right) \cdot \left(x \cdot x\right)\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original58.7
Target0.5
Herbie0.5
\[x \cdot \left(\left(1 + \frac{x}{2}\right) + \frac{x \cdot x}{6}\right)\]

Derivation

  1. Initial program 58.7

    \[e^{x} - 1\]
  2. Taylor expanded around 0 0.5

    \[\leadsto \color{blue}{x + \left(\frac{1}{6} \cdot {x}^{3} + \frac{1}{2} \cdot {x}^{2}\right)}\]
  3. Simplified0.5

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

    \[\leadsto x + \left(\frac{1}{2} + x \cdot \frac{1}{6}\right) \cdot \left(x \cdot x\right)\]

Reproduce

herbie shell --seed 2019005 
(FPCore (x)
  :name "expm1 (example 3.7)"
  :pre (< -0.00017 x)

  :herbie-target
  (* x (+ (+ 1 (/ x 2)) (/ (* x x) 6)))

  (- (exp x) 1))

Details

Time bar (total: 17.3s)Debug log

sample96.0ms

Algorithm
intervals

simplify4.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

4.0ms
(- (exp x) 1)

prune4.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 57.4b

localize6.0ms

Local error

Found 1 expressions with local error:

5.2b
(- (exp x) 1)

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
1 → 12
Calls

1 calls. Slowest were:

3.0ms
(- (exp x) 1)

series11.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

11.0ms
(- (exp x) 1)

simplify94.0ms

Counts
4 → 15
Calls

4 calls. Slowest were:

85.0ms
(+ x (+ (* 1/6 (pow x 3)) (* 1/2 (pow x 2))))
3.0ms
(- (exp x) 1)
3.0ms
(- (exp x) 1)

prune99.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

localize28.0ms

Local error

Found 2 expressions with local error:

0.3b
(* x 1/6)
0.0b
(* (+ (* x 1/6) 1/2) (* x x))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

11.0ms
(* (+ (* x 1/6) 1/2) (* x x))
0.0ms
(* x 1/6)

series57.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

45.0ms
(* (+ (* x 1/6) 1/2) (* x x))
12.0ms
(* x 1/6)

simplify1.1s

Counts
13 → 31
Calls

13 calls. Slowest were:

425.0ms
(* (- (* (* x 1/6) (* x 1/6)) (* 1/2 1/2)) (* x x))
404.0ms
(* (+ (pow (* x 1/6) 3) (pow 1/2 3)) (* x x))
94.0ms
(* (* (* (+ (* x 1/6) 1/2) (+ (* x 1/6) 1/2)) (+ (* x 1/6) 1/2)) (* (* (* x x) (* x x)) (* x x)))

prune196.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.1b

localize29.0ms

Local error

Found 4 expressions with local error:

5.0b
(- (pow (exp x) 3) (pow 1 3))
0.1b
(pow (exp x) 3)
0.0b
(/ (- (pow (exp x) 3) (pow 1 3)) (+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1))))
0.0b
(* (exp x) (exp x))

rewrite46.0ms

Algorithm
rewrite-expression-head
Counts
4 → 113
Calls

4 calls. Slowest were:

26.0ms
(/ (- (pow (exp x) 3) (pow 1 3)) (+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1))))
13.0ms
(- (pow (exp x) 3) (pow 1 3))
3.0ms
(* (exp x) (exp x))

series114.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

58.0ms
(/ (- (pow (exp x) 3) (pow 1 3)) (+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1))))
33.0ms
(- (pow (exp x) 3) (pow 1 3))
14.0ms
(pow (exp x) 3)
9.0ms
(* (exp x) (exp x))

simplify5.4s

Counts
113 → 125
Calls

113 calls. Slowest were:

359.0ms
(+ (* 3 x) (+ (* 9/2 (pow x 3)) (* 9/2 (pow x 2))))
163.0ms
(+ (* (* (exp x) (exp x)) (* (exp x) (exp x))) (- (* (+ (* 1 1) (* (exp x) 1)) (+ (* 1 1) (* (exp x) 1))) (* (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1)))))
152.0ms
(- (* (pow (exp x) 3) (pow (exp x) 3)) (* (pow 1 3) (pow 1 3)))

prune1.1s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.0b

localize16.0ms

Local error

Found 4 expressions with local error:

5.1b
(- (* (sqrt (exp x)) (exp x)) 1)
0.0b
(/ (* (+ 1 (* (sqrt (exp x)) (exp x))) (- (* (sqrt (exp x)) (exp x)) 1)) (+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1))))
0.0b
(* (exp x) (exp x))
0.0b
(+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1)))

rewrite64.0ms

Algorithm
rewrite-expression-head
Counts
4 → 75
Calls

4 calls. Slowest were:

43.0ms
(/ (* (+ 1 (* (sqrt (exp x)) (exp x))) (- (* (sqrt (exp x)) (exp x)) 1)) (+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1))))
10.0ms
(+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1)))
6.0ms
(- (* (sqrt (exp x)) (exp x)) 1)

series212.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

129.0ms
(/ (* (+ 1 (* (sqrt (exp x)) (exp x))) (- (* (sqrt (exp x)) (exp x)) 1)) (+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1))))
42.0ms
(- (* (sqrt (exp x)) (exp x)) 1)
29.0ms
(+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1)))
12.0ms
(* (exp x) (exp x))

simplify4.7s

Counts
50 → 87
Calls

50 calls. Slowest were:

430.0ms
(* (+ (pow 1 3) (pow (* (sqrt (exp x)) (exp x)) 3)) (- (pow (* (sqrt (exp x)) (exp x)) 3) (pow 1 3)))
371.0ms
(* (+ (pow 1 3) (pow (* (sqrt (exp x)) (exp x)) 3)) (- (* (sqrt (exp x)) (exp x)) 1))
343.0ms
(/ (* (* (* (+ 1 (* (sqrt (exp x)) (exp x))) (+ 1 (* (sqrt (exp x)) (exp x)))) (+ 1 (* (sqrt (exp x)) (exp x)))) (* (* (- (* (sqrt (exp x)) (exp x)) 1) (- (* (sqrt (exp x)) (exp x)) 1)) (- (* (sqrt (exp x)) (exp x)) 1))) (* (* (+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1))) (+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1)))) (+ (* (exp x) (exp x)) (+ (* 1 1) (* (exp x) 1)))))

prune1.2s

Pruning

5 alts after pruning (2 fresh and 3 done)

Merged error: 0.0b

regimes96.0ms

Accuracy

0% (0.4b remaining)

Error of 0.5b against oracle of 0.1b and baseline of 0.5b

bsearch2.0ms

end0.0ms

sample2.6s

Algorithm
intervals