Average Error: 0.0 → 0.0
Time: 2.4s
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 r172333 = x;
        double r172334 = y;
        double r172335 = r172333 - r172334;
        double r172336 = 1.0;
        double r172337 = r172336 - r172334;
        double r172338 = r172335 / r172337;
        return r172338;
}

double f(double x, double y) {
        double r172339 = x;
        double r172340 = 1.0;
        double r172341 = y;
        double r172342 = r172340 - r172341;
        double r172343 = r172339 / r172342;
        double r172344 = 1.0;
        double r172345 = r172342 / r172341;
        double r172346 = r172344 / r172345;
        double r172347 = r172343 - r172346;
        return r172347;
}

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 2020035 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, C"
  :precision binary64
  (/ (- x y) (- 1 y)))