Average Error: 0.0 → 0.0
Time: 7.6s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x - y\right) \cdot \left(2 \cdot x\right)\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(x - y\right) \cdot \left(2 \cdot x\right)
double f(double x, double y) {
        double r27607034 = 2.0;
        double r27607035 = x;
        double r27607036 = r27607035 * r27607035;
        double r27607037 = y;
        double r27607038 = r27607035 * r27607037;
        double r27607039 = r27607036 - r27607038;
        double r27607040 = r27607034 * r27607039;
        return r27607040;
}

double f(double x, double y) {
        double r27607041 = x;
        double r27607042 = y;
        double r27607043 = r27607041 - r27607042;
        double r27607044 = 2.0;
        double r27607045 = r27607044 * r27607041;
        double r27607046 = r27607043 * r27607045;
        return r27607046;
}

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

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

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

Reproduce

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