This question is explicitly not about doing burns at the apoapsis or periapsis in order to raise/lower the other apsis. Of course those are going to be the most efficient maneuvers, and the burns should be prograde or retrograde to the orbit at those points. The question is also not about Hohmann transfers, or circular starting orbits.
But, given a point which is closer to midway between the apses, what is the optimum burn $\Delta V$ and direction to modify one of the apses? For a more concrete example, lets say that we are "roughly" halfway on the return from the apoasis to the periapsis and wish to raise or lower the periapsis. Also this problem could be a hyperbolic entry orbit and we're trying to raise or lower the periapsis. The change in the final apoapsis is only going to be constrained by the requirement that the $\Delta V$ of the burn is minimized.
I know of one solution to this problem which assumes that a good enough burn direction will be tangent to the surface we are orbiting (not tangent to the orbit) and then does a binary search to find the burn that produces the right periapsis. Is there a better closed-form solution to this problem, and one which finds the minimal-$\Delta V$ burn?
Burning prograde or retrograde can also raise or lower the periapsis, but when away from the apoapsis this direction of the burn is less efficient.