Average Error: 0.0 → 0.0
Time: 8.1s
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 r22864253 = 2.0;
        double r22864254 = x;
        double r22864255 = r22864254 * r22864254;
        double r22864256 = y;
        double r22864257 = r22864254 * r22864256;
        double r22864258 = r22864255 + r22864257;
        double r22864259 = r22864253 * r22864258;
        return r22864259;
}

double f(double x, double y) {
        double r22864260 = 2.0;
        double r22864261 = x;
        double r22864262 = r22864260 * r22864261;
        double r22864263 = y;
        double r22864264 = r22864263 + r22864261;
        double r22864265 = r22864262 * r22864264;
        return r22864265;
}

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