Average Error: 0.0 → 0.0
Time: 4.8s
Precision: 64
\[\frac{x - y}{x}\]
\[1 - \frac{y}{x}\]
\frac{x - y}{x}
1 - \frac{y}{x}
double f(double x, double y) {
        double r36392244 = x;
        double r36392245 = y;
        double r36392246 = r36392244 - r36392245;
        double r36392247 = r36392246 / r36392244;
        return r36392247;
}

double f(double x, double y) {
        double r36392248 = 1.0;
        double r36392249 = y;
        double r36392250 = x;
        double r36392251 = r36392249 / r36392250;
        double r36392252 = r36392248 - r36392251;
        return r36392252;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[1 - \frac{y}{x}\]

Derivation

  1. Initial program 0.0

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

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

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

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

Reproduce

herbie shell --seed 2019162 
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, E"

  :herbie-target
  (- 1 (/ y x))

  (/ (- x y) x))