Average Error: 0.0 → 0.0
Time: 7.0s
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 r21445782 = 2.0;
        double r21445783 = x;
        double r21445784 = r21445783 * r21445783;
        double r21445785 = y;
        double r21445786 = r21445783 * r21445785;
        double r21445787 = r21445784 + r21445786;
        double r21445788 = r21445782 * r21445787;
        return r21445788;
}

double f(double x, double y) {
        double r21445789 = 2.0;
        double r21445790 = x;
        double r21445791 = r21445789 * r21445790;
        double r21445792 = y;
        double r21445793 = r21445792 + r21445790;
        double r21445794 = r21445791 * r21445793;
        return r21445794;
}

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 2019169 +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))))