I am alternating between 2 optimization steps and each step is using information and gradients from the other. I was able to write a code that works for 1-dimensional parame