Average Error: 0.0 → 0.0
Time: 11.4s
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 r524576 = x;
        double r524577 = y;
        double r524578 = r524576 - r524577;
        double r524579 = r524576 + r524577;
        double r524580 = r524578 / r524579;
        return r524580;
}

double f(double x, double y) {
        double r524581 = x;
        double r524582 = y;
        double r524583 = r524581 + r524582;
        double r524584 = r524581 / r524583;
        double r524585 = r524584 * r524584;
        double r524586 = r524582 / r524583;
        double r524587 = r524586 * r524586;
        double r524588 = r524585 - r524587;
        double r524589 = r524584 + r524586;
        double r524590 = r524588 / r524589;
        return r524590;
}

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 2019322 
(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)))