Average Error: 0.0 → 0.0
Time: 4.7s
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 r23003378 = 2.0;
        double r23003379 = x;
        double r23003380 = r23003379 * r23003379;
        double r23003381 = y;
        double r23003382 = r23003379 * r23003381;
        double r23003383 = r23003380 - r23003382;
        double r23003384 = r23003378 * r23003383;
        return r23003384;
}

double f(double x, double y) {
        double r23003385 = x;
        double r23003386 = y;
        double r23003387 = r23003385 - r23003386;
        double r23003388 = 2.0;
        double r23003389 = r23003387 * r23003388;
        double r23003390 = r23003389 * r23003385;
        return r23003390;
}

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