Average Error: 0.0 → 0.2
Time: 2.5s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{1}{2 - \left(x + y\right)} \cdot \left(x - y\right)\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{1}{2 - \left(x + y\right)} \cdot \left(x - y\right)
double f(double x, double y) {
        double r785399 = x;
        double r785400 = y;
        double r785401 = r785399 - r785400;
        double r785402 = 2.0;
        double r785403 = r785399 + r785400;
        double r785404 = r785402 - r785403;
        double r785405 = r785401 / r785404;
        return r785405;
}

double f(double x, double y) {
        double r785406 = 1.0;
        double r785407 = 2.0;
        double r785408 = x;
        double r785409 = y;
        double r785410 = r785408 + r785409;
        double r785411 = r785407 - r785410;
        double r785412 = r785406 / r785411;
        double r785413 = r785408 - r785409;
        double r785414 = r785412 * r785413;
        return r785414;
}

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.2
\[\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-sub0.0

    \[\leadsto \color{blue}{\frac{x}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)}}\]
  4. Using strategy rm
  5. Applied div-inv0.1

    \[\leadsto \frac{x}{2 - \left(x + y\right)} - \color{blue}{y \cdot \frac{1}{2 - \left(x + y\right)}}\]
  6. Applied div-inv0.2

    \[\leadsto \color{blue}{x \cdot \frac{1}{2 - \left(x + y\right)}} - y \cdot \frac{1}{2 - \left(x + y\right)}\]
  7. Applied distribute-rgt-out--0.2

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

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

Reproduce

herbie shell --seed 2020060 
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, C"
  :precision binary64

  :herbie-target
  (- (/ x (- 2 (+ x y))) (/ y (- 2 (+ x y))))

  (/ (- x y) (- 2 (+ x y))))