Average Error: 0.0 → 0.0
Time: 1.5s
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 r293642 = x;
        double r293643 = y;
        double r293644 = r293642 + r293643;
        double r293645 = r293642 / r293644;
        return r293645;
}

double f(double x, double y) {
        double r293646 = x;
        double r293647 = y;
        double r293648 = r293646 + r293647;
        double r293649 = r293646 / r293648;
        return r293649;
}

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 div-inv0.2

    \[\leadsto \color{blue}{x \cdot \frac{1}{x + y}}\]
  4. Using strategy rm
  5. Applied un-div-inv0.0

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

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

Reproduce

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