Average Error: 57.9 → 0.7
Time: 24.8s
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 2019004 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic sine"
  (/ (- (exp x) (exp (- x))) 2))

Details

Time bar (total: 24.2s)Debug log

sample171.0ms

Algorithm
intervals

simplify38.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune4.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 58.0b

localize13.0ms

Local error

Found 1 expressions with local error:

5.1b
(- (exp x) (exp (- x)))

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
1 → 28
Calls

1 calls. Slowest were:

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

series53.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

53.0ms
(- (exp x) (exp (- x)))

simplify612.0ms

Counts
27 → 31
Calls

27 calls. Slowest were:

55.0ms
(fma 1 (exp x) (- (* (exp (- x)) 1)))
52.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
46.0ms
(fma (sqrt (exp x)) (sqrt (exp x)) (- (* (exp (- x)) 1)))

prune364.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.0b

localize36.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))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 23
Calls

2 calls. Slowest were:

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

series48.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify177.0ms

Counts
8 → 29
Calls

8 calls. Slowest were:

60.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
55.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
54.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))

prune281.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 4 expressions with local error:

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

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

series146.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

38.0ms
(fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))
38.0ms
(* (pow x 5) 1/60)
35.0ms
(* (pow x 5) 1/60)
34.0ms
(* (sqrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (sqrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))))

simplify1.9s

Counts
38 → 80
Calls

38 calls. Slowest were:

286.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)))
282.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)))
172.0ms
(* (* (* (sqrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (sqrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))) (sqrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))) (* (* (sqrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60))) (sqrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))) (sqrt (fma (fma 1/3 (* x x) 2) x (* (pow x 5) 1/60)))))

prune930.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.0b

localize15.0ms

Local error

Found 4 expressions with local error:

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

rewrite63.0ms

Algorithm
rewrite-expression-head
Counts
4 → 121
Calls

4 calls. Slowest were:

32.0ms
(/ (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x)))) (+ (exp x) (exp (- x))))
12.0ms
(- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x))))
11.0ms
(* (exp (- x)) (exp (- x)))

series206.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

107.0ms
(/ (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x)))) (+ (exp x) (exp (- x))))
73.0ms
(- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x))))
17.0ms
(* (exp (- x)) (exp (- x)))
9.0ms
(* (exp x) (exp x))

simplify12.5s

Counts
114 → 133
Calls

114 calls. Slowest were:

545.0ms
(- (* (* (exp x) (exp x)) (* (exp x) (exp x))) (* (* (exp (- x)) (exp (- x))) (* (exp (- x)) (exp (- x)))))
521.0ms
(/ (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x)))) (+ (exp x) (exp (- x))))
505.0ms
(/ (- (* (exp x) (exp x)) (* (exp (- x)) (exp (- x)))) (+ (exp x) (exp (- x))))

prune996.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0.0b

regimes99.0ms

Accuracy

0% (0.6b remaining)

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

bsearch2.0ms

end0.0ms

sample5.5s

Algorithm
intervals