Average Error: 0.0 → 0.0
Time: 11.9s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{1}{\frac{x + y}{x}} - \frac{y}{x + y}\]
\frac{x - y}{x + y}
\frac{1}{\frac{x + y}{x}} - \frac{y}{x + y}
double f(double x, double y) {
        double r41283778 = x;
        double r41283779 = y;
        double r41283780 = r41283778 - r41283779;
        double r41283781 = r41283778 + r41283779;
        double r41283782 = r41283780 / r41283781;
        return r41283782;
}

double f(double x, double y) {
        double r41283783 = 1.0;
        double r41283784 = x;
        double r41283785 = y;
        double r41283786 = r41283784 + r41283785;
        double r41283787 = r41283786 / r41283784;
        double r41283788 = r41283783 / r41283787;
        double r41283789 = r41283785 / r41283786;
        double r41283790 = r41283788 - r41283789;
        return r41283790;
}

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 clear-num0.0

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

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

Reproduce

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