Average Error: 0.0 → 0.0
Time: 1.1s
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 r15497 = x;
        double r15498 = 1.0;
        double r15499 = r15497 + r15498;
        double r15500 = r15498 - r15497;
        double r15501 = r15499 / r15500;
        return r15501;
}

double f(double x) {
        double r15502 = 1.0;
        double r15503 = 1.0;
        double r15504 = x;
        double r15505 = r15503 - r15504;
        double r15506 = r15504 + r15503;
        double r15507 = r15505 / r15506;
        double r15508 = r15502 / r15507;
        return r15508;
}

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