Average Error: 0.0 → 0.0
Time: 8.1s
Precision: 64
\[\frac{x + 1}{1 - x}\]
\[\log \left(e^{\frac{1 + x}{1 - x}}\right)\]
\frac{x + 1}{1 - x}
\log \left(e^{\frac{1 + x}{1 - x}}\right)
double f(double x) {
        double r1741486 = x;
        double r1741487 = 1.0;
        double r1741488 = r1741486 + r1741487;
        double r1741489 = r1741487 - r1741486;
        double r1741490 = r1741488 / r1741489;
        return r1741490;
}

double f(double x) {
        double r1741491 = 1.0;
        double r1741492 = x;
        double r1741493 = r1741491 + r1741492;
        double r1741494 = r1741491 - r1741492;
        double r1741495 = r1741493 / r1741494;
        double r1741496 = exp(r1741495);
        double r1741497 = log(r1741496);
        return r1741497;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{x + 1}{1 - x}\]
  2. Using strategy rm
  3. Applied add-log-exp0.0

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x)
  :name "Prelude:atanh from fay-base-0.20.0.1"
  (/ (+ x 1.0) (- 1.0 x)))