Average Error: 0.0 → 0.0
Time: 7.3s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(x \cdot x + y \cdot x\right) \cdot 2\]
2 \cdot \left(x \cdot x + x \cdot y\right)
\left(x \cdot x + y \cdot x\right) \cdot 2
double f(double x, double y) {
        double r27928043 = 2.0;
        double r27928044 = x;
        double r27928045 = r27928044 * r27928044;
        double r27928046 = y;
        double r27928047 = r27928044 * r27928046;
        double r27928048 = r27928045 + r27928047;
        double r27928049 = r27928043 * r27928048;
        return r27928049;
}

double f(double x, double y) {
        double r27928050 = x;
        double r27928051 = r27928050 * r27928050;
        double r27928052 = y;
        double r27928053 = r27928052 * r27928050;
        double r27928054 = r27928051 + r27928053;
        double r27928055 = 2.0;
        double r27928056 = r27928054 * r27928055;
        return r27928056;
}

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. Final simplification0.0

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

Reproduce

herbie shell --seed 2019170 +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))))