Average Error: 0.0 → 0.0
Time: 5.1s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{x - y}{x + y}\]
\frac{x - y}{x + y}
\frac{x - y}{x + y}
double f(double x, double y) {
        double r898519 = x;
        double r898520 = y;
        double r898521 = r898519 - r898520;
        double r898522 = r898519 + r898520;
        double r898523 = r898521 / r898522;
        return r898523;
}

double f(double x, double y) {
        double r898524 = x;
        double r898525 = y;
        double r898526 = r898524 - r898525;
        double r898527 = r898524 + r898525;
        double r898528 = r898526 / r898527;
        return r898528;
}

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

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

Reproduce

herbie shell --seed 2020047 +o rules:numerics
(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)))