Average Error: 57.9 → 1.8
Time: 36.1s
Precision: 64
Internal Precision: 1344
\[\frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}\]
\[\left(x + {x}^{5} \cdot \frac{2}{15}\right) - \frac{1}{3} \cdot {x}^{3}\]

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}}{e^{x} + e^{-x}}\]
  2. Taylor expanded around 0 1.8

    \[\leadsto \frac{\color{blue}{2 \cdot x + \left(\frac{1}{3} \cdot {x}^{3} + \frac{1}{60} \cdot {x}^{5}\right)}}{e^{x} + e^{-x}}\]
  3. Taylor expanded around 0 1.8

    \[\leadsto \color{blue}{\left(x + \frac{2}{15} \cdot {x}^{5}\right) - \frac{1}{3} \cdot {x}^{3}}\]
  4. Final simplification1.8

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

Runtime

Time bar (total: 36.1s)Debug logProfile

herbie shell --seed 2018251 
(FPCore (x)
  :name "Hyperbolic tangent"
  (/ (- (exp x) (exp (- x))) (+ (exp x) (exp (- x)))))