Average Error: 0.0 → 0.0
Time: 7.8s
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 r38096067 = x;
        double r38096068 = y;
        double r38096069 = r38096067 - r38096068;
        double r38096070 = r38096067 + r38096068;
        double r38096071 = r38096069 / r38096070;
        return r38096071;
}

double f(double x, double y) {
        double r38096072 = x;
        double r38096073 = y;
        double r38096074 = r38096073 + r38096072;
        double r38096075 = r38096072 / r38096074;
        double r38096076 = r38096073 / r38096074;
        double r38096077 = r38096075 - r38096076;
        return r38096077;
}

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