Average Error: 58.6 → 0.6
Time: 23.7s
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 r176489 = 1.0;
        double r176490 = 2.0;
        double r176491 = r176489 / r176490;
        double r176492 = x;
        double r176493 = r176489 + r176492;
        double r176494 = r176489 - r176492;
        double r176495 = r176493 / r176494;
        double r176496 = log(r176495);
        double r176497 = r176491 * r176496;
        return r176497;
}

double f(double x) {
        double r176498 = 1.0;
        double r176499 = 2.0;
        double r176500 = r176498 / r176499;
        double r176501 = x;
        double r176502 = 2.0;
        double r176503 = pow(r176501, r176502);
        double r176504 = r176503 + r176501;
        double r176505 = r176499 * r176504;
        double r176506 = log(r176498);
        double r176507 = pow(r176498, r176502);
        double r176508 = r176503 / r176507;
        double r176509 = r176499 * r176508;
        double r176510 = r176506 - r176509;
        double r176511 = r176505 + r176510;
        double r176512 = r176500 * r176511;
        return r176512;
}

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 2020024 
(FPCore (x)
  :name "Hyperbolic arc-(co)tangent"
  :precision binary64
  (* (/ 1 2) (log (/ (+ 1 x) (- 1 x)))))