Average Error: 0.0 → 0.0
Time: 4.9s
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 r21234408 = 2.0;
        double r21234409 = x;
        double r21234410 = r21234409 * r21234409;
        double r21234411 = y;
        double r21234412 = r21234409 * r21234411;
        double r21234413 = r21234410 - r21234412;
        double r21234414 = r21234408 * r21234413;
        return r21234414;
}

double f(double x, double y) {
        double r21234415 = x;
        double r21234416 = r21234415 * r21234415;
        double r21234417 = y;
        double r21234418 = r21234417 * r21234415;
        double r21234419 = r21234416 - r21234418;
        double r21234420 = 2.0;
        double r21234421 = r21234419 * r21234420;
        return r21234421;
}

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