Average Error: 0.0 → 0.0
Time: 8.5s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x - y\right) \cdot \left(2 \cdot x\right)\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(x - y\right) \cdot \left(2 \cdot x\right)
double f(double x, double y) {
        double r30602161 = 2.0;
        double r30602162 = x;
        double r30602163 = r30602162 * r30602162;
        double r30602164 = y;
        double r30602165 = r30602162 * r30602164;
        double r30602166 = r30602163 - r30602165;
        double r30602167 = r30602161 * r30602166;
        return r30602167;
}

double f(double x, double y) {
        double r30602168 = x;
        double r30602169 = y;
        double r30602170 = r30602168 - r30602169;
        double r30602171 = 2.0;
        double r30602172 = r30602171 * r30602168;
        double r30602173 = r30602170 * r30602172;
        return r30602173;
}

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

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

Reproduce

herbie shell --seed 2019169 
(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))))