Average Error: 0.0 → 0.0
Time: 7.5s
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 r42483973 = x;
        double r42483974 = y;
        double r42483975 = r42483973 - r42483974;
        double r42483976 = r42483973 + r42483974;
        double r42483977 = r42483975 / r42483976;
        return r42483977;
}

double f(double x, double y) {
        double r42483978 = x;
        double r42483979 = y;
        double r42483980 = r42483979 + r42483978;
        double r42483981 = r42483978 / r42483980;
        double r42483982 = r42483979 / r42483980;
        double r42483983 = r42483981 - r42483982;
        return r42483983;
}

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

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

Reproduce

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