Average Error: 57.9 → 0.6
Time: 7.5s
Precision: binary64
\[\frac{e^{x} - e^{-x}}{2}\]
\[\frac{2 \cdot x + \left(\frac{1}{3} \cdot {x}^{3} + \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.6

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

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

Reproduce

herbie shell --seed 2020182 
(FPCore (x)
  :name "Hyperbolic sine"
  :precision binary64
  (/ (- (exp x) (exp (neg x))) 2.0))