Average Error: 0.0 → 0.0
Time: 5.1s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x \cdot x - y \cdot x\right) \cdot 2\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(x \cdot x - y \cdot x\right) \cdot 2
double f(double x, double y) {
        double r26920860 = 2.0;
        double r26920861 = x;
        double r26920862 = r26920861 * r26920861;
        double r26920863 = y;
        double r26920864 = r26920861 * r26920863;
        double r26920865 = r26920862 - r26920864;
        double r26920866 = r26920860 * r26920865;
        return r26920866;
}

double f(double x, double y) {
        double r26920867 = x;
        double r26920868 = r26920867 * r26920867;
        double r26920869 = y;
        double r26920870 = r26920869 * r26920867;
        double r26920871 = r26920868 - r26920870;
        double r26920872 = 2.0;
        double r26920873 = r26920871 * r26920872;
        return r26920873;
}

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. Final simplification0.0

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

Reproduce

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