Average Error: 0.0 → 0.0
Time: 3.5s
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 r738456 = x;
        double r738457 = y;
        double r738458 = r738456 - r738457;
        double r738459 = r738456 + r738457;
        double r738460 = r738458 / r738459;
        return r738460;
}

double f(double x, double y) {
        double r738461 = x;
        double r738462 = y;
        double r738463 = r738461 + r738462;
        double r738464 = r738461 / r738463;
        double r738465 = r738464 * r738464;
        double r738466 = r738462 / r738463;
        double r738467 = r738466 * r738466;
        double r738468 = r738465 - r738467;
        double r738469 = r738464 + r738466;
        double r738470 = r738468 / r738469;
        return r738470;
}

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