added implementations for cos, sin and sqrt