Average Error: 0.0 → 0.0
Time: 10.4s
Precision: 64
\[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(x + y\right) \cdot \left(2.0 \cdot x\right)\]
2.0 \cdot \left(x \cdot x + x \cdot y\right)
\left(x + y\right) \cdot \left(2.0 \cdot x\right)
double f(double x, double y) {
        double r28791504 = 2.0;
        double r28791505 = x;
        double r28791506 = r28791505 * r28791505;
        double r28791507 = y;
        double r28791508 = r28791505 * r28791507;
        double r28791509 = r28791506 + r28791508;
        double r28791510 = r28791504 * r28791509;
        return r28791510;
}

double f(double x, double y) {
        double r28791511 = x;
        double r28791512 = y;
        double r28791513 = r28791511 + r28791512;
        double r28791514 = 2.0;
        double r28791515 = r28791514 * r28791511;
        double r28791516 = r28791513 * r28791515;
        return r28791516;
}

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.0\right) \cdot \left(x + y\right)\]

Derivation

  1. Initial program 0.0

    \[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
  2. Simplified0.0

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

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

Reproduce

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