Average Error: 0.0 → 0.0
Time: 3.1s
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 r1032159 = x;
        double r1032160 = y;
        double r1032161 = r1032159 - r1032160;
        double r1032162 = r1032159 + r1032160;
        double r1032163 = r1032161 / r1032162;
        return r1032163;
}

double f(double x, double y) {
        double r1032164 = x;
        double r1032165 = y;
        double r1032166 = r1032164 + r1032165;
        double r1032167 = r1032164 / r1032166;
        double r1032168 = r1032167 * r1032167;
        double r1032169 = r1032165 / r1032166;
        double r1032170 = r1032169 * r1032169;
        double r1032171 = r1032168 - r1032170;
        double r1032172 = r1032167 + r1032169;
        double r1032173 = r1032171 / r1032172;
        return r1032173;
}

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