Average Error: 0.0 → 0.0
Time: 5.6s
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 r21019631 = 2.0;
        double r21019632 = x;
        double r21019633 = r21019632 * r21019632;
        double r21019634 = y;
        double r21019635 = r21019632 * r21019634;
        double r21019636 = r21019633 - r21019635;
        double r21019637 = r21019631 * r21019636;
        return r21019637;
}

double f(double x, double y) {
        double r21019638 = x;
        double r21019639 = y;
        double r21019640 = r21019638 - r21019639;
        double r21019641 = 2.0;
        double r21019642 = r21019640 * r21019641;
        double r21019643 = r21019642 * r21019638;
        return r21019643;
}

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))))