Average Error: 0.0 → 0.0
Time: 1.8s
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 r22016657 = 2.0;
        double r22016658 = x;
        double r22016659 = r22016658 * r22016658;
        double r22016660 = y;
        double r22016661 = r22016658 * r22016660;
        double r22016662 = r22016659 - r22016661;
        double r22016663 = r22016657 * r22016662;
        return r22016663;
}

double f(double x, double y) {
        double r22016664 = x;
        double r22016665 = r22016664 * r22016664;
        double r22016666 = y;
        double r22016667 = r22016666 * r22016664;
        double r22016668 = r22016665 - r22016667;
        double r22016669 = 2.0;
        double r22016670 = r22016668 * r22016669;
        return r22016670;
}

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