# extrapolation/interpolation in fmincg.m

Can you tell me these equations come from where in MATLAB fmincg.m?

A = 6*(f2-f3)/z3+3*(d2+d3);  % cubic fit
B = 3*(f3-f2)-z3*(d3+2*d2);
z2 = (sqrt(B*B-A*d2*z3*z3)-B)/A;


It is either cubic extrapolation or interpolation. I have looked for these equations in many websites and books of numerical optimization but but I do not find these equations even in the book "Numerical Optimization by Peter Glynn, Stephen M. Robinson p:57". It is not same in the fmincg.m

• Welcome to SciComp.SE. I think that we need not information here, what are f2, f3, d2, D3, z3? Apr 16, 2019 at 13:45
• in the line search...f2,f3 second and first function...d2,d3 their derivative...z3 first step length alpha0....z2 second step length Apr 27, 2019 at 17:22
• Those details should be in the text of the question. Apr 27, 2019 at 17:30
• Not an answer to this question, but it gives a little more background: stackoverflow.com/a/12161027/2452869 May 10, 2019 at 4:29