let _test n input ans =
let result = ((mathenatica input) = ans) in
((if result then (print_string "success: #")
else (print_string "failure: #"));
print_int n; print_string "\n")
let _testall lst =
let rec tall lst n =
match lst with
| [] -> ()
| (input,ans,err)::tl ->
if err = 1 then
(try _test n input (-999999.9999999) with FreeVariable ->
(print_string "success: #"; print_int n; print_string "\n");
tall tl (n+1))
else if err = 2 then
(try _test n input (-999999.9999999) with InvalidSigma ->
(print_string "success: #"; print_int n; print_string "\n");
tall tl (n+1))
else (_test n input ans; tall tl (n+1))
in
tall lst 0
let i1 = INT(1)
let i10 = INT(10)
let i0 = INT(0)
let fm1 = REAL(-1.0)
let f1 = REAL(1.0)
let f10 = REAL(10.0)
let f10p5 = REAL(10.5)
let f0 = REAL(0.0)
let a1 = ADD(i1, i10)
let a2 = ADD(fm1, i1)
let a3 = ADD(f10p5, i0)
let s1 = SUB(i1, i10)
let s2 = SUB(fm1, i1)
let s3 = SUB(f10p5, i0)
let d1 = DIV (i10, fm1)
let d2 = DIV (f10p5, f10)
let d3 = DIV (i10, i0)
let d4 = DIV (f10p5, f0)
let d5 = DIV (f0, fm1)
let m1 = MUL (i10, fm1)
let m2 = MUL (f10p5, f10)
let m3 = MUL (i10, i0)
let m4 = MUL (f10p5, f0)
let m5 = MUL (f0, fm1)
let e = X
let e2 = MUL(e,e)
let e3 = ADD(e,e2)
let e4 = MUL(e3,e2)
let e5 = SUB(e3, e4)
let in1 = (INTEGRAL (i1,i10,e))
let in2 = (INTEGRAL (fm1,f10p5,e2))
let in3 = (INTEGRAL (i10,fm1,e4))
let si1 = (SIGMA (i1,i10,e))
let si2 = (SIGMA (i0,i1,e3))
let si3 = (SIGMA (i0,i10,e5))
let si4 = (SIGMA (i1,m3,e3))
let si5 = (SIGMA (m3,i1,e5))
let ix1 = (INTEGRAL (X,(MUL (X,X)),e2))
let ix2 = (INTEGRAL (X,(MUL (X,X)),e4))
let ix3 = (INTEGRAL (X,(ADD (X,X)),ix1))
let ix4 = (INTEGRAL (X,(ADD (X,X)),ix2))
let sii1 = (SIGMA (i1,i10,ix1))
let sii2 = (SIGMA (i0,i10,ix2))
let ii1 = (INTEGRAL (fm1,f10p5,ix1))
let ii2 = (INTEGRAL (i10,fm1,ix2))
let sii = (SIGMA (i1,i10,ix3))
let iii = (INTEGRAL (fm1,f10p5,ix4))
let _t = _testall
[ (REAL 3.0,3.0,0);
(SIGMA (INT 1,INT 10,SUB(MUL(X,X),INT 1)),375.0,0);
(SIGMA (INT 10,INT 1,X),0.0,0);
(a1,11.0,0);
(a2,0.0,0);
(a3,10.5,0);
(s1,-9.0,0);
(s2,-2.0,0);
(s3,10.5,0);
(d1,-10.0,0);
(d2,1.05,0);
(d5,-0.0,0);
(m1,-10.0,0);
(m2,105.0,0);
(m3,0.0,0);
(m4,0.0,0);
(m5,-0.0,0);
(e,0.0,1);
(e2,0.0,1);
(e3,0.0,1);
(e4,0.0,1);
(e5,0.0,1);
(in1,49.0500000000001322,0);
(in2,380.765000000001123,0);
(in3,-21953.5341300000873,0);
(si1,55.0,0);
(si2,2.0,0);
(si3,-27918.0,0);
(si4,0.0,2);
(si5,0.0,2);
(ix1,0.0,1);
(ix2,0.0,1);
(ix3,0.0,1);
(ix4,0.0,1);
(sii1,657213.150000014808,0);
(sii2,3016273297.96902132,0);
(ii1,645706.121175517,0);
(ii2,-1740987898.05228162,0);
(sii,107179154.773896709,0);
(iii,5124806397791.05176,0)]
|