Average Error: 57.9 → 0.7
Time: 13.9s
Precision: 64
Internal Precision: 128
\[\frac{e^{x} - e^{-x}}{2}\]
\[\frac{(\left((\frac{1}{3} \cdot \left(x \cdot x\right) + 2)_*\right) \cdot x + \left(\frac{1}{60} \cdot {x}^{5}\right))_*}{2}\]

Error

Bits error versus x

Derivation

  1. Initial program 57.9

    \[\frac{e^{x} - e^{-x}}{2}\]
  2. Taylor expanded around 0 0.7

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

    \[\leadsto \frac{\color{blue}{(\left((\frac{1}{3} \cdot \left(x \cdot x\right) + 2)_*\right) \cdot x + \left({x}^{5} \cdot \frac{1}{60}\right))_*}}{2}\]
  4. Final simplification0.7

    \[\leadsto \frac{(\left((\frac{1}{3} \cdot \left(x \cdot x\right) + 2)_*\right) \cdot x + \left(\frac{1}{60} \cdot {x}^{5}\right))_*}{2}\]

Reproduce

herbie shell --seed 2019005 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic sine"
  (/ (- (exp x) (exp (- x))) 2))

Details

Time bar (total: 13.2s)Debug log

sample99.0ms

Algorithm
intervals

simplify22.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

22.0ms
(/ (- (exp x) (exp (- x))) 2)

prune19.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 57.5b

localize23.0ms

Local error

Found 1 expressions with local error:

6.7b
(- (exp x) (exp (- x)))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
1 → 28
Calls

1 calls. Slowest were:

10.0ms
(- (exp x) (exp (- x)))

series68.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

68.0ms
(- (exp x) (exp (- x)))

simplify690.0ms

Counts
27 → 31
Calls

27 calls. Slowest were:

92.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
81.0ms
(fma 1 (exp x) (- (* (exp (- x)) 1)))
50.0ms
(fma 1 (exp x) (- (* (cbrt (exp (- x))) (* (cbrt (exp (- x))) (cbrt (exp (- x)))))))

prune264.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.0b

localize30.0ms

Local error

Found 3 expressions with local error:

0.1b
(* (pow x 5) 1/60)
0.0b
(fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))
0.0b
(fma 1/3 (* x x) 2)

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
3 → 33
Calls

3 calls. Slowest were:

2.0ms
(* (pow x 5) 1/60)
0.0ms
(fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))
0.0ms
(fma 1/3 (* x x) 2)

series90.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

38.0ms
(fma 1/3 (* x x) 2)
33.0ms
(fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))
19.0ms
(* (pow x 5) 1/60)

simplify298.0ms

Counts
11 → 42
Calls

11 calls. Slowest were:

90.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
90.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
62.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))

prune559.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 4 expressions with local error:

37.6b
(cbrt (* (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))))
0.1b
(* (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))
0.1b
(* (pow x 5) 1/60)
0.1b
(* (pow x 5) 1/60)

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
4 → 67
Calls

4 calls. Slowest were:

13.0ms
(* (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))
6.0ms
(cbrt (* (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))))
2.0ms
(* (pow x 5) 1/60)

series129.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

54.0ms
(* (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))
29.0ms
(cbrt (* (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))))
24.0ms
(* (pow x 5) 1/60)
23.0ms
(* (pow x 5) 1/60)

simplify3.1s

Counts
40 → 79
Calls

40 calls. Slowest were:

1.1s
(* (* (* (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (* (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))) (* (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))))
322.0ms
(cbrt (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))))
297.0ms
(+ (log (* (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)) (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))) (log (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))))

prune914.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.0b

localize2.0ms

Local error

Found 1 expressions with local error:

6.7b
(- (exp x) (exp (- x)))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
1 → 28
Calls

1 calls. Slowest were:

10.0ms
(- (exp x) (exp (- x)))

series66.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

66.0ms
(- (exp x) (exp (- x)))

simplify658.0ms

Counts
27 → 31
Calls

27 calls. Slowest were:

83.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
56.0ms
(fma 1 (exp x) (- (* (exp (- x)) 1)))
39.0ms
(fma 1 (exp x) (- (* (sqrt (exp (- x))) (sqrt (exp (- x))))))

prune226.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0.0b

regimes164.0ms

Accuracy

0% (0.7b remaining)

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

bsearch1.0ms

end0.0ms

sample5.7s

Algorithm
intervals