Average Error: 0.0 → 0.0
Time: 6.0s
Precision: 64
\[\frac{x - y}{y}\]
\[\frac{x}{y} - 1\]
\frac{x - y}{y}
\frac{x}{y} - 1
double f(double x, double y) {
        double r15003744 = x;
        double r15003745 = y;
        double r15003746 = r15003744 - r15003745;
        double r15003747 = r15003746 / r15003745;
        return r15003747;
}

double f(double x, double y) {
        double r15003748 = x;
        double r15003749 = y;
        double r15003750 = r15003748 / r15003749;
        double r15003751 = 1.0;
        double r15003752 = r15003750 - r15003751;
        return r15003752;
}

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}{y}\]
  2. Using strategy rm
  3. Applied div-sub0.0

    \[\leadsto \color{blue}{\frac{x}{y} - \frac{y}{y}}\]
  4. Simplified0.0

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

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

Reproduce

herbie shell --seed 1 
(FPCore (x y)
  :name "(x-y)/y"
  (/ (- x y) y))