Average Error: 0.0 → 0.0
Time: 6.9s
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 r537446 = x;
        double r537447 = y;
        double r537448 = r537446 - r537447;
        double r537449 = r537446 + r537447;
        double r537450 = r537448 / r537449;
        return r537450;
}

double f(double x, double y) {
        double r537451 = x;
        double r537452 = y;
        double r537453 = r537452 + r537451;
        double r537454 = r537451 / r537453;
        double r537455 = r537452 / r537453;
        double r537456 = r537454 - r537455;
        return r537456;
}

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. Simplified0.0

    \[\leadsto \color{blue}{\frac{x - y}{y + x}}\]
  3. Using strategy rm
  4. Applied div-sub0.0

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

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

Reproduce

herbie shell --seed 2019179 
(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)))