Average Error: 0.0 → 0.0
Time: 11.5s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{\frac{x}{y + x} \cdot \frac{x}{y + x} - \frac{y}{y + x} \cdot \frac{y}{y + x}}{\frac{1}{\frac{y + x}{x}} + \frac{y}{y + x}}\]
\frac{x - y}{x + y}
\frac{\frac{x}{y + x} \cdot \frac{x}{y + x} - \frac{y}{y + x} \cdot \frac{y}{y + x}}{\frac{1}{\frac{y + x}{x}} + \frac{y}{y + x}}
double f(double x, double y) {
        double r42506369 = x;
        double r42506370 = y;
        double r42506371 = r42506369 - r42506370;
        double r42506372 = r42506369 + r42506370;
        double r42506373 = r42506371 / r42506372;
        return r42506373;
}

double f(double x, double y) {
        double r42506374 = x;
        double r42506375 = y;
        double r42506376 = r42506375 + r42506374;
        double r42506377 = r42506374 / r42506376;
        double r42506378 = r42506377 * r42506377;
        double r42506379 = r42506375 / r42506376;
        double r42506380 = r42506379 * r42506379;
        double r42506381 = r42506378 - r42506380;
        double r42506382 = 1.0;
        double r42506383 = r42506376 / r42506374;
        double r42506384 = r42506382 / r42506383;
        double r42506385 = r42506384 + r42506379;
        double r42506386 = r42506381 / r42506385;
        return r42506386;
}

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. Using strategy rm
  5. Applied flip--0.0

    \[\leadsto \color{blue}{\frac{\frac{x}{x + y} \cdot \frac{x}{x + y} - \frac{y}{x + y} \cdot \frac{y}{x + y}}{\frac{x}{x + y} + \frac{y}{x + y}}}\]
  6. Using strategy rm
  7. Applied clear-num0.0

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

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

Reproduce

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