Average Error: 0.0 → 0.0
Time: 11.6s
Precision: 64
\[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
\[x \cdot \left(x \cdot 2.0\right) + y \cdot \left(x \cdot 2.0\right)\]
2.0 \cdot \left(x \cdot x + x \cdot y\right)
x \cdot \left(x \cdot 2.0\right) + y \cdot \left(x \cdot 2.0\right)
double f(double x, double y) {
        double r27810297 = 2.0;
        double r27810298 = x;
        double r27810299 = r27810298 * r27810298;
        double r27810300 = y;
        double r27810301 = r27810298 * r27810300;
        double r27810302 = r27810299 + r27810301;
        double r27810303 = r27810297 * r27810302;
        return r27810303;
}

double f(double x, double y) {
        double r27810304 = x;
        double r27810305 = 2.0;
        double r27810306 = r27810304 * r27810305;
        double r27810307 = r27810304 * r27810306;
        double r27810308 = y;
        double r27810309 = r27810308 * r27810306;
        double r27810310 = r27810307 + r27810309;
        return r27810310;
}

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(2.0 \cdot x\right) \cdot \left(x + y\right)}\]
  3. Using strategy rm
  4. Applied distribute-rgt-in0.0

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

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

Reproduce

herbie shell --seed 2019158 
(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))))