Average Error: 0.0 → 0.0
Time: 16.6s
Precision: 64
\[\left(x \cdot y + x\right) + y\]
\[y + \left(1 + y\right) \cdot x\]
\left(x \cdot y + x\right) + y
y + \left(1 + y\right) \cdot x
double f(double x, double y) {
        double r8472317 = x;
        double r8472318 = y;
        double r8472319 = r8472317 * r8472318;
        double r8472320 = r8472319 + r8472317;
        double r8472321 = r8472320 + r8472318;
        return r8472321;
}

double f(double x, double y) {
        double r8472322 = y;
        double r8472323 = 1.0;
        double r8472324 = r8472323 + r8472322;
        double r8472325 = x;
        double r8472326 = r8472324 * r8472325;
        double r8472327 = r8472322 + r8472326;
        return r8472327;
}

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

    \[\left(x \cdot y + x\right) + y\]
  2. Using strategy rm
  3. Applied *-commutative0.0

    \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y\]
  4. Applied distribute-lft1-in0.0

    \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y\]
  5. Final simplification0.0

    \[\leadsto y + \left(1 + y\right) \cdot x\]

Reproduce

herbie shell --seed 2019158 
(FPCore (x y)
  :name "Numeric.Log:$cexpm1 from log-domain-0.10.2.1, B"
  (+ (+ (* x y) x) y))