Average Error: 0.0 → 0.0
Time: 1.2s
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 r18541 = x;
        double r18542 = 1.0;
        double r18543 = r18541 + r18542;
        double r18544 = r18542 - r18541;
        double r18545 = r18543 / r18544;
        return r18545;
}

double f(double x) {
        double r18546 = 1.0;
        double r18547 = 1.0;
        double r18548 = x;
        double r18549 = r18547 - r18548;
        double r18550 = r18548 + r18547;
        double r18551 = r18549 / r18550;
        double r18552 = r18546 / r18551;
        return r18552;
}

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