Average Error: 0.0 → 0.0
Time: 3.3s
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 r41062 = x;
        double r41063 = 1.0;
        double r41064 = r41062 + r41063;
        double r41065 = r41063 - r41062;
        double r41066 = r41064 / r41065;
        return r41066;
}

double f(double x) {
        double r41067 = x;
        double r41068 = 1.0;
        double r41069 = r41067 + r41068;
        double r41070 = r41068 - r41067;
        double r41071 = r41069 / r41070;
        double r41072 = exp(r41071);
        double r41073 = log(r41072);
        return r41073;
}

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 +o rules:numerics
(FPCore (x)
  :name "Prelude:atanh from fay-base-0.20.0.1"
  :precision binary64
  (/ (+ x 1) (- 1 x)))