Average Error: 0.0 → 0.1
Time: 33.1s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{1}{2 - \left(y + x\right)} \cdot \left(x - y\right)\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{1}{2 - \left(y + x\right)} \cdot \left(x - y\right)
double f(double x, double y) {
        double r40078515 = x;
        double r40078516 = y;
        double r40078517 = r40078515 - r40078516;
        double r40078518 = 2.0;
        double r40078519 = r40078515 + r40078516;
        double r40078520 = r40078518 - r40078519;
        double r40078521 = r40078517 / r40078520;
        return r40078521;
}

double f(double x, double y) {
        double r40078522 = 1.0;
        double r40078523 = 2.0;
        double r40078524 = y;
        double r40078525 = x;
        double r40078526 = r40078524 + r40078525;
        double r40078527 = r40078523 - r40078526;
        double r40078528 = r40078522 / r40078527;
        double r40078529 = r40078525 - r40078524;
        double r40078530 = r40078528 * r40078529;
        return r40078530;
}

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

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

    \[\leadsto \frac{1}{2 - \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))))