Average Error: 0.0 → 0.0
Time: 3.8s
Precision: 64
\[\frac{x + y}{x}\]
\[1 + \frac{y}{x}\]
\frac{x + y}{x}
1 + \frac{y}{x}
double f(double x, double y) {
        double r1731641 = x;
        double r1731642 = y;
        double r1731643 = r1731641 + r1731642;
        double r1731644 = r1731643 / r1731641;
        return r1731644;
}

double f(double x, double y) {
        double r1731645 = 1.0;
        double r1731646 = y;
        double r1731647 = x;
        double r1731648 = r1731646 / r1731647;
        double r1731649 = r1731645 + r1731648;
        return r1731649;
}

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. Taylor expanded around 0 0.0

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

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

Reproduce

herbie shell --seed 1 
(FPCore (x y)
  :name "(x+y)/x"
  :precision binary64
  (/ (+ x y) x))