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 r248885 = x;
        double r248886 = y;
        double r248887 = r248885 - r248886;
        double r248888 = 1.0;
        double r248889 = r248888 - r248886;
        double r248890 = r248887 / r248889;
        return r248890;
}

double f(double x, double y) {
        double r248891 = x;
        double r248892 = 1.0;
        double r248893 = y;
        double r248894 = r248892 - r248893;
        double r248895 = r248891 / r248894;
        double r248896 = 1.0;
        double r248897 = r248894 / r248893;
        double r248898 = r248896 / r248897;
        double r248899 = r248895 - r248898;
        return r248899;
}

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