Average Error: 0.0 → 0.0
Time: 7.1s
Precision: 64
\[2.0 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(\left(x - y\right) \cdot 2.0\right) \cdot x\]
2.0 \cdot \left(x \cdot x - x \cdot y\right)
\left(\left(x - y\right) \cdot 2.0\right) \cdot x
double f(double x, double y) {
        double r24008771 = 2.0;
        double r24008772 = x;
        double r24008773 = r24008772 * r24008772;
        double r24008774 = y;
        double r24008775 = r24008772 * r24008774;
        double r24008776 = r24008773 - r24008775;
        double r24008777 = r24008771 * r24008776;
        return r24008777;
}

double f(double x, double y) {
        double r24008778 = x;
        double r24008779 = y;
        double r24008780 = r24008778 - r24008779;
        double r24008781 = 2.0;
        double r24008782 = r24008780 * r24008781;
        double r24008783 = r24008782 * r24008778;
        return r24008783;
}

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

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

Reproduce

herbie shell --seed 2019163 +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))))