I'm very limited in my JS and even mathematics knowledge for that matter so I turn to you. I'm using a site linked here to find annual population growth rates for individual Nigerian states. When you click on a state, say Abia, it will give you the annual growth rate. I'm trying to figure out the exact formula that they're using to produce said growth rates. Here is the .js file that containing the code to do this. I believe the block we want is this:
cp.data.computeAnnualChange=function(a,b,c,d){
if(!a||!b)return null;a=this.dateDiffInYears(a,b);
return 0<c&&0<a&&0<d?Math.round(1E4*(Math.exp(Math.log(d/c)/a)-1))/100:null};
cp.data.INT_MODE="i";
Some context: The formula is supposed to take the population of a state from 1991 and the population from 2006 and provide you with the annual rate of growth. I recognize that basic equation on line 4, it's a geometric growth rate. I can make that in excel, but when I do the number I come up with is about .13 percent off, which is significant. My ultimate goal is to make this into a formula I can use in excel.