Average Error: 0.0 → 0.0
Time: 860.0ms
Precision: 64
\[\frac{x - y}{x}\]
\[\frac{x - y}{x}\]
\frac{x - y}{x}
\frac{x - y}{x}
double f(double x, double y) {
        double r1101691 = x;
        double r1101692 = y;
        double r1101693 = r1101691 - r1101692;
        double r1101694 = r1101693 / r1101691;
        return r1101694;
}

double f(double x, double y) {
        double r1101695 = x;
        double r1101696 = y;
        double r1101697 = r1101695 - r1101696;
        double r1101698 = r1101697 / r1101695;
        return r1101698;
}

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. Final simplification0.0

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

Reproduce

herbie shell --seed 2019362 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, E"
  :precision binary64

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

  (/ (- x y) x))