Average Error: 0.0 → 0.0
Time: 5.4s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\log \left(e^{\frac{\frac{x}{x + y} \cdot \frac{x}{x + y} - \frac{y}{x + y} \cdot \frac{y}{x + y}}{\frac{x}{x + y} + \frac{y}{x + y}}}\right)\]
\frac{x - y}{x + y}
\log \left(e^{\frac{\frac{x}{x + y} \cdot \frac{x}{x + y} - \frac{y}{x + y} \cdot \frac{y}{x + y}}{\frac{x}{x + y} + \frac{y}{x + y}}}\right)
double f(double x, double y) {
        double r944527 = x;
        double r944528 = y;
        double r944529 = r944527 - r944528;
        double r944530 = r944527 + r944528;
        double r944531 = r944529 / r944530;
        return r944531;
}

double f(double x, double y) {
        double r944532 = x;
        double r944533 = y;
        double r944534 = r944532 + r944533;
        double r944535 = r944532 / r944534;
        double r944536 = r944535 * r944535;
        double r944537 = r944533 / r944534;
        double r944538 = r944537 * r944537;
        double r944539 = r944536 - r944538;
        double r944540 = r944535 + r944537;
        double r944541 = r944539 / r944540;
        double r944542 = exp(r944541);
        double r944543 = log(r944542);
        return r944543;
}

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. Using strategy rm
  5. Applied div-sub0.0

    \[\leadsto \log \left(e^{\color{blue}{\frac{x}{x + y} - \frac{y}{x + y}}}\right)\]
  6. Using strategy rm
  7. Applied flip--0.0

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

    \[\leadsto \log \left(e^{\frac{\frac{x}{x + y} \cdot \frac{x}{x + y} - \frac{y}{x + y} \cdot \frac{y}{x + y}}{\frac{x}{x + y} + \frac{y}{x + y}}}\right)\]

Reproduce

herbie shell --seed 2019354 +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)))