I'm guessing you haven't set the variables to a certain value. So when you initialize variable E3, it will have a number stored in it from the previous time that certain point in your memory was used.
Unless this isn't your full code...
I do not understand
1) why you do not print the value of E1 in the very beginning of the function that to be sure that it has a given value;
2) why you do not print the value of the corresponding argument before calling the function;
3) why you are disturbing the forum and think that somebody else shall resolve the problem instead of you?!!!