Average Error: 0.0 → 0.0
Time: 8.6s
Precision: 64
\[\frac{x + 1.0}{1.0 - x}\]
\[\frac{1}{\frac{1.0 - x}{1.0 + x}}\]
\frac{x + 1.0}{1.0 - x}
\frac{1}{\frac{1.0 - x}{1.0 + x}}
double f(double x) {
        double r1639458 = x;
        double r1639459 = 1.0;
        double r1639460 = r1639458 + r1639459;
        double r1639461 = r1639459 - r1639458;
        double r1639462 = r1639460 / r1639461;
        return r1639462;
}

double f(double x) {
        double r1639463 = 1.0;
        double r1639464 = 1.0;
        double r1639465 = x;
        double r1639466 = r1639464 - r1639465;
        double r1639467 = r1639464 + r1639465;
        double r1639468 = r1639466 / r1639467;
        double r1639469 = r1639463 / r1639468;
        return r1639469;
}

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.0}{1.0 - x}\]
  2. Using strategy rm
  3. Applied clear-num0.0

    \[\leadsto \color{blue}{\frac{1}{\frac{1.0 - x}{x + 1.0}}}\]
  4. Final simplification0.0

    \[\leadsto \frac{1}{\frac{1.0 - x}{1.0 + x}}\]

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x)
  :name "Prelude:atanh from fay-base-0.20.0.1"
  (/ (+ x 1.0) (- 1.0 x)))