Average Error: 0.0 → 0.0
Time: 1.6s
Precision: 64
\[\frac{x}{y + x}\]
\[\frac{x}{y + x}\]
\frac{x}{y + x}
\frac{x}{y + x}
double f(double x, double y) {
        double r322981 = x;
        double r322982 = y;
        double r322983 = r322982 + r322981;
        double r322984 = r322981 / r322983;
        return r322984;
}

double f(double x, double y) {
        double r322985 = x;
        double r322986 = y;
        double r322987 = r322986 + r322985;
        double r322988 = r322985 / r322987;
        return r322988;
}

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}{y + x}\]
  2. Using strategy rm
  3. Applied div-inv0.2

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

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

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

Reproduce

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