This is an implementation of Carol Vorderman in C, i.e., it quickly works out the simplest way of using the four operations addition, subtraction, multiplication and division on a list of numbers to make a given target number.
It should compile on any system. To run it, you need to be able to give it command line options, such as
ngs 1 2 7 7 10 25 t867
or
ngs 2 3 5 7 11 13
In the first mode of operation it will try to reach the target value (867 above). In the second mode it finds an example of the simplest sum for any reachable number under 1000.
It tries not to output essentially equivalent sums. For example it knows that
5-(7*2-6) = 5+6-7*2 = 6+5-7*2 = 6-2*7+5, etc.
and will only give one form. It knows about commutativity, associativity, laws like
a-(b-c)=a+c-b, a/(b/c)=a*c/b,
and laws like
a-b*(c-d)=a+b*(d-c).
It doesn't know that
(a-b)*(c-d)=(b-a)*(d-c).