Average Error: 0.0 → 0.0
Time: 6.0s
Precision: 64
\[\frac{x}{x + y}\]
\[\frac{x}{y + x}\]
\frac{x}{x + y}
\frac{x}{y + x}
double f(double x, double y) {
        double r161549 = x;
        double r161550 = y;
        double r161551 = r161549 + r161550;
        double r161552 = r161549 / r161551;
        return r161552;
}

double f(double x, double y) {
        double r161553 = x;
        double r161554 = y;
        double r161555 = r161554 + r161553;
        double r161556 = r161553 / r161555;
        return r161556;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{x}{x + y}\]
  2. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019179 +o rules:numerics
(FPCore (x y)
  :name "AI.Clustering.Hierarchical.Internal:average from clustering-0.2.1, A"
  (/ x (+ x y)))