Average Error: 0.0 → 0.0
Time: 1.8s
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 r538159 = 2.0;
        double r538160 = x;
        double r538161 = r538160 * r538160;
        double r538162 = y;
        double r538163 = r538160 * r538162;
        double r538164 = r538161 - r538163;
        double r538165 = r538159 * r538164;
        return r538165;
}

double f(double x, double y) {
        double r538166 = x;
        double r538167 = y;
        double r538168 = r538166 - r538167;
        double r538169 = r538166 * r538168;
        double r538170 = 2.0;
        double r538171 = r538169 * r538170;
        return r538171;
}

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