Average Error: 0.0 → 0.0
Time: 14.9s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{x}{2 - \left(x + y\right)} - \frac{1}{\frac{2 - x}{y} - 1}\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{x}{2 - \left(x + y\right)} - \frac{1}{\frac{2 - x}{y} - 1}
double f(double x, double y) {
        double r495343 = x;
        double r495344 = y;
        double r495345 = r495343 - r495344;
        double r495346 = 2.0;
        double r495347 = r495343 + r495344;
        double r495348 = r495346 - r495347;
        double r495349 = r495345 / r495348;
        return r495349;
}

double f(double x, double y) {
        double r495350 = x;
        double r495351 = 2.0;
        double r495352 = y;
        double r495353 = r495350 + r495352;
        double r495354 = r495351 - r495353;
        double r495355 = r495350 / r495354;
        double r495356 = 1.0;
        double r495357 = r495351 - r495350;
        double r495358 = r495357 / r495352;
        double r495359 = r495358 - r495356;
        double r495360 = r495356 / r495359;
        double r495361 = r495355 - r495360;
        return r495361;
}

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 div-sub0.0

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

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

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

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

Reproduce

herbie shell --seed 2019306 +o rules:numerics
(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))))