Average Error: 60.1 → 53.0
Time: 38.1s
Precision: 64
Internal Precision: 128
\[\frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}\]
\[(\left(\log_* (1 + (e^{\sqrt[3]{(\frac{2}{15} \cdot \left({x}^{5}\right) + x)_*}} - 1)^*) \cdot \sqrt[3]{(\frac{2}{15} \cdot \left({x}^{5}\right) + x)_*}\right) \cdot \left(\log_* (1 + (e^{\sqrt[3]{{x}^{5} \cdot \frac{2}{15} + x}} - 1)^*)\right) + \left(\frac{-1}{3} \cdot {x}^{3}\right))_*\]

Error

Bits error versus x

Derivation

  1. Initial program 60.1

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

    \[\leadsto \color{blue}{\left(x + \frac{2}{15} \cdot {x}^{5}\right) - \frac{1}{3} \cdot {x}^{3}}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt53.0

    \[\leadsto \color{blue}{\left(\sqrt[3]{x + \frac{2}{15} \cdot {x}^{5}} \cdot \sqrt[3]{x + \frac{2}{15} \cdot {x}^{5}}\right) \cdot \sqrt[3]{x + \frac{2}{15} \cdot {x}^{5}}} - \frac{1}{3} \cdot {x}^{3}\]
  5. Applied fma-neg53.0

    \[\leadsto \color{blue}{(\left(\sqrt[3]{x + \frac{2}{15} \cdot {x}^{5}} \cdot \sqrt[3]{x + \frac{2}{15} \cdot {x}^{5}}\right) \cdot \left(\sqrt[3]{x + \frac{2}{15} \cdot {x}^{5}}\right) + \left(-\frac{1}{3} \cdot {x}^{3}\right))_*}\]
  6. Simplified53.0

    \[\leadsto (\color{blue}{\left(\sqrt[3]{(\frac{2}{15} \cdot \left({x}^{5}\right) + x)_*} \cdot \sqrt[3]{(\frac{2}{15} \cdot \left({x}^{5}\right) + x)_*}\right)} \cdot \left(\sqrt[3]{x + \frac{2}{15} \cdot {x}^{5}}\right) + \left(-\frac{1}{3} \cdot {x}^{3}\right))_*\]
  7. Using strategy rm
  8. Applied log1p-expm1-u53.0

    \[\leadsto (\left(\sqrt[3]{(\frac{2}{15} \cdot \left({x}^{5}\right) + x)_*} \cdot \sqrt[3]{(\frac{2}{15} \cdot \left({x}^{5}\right) + x)_*}\right) \cdot \color{blue}{\left(\log_* (1 + (e^{\sqrt[3]{x + \frac{2}{15} \cdot {x}^{5}}} - 1)^*)\right)} + \left(-\frac{1}{3} \cdot {x}^{3}\right))_*\]
  9. Using strategy rm
  10. Applied log1p-expm1-u53.0

    \[\leadsto (\left(\sqrt[3]{(\frac{2}{15} \cdot \left({x}^{5}\right) + x)_*} \cdot \color{blue}{\log_* (1 + (e^{\sqrt[3]{(\frac{2}{15} \cdot \left({x}^{5}\right) + x)_*}} - 1)^*)}\right) \cdot \left(\log_* (1 + (e^{\sqrt[3]{x + \frac{2}{15} \cdot {x}^{5}}} - 1)^*)\right) + \left(-\frac{1}{3} \cdot {x}^{3}\right))_*\]
  11. Final simplification53.0

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

Runtime

Time bar (total: 38.1s)Debug logProfile

herbie shell --seed 2018255 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic tangent"
  (/ (- (exp x) (exp (- x))) (+ (exp x) (exp (- x)))))