Average Error: 0.0 → 0.0
Time: 6.4s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{x}{y + x} - \frac{y}{y + x}\]
\frac{x - y}{x + y}
\frac{x}{y + x} - \frac{y}{y + x}
double f(double x, double y) {
        double r685225 = x;
        double r685226 = y;
        double r685227 = r685225 - r685226;
        double r685228 = r685225 + r685226;
        double r685229 = r685227 / r685228;
        return r685229;
}

double f(double x, double y) {
        double r685230 = x;
        double r685231 = y;
        double r685232 = r685231 + r685230;
        double r685233 = r685230 / r685232;
        double r685234 = r685231 / r685232;
        double r685235 = r685233 - r685234;
        return r685235;
}

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. Simplified0.0

    \[\leadsto \color{blue}{\frac{x - y}{y + x}}\]
  3. Using strategy rm
  4. Applied div-sub0.0

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

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

Reproduce

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