Average Error: 0.0 → 0.1
Time: 53.6s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{1}{2 - \left(y + x\right)} \cdot x - \frac{y}{2 - \left(y + x\right)}\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{1}{2 - \left(y + x\right)} \cdot x - \frac{y}{2 - \left(y + x\right)}
double f(double x, double y) {
        double r39334068 = x;
        double r39334069 = y;
        double r39334070 = r39334068 - r39334069;
        double r39334071 = 2.0;
        double r39334072 = r39334068 + r39334069;
        double r39334073 = r39334071 - r39334072;
        double r39334074 = r39334070 / r39334073;
        return r39334074;
}

double f(double x, double y) {
        double r39334075 = 1.0;
        double r39334076 = 2.0;
        double r39334077 = y;
        double r39334078 = x;
        double r39334079 = r39334077 + r39334078;
        double r39334080 = r39334076 - r39334079;
        double r39334081 = r39334075 / r39334080;
        double r39334082 = r39334081 * r39334078;
        double r39334083 = r39334077 / r39334080;
        double r39334084 = r39334082 - r39334083;
        return r39334084;
}

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-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 div-inv0.1

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

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

Reproduce

herbie shell --seed 2019200 +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))))