Average Error: 0.0 → 0.0
Time: 2.5s
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 r810346 = x;
        double r810347 = y;
        double r810348 = r810346 - r810347;
        double r810349 = 2.0;
        double r810350 = r810346 + r810347;
        double r810351 = r810349 - r810350;
        double r810352 = r810348 / r810351;
        return r810352;
}

double f(double x, double y) {
        double r810353 = x;
        double r810354 = 2.0;
        double r810355 = y;
        double r810356 = r810353 + r810355;
        double r810357 = r810354 - r810356;
        double r810358 = r810353 / r810357;
        double r810359 = r810355 / r810357;
        double r810360 = r810358 - r810359;
        return r810360;
}

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))))