Calculation of the Weierstrass function