Average Error: 0.0 → 0.0
Time: 4.0s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
2 \cdot \left(x \cdot x + x \cdot y\right)
2 \cdot \left(x \cdot x + x \cdot y\right)
double f(double x, double y) {
        double r356377 = 2.0;
        double r356378 = x;
        double r356379 = r356378 * r356378;
        double r356380 = y;
        double r356381 = r356378 * r356380;
        double r356382 = r356379 + r356381;
        double r356383 = r356377 * r356382;
        return r356383;
}

double f(double x, double y) {
        double r356384 = 2.0;
        double r356385 = x;
        double r356386 = r356385 * r356385;
        double r356387 = y;
        double r356388 = r356385 * r356387;
        double r356389 = r356386 + r356388;
        double r356390 = r356384 * r356389;
        return r356390;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[\left(x \cdot 2\right) \cdot \left(x + y\right)\]

Derivation

  1. Initial program 0.0

    \[2 \cdot \left(x \cdot x + x \cdot y\right)\]
  2. Final simplification0.0

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

Reproduce

herbie shell --seed 2019208 +o rules:numerics
(FPCore (x y)
  :name "Linear.Matrix:fromQuaternion from linear-1.19.1.3, B"
  :precision binary64

  :herbie-target
  (* (* x 2) (+ x y))

  (* 2 (+ (* x x) (* x y))))