While you're arguing over what gcc does or doesn't optimize here, may I point out the foolishness of for(i=1; i<50; i++){ for the calculation of a Maclaurin series, the rate of convergence of which is dependent on the input value? What you probably want is while(t > some_threshold)