Average Error: 0.0 → 0.0
Time: 1.6s
Precision: 64
\[\frac{x}{x + y}\]
\[\frac{x}{x + y}\]
\frac{x}{x + y}
\frac{x}{x + y}
double f(double x, double y) {
        double r262533 = x;
        double r262534 = y;
        double r262535 = r262533 + r262534;
        double r262536 = r262533 / r262535;
        return r262536;
}

double f(double x, double y) {
        double r262537 = x;
        double r262538 = y;
        double r262539 = r262537 + r262538;
        double r262540 = r262537 / r262539;
        return r262540;
}

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. Using strategy rm
  3. Applied *-un-lft-identity0.0

    \[\leadsto \frac{x}{\color{blue}{1 \cdot \left(x + y\right)}}\]
  4. Applied *-un-lft-identity0.0

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{1 \cdot \left(x + y\right)}\]
  5. Applied times-frac0.0

    \[\leadsto \color{blue}{\frac{1}{1} \cdot \frac{x}{x + y}}\]
  6. Simplified0.0

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

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

Reproduce

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