title: Software where equations are the principal objects of interest?
body: <p>I'm working on a program where the main entities are mathematical equations. 
  Equations can only return a double or a boolean result.</p>
  
  <p>The problems:</p>
  
  <p>1- Lots of equations. (~300 per file)</p>
  
  <p>2- There has to be a computations-log at the end, so every equation should somehow be able to log itself.</p>
  
  <p>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).</p>
  
  <p>4- I want to enforce a certain order of appearance for the logged equations that is not necessarily similar that of the code.</p>
  
  <p>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?</p>