initial add: test-verified logistic regression cost function