Average Error: 0.0 → 0.1
Time: 10.8s
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 r40091120 = x;
        double r40091121 = y;
        double r40091122 = r40091120 - r40091121;
        double r40091123 = 2.0;
        double r40091124 = r40091120 + r40091121;
        double r40091125 = r40091123 - r40091124;
        double r40091126 = r40091122 / r40091125;
        return r40091126;
}

double f(double x, double y) {
        double r40091127 = 1.0;
        double r40091128 = 2.0;
        double r40091129 = y;
        double r40091130 = x;
        double r40091131 = r40091129 + r40091130;
        double r40091132 = r40091128 - r40091131;
        double r40091133 = r40091130 - r40091129;
        double r40091134 = r40091132 / r40091133;
        double r40091135 = r40091127 / r40091134;
        return r40091135;
}

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 
(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))))