Average Error: 0.0 → 0.0
Time: 4.1s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[2 \cdot \left(x \cdot x\right) + \left(y \cdot 2\right) \cdot \left(-x\right)\]
2 \cdot \left(x \cdot x - x \cdot y\right)
2 \cdot \left(x \cdot x\right) + \left(y \cdot 2\right) \cdot \left(-x\right)
double f(double x, double y) {
        double r476518 = 2.0;
        double r476519 = x;
        double r476520 = r476519 * r476519;
        double r476521 = y;
        double r476522 = r476519 * r476521;
        double r476523 = r476520 - r476522;
        double r476524 = r476518 * r476523;
        return r476524;
}

double f(double x, double y) {
        double r476525 = 2.0;
        double r476526 = x;
        double r476527 = r476526 * r476526;
        double r476528 = r476525 * r476527;
        double r476529 = y;
        double r476530 = r476529 * r476525;
        double r476531 = -r476526;
        double r476532 = r476530 * r476531;
        double r476533 = r476528 + r476532;
        return r476533;
}

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. Using strategy rm
  4. Applied sub-neg0.0

    \[\leadsto \left(2 \cdot x\right) \cdot \color{blue}{\left(x + \left(-y\right)\right)}\]
  5. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot x + \left(2 \cdot x\right) \cdot \left(-y\right)}\]
  6. Simplified0.0

    \[\leadsto \color{blue}{2 \cdot \left(x \cdot x\right)} + \left(2 \cdot x\right) \cdot \left(-y\right)\]
  7. Simplified0.0

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

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

Reproduce

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