Average Error: 0.0 → 0.0
Time: 13.4s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{1}{\frac{x + y}{x - y}}\]
\frac{x - y}{x + y}
\frac{1}{\frac{x + y}{x - y}}
double f(double x, double y) {
        double r38904917 = x;
        double r38904918 = y;
        double r38904919 = r38904917 - r38904918;
        double r38904920 = r38904917 + r38904918;
        double r38904921 = r38904919 / r38904920;
        return r38904921;
}

double f(double x, double y) {
        double r38904922 = 1.0;
        double r38904923 = x;
        double r38904924 = y;
        double r38904925 = r38904923 + r38904924;
        double r38904926 = r38904923 - r38904924;
        double r38904927 = r38904925 / r38904926;
        double r38904928 = r38904922 / r38904927;
        return r38904928;
}

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}{x + y} - \frac{y}{x + y}\]

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{x + y}\]
  2. Using strategy rm
  3. Applied clear-num0.0

    \[\leadsto \color{blue}{\frac{1}{\frac{x + y}{x - y}}}\]
  4. Final simplification0.0

    \[\leadsto \frac{1}{\frac{x + y}{x - y}}\]

Reproduce

herbie shell --seed 2019169 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, D"

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

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