Average Error: 0.0 → 0.1
Time: 9.1s
Precision: 64
\[\frac{x}{1 - x}\]
\[x \cdot \frac{1}{1 - x}\]
\frac{x}{1 - x}
x \cdot \frac{1}{1 - x}
double f(double x) {
        double r118255 = x;
        double r118256 = 1.0;
        double r118257 = r118256 - r118255;
        double r118258 = r118255 / r118257;
        return r118258;
}

double f(double x) {
        double r118259 = x;
        double r118260 = 1.0;
        double r118261 = 1.0;
        double r118262 = r118261 - r118259;
        double r118263 = r118260 / r118262;
        double r118264 = r118259 * r118263;
        return r118264;
}

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 - x}\]
  2. Using strategy rm
  3. Applied div-inv0.1

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

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

Reproduce

herbie shell --seed 2019303 +o rules:numerics
(FPCore (x)
  :name "Numeric.Integration.TanhSinh:nonNegative from integration-0.2.1"
  :precision binary64
  (/ x (- 1 x)))