Compute every combination of operations written in a .TXT file Your task is to create a program that computes every combination of the operations written in a .TXT file.

Example TXT File:

1
+
2
/
3


Example Output:

1+2/3=1
1+3/2=2
2+1/3=1
2+3/1=5
3+2/1=5
3+1/2=2
1/2+3= //See bonuses. If your program does not feature float, leave blank result.
1/3+2= //See above.
2/1+3=5
2/3+1= //See above.
3/2+1= //See above.
3/1+2=5


Specs:


Every line of the .TXT file must contain a number or an operation;
The minimum length for the .TXT file is 5 lines;
The operations must be computed from left to right. E.g. 4+4/2 results in 4;
Your program should feature +, -, * and / operations;
Your program should work with any valid input of any valid length.


Scoring:

Code length is your starting score, but not the only parameter. Here's a short list of bonuses you can achieve to lower your score. The user with the lowest score wins.


Implement ^: -20;
Implement log (in base e): -30;
Implement logn (where n is any positive base): -50 (only -20 if you achieved the log bonus);
Implement e (and the number in the line below is the exponent of 10. So 1e4=10000): -20;
Can handle negative values: -10;
Can handle float values: -20;
There are no digits (0123456789) in the code: -10;
There is no call to eval or equivalent: -20;
All of the above: -100.


For a total of -250 bonus points.

Good luck!
Mathematica (-4 = 246 - 250)
Update: operation e instead of the number representation with e.
Update2: reading from the file.
i = &quot;1.txt&quot;;

w@&quot;log&quot;=r=Real;
e_~p~c_:=(g[x_r,w@c=c]~g~y_r:=#;p)&amp;@e
y~Log~x~p[x+y,&quot;+&quot;][x-y,&quot;-&quot;][x/y,&quot;/&quot;][x*y,&quot;*&quot;][x*10^y,&quot;e&quot;][x^y,&quot;^&quot;]~&quot;logn&quot;;
x_r~g~r:=Log@x
w@y_:=N@ToExpression@y
g[,x_]:=x
f@x_r:=s~Print~x
f@Fold[g,s=#&lt;&gt;&quot;=&quot;;,w/@#]&amp;/@Permutations@ReadList[i,String];

File:
1
+
2
/
3

Output:
1+2/3=1.
1+3/2=2.
1/2+3=3.5
1/3+2=2.33333
2+1/3=1.
2+3/1=5.
2/1+3=5.
2/3+1=1.66667
3+1/2=2.
3+2/1=5.
3/1+2=5.
3/2+1=2.5

File:
-1
^
2
e
3
logn
4
log

Output:
-1e2^4logn3log=2.81943
-1e2^4loglogn3=2.65196
-1e3^2logn4log=2.29916
-1e3^2loglogn4=1.89411
-1e3^4logn2log=3.68545
-1e3^4loglogn2=4.78822
-1e4^2logn3log=2.81943
-1e4^2loglogn3=2.65196
2^-1e3logn4log=1.50027
2^-1e3loglogn4=1.31783
2^-1e4logn3log=2.04804
2^-1e4loglogn3=1.94981
2^3logn4e-1log=-1.89712
2^3logn4loge-1=0.0405465
2^3loge-1logn4=-1.13287
2^3loglogn4e-1=0.0528098
2^4e-1logn3log=-0.849063
2^4e-1loglogn3=-0.687244
2^4logn3e-1log=-1.37685
2^4logn3loge-1=0.0925734
2^4loge-1logn3=-1.16766
2^4loglogn3e-1=0.0928245
2e-1logn3^4log=1.52735
2e-1log^4logn3=1.73268
2e3logn4^-1log=-1.70163
2e3logn4log^-1=0.587671
2e3log^-1logn4=-1.46309
2e3loglogn4^-1=0.683487
2e4logn3^-1log=-2.19884
2e4logn3log^-1=0.454785
2e4log^-1logn3=-2.08708
2e4loglogn3^-1=0.479139
2logn3^-1e4log=9.6709
2logn3^-1loge4=4605.61
2logn3^4e-1log=-4.14483
2logn3^4loge-1=-0.184224
2logn3e-1^4log=-11.0526
2logn3e-1log^4=58.2928
2logn3e4^-1log=-8.74978
2logn3e4log^-1=0.114289
2logn3log^-1e4=-21712.7
2logn3log^4e-1=0.00449933
2logn3loge-1^4=4.49933*10^-6
2logn3loge4^-1=-0.000217127
2logn4^-1e3log=7.6009
2logn4^-1loge3=693.147
2logn4^3e-1log=-4.38203
2logn4^3loge-1=-0.207944
2logn4e-1^3log=-8.9872
2logn4e-1log^3=-26.8849
2logn4e3^-1log=-6.21461
2logn4e3log^-1=0.160911
2logn4log^-1e3=-1442.7
2logn4log^3e-1=-0.0333025
2logn4loge-1^3=-0.000333025
2logn4loge3^-1=-0.0014427
2log^-1e3logn4=5.24728
2log^-1e4logn3=8.71723
2log^-1logn3e4=3336.14
2log^-1logn4e3=264.383
2log^3e-1logn4=-2.45411
2log^3logn4e-1=-0.079315
2log^4e-1logn3=-3.43036
2log^4logn3e-1=-0.133446
2loge-1^3logn4=-5.77604
2loge-1^4logn3=-9.71807
2loge-1logn3^4=34.8402
2loge-1logn4^3=-7.13719
2loge3^-1logn4=-4.71851
2loge3logn4^-1=0.211931
2loge4^-1logn3=-8.05
2loge4logn3^-1=0.124224
2loglogn3^-1e4=-29974.7
2loglogn3^4e-1=0.00123874
2loglogn3e-1^4=1.23874*10^-6
2loglogn3e4^-1=-0.000299747
2loglogn4^-1e3=-3782.39
2loglogn4^3e-1=-0.001848
2loglogn4e-1^3=-0.00001848
2loglogn4e3^-1=-0.00378239
3^-1e2logn4log=0.928001
3^-1e2loglogn4=0.905028
3^-1e4logn2log=2.45982
3^-1e4loglogn2=3.02001
3^2logn4e-1log=-1.84202
3^2logn4loge-1=0.0460561
3^2loge-1logn4=-1.09312
3^2loglogn4e-1=0.0567841
3^4e-1logn2log=1.10457
3^4e-1loglogn2=1.06479
3^4logn2e-1log=-0.45573
3^4logn2loge-1=0.184686
3^4loge-1logn2=-1.18625
3^4loglogn2e-1=0.213568
3e-1logn2^4log=2.20856
3e-1logn4^2log=-0.282015
3e-1log^2logn4=0.267803
3e-1log^4logn2=1.07121
3e2logn4^-1log=-1.4145
3e2logn4log^-1=0.706966
3e2log^-1logn4=-1.25596
3e2loglogn4^-1=0.796204
3e4logn2^-1log=-2.69953
3e4logn2log^-1=0.370435
3e4log^-1logn2=-3.36583
3e4loglogn2^-1=0.297104
3logn2^-1e4log=8.74978
3logn2^-1loge4=-4605.61
3logn2^4e-1log=-0.460342
3logn2^4loge-1=0.184224
3logn2e-1^4log=-7.3681
3logn2e-1log^4=11.5128
3logn2e4^-1log=-9.6709
3logn2e4log^-1=0.103403
3logn2log^-1e4=21712.7
3logn2log^4e-1=0.00449933
3logn2loge-1^4=4.49933*10^-6
3logn2loge4^-1=0.000217127
3logn4^-1e2log=4.83776
3logn4^-1loge2=23.2586
3logn4^2e-1log=-2.76776
3logn4^2loge-1=-0.0465173
3logn4e-1^2log=-5.07034
3logn4e-1log^2=6.42709
3logn4e2^-1log=-4.37258
3logn4e2log^-1=0.228698
3logn4log^-1e2=-429.948
3logn4log^2e-1=0.00540964
3logn4loge-1^2=0.000540964
3logn4loge2^-1=-0.0429948
3log^-1e2logn4=3.25409
3log^-1e4logn2=13.152
3log^-1logn2e4=-1356.82
3log^-1logn4e2=-6.78412
3log^2e-1logn4=-1.52528
3log^2logn4e-1=0.0135682
3log^4e-1logn2=-2.7792
3log^4logn2e-1=0.0542729
3loge-1^2logn4=-3.18625
3loge-1^4logn2=-12.745
3loge-1logn2^4=103.066
3loge-1logn4^2=2.53804
3loge2^-1logn4=-3.38977
3loge2logn4^-1=0.295005
3loge4^-1logn2=-13.4234
3loge4logn2^-1=0.0744968
3loglogn2^-1e4=73701.6
3loglogn2^4e-1=0.0000338917
3loglogn2e-1^4=3.38917*10^-8
3loglogn2e4^-1=0.000737016
3loglogn4^-1e2=1474.03
3loglogn4^2e-1=0.000460242
3loglogn4e-1^2=0.0000460242
3loglogn4e2^-1=0.147403
4^-1e2logn3log=1.07498
4^-1e2loglogn3=1.0641
4^-1e3logn2log=2.07516
4^-1e3loglogn2=2.46505
4^2e-1logn3log=-0.849063
4^2e-1loglogn3=-0.687244
4^2logn3e-1log=-1.37685
4^2logn3loge-1=0.0925734
4^2loge-1logn3=-1.16766
4^2loglogn3e-1=0.0928245
4^3e-1logn2log=0.985097
4^3e-1loglogn2=0.892428
4^3logn2e-1log=-0.510826
4^3logn2loge-1=0.179176
4^3loge-1logn2=-1.26573
4^3loglogn2e-1=0.20562
4e-1logn3^2log=-0.362939
4e-1log^2logn3=-0.159149
4e2logn3^-1log=-1.69629
4e2logn3log^-1=0.589523
4e2log^-1logn3=-1.62963
4e2loglogn3^-1=0.613635
4e3logn2^-1log=-2.48205
4e3logn2log^-1=0.402893
4e3log^-1logn2=-3.05208
4e3loglogn2^-1=0.327646
4logn2^-1e3log=6.21461
4logn2^-1loge3=-693.147
4logn2^3e-1log=-0.223144
4logn2^3loge-1=0.207944
4logn2e-1^3log=-4.82831
4logn2e-1log^3=-4.16891
4logn2e3^-1log=-7.6009
4logn2e3log^-1=0.131563
4logn2log^-1e3=1442.7
4logn2log^3e-1=0.0333025
4logn2loge-1^3=0.000333025
4logn2loge3^-1=0.0014427
4logn3^-1e2log=4.37258
4logn3^-1loge2=-23.2586
4logn3^2e-1log=-1.83741
4logn3^2loge-1=0.0465173
4logn3e-1^2log=-4.14
4logn3e-1log^2=4.28489
4logn3e2^-1log=-4.83776
4logn3e2log^-1=0.206707
4logn3log^-1e2=429.948
4logn3log^2e-1=0.00540964
4logn3loge-1^2=0.000540964
4logn3loge2^-1=0.0429948
4log^-1e2logn3=3.89449
4log^-1e3logn2=9.49455
4log^-1logn2e3=-471.234
4log^-1logn3e2=-29.7315
4log^2e-1logn3=-1.50127
4log^2logn3e-1=0.0594631
4log^3e-1logn2=-1.90823
4log^3logn2e-1=0.14137
4loge-1^2logn3=-3.59718
4loge-1^3logn2=-8.55208
4loge-1logn2^3=-23.1661
4loge-1logn3^2=3.23492
4loge2^-1logn3=-4.48912
4loge2logn3^-1=0.222761
4loge3^-1logn2=-10.437
4loge3logn2^-1=0.0958128
4loglogn2^-1e3=2122.09
4loglogn2^3e-1=0.0104643
4loglogn2e-1^3=0.000104643
4loglogn2e3^-1=0.00212209
4loglogn3^-1e2=336.343
4loglogn3^2e-1=0.00883964
4loglogn3e-1^2=0.000883964
4loglogn3e2^-1=0.0336343

Description:

The function w[y] converts string y to the number if y is not an operation.
The pattern g[g[x,c],y] is converted to x+y, x-y, etc depending on the operation c. Otherwise it stay a symbolic expression.
f[x] prints x only if it is a number.