Average Error: 0.0 → 0.1
Time: 20.3s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{1}{2 - \left(y + x\right)} \cdot \left(x - y\right)\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{1}{2 - \left(y + x\right)} \cdot \left(x - y\right)
double f(double x, double y) {
        double r43782065 = x;
        double r43782066 = y;
        double r43782067 = r43782065 - r43782066;
        double r43782068 = 2.0;
        double r43782069 = r43782065 + r43782066;
        double r43782070 = r43782068 - r43782069;
        double r43782071 = r43782067 / r43782070;
        return r43782071;
}

double f(double x, double y) {
        double r43782072 = 1.0;
        double r43782073 = 2.0;
        double r43782074 = y;
        double r43782075 = x;
        double r43782076 = r43782074 + r43782075;
        double r43782077 = r43782073 - r43782076;
        double r43782078 = r43782072 / r43782077;
        double r43782079 = r43782075 - r43782074;
        double r43782080 = r43782078 * r43782079;
        return r43782080;
}

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.1
\[\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-inv0.1

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

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

Reproduce

herbie shell --seed 2019169 
(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))))