Average Error: 0.0 → 0.0
Time: 7.4s
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 r19262896 = 2.0;
        double r19262897 = x;
        double r19262898 = r19262897 * r19262897;
        double r19262899 = y;
        double r19262900 = r19262897 * r19262899;
        double r19262901 = r19262898 + r19262900;
        double r19262902 = r19262896 * r19262901;
        return r19262902;
}

double f(double x, double y) {
        double r19262903 = 2.0;
        double r19262904 = x;
        double r19262905 = r19262903 * r19262904;
        double r19262906 = y;
        double r19262907 = r19262906 + r19262904;
        double r19262908 = r19262905 * r19262907;
        return r19262908;
}

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