Average Error: 0.0 → 0.0
Time: 10.7s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x \cdot \left(x - y\right)\right) \cdot 2\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(x \cdot \left(x - y\right)\right) \cdot 2
double f(double x, double y) {
        double r338581 = 2.0;
        double r338582 = x;
        double r338583 = r338582 * r338582;
        double r338584 = y;
        double r338585 = r338582 * r338584;
        double r338586 = r338583 - r338585;
        double r338587 = r338581 * r338586;
        return r338587;
}

double f(double x, double y) {
        double r338588 = x;
        double r338589 = y;
        double r338590 = r338588 - r338589;
        double r338591 = r338588 * r338590;
        double r338592 = 2.0;
        double r338593 = r338591 * r338592;
        return r338593;
}

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

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

Reproduce

herbie shell --seed 2019322 +o rules:numerics
(FPCore (x y)
  :name "Linear.Matrix:fromQuaternion from linear-1.19.1.3, A"
  :precision binary64

  :herbie-target
  (* (* x 2) (- x y))

  (* 2 (- (* x x) (* x y))))