Average Error: 0.0 → 0.0
Time: 8.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 r608527 = x;
        double r608528 = y;
        double r608529 = r608527 - r608528;
        double r608530 = r608527 + r608528;
        double r608531 = r608529 / r608530;
        return r608531;
}

double f(double x, double y) {
        double r608532 = x;
        double r608533 = y;
        double r608534 = r608532 - r608533;
        double r608535 = r608532 + r608533;
        double r608536 = r608534 / r608535;
        return r608536;
}

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 add-log-exp0.0

    \[\leadsto \color{blue}{\log \left(e^{\frac{x - y}{x + y}}\right)}\]
  4. Final simplification0.0

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

Reproduce

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