Average Error: 0.0 → 0.0
Time: 11.3s
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 r27584133 = 2.0;
        double r27584134 = x;
        double r27584135 = r27584134 * r27584134;
        double r27584136 = y;
        double r27584137 = r27584134 * r27584136;
        double r27584138 = r27584135 - r27584137;
        double r27584139 = r27584133 * r27584138;
        return r27584139;
}

double f(double x, double y) {
        double r27584140 = x;
        double r27584141 = y;
        double r27584142 = r27584140 - r27584141;
        double r27584143 = 2.0;
        double r27584144 = r27584143 * r27584140;
        double r27584145 = r27584142 * r27584144;
        return r27584145;
}

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 2019168 
(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))))