The error has been not feature scaling the target function / input data set. The algorithm was working fine. Furthermore it helped choosing a different function to model, then the logistic, as its value can differ greatly for small input changes, which made it initially harder.