Average Error: 0.0 → 0.0
Time: 25.5s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{x}{y + x} - \frac{y}{y + x}\]
\frac{x - y}{x + y}
\frac{x}{y + x} - \frac{y}{y + x}
double f(double x, double y) {
        double r37064554 = x;
        double r37064555 = y;
        double r37064556 = r37064554 - r37064555;
        double r37064557 = r37064554 + r37064555;
        double r37064558 = r37064556 / r37064557;
        return r37064558;
}

double f(double x, double y) {
        double r37064559 = x;
        double r37064560 = y;
        double r37064561 = r37064560 + r37064559;
        double r37064562 = r37064559 / r37064561;
        double r37064563 = r37064560 / r37064561;
        double r37064564 = r37064562 - r37064563;
        return r37064564;
}

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
\[\frac{x}{x + y} - \frac{y}{x + y}\]

Derivation

  1. Initial program 0.0

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

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

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

Reproduce

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

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

  (/ (- x y) (+ x y)))