tests/numeric-quadratic-function.cc: check gradients with random A/b values