Average Error: 0.0 → 0.0
Time: 9.3s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(x + y\right) \cdot \left(2 \cdot x\right)\]
2 \cdot \left(x \cdot x + x \cdot y\right)
\left(x + y\right) \cdot \left(2 \cdot x\right)
double f(double x, double y) {
        double r26505813 = 2.0;
        double r26505814 = x;
        double r26505815 = r26505814 * r26505814;
        double r26505816 = y;
        double r26505817 = r26505814 * r26505816;
        double r26505818 = r26505815 + r26505817;
        double r26505819 = r26505813 * r26505818;
        return r26505819;
}

double f(double x, double y) {
        double r26505820 = x;
        double r26505821 = y;
        double r26505822 = r26505820 + r26505821;
        double r26505823 = 2.0;
        double r26505824 = r26505823 * r26505820;
        double r26505825 = r26505822 * r26505824;
        return r26505825;
}

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

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

Reproduce

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