Average Error: 0.0 → 0.0
Time: 2.0s
Precision: 64
\[\frac{x + 1}{1 - x}\]
\[\frac{1}{\frac{1 - x}{x + 1}}\]
\frac{x + 1}{1 - x}
\frac{1}{\frac{1 - x}{x + 1}}
double f(double x) {
        double r35530 = x;
        double r35531 = 1.0;
        double r35532 = r35530 + r35531;
        double r35533 = r35531 - r35530;
        double r35534 = r35532 / r35533;
        return r35534;
}

double f(double x) {
        double r35535 = 1.0;
        double r35536 = 1.0;
        double r35537 = x;
        double r35538 = r35536 - r35537;
        double r35539 = r35537 + r35536;
        double r35540 = r35538 / r35539;
        double r35541 = r35535 / r35540;
        return r35541;
}

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 clear-num0.0

    \[\leadsto \color{blue}{\frac{1}{\frac{1 - x}{x + 1}}}\]
  4. Final simplification0.0

    \[\leadsto \frac{1}{\frac{1 - x}{x + 1}}\]

Reproduce

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