Average Error: 0.0 → 0.0
Time: 1.7s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x \cdot \left(x - y\right)\right) \cdot 2\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(x \cdot \left(x - y\right)\right) \cdot 2
double f(double x, double y) {
        double r565417 = 2.0;
        double r565418 = x;
        double r565419 = r565418 * r565418;
        double r565420 = y;
        double r565421 = r565418 * r565420;
        double r565422 = r565419 - r565421;
        double r565423 = r565417 * r565422;
        return r565423;
}

double f(double x, double y) {
        double r565424 = x;
        double r565425 = y;
        double r565426 = r565424 - r565425;
        double r565427 = r565424 * r565426;
        double r565428 = 2.0;
        double r565429 = r565427 * r565428;
        return r565429;
}

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

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

Reproduce

herbie shell --seed 2020036 
(FPCore (x y)
  :name "Linear.Matrix:fromQuaternion from linear-1.19.1.3, A"
  :precision binary64

  :herbie-target
  (* (* x 2) (- x y))

  (* 2 (- (* x x) (* x y))))