Average Error: 0.0 → 0.0
Time: 6.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 r23010537 = 2.0;
        double r23010538 = x;
        double r23010539 = r23010538 * r23010538;
        double r23010540 = y;
        double r23010541 = r23010538 * r23010540;
        double r23010542 = r23010539 - r23010541;
        double r23010543 = r23010537 * r23010542;
        return r23010543;
}

double f(double x, double y) {
        double r23010544 = x;
        double r23010545 = y;
        double r23010546 = r23010544 - r23010545;
        double r23010547 = 2.0;
        double r23010548 = r23010546 * r23010547;
        double r23010549 = r23010548 * r23010544;
        return r23010549;
}

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