Average Error: 0.0 → 0.0
Time: 3.4s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x \cdot x - y \cdot x\right) \cdot 2\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(x \cdot x - y \cdot x\right) \cdot 2
double f(double x, double y) {
        double r354236 = 2.0;
        double r354237 = x;
        double r354238 = r354237 * r354237;
        double r354239 = y;
        double r354240 = r354237 * r354239;
        double r354241 = r354238 - r354240;
        double r354242 = r354236 * r354241;
        return r354242;
}

double f(double x, double y) {
        double r354243 = x;
        double r354244 = r354243 * r354243;
        double r354245 = y;
        double r354246 = r354245 * r354243;
        double r354247 = r354244 - r354246;
        double r354248 = 2.0;
        double r354249 = r354247 * r354248;
        return r354249;
}

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. Final simplification0.0

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

Reproduce

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