Average Error: 0.0 → 0.0
Time: 1.7s
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 r17495966 = 2.0;
        double r17495967 = x;
        double r17495968 = r17495967 * r17495967;
        double r17495969 = y;
        double r17495970 = r17495967 * r17495969;
        double r17495971 = r17495968 - r17495970;
        double r17495972 = r17495966 * r17495971;
        return r17495972;
}

double f(double x, double y) {
        double r17495973 = x;
        double r17495974 = r17495973 * r17495973;
        double r17495975 = y;
        double r17495976 = r17495975 * r17495973;
        double r17495977 = r17495974 - r17495976;
        double r17495978 = 2.0;
        double r17495979 = r17495977 * r17495978;
        return r17495979;
}

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