Average Error: 0.0 → 0.0
Time: 10.2s
Precision: 64
\[\left(x \cdot y + x\right) + y\]
\[x + \left(1 + x\right) \cdot y\]
\left(x \cdot y + x\right) + y
x + \left(1 + x\right) \cdot y
double f(double x, double y) {
        double r63794 = x;
        double r63795 = y;
        double r63796 = r63794 * r63795;
        double r63797 = r63796 + r63794;
        double r63798 = r63797 + r63795;
        return r63798;
}

double f(double x, double y) {
        double r63799 = x;
        double r63800 = 1.0;
        double r63801 = r63800 + r63799;
        double r63802 = y;
        double r63803 = r63801 * r63802;
        double r63804 = r63799 + r63803;
        return r63804;
}

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 *-un-lft-identity0.0

    \[\leadsto \left(x \cdot y + x\right) + \color{blue}{1 \cdot y}\]
  4. Applied *-un-lft-identity0.0

    \[\leadsto \color{blue}{1 \cdot \left(x \cdot y + x\right)} + 1 \cdot y\]
  5. Applied distribute-lft-out0.0

    \[\leadsto \color{blue}{1 \cdot \left(\left(x \cdot y + x\right) + y\right)}\]
  6. Simplified0.0

    \[\leadsto 1 \cdot \color{blue}{\left(x + \left(y + x \cdot y\right)\right)}\]
  7. Using strategy rm
  8. Applied distribute-rgt1-in0.0

    \[\leadsto 1 \cdot \left(x + \color{blue}{\left(x + 1\right) \cdot y}\right)\]
  9. Simplified0.0

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

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

Reproduce

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