def _step_size_obj_jac_func(step_size, parameters, step_dir, obj_jac_func):
    """Return objective value and gradient for step size."""
    step_obj, jac_xk_plus_ap = obj_jac_func(parameters + step_size * step_dir)
    # Derivative of step size objective function, is jacobian
    # dot step direction
    step_grad = jac_xk_plus_ap.dot(step_dir)

    return step_obj, step_grad