Average Error: 0.0 → 0.0
Time: 8.2s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{x - y}{\left(2 - y\right) - x}\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{x - y}{\left(2 - y\right) - x}
double f(double x, double y) {
        double r1789838 = x;
        double r1789839 = y;
        double r1789840 = r1789838 - r1789839;
        double r1789841 = 2.0;
        double r1789842 = r1789838 + r1789839;
        double r1789843 = r1789841 - r1789842;
        double r1789844 = r1789840 / r1789843;
        return r1789844;
}

double f(double x, double y) {
        double r1789845 = x;
        double r1789846 = y;
        double r1789847 = r1789845 - r1789846;
        double r1789848 = 2.0;
        double r1789849 = r1789848 - r1789846;
        double r1789850 = r1789849 - r1789845;
        double r1789851 = r1789847 / r1789850;
        return r1789851;
}

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. Taylor expanded around 0 0.0

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

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

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

Reproduce

herbie shell --seed 2019235 
(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))))