Average Error: 0.0 → 0.0
Time: 1.0s
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 r270525 = x;
        double r270526 = y;
        double r270527 = r270525 + r270526;
        double r270528 = r270525 / r270527;
        return r270528;
}

double f(double x, double y) {
        double r270529 = x;
        double r270530 = y;
        double r270531 = r270529 + r270530;
        double r270532 = r270529 / r270531;
        return r270532;
}

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