Average Error: 58.1 → 0.6
Time: 7.6s
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 58.1

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

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

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

    \[\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 2019002 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic sine"
  (/ (- (exp x) (exp (- x))) 2))

Details

Time bar (total: 7.1s)Debug log

sample110.0ms

Algorithm
intervals

simplify18.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune4.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 58.8b

localize26.0ms

Local error

Found 1 expressions with local error:

5.3b
(- (exp x) (exp (- x)))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
1 → 28
Calls

1 calls. Slowest were:

5.0ms
(- (exp x) (exp (- x)))

series51.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

51.0ms
(- (exp x) (exp (- x)))

simplify447.0ms

Counts
27 → 31
Calls

27 calls. Slowest were:

47.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
43.0ms
(fma 1 (exp x) (- (* (exp (- x)) 1)))
27.0ms
(fma (- (cbrt (exp (- x)))) (* (cbrt (exp (- x))) (cbrt (exp (- x)))) (* (cbrt (exp (- x))) (* (cbrt (exp (- x))) (cbrt (exp (- x))))))

prune189.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0b

localize17.0ms

Local error

Found 3 expressions with local error:

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

series65.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

23.0ms
(* (pow x 5) 1/60)
22.0ms
(fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))
21.0ms
(fma 1/3 (* x x) 2)

simplify166.0ms

Counts
11 → 42
Calls

11 calls. Slowest were:

47.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
46.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
45.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))

prune255.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize0.0ms

Local error

Found 1 expressions with local error:

5.3b
(- (exp x) (exp (- x)))

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
1 → 28
Calls

1 calls. Slowest were:

5.0ms
(- (exp x) (exp (- x)))

series40.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

40.0ms
(- (exp x) (exp (- x)))

simplify422.0ms

Counts
27 → 31
Calls

27 calls. Slowest were:

44.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
43.0ms
(fma 1 (exp x) (- (* (exp (- x)) 1)))
25.0ms
(fma 1 (exp x) (- (* (cbrt (exp (- x))) (* (cbrt (exp (- x))) (cbrt (exp (- x)))))))

prune182.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize18.0ms

Local error

Found 1 expressions with local error:

5.3b
(fma (sqrt (exp x)) (sqrt (exp x)) (- (exp (- x))))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 10
Calls

1 calls. Slowest were:

0.0ms
(fma (sqrt (exp x)) (sqrt (exp x)) (- (exp (- x))))

series118.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

118.0ms
(fma (sqrt (exp x)) (sqrt (exp x)) (- (exp (- x))))

simplify97.0ms

Counts
3 → 13
Calls

3 calls. Slowest were:

71.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
16.0ms
(- (exp x) (exp (* -1 x)))
8.0ms
(- (exp x) (exp (- x)))

prune130.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes70.0ms

Accuracy

0% (0.6b remaining)

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

bsearch1.0ms

end0.0ms

sample4.7s

Algorithm
intervals