Average Error: 58.8 → 0.4
Time: 4.5s
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.8
Target0.4
Herbie0.4
\[x \cdot \left(\left(1 + \frac{x}{2}\right) + \frac{x \cdot x}{6}\right)\]

Derivation

  1. Initial program 58.8

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

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

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

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

Reproduce

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

sample75.0ms

Algorithm
intervals

simplify4.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

4.0ms
(- (exp x) 1)

prune7.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 58.9b

localize11.0ms

Local error

Found 1 expressions with local error:

6.9b
(- (exp x) 1)

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
1 → 12
Calls

1 calls. Slowest were:

6.0ms
(- (exp x) 1)

series20.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

20.0ms
(- (exp x) 1)

simplify106.0ms

Counts
4 → 15
Calls

4 calls. Slowest were:

93.0ms
(+ x (+ (* 1/6 (pow x 3)) (* 1/2 (pow x 2))))
4.0ms
(+ (sqrt (exp x)) 1)
3.0ms
(- (exp x) 1)

prune82.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.0b

localize22.0ms

Local error

Found 2 expressions with local error:

0.4b
(* 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)

series36.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

26.0ms
(* (+ (* x 1/6) 1/2) (* x x))
10.0ms
(* x 1/6)

simplify1.1s

Counts
13 → 31
Calls

13 calls. Slowest were:

477.0ms
(* (- (* (* x 1/6) (* x 1/6)) (* 1/2 1/2)) (* x x))
352.0ms
(* (+ (pow (* x 1/6) 3) (pow 1/2 3)) (* x x))
89.0ms
(* (* (* (+ (* x 1/6) 1/2) (+ (* x 1/6) 1/2)) (+ (* x 1/6) 1/2)) (* (* (* x x) (* x x)) (* x x)))

prune287.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0.0b

regimes58.0ms

Accuracy

0% (0.4b remaining)

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

bsearch2.0ms

end0.0ms

sample2.5s

Algorithm
intervals