Average Error: 0.0 → 0.0
Time: 4.8s
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 r41096 = x;
        double r41097 = 1.0;
        double r41098 = r41096 + r41097;
        double r41099 = r41097 - r41096;
        double r41100 = r41098 / r41099;
        return r41100;
}

double f(double x) {
        double r41101 = 1.0;
        double r41102 = 1.0;
        double r41103 = x;
        double r41104 = r41102 - r41103;
        double r41105 = r41103 + r41102;
        double r41106 = r41104 / r41105;
        double r41107 = r41101 / r41106;
        return r41107;
}

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