Average Error: 0.0 → 0.0
Time: 8.4s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(2 \cdot x\right) \cdot \left(x + y\right)\]
2 \cdot \left(x \cdot x + x \cdot y\right)
\left(2 \cdot x\right) \cdot \left(x + y\right)
double f(double x, double y) {
        double r37866148 = 2.0;
        double r37866149 = x;
        double r37866150 = r37866149 * r37866149;
        double r37866151 = y;
        double r37866152 = r37866149 * r37866151;
        double r37866153 = r37866150 + r37866152;
        double r37866154 = r37866148 * r37866153;
        return r37866154;
}

double f(double x, double y) {
        double r37866155 = 2.0;
        double r37866156 = x;
        double r37866157 = r37866155 * r37866156;
        double r37866158 = y;
        double r37866159 = r37866156 + r37866158;
        double r37866160 = r37866157 * r37866159;
        return r37866160;
}

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. Using strategy rm
  3. Applied distribute-lft-out0.0

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

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

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

Reproduce

herbie shell --seed 2019174 
(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))))