Average Error: 0.0 → 0.1
Time: 9.4s
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 r589112 = x;
        double r589113 = y;
        double r589114 = r589112 - r589113;
        double r589115 = 2.0;
        double r589116 = r589112 + r589113;
        double r589117 = r589115 - r589116;
        double r589118 = r589114 / r589117;
        return r589118;
}

double f(double x, double y) {
        double r589119 = 1.0;
        double r589120 = 2.0;
        double r589121 = y;
        double r589122 = x;
        double r589123 = r589121 + r589122;
        double r589124 = r589120 - r589123;
        double r589125 = r589122 - r589121;
        double r589126 = r589124 / r589125;
        double r589127 = r589119 / r589126;
        return r589127;
}

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. Simplified0.0

    \[\leadsto \color{blue}{\frac{x - y}{\left(2 - x\right) - y}}\]
  3. Using strategy rm
  4. Applied clear-num0.1

    \[\leadsto \color{blue}{\frac{1}{\frac{\left(2 - x\right) - y}{x - y}}}\]
  5. Simplified0.1

    \[\leadsto \frac{1}{\color{blue}{\frac{2 - \left(x + y\right)}{x - y}}}\]
  6. 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))))