Average Error: 0.0 → 0.0
Time: 9.4s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(\left(x - y\right) \cdot 2\right) \cdot x\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(\left(x - y\right) \cdot 2\right) \cdot x
double f(double x, double y) {
        double r445571 = 2.0;
        double r445572 = x;
        double r445573 = r445572 * r445572;
        double r445574 = y;
        double r445575 = r445572 * r445574;
        double r445576 = r445573 - r445575;
        double r445577 = r445571 * r445576;
        return r445577;
}

double f(double x, double y) {
        double r445578 = x;
        double r445579 = y;
        double r445580 = r445578 - r445579;
        double r445581 = 2.0;
        double r445582 = r445580 * r445581;
        double r445583 = r445582 * r445578;
        return r445583;
}

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}{x \cdot \left(\left(x - y\right) \cdot 2\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(FPCore (x y)
  :name "Linear.Matrix:fromQuaternion from linear-1.19.1.3, A"

  :herbie-target
  (* (* x 2.0) (- x y))

  (* 2.0 (- (* x x) (* x y))))