Average Error: 0.0 → 0.1
Time: 15.7s
Precision: 64
\[\frac{x - y}{2.0 - \left(x + y\right)}\]
\[\frac{1}{2.0 - \left(y + x\right)} \cdot \left(x - y\right)\]
\frac{x - y}{2.0 - \left(x + y\right)}
\frac{1}{2.0 - \left(y + x\right)} \cdot \left(x - y\right)
double f(double x, double y) {
        double r38144511 = x;
        double r38144512 = y;
        double r38144513 = r38144511 - r38144512;
        double r38144514 = 2.0;
        double r38144515 = r38144511 + r38144512;
        double r38144516 = r38144514 - r38144515;
        double r38144517 = r38144513 / r38144516;
        return r38144517;
}

double f(double x, double y) {
        double r38144518 = 1.0;
        double r38144519 = 2.0;
        double r38144520 = y;
        double r38144521 = x;
        double r38144522 = r38144520 + r38144521;
        double r38144523 = r38144519 - r38144522;
        double r38144524 = r38144518 / r38144523;
        double r38144525 = r38144521 - r38144520;
        double r38144526 = r38144524 * r38144525;
        return r38144526;
}

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

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

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

Reproduce

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