Average Error: 0.0 → 0.0
Time: 4.9s
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 r19408976 = 2.0;
        double r19408977 = x;
        double r19408978 = r19408977 * r19408977;
        double r19408979 = y;
        double r19408980 = r19408977 * r19408979;
        double r19408981 = r19408978 - r19408980;
        double r19408982 = r19408976 * r19408981;
        return r19408982;
}

double f(double x, double y) {
        double r19408983 = x;
        double r19408984 = y;
        double r19408985 = r19408983 - r19408984;
        double r19408986 = 2.0;
        double r19408987 = r19408985 * r19408986;
        double r19408988 = r19408987 * r19408983;
        return r19408988;
}

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