Average Error: 0.0 → 0.0
Time: 10.3s
Precision: 64
\[\frac{x - y}{1 - y}\]
\[\frac{x}{1 - y} - \frac{1}{\frac{1 - y}{y}}\]
\frac{x - y}{1 - y}
\frac{x}{1 - y} - \frac{1}{\frac{1 - y}{y}}
double f(double x, double y) {
        double r179311 = x;
        double r179312 = y;
        double r179313 = r179311 - r179312;
        double r179314 = 1.0;
        double r179315 = r179314 - r179312;
        double r179316 = r179313 / r179315;
        return r179316;
}

double f(double x, double y) {
        double r179317 = x;
        double r179318 = 1.0;
        double r179319 = y;
        double r179320 = r179318 - r179319;
        double r179321 = r179317 / r179320;
        double r179322 = 1.0;
        double r179323 = r179320 / r179319;
        double r179324 = r179322 / r179323;
        double r179325 = r179321 - r179324;
        return r179325;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{1 - y}\]
  2. Using strategy rm
  3. Applied div-sub0.0

    \[\leadsto \color{blue}{\frac{x}{1 - y} - \frac{y}{1 - y}}\]
  4. Using strategy rm
  5. Applied clear-num0.0

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

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

Reproduce

herbie shell --seed 2020043 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, C"
  :precision binary64
  (/ (- x y) (- 1 y)))