Average Error: 58.6 → 0.6
Time: 8.0s
Precision: 64
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\frac{1}{2} \cdot \left(2 \cdot \left({x}^{2} + x\right) + \left(\log 1 - 2 \cdot \frac{{x}^{2}}{{1}^{2}}\right)\right)\]
\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)
\frac{1}{2} \cdot \left(2 \cdot \left({x}^{2} + x\right) + \left(\log 1 - 2 \cdot \frac{{x}^{2}}{{1}^{2}}\right)\right)
double f(double x) {
        double r91441 = 1.0;
        double r91442 = 2.0;
        double r91443 = r91441 / r91442;
        double r91444 = x;
        double r91445 = r91441 + r91444;
        double r91446 = r91441 - r91444;
        double r91447 = r91445 / r91446;
        double r91448 = log(r91447);
        double r91449 = r91443 * r91448;
        return r91449;
}

double f(double x) {
        double r91450 = 1.0;
        double r91451 = 2.0;
        double r91452 = r91450 / r91451;
        double r91453 = x;
        double r91454 = 2.0;
        double r91455 = pow(r91453, r91454);
        double r91456 = r91455 + r91453;
        double r91457 = r91451 * r91456;
        double r91458 = log(r91450);
        double r91459 = pow(r91450, r91454);
        double r91460 = r91455 / r91459;
        double r91461 = r91451 * r91460;
        double r91462 = r91458 - r91461;
        double r91463 = r91457 + r91462;
        double r91464 = r91452 * r91463;
        return r91464;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 58.6

    \[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
  2. Taylor expanded around 0 0.6

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

    \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(2 \cdot \left({x}^{2} + x\right) + \left(\log 1 - 2 \cdot \frac{{x}^{2}}{{1}^{2}}\right)\right)}\]
  4. Final simplification0.6

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

Reproduce

herbie shell --seed 2019353 
(FPCore (x)
  :name "Hyperbolic arc-(co)tangent"
  :precision binary64
  (* (/ 1 2) (log (/ (+ 1 x) (- 1 x)))))