As a side not, you can use OpenGL with GLSL shaders for both.
In the shaders you do your math, if you have any.
But doing general purpose calculations in GLSL needs a different kind of thinking then usual...