Average Error: 0.0 → 0.0
Time: 15.3s
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 r660626 = x;
        double r660627 = y;
        double r660628 = r660626 - r660627;
        double r660629 = r660626 + r660627;
        double r660630 = r660628 / r660629;
        return r660630;
}

double f(double x, double y) {
        double r660631 = 1.0;
        double r660632 = x;
        double r660633 = y;
        double r660634 = r660632 + r660633;
        double r660635 = r660634 / r660632;
        double r660636 = r660631 / r660635;
        double r660637 = r660633 / r660634;
        double r660638 = r660636 - r660637;
        return r660638;
}

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