Average Error: 0.0 → 0.0
Time: 10.7s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{1}{\frac{x + y}{x}} - \frac{y}{x + y}\]
\frac{x - y}{x + y}
\frac{1}{\frac{x + y}{x}} - \frac{y}{x + y}
double f(double x, double y) {
        double r39174428 = x;
        double r39174429 = y;
        double r39174430 = r39174428 - r39174429;
        double r39174431 = r39174428 + r39174429;
        double r39174432 = r39174430 / r39174431;
        return r39174432;
}

double f(double x, double y) {
        double r39174433 = 1.0;
        double r39174434 = x;
        double r39174435 = y;
        double r39174436 = r39174434 + r39174435;
        double r39174437 = r39174436 / r39174434;
        double r39174438 = r39174433 / r39174437;
        double r39174439 = r39174435 / r39174436;
        double r39174440 = r39174438 - r39174439;
        return r39174440;
}

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 clear-num0.0

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

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

Reproduce

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