The code looks ok to me. You have 1 input and 1 output. So your jacobian is a single element.
Running the gradcheck as:
from torch.autograd import gradcheck
gradcheck(eval_g, torch.tensor([k], dtype=torch.double, requires_grad=True))

Gives
numerical:tensor([[76.0006]], dtype=torch.float64)
analytical:tensor([[75.7641]], dtype=torch.float64)

Given the number of operations in your formula. It looks plausible to me.
How does your function look if you plot it? Is it properly smooth?