Some side issues for OP.
Deeper math issues
Best to use float constants rather than double ones to initialize a float array.
float X[row * column] = { -0.251521, 1.045117, -1.281658,
// float X[row * column] = { -0.251521f, 1.045117f, -1.281658f,
Sometimes it makes a value difference and it quiets certain warnings.
There are multiple float that when printed to 6 places report 0.178434.
In general, use at least FLT_DECIMAL_DIG (9) significant digits to maintain aan about 1-to-1 mapping of float to display value.