Average Error: 0.0 → 0.0
Time: 3.0s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\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}}\]
\frac{x - y}{x + y}
\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}}
double f(double x, double y) {
        double r730247 = x;
        double r730248 = y;
        double r730249 = r730247 - r730248;
        double r730250 = r730247 + r730248;
        double r730251 = r730249 / r730250;
        return r730251;
}

double f(double x, double y) {
        double r730252 = x;
        double r730253 = y;
        double r730254 = r730252 + r730253;
        double r730255 = r730252 / r730254;
        double r730256 = r730255 * r730255;
        double r730257 = r730253 / r730254;
        double r730258 = r730257 * r730257;
        double r730259 = r730256 - r730258;
        double r730260 = r730255 + r730257;
        double r730261 = r730259 / r730260;
        return r730261;
}

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. Final simplification0.0

    \[\leadsto \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}}\]

Reproduce

herbie shell --seed 2020083 
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, D"
  :precision binary64

  :herbie-target
  (- (/ x (+ x y)) (/ y (+ x y)))

  (/ (- x y) (+ x y)))