Average Error: 0.0 → 0.0
Time: 14.5s
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 r36645848 = x;
        double r36645849 = y;
        double r36645850 = r36645848 - r36645849;
        double r36645851 = r36645848 + r36645849;
        double r36645852 = r36645850 / r36645851;
        return r36645852;
}

double f(double x, double y) {
        double r36645853 = 1.0;
        double r36645854 = x;
        double r36645855 = y;
        double r36645856 = r36645854 + r36645855;
        double r36645857 = r36645854 - r36645855;
        double r36645858 = r36645856 / r36645857;
        double r36645859 = r36645853 / r36645858;
        return r36645859;
}

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 2019168 +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)))