suggestions on syntax to express mathematical formula concisely

Posted by aaa on Stack Overflow See other posts from Stack Overflow or by aaa
Published on 2010-05-24T17:23:13Z Indexed on 2010/05/30 19:42 UTC
Read the original article Hit count: 202

hello.

I am developing functional domain specific embedded language within C++ to translate formulas into working code as concisely and accurately as possible.

I post prototype in the comment, it is about 2 hundred lines long.

Right now my language looks something like this (well, actually is going to look like):

// implies two nested loops j=0:N, i=0,j
(range(i) < j < N)[T(i,j) = (T(i,j) - T(j,i))/e(i+j)];

// implies summation over above expression
sum(range(i) < j < N))[(T(i,j) - T(j,i))/e(i+j)];

I am looking for possible syntax improvements/extensions or just different ideas about expressing mathematical formulas as clearly and precisely as possible (in any language, not just C++).

Can you give me some syntax examples relating to my question which can be accomplished in your language of choice which consider useful. In particular, if you have some ideas about how to translate the above code segments, I would be happy to hear them.

Thank you

just to clarify and give actual formula, my short-term goal is to express the following

alt textalt text

expression concisely where values in <> are already computed as 4-dimensional array

© Stack Overflow or respective owner

Related posts about c++

Related posts about math