Average Error: 0.0 → 0.0
Time: 29.1s
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 r23608629 = 2.0;
        double r23608630 = x;
        double r23608631 = r23608630 * r23608630;
        double r23608632 = y;
        double r23608633 = r23608630 * r23608632;
        double r23608634 = r23608631 - r23608633;
        double r23608635 = r23608629 * r23608634;
        return r23608635;
}

double f(double x, double y) {
        double r23608636 = x;
        double r23608637 = y;
        double r23608638 = r23608636 - r23608637;
        double r23608639 = 2.0;
        double r23608640 = r23608638 * r23608639;
        double r23608641 = r23608640 * r23608636;
        return r23608641;
}

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