For details of the math behind this calculator, see this article.

Token A =

Token B =