Average Error: 0.0 → 0.0
Time: 1.5s
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 r28090 = x;
        double r28091 = 1.0;
        double r28092 = r28090 + r28091;
        double r28093 = r28091 - r28090;
        double r28094 = r28092 / r28093;
        return r28094;
}

double f(double x) {
        double r28095 = x;
        double r28096 = 1.0;
        double r28097 = r28095 + r28096;
        double r28098 = r28096 - r28095;
        double r28099 = r28097 / r28098;
        return r28099;
}

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