
Yeah its there, nine lines down. but im still getting math errors and its definately on the line:
x_coeff = (exp(x[0]*2*pi)cosh(x[0]*x[1]*Actual_Output[0]))/sinh(x[0]*x[1]*Actual_Output[0]);
however i got it to print each bit to screen and it does have each variable so i am a little confused

So what are x[0] and x[1] and Actual_Output[0] going in and what is x_coeff coming out? Do you #define pi somewhere? Make sure you didn't put a ; at the end of that line.

The problem i have finally found is that the estimations of x[0] and x[1] that are being improved with every call of rosen, are not getting sent to rosen as the latest x's but always the original x estimations. Therefore each time it calculates everything it is just a repeat of the last time.