Hank, your formula gives blue line, If I understand correctly, he want red.
You can try to get more precision formula of red curve in excel. Look what is best approximation, and which you can implement in code. I'll start with polynomial equation, because it easiest to implement.
Bookmarks