The main formulas used in Balancer protocol make use of exponentiation where both the base and exponent are fixed-point (non-integer) values. Take for example the swap
functions where both the weights in the exponent as well as the base are fractions:
\begin{equation} \begin{gathered} A_i = \left(\left(\frac{B_o}{B_o-A_o}\right)^{\frac{W_o}{W_i}}-1\right).B_i \end{gathered} \end{equation}
Since solidity does not have fixed point algebra or more complex functions like fractional power we use the following binomial approximation:
\begin{equation} \begin{gathered} \left(1+x\right)^\alpha=1+\alpha x+\frac{(\alpha)(\alpha-1)}{2!}x^2+ \frac{(\alpha)(\alpha-1)(\alpha-2)}{3!}x^3+ \cdots = \sum_{k=0}^{\infty}{\alpha \choose k}x^k \end{gathered} \end{equation}
which converges for
When