I'm working on a program where the main entities are mathematical equations. Equations can only return a double or a boolean result.
The problems:
1- Lots of equations. (~300 per file)
2- There has to be a computations-log at the end, so every equation should somehow be able to log itself.
3- It has to be fast, as fast as possible, because those few hundred equations could be triggered a million times. (Think of it as a big optimization loop).
4- I want to enforce a certain order of appearance for the logged equations that is not necessarily similar that of the code.
Currently, I'm using C. (or C, with a little bit of C++), and writing every equation as a function-like macro. I'm wondering though if this is the right way to go. Has this kind of problems been tackled before? Is there some other language that's better suited to this than C? And is there any design patterns or practices that I need to be aware of for this specific class of problems?