Average Error: 0.0 → 0.0
Time: 8.0s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(2 \cdot x\right) \cdot x + y \cdot \left(2 \cdot x\right)\]
2 \cdot \left(x \cdot x + x \cdot y\right)
\left(2 \cdot x\right) \cdot x + y \cdot \left(2 \cdot x\right)
double f(double x, double y) {
        double r23994852 = 2.0;
        double r23994853 = x;
        double r23994854 = r23994853 * r23994853;
        double r23994855 = y;
        double r23994856 = r23994853 * r23994855;
        double r23994857 = r23994854 + r23994856;
        double r23994858 = r23994852 * r23994857;
        return r23994858;
}

double f(double x, double y) {
        double r23994859 = 2.0;
        double r23994860 = x;
        double r23994861 = r23994859 * r23994860;
        double r23994862 = r23994861 * r23994860;
        double r23994863 = y;
        double r23994864 = r23994863 * r23994861;
        double r23994865 = r23994862 + r23994864;
        return r23994865;
}

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

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

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

Reproduce

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