Average Error: 0.0 → 0.0
Time: 2.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 r44230 = x;
        double r44231 = 1.0;
        double r44232 = r44230 + r44231;
        double r44233 = r44231 - r44230;
        double r44234 = r44232 / r44233;
        return r44234;
}

double f(double x) {
        double r44235 = 1.0;
        double r44236 = 1.0;
        double r44237 = x;
        double r44238 = r44236 - r44237;
        double r44239 = r44237 + r44236;
        double r44240 = r44238 / r44239;
        double r44241 = r44235 / r44240;
        return r44241;
}

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)))