Average Error: 0.0 → 0.0
Time: 2.5s
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 r436740 = 2.0;
        double r436741 = x;
        double r436742 = r436741 * r436741;
        double r436743 = y;
        double r436744 = r436741 * r436743;
        double r436745 = r436742 - r436744;
        double r436746 = r436740 * r436745;
        return r436746;
}

double f(double x, double y) {
        double r436747 = 2.0;
        double r436748 = x;
        double r436749 = r436748 * r436748;
        double r436750 = r436747 * r436749;
        double r436751 = y;
        double r436752 = r436751 * r436747;
        double r436753 = -r436748;
        double r436754 = r436752 * r436753;
        double r436755 = r436750 + r436754;
        return r436755;
}

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