Average Error: 0.0 → 0.0
Time: 1.4s
Precision: 64
\[2.0 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x - y\right) \cdot \left(2.0 \cdot x\right)\]
2.0 \cdot \left(x \cdot x - x \cdot y\right)
\left(x - y\right) \cdot \left(2.0 \cdot x\right)
double f(double x, double y) {
        double r9136254 = 2.0;
        double r9136255 = x;
        double r9136256 = r9136255 * r9136255;
        double r9136257 = y;
        double r9136258 = r9136255 * r9136257;
        double r9136259 = r9136256 - r9136258;
        double r9136260 = r9136254 * r9136259;
        return r9136260;
}

double f(double x, double y) {
        double r9136261 = x;
        double r9136262 = y;
        double r9136263 = r9136261 - r9136262;
        double r9136264 = 2.0;
        double r9136265 = r9136264 * r9136261;
        double r9136266 = r9136263 * r9136265;
        return r9136266;
}

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

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

Reproduce

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