Average Error: 57.9 → 0.3
Time: 15.4s
Precision: 64
Internal Precision: 128
\[\frac{e^{x} - e^{-x}}{2}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.016826919170264975:\\ \;\;\;\;\frac{e^{x} - e^{-x}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot x + \left(\frac{1}{60} \cdot {x}^{5} + {x}^{3} \cdot \frac{1}{3}\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}\]

    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. Recombined 2 regimes into one program.
  4. Final simplification0.3

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

Runtime

Time bar (total: 15.4s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes0.60.30.00.658.5%
herbie shell --seed 2018354 
(FPCore (x)
  :name "Hyperbolic sine"
  (/ (- (exp x) (exp (- x))) 2))