Average Error: 0.0 → 0.0
Time: 6.4s
Precision: 64
\[x \cdot \left(y + y\right)\]
\[\left(x \cdot 2\right) \cdot y\]
x \cdot \left(y + y\right)
\left(x \cdot 2\right) \cdot y
double f(double x, double y) {
        double r58422 = x;
        double r58423 = y;
        double r58424 = r58423 + r58423;
        double r58425 = r58422 * r58424;
        return r58425;
}

double f(double x, double y) {
        double r58426 = x;
        double r58427 = 2.0;
        double r58428 = r58426 * r58427;
        double r58429 = y;
        double r58430 = r58428 * r58429;
        return r58430;
}

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

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

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

    \[\leadsto x \cdot \color{blue}{\left(\left(1 + 1\right) \cdot y\right)}\]
  5. Applied associate-*r*0.0

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

    \[\leadsto \color{blue}{\left(x \cdot 2\right)} \cdot y\]
  7. Final simplification0.0

    \[\leadsto \left(x \cdot 2\right) \cdot y\]

Reproduce

herbie shell --seed 2019322 +o rules:numerics
(FPCore (x y)
  :name "Numeric.Integration.TanhSinh:simpson  from integration-0.2.1"
  :precision binary64
  (* x (+ y y)))