Average Error: 0.0 → 0.0
Time: 1.8s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x \cdot x - y \cdot x\right) \cdot 2\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(x \cdot x - y \cdot x\right) \cdot 2
double f(double x, double y) {
        double r23514405 = 2.0;
        double r23514406 = x;
        double r23514407 = r23514406 * r23514406;
        double r23514408 = y;
        double r23514409 = r23514406 * r23514408;
        double r23514410 = r23514407 - r23514409;
        double r23514411 = r23514405 * r23514410;
        return r23514411;
}

double f(double x, double y) {
        double r23514412 = x;
        double r23514413 = r23514412 * r23514412;
        double r23514414 = y;
        double r23514415 = r23514414 * r23514412;
        double r23514416 = r23514413 - r23514415;
        double r23514417 = 2.0;
        double r23514418 = r23514416 * r23514417;
        return r23514418;
}

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. Final simplification0.0

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

Reproduce

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