MATH-1151 New interface "ValueAndJacobianFunction" (to allow separate evaluation of either quantity) is a precondition for lazy evaluation (and is enforced by raising an exception early rather than wait for a failed cast).