Average Error: 57.9 → 0.3
Time: 12.9s
Precision: 64
Internal Precision: 128
\[\frac{e^{x} - e^{-x}}{2}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.016826919170264975:\\ \;\;\;\;\frac{e^{x}}{2} - \frac{\frac{1}{2}}{e^{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{x}^{5} \cdot \frac{1}{60} + \left({x}^{3} \cdot \frac{1}{3} + 2 \cdot x\right)}{2}\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < -0.016826919170264975

    1. Initial program 0.7

      \[\frac{e^{x} - e^{-x}}{2}\]
    2. Initial simplification0.9

      \[\leadsto \frac{e^{x}}{2} - \frac{\frac{1}{2}}{e^{x}}\]

    if -0.016826919170264975 < x

    1. Initial program 58.4

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

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

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

      \[\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 0 0.3

      \[\leadsto \frac{\color{blue}{\left(2 \cdot x + \frac{1}{3} \cdot {x}^{3}\right)} + {x}^{5} \cdot \frac{1}{60}}{2}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.016826919170264975:\\ \;\;\;\;\frac{e^{x}}{2} - \frac{\frac{1}{2}}{e^{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{x}^{5} \cdot \frac{1}{60} + \left({x}^{3} \cdot \frac{1}{3} + 2 \cdot x\right)}{2}\\ \end{array}\]

Runtime

Time bar (total: 12.9s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes0.60.30.00.658.7%
herbie shell --seed 2018354 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic sine"
  (/ (- (exp x) (exp (- x))) 2))