Average Error: 0.0 → 0.0
Time: 10.9s
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 r647117 = x;
        double r647118 = y;
        double r647119 = r647117 - r647118;
        double r647120 = r647117 + r647118;
        double r647121 = r647119 / r647120;
        return r647121;
}

double f(double x, double y) {
        double r647122 = x;
        double r647123 = y;
        double r647124 = r647122 - r647123;
        double r647125 = r647122 + r647123;
        double r647126 = r647124 / r647125;
        return r647126;
}

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 2019347 +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)))