Average Error: 0.0 → 0.0
Time: 2.2s
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 r19928799 = 2.0;
        double r19928800 = x;
        double r19928801 = r19928800 * r19928800;
        double r19928802 = y;
        double r19928803 = r19928800 * r19928802;
        double r19928804 = r19928801 + r19928803;
        double r19928805 = r19928799 * r19928804;
        return r19928805;
}

double f(double x, double y) {
        double r19928806 = 2.0;
        double r19928807 = x;
        double r19928808 = r19928806 * r19928807;
        double r19928809 = y;
        double r19928810 = r19928809 + r19928807;
        double r19928811 = r19928808 * r19928810;
        return r19928811;
}

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