Link to Exp Formula¶
To convert from link to exp, the game uses the following polynomial formula:
\(E(L) = \left\lfloor \frac{2L^3 + 9L^2 + 15013L}{300} \right\rfloor\)
Which is this code:
The generated arm assembly uses a magic multiplier plus shift in order to do the divide, so the divide by 300 becomes:
To convert back from exp to link, it just runs through link values from 0-100 until it finds the right one: