Average Error: 0.0 → 0.0
Time: 1.3s
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 r42666 = x;
        double r42667 = 1.0;
        double r42668 = r42666 + r42667;
        double r42669 = r42667 - r42666;
        double r42670 = r42668 / r42669;
        return r42670;
}

double f(double x) {
        double r42671 = 1.0;
        double r42672 = 1.0;
        double r42673 = x;
        double r42674 = r42672 - r42673;
        double r42675 = r42673 + r42672;
        double r42676 = r42674 / r42675;
        double r42677 = r42671 / r42676;
        return r42677;
}

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