Getting wrong values from function

I am trying to program a function in igor that takes an equation and passes values to it and it populates a wave with the values obtained from the equation. This is really simple and I think I have it working properly except for the fact that most of the values Igor reports are inf or really large values. Some of the values match what a calculator says they should be but only at larger input values. My input values are 10^-8 up to 10^4. Using the really small values Igor just puts in inf instead of what the real calculated value is. My first thought was that this was an integer/float problem but I put decimals in the integers used and it hasn't changed anything. Any help would be appreciated.

The code that calculates the values:
function basic(E)
    variable E
    variable z, c1 = 0.229, c2 = 2.31, c3 = 0.721, c4 = 0.0516, c5 = 126., c6 = 2.17, c7 = 0.00108, c8 = 3.33e-12, c9 = 1.62, c10 = 9.59e-8, c11 = 1.48, c12 = 299.
    z = c1*(E/c2)^(c3)*e^(-E/c2)+c4*e^(-(log(E)-log(c5))^2./(2.*(log(c6))^2.))+c7*log(E/c8)*(1+tanh(c9*log(E/c10)))*(1-tanh(c11*log(E/c12)))
    print z
    return z
end


The code that I am running to make the new wave:
function spectra()
    variable i, phi_L
    wave phi_b, phi_inf, energy
    phi_L = low_energy()
    for (i = 0; i < 30000; i += 1)  
        phi_b[i] = basic(energy[i])
        phi_inf[i] = phi_b[i]*phi_L
    endfor
end


For example my calculator gives a value of 0.000599384879 for the input value of 10^-8 but Igor gives inf. I have attached a file of the equation it is equation (7) on page 548. Thank you for the help!
Sato-RR166-p544-2006.pdf
I think your problem is with the exponential function. You can see that if you rewrite your function as:
function basic(E)
    variable E
    variable z, c1 = 0.229, c2 = 2.31, c3 = 0.721, c4 = 0.0516, c5 = 126., c6 = 2.17, c7 = 0.00108, c8 = 3.33e-12, c9 = 1.62, c10 = 9.59e-8, c11 = 1.48, c12 = 299.
    z = c1*(E/c2)^(c3)*e^(-E/c2)
    Variable arg=(-(log(E)-log(c5))^2./(2.*(log(c6))^2.))
    z+=c4*exp(arg)
    z+=c7*log(E/c8)*(1+tanh(c9*log(E/c10)))*(1-tanh(c11*log(E/c12)))
    print z
    return z
end


Thank you for the help this seemed to work but I am not sure I understand what the difference between my code and your code is. If you could explain that a little bit that would be appreciated.
I think you want exp(...) instead of e^(...) since your variable is called E. Note that igor is case insensitive.
The suggested code worked great and it seems to mix both exp() and e^() so I don't think that was the problem.
Generally you should not use E as a variable (in fact you get an error message if you try to do so in the command line).
e^(-E/c2) in z = c1*(E/c2)^(c3)*e^(-E/c2) is very close to 1 for your mentioned E=1e-8,hence it will not have an effect on the final result. (I guess this is a typo and not an intended "mixing")

You can do wired things with these named constants:
As an example, execute
print e
in the command window. Everything seems fine. Now copy
constant e=42
to the local procedure file (ctrl-m), compile it, and execute the command again.
Now you get "the answer".

HJ
OK I see. I changed the variable E and it seems to have changed the shape of the output. Looks like it was getting E confused. Thank you for the help guys.