Average Error: 0.0 → 0.1
Time: 11.0s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{1}{\frac{2 - \left(y + x\right)}{x - y}}\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{1}{\frac{2 - \left(y + x\right)}{x - y}}
double f(double x, double y) {
        double r34970698 = x;
        double r34970699 = y;
        double r34970700 = r34970698 - r34970699;
        double r34970701 = 2.0;
        double r34970702 = r34970698 + r34970699;
        double r34970703 = r34970701 - r34970702;
        double r34970704 = r34970700 / r34970703;
        return r34970704;
}

double f(double x, double y) {
        double r34970705 = 1.0;
        double r34970706 = 2.0;
        double r34970707 = y;
        double r34970708 = x;
        double r34970709 = r34970707 + r34970708;
        double r34970710 = r34970706 - r34970709;
        double r34970711 = r34970708 - r34970707;
        double r34970712 = r34970710 / r34970711;
        double r34970713 = r34970705 / r34970712;
        return r34970713;
}

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 clear-num0.1

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

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

Reproduce

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