Average Error: 58.5 → 0.0
Time: 2.7m
Precision: 64
Internal Precision: 1344
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\frac{1}{2} \cdot \left(\log_* (1 + x) + \left(-\log_* (1 + \left(-x\right))\right)\right)\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 58.5

    \[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
  2. Using strategy rm
  3. Applied div-inv58.5

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

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

    \[\leadsto \frac{1}{2} \cdot \left(\color{blue}{\log_* (1 + x)} + \log \left(\frac{1}{1 - x}\right)\right)\]
  6. Applied simplify50.5

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

    \[\leadsto \frac{1}{2} \cdot \left(\log_* (1 + x) + \left(-\color{blue}{\log_* (1 + (e^{\log \left(1 - x\right)} - 1)^*)}\right)\right)\]
  9. Applied simplify0.0

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

Runtime

Time bar (total: 2.7m)Debug logProfile

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