Average Error: 0.0 → 0.0
Time: 6.5s
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 r26887702 = 2.0;
        double r26887703 = x;
        double r26887704 = r26887703 * r26887703;
        double r26887705 = y;
        double r26887706 = r26887703 * r26887705;
        double r26887707 = r26887704 + r26887706;
        double r26887708 = r26887702 * r26887707;
        return r26887708;
}

double f(double x, double y) {
        double r26887709 = 2.0;
        double r26887710 = x;
        double r26887711 = r26887709 * r26887710;
        double r26887712 = y;
        double r26887713 = r26887712 + r26887710;
        double r26887714 = r26887711 * r26887713;
        return r26887714;
}

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