Average Error: 0.0 → 0.0
Time: 8.5s
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 r149648 = x;
        double r149649 = y;
        double r149650 = r149648 + r149649;
        double r149651 = r149648 / r149650;
        return r149651;
}

double f(double x, double y) {
        double r149652 = x;
        double r149653 = y;
        double r149654 = r149653 + r149652;
        double r149655 = r149652 / r149654;
        return r149655;
}

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 2019174 +o rules:numerics
(FPCore (x y)
  :name "AI.Clustering.Hierarchical.Internal:average from clustering-0.2.1, A"
  (/ x (+ x y)))