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 r23527 = x;
        double r23528 = 1.0;
        double r23529 = r23527 + r23528;
        double r23530 = r23528 - r23527;
        double r23531 = r23529 / r23530;
        return r23531;
}

double f(double x) {
        double r23532 = 1.0;
        double r23533 = 1.0;
        double r23534 = x;
        double r23535 = r23533 - r23534;
        double r23536 = r23534 + r23533;
        double r23537 = r23535 / r23536;
        double r23538 = r23532 / r23537;
        return r23538;
}

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