Average Error: 0.0 → 0.0
Time: 1.5s
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 r21261936 = 2.0;
        double r21261937 = x;
        double r21261938 = r21261937 * r21261937;
        double r21261939 = y;
        double r21261940 = r21261937 * r21261939;
        double r21261941 = r21261938 - r21261940;
        double r21261942 = r21261936 * r21261941;
        return r21261942;
}

double f(double x, double y) {
        double r21261943 = x;
        double r21261944 = r21261943 * r21261943;
        double r21261945 = y;
        double r21261946 = r21261945 * r21261943;
        double r21261947 = r21261944 - r21261946;
        double r21261948 = 2.0;
        double r21261949 = r21261947 * r21261948;
        return r21261949;
}

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 2019172 +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))))