There is a missile guidance algorithm called proportional navigation. Is there an opposite algorithm for missile avoidance? Something that tries something other than escaping in the direction of a homing missile that doesn't work when the escaping object has a little less power?
Short answer: if there was one on the target, it would basically seek to be unpredictable, i.e. random (but within bounds of wanting to close the distance)
Long answer: If the target is ahead of the interceptor, and they are both flying in approximately the same direction, a faster/more agile interceptor will eventually intercept the target, unless the target does something like release chaff or the interceptor runs out of propellant.
If they are head-on, closing distances, then the relative agilities makes a difference. If the interceptor has a relatively small maneuverability envelope, then the target may be able to dodge the interceptor, and then fly past.
From these examples above, we see that the evasion strategy implemented by the algorithm must take into account the relative speed and agilities of itself, and the interceptor. I'm not aware of any air-to-surface, air-to-air, ballistic or other missile, that is capable of detecting and discriminating what interceptors are launched against it, and plan an evasion route accordingly.
Usually what is done is the route to the target has features that make the target hard to intercept en route, such as a terrain following, hypersonic velocities or random course changes.
Specific answer: Let the: Interceptor be I Missile be M Target of missile be T Bearing of M to be BM Bearing of I to be BI
Essentially you want M to close the distance with T in the most direct route possible. In 2D space without obstacles, if T is fixed then you just need a bearing, BM.
M may assume that I will use proportional navigation to intercept it, and will follow BI. Plotting a course for M to hit T will therefore be a compromise between the shortest path, and the path that evades interception.
How I would code the algorithm is to let M have a random evasion time interval, RT, specified by an average + variance. Every RT, M makes a random course change.
The random course change is itself defined by another Gaussian distribution with the average = BM and the variance an "evasiveness parameter".
Hope this helps.