Automatic Generation and Solving of mathematical expressions