Average Error: 0.0 → 0.0
Time: 6.2s
Precision: 64
\[2.0 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(\left(x - y\right) \cdot 2.0\right) \cdot x\]
2.0 \cdot \left(x \cdot x - x \cdot y\right)
\left(\left(x - y\right) \cdot 2.0\right) \cdot x
double f(double x, double y) {
        double r24359022 = 2.0;
        double r24359023 = x;
        double r24359024 = r24359023 * r24359023;
        double r24359025 = y;
        double r24359026 = r24359023 * r24359025;
        double r24359027 = r24359024 - r24359026;
        double r24359028 = r24359022 * r24359027;
        return r24359028;
}

double f(double x, double y) {
        double r24359029 = x;
        double r24359030 = y;
        double r24359031 = r24359029 - r24359030;
        double r24359032 = 2.0;
        double r24359033 = r24359031 * r24359032;
        double r24359034 = r24359033 * r24359029;
        return r24359034;
}

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.0\right) \cdot \left(x - y\right)\]

Derivation

  1. Initial program 0.0

    \[2.0 \cdot \left(x \cdot x - x \cdot y\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{x \cdot \left(\left(x - y\right) \cdot 2.0\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019164 +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))))