Generic math library for C#