Average Error: 0.0 → 0.0
Time: 8.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 r533367 = x;
        double r533368 = y;
        double r533369 = r533367 - r533368;
        double r533370 = r533367 + r533368;
        double r533371 = r533369 / r533370;
        return r533371;
}

double f(double x, double y) {
        double r533372 = x;
        double r533373 = y;
        double r533374 = r533373 + r533372;
        double r533375 = r533372 / r533374;
        double r533376 = r533373 / r533374;
        double r533377 = r533375 - r533376;
        return r533377;
}

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

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

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

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

Reproduce

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