Average Error: 0.0 → 0.0
Time: 1.3m
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{x}{x + y} - \frac{y}{x + y}\]
\frac{x - y}{x + y}
\frac{x}{x + y} - \frac{y}{x + y}
double f(double x, double y) {
        double r31502324 = x;
        double r31502325 = y;
        double r31502326 = r31502324 - r31502325;
        double r31502327 = r31502324 + r31502325;
        double r31502328 = r31502326 / r31502327;
        return r31502328;
}

double f(double x, double y) {
        double r31502329 = x;
        double r31502330 = y;
        double r31502331 = r31502329 + r31502330;
        double r31502332 = r31502329 / r31502331;
        double r31502333 = r31502330 / r31502331;
        double r31502334 = r31502332 - r31502333;
        return r31502334;
}

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}{x + y} - \frac{y}{x + y}\]

Reproduce

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