Average Error: 0.0 → 0.0
Time: 24.3s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(2 \cdot x\right) \cdot \left(x - y\right)\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(2 \cdot x\right) \cdot \left(x - y\right)
double f(double x, double y) {
        double r27413446 = 2.0;
        double r27413447 = x;
        double r27413448 = r27413447 * r27413447;
        double r27413449 = y;
        double r27413450 = r27413447 * r27413449;
        double r27413451 = r27413448 - r27413450;
        double r27413452 = r27413446 * r27413451;
        return r27413452;
}

double f(double x, double y) {
        double r27413453 = 2.0;
        double r27413454 = x;
        double r27413455 = r27413453 * r27413454;
        double r27413456 = y;
        double r27413457 = r27413454 - r27413456;
        double r27413458 = r27413455 * r27413457;
        return r27413458;
}

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(x - y\right) \cdot \left(x \cdot 2\right)}\]
  3. Final simplification0.0

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

Reproduce

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