Average Error: 0.0 → 0.0
Time: 928.0ms
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
2 \cdot \left(x \cdot x - x \cdot y\right)
2 \cdot \left(x \cdot x - x \cdot y\right)
double f(double x, double y) {
        double r2056884 = 2.0;
        double r2056885 = x;
        double r2056886 = r2056885 * r2056885;
        double r2056887 = y;
        double r2056888 = r2056885 * r2056887;
        double r2056889 = r2056886 - r2056888;
        double r2056890 = r2056884 * r2056889;
        return r2056890;
}

double f(double x, double y) {
        double r2056891 = 2.0;
        double r2056892 = x;
        double r2056893 = r2056892 * r2056892;
        double r2056894 = y;
        double r2056895 = r2056892 * r2056894;
        double r2056896 = r2056893 - r2056895;
        double r2056897 = r2056891 * r2056896;
        return r2056897;
}

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

Reproduce

herbie shell --seed 2020047 +o rules:numerics
(FPCore (x y)
  :name "Linear.Matrix:fromQuaternion from linear-1.19.1.3, A"
  :precision binary64

  :herbie-target
  (* (* x 2) (- x y))

  (* 2 (- (* x x) (* x y))))