Average Error: 0.0 → 0.0
Time: 6.0s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[x \cdot \left(x \cdot 2\right) + y \cdot \left(x \cdot 2\right)\]
2 \cdot \left(x \cdot x + x \cdot y\right)
x \cdot \left(x \cdot 2\right) + y \cdot \left(x \cdot 2\right)
double f(double x, double y) {
        double r25979282 = 2.0;
        double r25979283 = x;
        double r25979284 = r25979283 * r25979283;
        double r25979285 = y;
        double r25979286 = r25979283 * r25979285;
        double r25979287 = r25979284 + r25979286;
        double r25979288 = r25979282 * r25979287;
        return r25979288;
}

double f(double x, double y) {
        double r25979289 = x;
        double r25979290 = 2.0;
        double r25979291 = r25979289 * r25979290;
        double r25979292 = r25979289 * r25979291;
        double r25979293 = y;
        double r25979294 = r25979293 * r25979291;
        double r25979295 = r25979292 + r25979294;
        return r25979295;
}

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-rgt-in0.0

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

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

Reproduce

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