Average Error: 0.0 → 0.0
Time: 11.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 r554489 = x;
        double r554490 = y;
        double r554491 = r554489 - r554490;
        double r554492 = r554489 + r554490;
        double r554493 = r554491 / r554492;
        return r554493;
}

double f(double x, double y) {
        double r554494 = x;
        double r554495 = y;
        double r554496 = r554494 - r554495;
        double r554497 = r554494 + r554495;
        double r554498 = r554496 / r554497;
        return r554498;
}

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 *-un-lft-identity0.0

    \[\leadsto \frac{x - y}{\color{blue}{1 \cdot \left(x + y\right)}}\]
  4. Applied *-un-lft-identity0.0

    \[\leadsto \frac{\color{blue}{1 \cdot \left(x - y\right)}}{1 \cdot \left(x + y\right)}\]
  5. Applied times-frac0.0

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

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

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

Reproduce

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