Average Error: 0.0 → 0.0
Time: 5.1s
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 r544966 = x;
        double r544967 = y;
        double r544968 = r544966 - r544967;
        double r544969 = r544966 + r544967;
        double r544970 = r544968 / r544969;
        return r544970;
}

double f(double x, double y) {
        double r544971 = 1.0;
        double r544972 = x;
        double r544973 = y;
        double r544974 = r544972 + r544973;
        double r544975 = r544972 - r544973;
        double r544976 = r544974 / r544975;
        double r544977 = r544971 / r544976;
        return r544977;
}

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