Average Error: 0.0 → 0.0
Time: 6.5s
Precision: 64
\[2.0 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x - y\right) \cdot \left(2.0 \cdot x\right)\]
2.0 \cdot \left(x \cdot x - x \cdot y\right)
\left(x - y\right) \cdot \left(2.0 \cdot x\right)
double f(double x, double y) {
        double r27584027 = 2.0;
        double r27584028 = x;
        double r27584029 = r27584028 * r27584028;
        double r27584030 = y;
        double r27584031 = r27584028 * r27584030;
        double r27584032 = r27584029 - r27584031;
        double r27584033 = r27584027 * r27584032;
        return r27584033;
}

double f(double x, double y) {
        double r27584034 = x;
        double r27584035 = y;
        double r27584036 = r27584034 - r27584035;
        double r27584037 = 2.0;
        double r27584038 = r27584037 * r27584034;
        double r27584039 = r27584036 * r27584038;
        return r27584039;
}

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. Simplified0.0

    \[\leadsto \color{blue}{\left(2.0 \cdot x\right) \cdot \left(x - y\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019163 
(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))))