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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 57.9

    \[\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. Using strategy rm
  5. Applied fma-udef0.6

    \[\leadsto \frac{\color{blue}{(\frac{1}{3} \cdot \left(x \cdot x\right) + 2)_* \cdot x + {x}^{5} \cdot \frac{1}{60}}}{2}\]
  6. Taylor expanded around -inf 0.6

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

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

Reproduce

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

Details

Time bar (total: 10.2s)Debug log

sample169.0ms

Algorithm
intervals

simplify32.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune5.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 58.4b

localize12.0ms

Local error

Found 1 expressions with local error:

7.5b
(- (exp x) (exp (- x)))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
1 → 28
Calls

1 calls. Slowest were:

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

series77.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

77.0ms
(- (exp x) (exp (- x)))

simplify772.0ms

Counts
27 → 31
Calls

27 calls. Slowest were:

88.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
60.0ms
(fma 1 (exp x) (- (* (exp (- x)) 1)))
52.0ms
(fma (* (cbrt (exp x)) (cbrt (exp x))) (cbrt (exp x)) (- (* (exp (- x)) 1)))

prune271.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.0b

localize35.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
Counts
2 → 23
Calls

2 calls. Slowest were:

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

series63.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify292.0ms

Counts
8 → 29
Calls

8 calls. Slowest were:

93.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
92.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
91.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))

prune395.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.0b

localize16.0ms

Local error

Found 3 expressions with local error:

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

rewrite19.0ms

Algorithm
rewrite-expression-head
Counts
3 → 40
Calls

3 calls. Slowest were:

9.0ms
(+ (* (fma 1/3 (* x x) 2) x) (* (pow x 5) 1/60))
5.0ms
(* (fma 1/3 (* x x) 2) x)
4.0ms
(* (pow x 5) 1/60)

series134.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

57.0ms
(* (fma 1/3 (* x x) 2) x)
41.0ms
(+ (* (fma 1/3 (* x x) 2) x) (* (pow x 5) 1/60))
36.0ms
(* (pow x 5) 1/60)

simplify454.0ms

Counts
15 → 49
Calls

15 calls. Slowest were:

107.0ms
(* (exp (* (fma 1/3 (* x x) 2) x)) (exp (* (pow x 5) 1/60)))
72.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))
67.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))

prune465.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.0b

localize24.0ms

Local error

Found 4 expressions with local error:

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

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

15.0ms
(+ (+ (* 2 x) (* 1/3 (pow x 3))) (* (pow x 5) 1/60))
4.0ms
(* (pow x 5) 1/60)
3.0ms
(+ (* 2 x) (* 1/3 (pow x 3)))

series113.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

42.0ms
(+ (* 2 x) (* 1/3 (pow x 3)))
30.0ms
(* (pow x 5) 1/60)
25.0ms
(+ (+ (* 2 x) (* 1/3 (pow x 3))) (* (pow x 5) 1/60))
16.0ms
(* 1/3 (pow x 3))

simplify759.0ms

Counts
24 → 72
Calls

24 calls. Slowest were:

142.0ms
(* (* (exp (* 2 x)) (exp (* 1/3 (pow x 3)))) (exp (* (pow x 5) 1/60)))
138.0ms
(* (exp (+ (* 2 x) (* 1/3 (pow x 3)))) (exp (* (pow x 5) 1/60)))
70.0ms
(+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5))))

prune758.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

regimes116.0ms

Accuracy

0% (0.6b remaining)

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

bsearch3.0ms

end0.0ms

sample5.2s

Algorithm
intervals