Average Error: 0.0 → 0.0
Time: 3.8s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(2 \cdot x\right) \cdot \left(y + x\right)\]
2 \cdot \left(x \cdot x + x \cdot y\right)
\left(2 \cdot x\right) \cdot \left(y + x\right)
double f(double x, double y) {
        double r21460510 = 2.0;
        double r21460511 = x;
        double r21460512 = r21460511 * r21460511;
        double r21460513 = y;
        double r21460514 = r21460511 * r21460513;
        double r21460515 = r21460512 + r21460514;
        double r21460516 = r21460510 * r21460515;
        return r21460516;
}

double f(double x, double y) {
        double r21460517 = 2.0;
        double r21460518 = x;
        double r21460519 = r21460517 * r21460518;
        double r21460520 = y;
        double r21460521 = r21460520 + r21460518;
        double r21460522 = r21460519 * r21460521;
        return r21460522;
}

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. Simplified0.0

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

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

Reproduce

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

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

  (* 2.0 (+ (* x x) (* x y))))