Average Error: 0.0 → 0.0
Time: 11.1s
Precision: 64
\[\frac{x}{y + x}\]
\[\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{y + x}\right)\right)\]
\frac{x}{y + x}
\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{y + x}\right)\right)
double f(double x, double y) {
        double r12064312 = x;
        double r12064313 = y;
        double r12064314 = r12064313 + r12064312;
        double r12064315 = r12064312 / r12064314;
        return r12064315;
}

double f(double x, double y) {
        double r12064316 = x;
        double r12064317 = y;
        double r12064318 = r12064317 + r12064316;
        double r12064319 = r12064316 / r12064318;
        double r12064320 = log1p(r12064319);
        double r12064321 = expm1(r12064320);
        return r12064321;
}

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 expm1-log1p-u0.0

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{y + x}\right)\right)}\]
  4. Final simplification0.0

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{y + x}\right)\right)\]

Reproduce

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