Average Error: 0.0 → 0.0
Time: 7.4s
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 r198094 = x;
        double r198095 = y;
        double r198096 = r198094 + r198095;
        double r198097 = r198094 / r198096;
        return r198097;
}

double f(double x, double y) {
        double r198098 = x;
        double r198099 = y;
        double r198100 = r198099 + r198098;
        double r198101 = r198098 / r198100;
        return r198101;
}

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