Average Error: 0.0 → 0.1
Time: 4.8s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{x}{2 - \left(x + y\right)} - y \cdot \frac{1}{2 - \left(x + y\right)}\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{x}{2 - \left(x + y\right)} - y \cdot \frac{1}{2 - \left(x + y\right)}
double f(double x, double y) {
        double r778916 = x;
        double r778917 = y;
        double r778918 = r778916 - r778917;
        double r778919 = 2.0;
        double r778920 = r778916 + r778917;
        double r778921 = r778919 - r778920;
        double r778922 = r778918 / r778921;
        return r778922;
}

double f(double x, double y) {
        double r778923 = x;
        double r778924 = 2.0;
        double r778925 = y;
        double r778926 = r778923 + r778925;
        double r778927 = r778924 - r778926;
        double r778928 = r778923 / r778927;
        double r778929 = 1.0;
        double r778930 = r778929 / r778927;
        double r778931 = r778925 * r778930;
        double r778932 = r778928 - r778931;
        return r778932;
}

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-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. Final simplification0.1

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

Reproduce

herbie shell --seed 2020033 +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))))