Average Error: 0.0 → 0.0
Time: 13.2s
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 r1425638 = x;
        double r1425639 = 1.0;
        double r1425640 = r1425638 + r1425639;
        double r1425641 = r1425639 - r1425638;
        double r1425642 = r1425640 / r1425641;
        return r1425642;
}

double f(double x) {
        double r1425643 = 1.0;
        double r1425644 = x;
        double r1425645 = r1425643 + r1425644;
        double r1425646 = r1425643 - r1425644;
        double r1425647 = r1425645 / r1425646;
        double r1425648 = exp(r1425647);
        double r1425649 = log(r1425648);
        return r1425649;
}

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)))