Average Error: 0.0 → 0.0
Time: 1.7s
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 r253426 = x;
        double r253427 = y;
        double r253428 = r253426 + r253427;
        double r253429 = r253426 / r253428;
        return r253429;
}

double f(double x, double y) {
        double r253430 = x;
        double r253431 = y;
        double r253432 = r253430 + r253431;
        double r253433 = r253430 / r253432;
        return r253433;
}

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)))