Average Error: 0.0 → 0.0
Time: 13.3s
Precision: 64
\[\frac{x - y}{2.0 - \left(x + y\right)}\]
\[\frac{x}{2.0 - \left(x + y\right)} + \left(-\frac{y}{2.0 - \left(x + y\right)}\right)\]
\frac{x - y}{2.0 - \left(x + y\right)}
\frac{x}{2.0 - \left(x + y\right)} + \left(-\frac{y}{2.0 - \left(x + y\right)}\right)
double f(double x, double y) {
        double r47380511 = x;
        double r47380512 = y;
        double r47380513 = r47380511 - r47380512;
        double r47380514 = 2.0;
        double r47380515 = r47380511 + r47380512;
        double r47380516 = r47380514 - r47380515;
        double r47380517 = r47380513 / r47380516;
        return r47380517;
}

double f(double x, double y) {
        double r47380518 = x;
        double r47380519 = 2.0;
        double r47380520 = y;
        double r47380521 = r47380518 + r47380520;
        double r47380522 = r47380519 - r47380521;
        double r47380523 = r47380518 / r47380522;
        double r47380524 = r47380520 / r47380522;
        double r47380525 = -r47380524;
        double r47380526 = r47380523 + r47380525;
        return r47380526;
}

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}{2.0 - \left(x + y\right)} - \frac{y}{2.0 - \left(x + y\right)}\]

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{2.0 - \left(x + y\right)}\]
  2. Using strategy rm
  3. Applied div-sub0.0

    \[\leadsto \color{blue}{\frac{x}{2.0 - \left(x + y\right)} - \frac{y}{2.0 - \left(x + y\right)}}\]
  4. Using strategy rm
  5. Applied sub-neg0.0

    \[\leadsto \color{blue}{\frac{x}{2.0 - \left(x + y\right)} + \left(-\frac{y}{2.0 - \left(x + y\right)}\right)}\]
  6. Final simplification0.0

    \[\leadsto \frac{x}{2.0 - \left(x + y\right)} + \left(-\frac{y}{2.0 - \left(x + y\right)}\right)\]

Reproduce

herbie shell --seed 2019158 
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, C"

  :herbie-target
  (- (/ x (- 2.0 (+ x y))) (/ y (- 2.0 (+ x y))))

  (/ (- x y) (- 2.0 (+ x y))))