Average Error: 0.0 → 0.0
Time: 11.6s
Precision: 64
\[2.0 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x \cdot x - y \cdot x\right) \cdot 2.0\]
2.0 \cdot \left(x \cdot x - x \cdot y\right)
\left(x \cdot x - y \cdot x\right) \cdot 2.0
double f(double x, double y) {
        double r26318705 = 2.0;
        double r26318706 = x;
        double r26318707 = r26318706 * r26318706;
        double r26318708 = y;
        double r26318709 = r26318706 * r26318708;
        double r26318710 = r26318707 - r26318709;
        double r26318711 = r26318705 * r26318710;
        return r26318711;
}

double f(double x, double y) {
        double r26318712 = x;
        double r26318713 = r26318712 * r26318712;
        double r26318714 = y;
        double r26318715 = r26318714 * r26318712;
        double r26318716 = r26318713 - r26318715;
        double r26318717 = 2.0;
        double r26318718 = r26318716 * r26318717;
        return r26318718;
}

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

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

Reproduce

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