Average Error: 0.0 → 0.0
Time: 3.8s
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 r312455 = 2.0;
        double r312456 = x;
        double r312457 = r312456 * r312456;
        double r312458 = y;
        double r312459 = r312456 * r312458;
        double r312460 = r312457 - r312459;
        double r312461 = r312455 * r312460;
        return r312461;
}

double f(double x, double y) {
        double r312462 = x;
        double r312463 = y;
        double r312464 = r312462 - r312463;
        double r312465 = 2.0;
        double r312466 = r312464 * r312465;
        double r312467 = r312466 * r312462;
        return r312467;
}

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