Average Error: 58.2 → 0.6
Time: 25.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 58.2

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

Details

Time bar (total: 25.4s)Debug log

sample216.0ms

Algorithm
intervals

simplify36.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
36.0ms
(/ (- (exp x) (exp (- x))) 2)

prune9.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 58.5b

localize26.0ms

Local error

Found 1 expressions with local error:

5.4b
(- (exp x) (exp (- x)))

rewrite10.0ms

Algorithm
rewrite-expression-head
Rules
10×*-un-lft-identity
10×add-sqr-sqrt
prod-diff
add-cube-cbrt
add-log-exp
fma-neg
difference-of-squares
distribute-lft-out--
flip--
log1p-expm1-u
add-exp-log
diff-log
add-cbrt-cube
flip3--
sub-neg
pow1
expm1-log1p-u
Counts
1 → 28
Calls
1 calls:
Slowest
10.0ms
(- (exp x) (exp (- x)))

series58.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
58.0ms
(- (exp x) (exp (- x)))

simplify576.0ms

Counts
27 → 31
Calls
27 calls:
Slowest
56.0ms
(fma 1 (exp x) (- (* (exp (- x)) 1)))
51.0ms
(fma 1 (exp x) (- (* (cbrt (exp (- x))) (* (cbrt (exp (- x))) (cbrt (exp (- x)))))))
45.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
35.0ms
(fma (- (cbrt (exp (- x)))) (* (cbrt (exp (- x))) (cbrt (exp (- x)))) (* (cbrt (exp (- x))) (* (cbrt (exp (- x))) (cbrt (exp (- x))))))
33.0ms
(fma (- (cbrt (exp (- x)))) (* (cbrt (exp (- x))) (cbrt (exp (- x)))) (* (cbrt (exp (- x))) (* (cbrt (exp (- x))) (cbrt (exp (- x))))))

prune242.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.0b

localize22.0ms

Local error

Found 2 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))

rewrite3.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
associate-*l*
*-un-lft-identity
add-sqr-sqrt
add-log-exp
log1p-expm1-u
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
fma-udef
*-commutative
Counts
2 → 23
Calls
2 calls:
Slowest
2.0ms
(* (pow x 5) 1/60)
0.0ms
(fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))

series42.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
23.0ms
(fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))
19.0ms
(* (pow x 5) 1/60)

simplify235.0ms

Counts
8 → 29
Calls
8 calls:
Slowest
90.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
88.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
49.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
2.0ms
(* 1/60 (pow x 5))
2.0ms
(* 1/60 (pow x 5))

prune251.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

localize28.0ms

Local error

Found 4 expressions with local error:

0.6b
(cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))
0.6b
(cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))
0.6b
(cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))
0.5b
(* (cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))))

rewrite14.0ms

Algorithm
rewrite-expression-head
Rules
15×cbrt-prod
11×add-cube-cbrt
11×*-un-lft-identity
11×add-sqr-sqrt
pow1
pow1/3
add-exp-log
associate-*l*
associate-*r*
add-log-exp
log1p-expm1-u
add-cbrt-cube
expm1-log1p-u
pow-prod-up
pow-prod-down
cbrt-unprod
*-commutative
prod-exp
pow-plus
pow2
Counts
4 → 69
Calls
4 calls:
Slowest
9.0ms
(* (cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))))
1.0ms
(cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))
1.0ms
(cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))
1.0ms
(cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))

series513.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
143.0ms
(cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))
136.0ms
(cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))
120.0ms
(* (cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))))
114.0ms
(cbrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))

simplify4.0s

Counts
41 → 81
Calls
41 calls:
Slowest
409.0ms
(+ (* 1/9 (* (pow x 2) (exp (* 1/3 (+ (log 4) (* 2 (log x))))))) (+ (exp (* 1/3 (+ (log 4) (* 2 (log x))))) (* 1/405 (* (pow x 4) (exp (* 1/3 (+ (log 4) (* 2 (log x)))))))))
402.0ms
(+ (exp (* 1/3 (- (log 1/3600) (* 10 (log (/ 1 x)))))) (+ (* 40/3 (/ (exp (* 1/3 (- (log 1/3600) (* 10 (log (/ 1 x)))))) (pow x 2))) (* 320/9 (/ (exp (* 1/3 (- (log 1/3600) (* 10 (log (/ 1 x)))))) (pow x 4)))))
301.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)))
238.0ms
(- (+ (* 20/3 (/ (exp (* 1/3 (- (log 1/60) (* 5 (log (/ 1 x)))))) (pow x 2))) (exp (* 1/3 (- (log 1/60) (* 5 (log (/ 1 x))))))) (* 40/9 (/ (exp (* 1/3 (- (log 1/60) (* 5 (log (/ 1 x)))))) (pow x 4))))
217.0ms
(- (+ (exp (* 1/3 (- (log -1/60) (* 5 (log (/ -1 x)))))) (* 20/3 (/ (exp (* 1/3 (- (log -1/60) (* 5 (log (/ -1 x)))))) (pow x 2)))) (* 40/9 (/ (exp (* 1/3 (- (log -1/60) (* 5 (log (/ -1 x)))))) (pow x 4))))

prune1.0s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0.0b

localize32.0ms

Local error

Found 4 expressions with local error:

5.4b
(- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x))))
0.0b
(* (exp x) (exp x))
0.0b
(* (exp (- x)) (exp (- x)))
0.0b
(/ (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x)))) (+ (exp x) (exp (- x))))

rewrite70.0ms

Algorithm
rewrite-expression-head
Rules
32×*-un-lft-identity
22×add-cube-cbrt
22×add-sqr-sqrt
16×times-frac
16×exp-prod
14×pow1
10×add-cbrt-cube
exp-neg
difference-of-squares
add-log-exp
pow-prod-up
add-exp-log
pow-prod-down
associate-*l*
associate-*r*
exp-diff
neg-sub0
distribute-lft-out
associate-/l*
log1p-expm1-u
neg-mul-1
associate-/r*
frac-times
expm1-log1p-u
associate-/l/
flip--
cbrt-unprod
*-commutative
associate-/r/
associate-*r/
prod-exp
associate-*l/
flip3--
pow-plus
pow2
div-inv
flip-+
un-div-inv
prod-diff
div-exp
div-sub
diff-log
fma-neg
flip3-+
frac-2neg
sub-neg
clear-num
cbrt-undiv
Counts
4 → 121
Calls
4 calls:
Slowest
32.0ms
(/ (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x)))) (+ (exp x) (exp (- x))))
17.0ms
(* (exp (- x)) (exp (- x)))
11.0ms
(- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x))))
7.0ms
(* (exp x) (exp x))

series183.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
86.0ms
(/ (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x)))) (+ (exp x) (exp (- x))))
77.0ms
(- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x))))
10.0ms
(* (exp (- x)) (exp (- x)))
10.0ms
(* (exp x) (exp x))

simplify11.3s

Counts
114 → 133
Calls
114 calls:
Slowest
673.0ms
(/ (sqrt (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x))))) (sqrt (+ (exp x) (exp (- x)))))
436.0ms
(- (log (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x))))) (log (+ (exp x) (exp (- x)))))
436.0ms
(/ (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x)))) (+ (exp x) (exp (- x))))
432.0ms
(/ (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x)))) (+ (exp x) (exp (- x))))
427.0ms
(/ (- (pow (exp x) 2) (pow (exp (* -1 x)) 2)) (+ (exp (* -1 x)) (exp x)))

prune988.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0.0b

regimes43.0ms

Accuracy

0% (0.5b remaining)

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

bsearch2.0ms

end0.0ms

sample5.4s

Algorithm
intervals