Baidu Interview Question

Code from a mathematical formula.