Average Error: 0.0 → 0.0
Time: 7.8s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{x}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)}\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{x}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)}
double f(double x, double y) {
        double r978576 = x;
        double r978577 = y;
        double r978578 = r978576 - r978577;
        double r978579 = 2.0;
        double r978580 = r978576 + r978577;
        double r978581 = r978579 - r978580;
        double r978582 = r978578 / r978581;
        return r978582;
}

double f(double x, double y) {
        double r978583 = x;
        double r978584 = 2.0;
        double r978585 = y;
        double r978586 = r978583 + r978585;
        double r978587 = r978584 - r978586;
        double r978588 = r978583 / r978587;
        double r978589 = r978585 / r978587;
        double r978590 = r978588 - r978589;
        return r978590;
}

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

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{2 - \left(x + y\right)}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.0

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

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

    \[\leadsto \color{blue}{\frac{1}{1} \cdot \frac{x - y}{2 - \left(x + y\right)}}\]
  6. Simplified0.0

    \[\leadsto \color{blue}{1} \cdot \frac{x - y}{2 - \left(x + y\right)}\]
  7. Using strategy rm
  8. Applied div-sub0.0

    \[\leadsto 1 \cdot \color{blue}{\left(\frac{x}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)}\right)}\]
  9. Final simplification0.0

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

Reproduce

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

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

  (/ (- x y) (- 2 (+ x y))))