Average Error: 0.0 → 0.0
Time: 6.7s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x - y\right) \cdot \left(2 \cdot x\right)\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(x - y\right) \cdot \left(2 \cdot x\right)
double f(double x, double y) {
        double r23665515 = 2.0;
        double r23665516 = x;
        double r23665517 = r23665516 * r23665516;
        double r23665518 = y;
        double r23665519 = r23665516 * r23665518;
        double r23665520 = r23665517 - r23665519;
        double r23665521 = r23665515 * r23665520;
        return r23665521;
}

double f(double x, double y) {
        double r23665522 = x;
        double r23665523 = y;
        double r23665524 = r23665522 - r23665523;
        double r23665525 = 2.0;
        double r23665526 = r23665525 * r23665522;
        double r23665527 = r23665524 * r23665526;
        return r23665527;
}

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

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

Reproduce

herbie shell --seed 2019192 
(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))))