Hi @realisation,
What roots do you need, is it just square roots or is it roots of higher degree (https://en.wikipedia.org/wiki/Nth_root)?
I am not sure I understand what you mean by ERC20 caliber numbers? Do you mean 18 decimals?
In your smart contract I assumed that your calculations are done in the base token units and don’t use the decimals.
Tagging community members who may have dealt with this type of maths: @bugduino, @alsco77