Average Error: 58.6 → 0.2
Time: 32.6s
Precision: 64
Internal Precision: 128
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[(\frac{2}{5} \cdot \left({x}^{5}\right) + \left(2 \cdot x + \left(\frac{2}{3} \cdot \left(x \cdot x\right)\right) \cdot x\right))_* \cdot \frac{1}{2}\]

Error

Bits error versus x

Derivation

  1. Initial program 58.6

    \[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
  2. Simplified58.6

    \[\leadsto \color{blue}{\log \left(\frac{x + 1}{1 - x}\right) \cdot \frac{1}{2}}\]
  3. Taylor expanded around 0 0.2

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

    \[\leadsto \color{blue}{(\frac{2}{5} \cdot \left({x}^{5}\right) + \left(x \cdot (\frac{2}{3} \cdot \left(x \cdot x\right) + 2)_*\right))_*} \cdot \frac{1}{2}\]
  5. Using strategy rm
  6. Applied fma-udef0.2

    \[\leadsto (\frac{2}{5} \cdot \left({x}^{5}\right) + \left(x \cdot \color{blue}{\left(\frac{2}{3} \cdot \left(x \cdot x\right) + 2\right)}\right))_* \cdot \frac{1}{2}\]
  7. Applied distribute-lft-in0.2

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

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

Reproduce

herbie shell --seed 2019091 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)tangent"
  (* (/ 1 2) (log (/ (+ 1 x) (- 1 x)))))