Average Error: 0.0 → 0.0
Time: 2.3s
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 r434449 = 2.0;
        double r434450 = x;
        double r434451 = r434450 * r434450;
        double r434452 = y;
        double r434453 = r434450 * r434452;
        double r434454 = r434451 + r434453;
        double r434455 = r434449 * r434454;
        return r434455;
}

double f(double x, double y) {
        double r434456 = 2.0;
        double r434457 = x;
        double r434458 = r434456 * r434457;
        double r434459 = y;
        double r434460 = r434459 + r434457;
        double r434461 = r434458 * r434460;
        return r434461;
}

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