Average Error: 0.0 → 0.0
Time: 1.4s
Precision: 64
\[\frac{x + 1}{1 - x}\]
\[\frac{x + 1}{1 - x}\]
\frac{x + 1}{1 - x}
\frac{x + 1}{1 - x}
double f(double x) {
        double r28322 = x;
        double r28323 = 1.0;
        double r28324 = r28322 + r28323;
        double r28325 = r28323 - r28322;
        double r28326 = r28324 / r28325;
        return r28326;
}

double f(double x) {
        double r28327 = x;
        double r28328 = 1.0;
        double r28329 = r28327 + r28328;
        double r28330 = r28328 - r28327;
        double r28331 = r28329 / r28330;
        return r28331;
}

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 expm1-log1p-u1.0

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x + 1}{1 - x}\right)\right)}\]
  4. Using strategy rm
  5. Applied expm1-log1p0.0

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

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

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(FPCore (x)
  :name "Prelude:atanh from fay-base-0.20.0.1"
  :precision binary64
  (/ (+ x 1) (- 1 x)))