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 r18179 = x;
        double r18180 = 1.0;
        double r18181 = r18179 + r18180;
        double r18182 = r18180 - r18179;
        double r18183 = r18181 / r18182;
        return r18183;
}

double f(double x) {
        double r18184 = 1.0;
        double r18185 = 1.0;
        double r18186 = x;
        double r18187 = r18185 - r18186;
        double r18188 = r18186 + r18185;
        double r18189 = r18187 / r18188;
        double r18190 = r18184 / r18189;
        return r18190;
}

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