Average Error: 0.0 → 0.0
Time: 5.7s
Precision: 64
\[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(2.0 \cdot x\right) \cdot \left(y + x\right)\]
2.0 \cdot \left(x \cdot x + x \cdot y\right)
\left(2.0 \cdot x\right) \cdot \left(y + x\right)
double f(double x, double y) {
        double r13365978 = 2.0;
        double r13365979 = x;
        double r13365980 = r13365979 * r13365979;
        double r13365981 = y;
        double r13365982 = r13365979 * r13365981;
        double r13365983 = r13365980 + r13365982;
        double r13365984 = r13365978 * r13365983;
        return r13365984;
}

double f(double x, double y) {
        double r13365985 = 2.0;
        double r13365986 = x;
        double r13365987 = r13365985 * r13365986;
        double r13365988 = y;
        double r13365989 = r13365988 + r13365986;
        double r13365990 = r13365987 * r13365989;
        return r13365990;
}

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.0\right) \cdot \left(x + y\right)\]

Derivation

  1. Initial program 0.0

    \[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\left(x + y\right) \cdot \left(2.0 \cdot x\right)}\]
  3. Final simplification0.0

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

Reproduce

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