Average Error: 0.0 → 0.0
Time: 1.2s
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 r27043 = x;
        double r27044 = 1.0;
        double r27045 = r27043 + r27044;
        double r27046 = r27044 - r27043;
        double r27047 = r27045 / r27046;
        return r27047;
}

double f(double x) {
        double r27048 = 1.0;
        double r27049 = 1.0;
        double r27050 = x;
        double r27051 = r27049 - r27050;
        double r27052 = r27050 + r27049;
        double r27053 = r27051 / r27052;
        double r27054 = r27048 / r27053;
        return r27054;
}

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