Average Error: 0.0 → 0.0
Time: 16.1s
Precision: 64
\[\frac{x - y}{2.0 - \left(x + y\right)}\]
\[\frac{x - y}{\left(2.0 - x\right) - y}\]
\frac{x - y}{2.0 - \left(x + y\right)}
\frac{x - y}{\left(2.0 - x\right) - y}
double f(double x, double y) {
        double r27963349 = x;
        double r27963350 = y;
        double r27963351 = r27963349 - r27963350;
        double r27963352 = 2.0;
        double r27963353 = r27963349 + r27963350;
        double r27963354 = r27963352 - r27963353;
        double r27963355 = r27963351 / r27963354;
        return r27963355;
}

double f(double x, double y) {
        double r27963356 = x;
        double r27963357 = y;
        double r27963358 = r27963356 - r27963357;
        double r27963359 = 2.0;
        double r27963360 = r27963359 - r27963356;
        double r27963361 = r27963360 - r27963357;
        double r27963362 = r27963358 / r27963361;
        return r27963362;
}

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 associate--r+0.0

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

    \[\leadsto \color{blue}{\frac{1}{\frac{\left(2.0 - x\right) - y}{x - y}}}\]
  6. Using strategy rm
  7. Applied div-sub0.1

    \[\leadsto \frac{1}{\color{blue}{\frac{2.0 - x}{x - y} - \frac{y}{x - y}}}\]
  8. Using strategy rm
  9. Applied div-inv0.1

    \[\leadsto \frac{1}{\frac{2.0 - x}{x - y} - \color{blue}{y \cdot \frac{1}{x - y}}}\]
  10. Applied div-inv0.2

    \[\leadsto \frac{1}{\color{blue}{\left(2.0 - x\right) \cdot \frac{1}{x - y}} - y \cdot \frac{1}{x - y}}\]
  11. Applied distribute-rgt-out--0.2

    \[\leadsto \frac{1}{\color{blue}{\frac{1}{x - y} \cdot \left(\left(2.0 - x\right) - y\right)}}\]
  12. Applied associate-/r*0.2

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

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

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

Reproduce

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