Average Error: 0.0 → 0.0
Time: 11.5s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{1}{\frac{x + y}{x}} - \frac{1}{\frac{x + y}{y}}\]
\frac{x - y}{x + y}
\frac{1}{\frac{x + y}{x}} - \frac{1}{\frac{x + y}{y}}
double f(double x, double y) {
        double r39873998 = x;
        double r39873999 = y;
        double r39874000 = r39873998 - r39873999;
        double r39874001 = r39873998 + r39873999;
        double r39874002 = r39874000 / r39874001;
        return r39874002;
}

double f(double x, double y) {
        double r39874003 = 1.0;
        double r39874004 = x;
        double r39874005 = y;
        double r39874006 = r39874004 + r39874005;
        double r39874007 = r39874006 / r39874004;
        double r39874008 = r39874003 / r39874007;
        double r39874009 = r39874006 / r39874005;
        double r39874010 = r39874003 / r39874009;
        double r39874011 = r39874008 - r39874010;
        return r39874011;
}

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. Using strategy rm
  7. Applied clear-num0.0

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

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

Reproduce

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