Average Error: 0.0 → 0.0
Time: 2.5s
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 r8797629 = x;
        double r8797630 = y;
        double r8797631 = r8797629 - r8797630;
        double r8797632 = r8797631 / r8797629;
        return r8797632;
}

double f(double x, double y) {
        double r8797633 = x;
        double r8797634 = y;
        double r8797635 = r8797633 - r8797634;
        double r8797636 = r8797635 / r8797633;
        return r8797636;
}

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 2019156 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, E"

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

  (/ (- x y) x))