Average Error: 58.6 → 0.0
Time: 28.2s
Precision: 64
Internal Precision: 128
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\left(\log_* (1 + x) - \log_* (1 + \left(-x\right))\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. Using strategy rm
  4. Applied log-div58.6

    \[\leadsto \color{blue}{\left(\log \left(x + 1\right) - \log \left(1 - x\right)\right)} \cdot \frac{1}{2}\]
  5. Simplified50.5

    \[\leadsto \left(\color{blue}{\log_* (1 + x)} - \log \left(1 - x\right)\right) \cdot \frac{1}{2}\]
  6. Using strategy rm
  7. Applied sub-neg50.5

    \[\leadsto \left(\log_* (1 + x) - \log \color{blue}{\left(1 + \left(-x\right)\right)}\right) \cdot \frac{1}{2}\]
  8. Applied log1p-def0.0

    \[\leadsto \left(\log_* (1 + x) - \color{blue}{\log_* (1 + \left(-x\right))}\right) \cdot \frac{1}{2}\]
  9. Final simplification0.0

    \[\leadsto \left(\log_* (1 + x) - \log_* (1 + \left(-x\right))\right) \cdot \frac{1}{2}\]

Reproduce

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