Average Error: 0.0 → 0.0
Time: 7.5s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{x}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)}\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{x}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)}
double f(double x, double y) {
        double r957668 = x;
        double r957669 = y;
        double r957670 = r957668 - r957669;
        double r957671 = 2.0;
        double r957672 = r957668 + r957669;
        double r957673 = r957671 - r957672;
        double r957674 = r957670 / r957673;
        return r957674;
}

double f(double x, double y) {
        double r957675 = x;
        double r957676 = 2.0;
        double r957677 = y;
        double r957678 = r957675 + r957677;
        double r957679 = r957676 - r957678;
        double r957680 = r957675 / r957679;
        double r957681 = r957677 / r957679;
        double r957682 = r957680 - r957681;
        return r957682;
}

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.0
\[\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 *-un-lft-identity0.0

    \[\leadsto \frac{x - y}{\color{blue}{1 \cdot \left(2 - \left(x + y\right)\right)}}\]
  4. Applied *-un-lft-identity0.0

    \[\leadsto \frac{\color{blue}{1 \cdot \left(x - y\right)}}{1 \cdot \left(2 - \left(x + y\right)\right)}\]
  5. Applied times-frac0.0

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

    \[\leadsto \color{blue}{1} \cdot \frac{x - y}{2 - \left(x + y\right)}\]
  7. Using strategy rm
  8. Applied div-sub0.0

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

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

Reproduce

herbie shell --seed 2020047 +o rules:numerics
(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))))