Average Error: 0.0 → 0.0
Time: 1.3s
Precision: 64
\[\frac{x}{x + y}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{x + y}\right)\right)\]
\frac{x}{x + y}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{x + y}\right)\right)
double f(double x, double y) {
        double r294323 = x;
        double r294324 = y;
        double r294325 = r294323 + r294324;
        double r294326 = r294323 / r294325;
        return r294326;
}

double f(double x, double y) {
        double r294327 = x;
        double r294328 = y;
        double r294329 = r294327 + r294328;
        double r294330 = r294327 / r294329;
        double r294331 = expm1(r294330);
        double r294332 = log1p(r294331);
        return r294332;
}

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

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

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

Reproduce

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