Average Error: 0.0 → 0.0
Time: 2.0s
Precision: 64
\[\frac{x + 1}{1 - x}\]
\[\log \left(e^{\frac{x + 1}{1 - x}}\right)\]
\frac{x + 1}{1 - x}
\log \left(e^{\frac{x + 1}{1 - x}}\right)
double f(double x) {
        double r46605 = x;
        double r46606 = 1.0;
        double r46607 = r46605 + r46606;
        double r46608 = r46606 - r46605;
        double r46609 = r46607 / r46608;
        return r46609;
}

double f(double x) {
        double r46610 = x;
        double r46611 = 1.0;
        double r46612 = r46610 + r46611;
        double r46613 = r46611 - r46610;
        double r46614 = r46612 / r46613;
        double r46615 = exp(r46614);
        double r46616 = log(r46615);
        return r46616;
}

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{x + 1}{1 - x}}\right)\]

Reproduce

herbie shell --seed 2020035 
(FPCore (x)
  :name "Prelude:atanh from fay-base-0.20.0.1"
  :precision binary64
  (/ (+ x 1) (- 1 x)))