Cody

Solution 1740606

Submitted on 2 Mar 2019 by Martin C.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 3; e=0.01 y_correct = 19.846; tolerance = 1e-2; assert(abs((evalSum(x,e))-y_correct(1))<tolerance)

e = 0.0100 s = 4 s = 8.5000 s = 13 s = 16.3750 s = 18.4000 s = 19.4125 s = 19.8464 s = 20.0092 y = 19.8464

2   Pass
x = 5; e=0.001; y_correct = 148.3096; tolerance = 1e-2; assert(abs((evalSum(x,e))-y_correct(1))<tolerance)

s = 6 s = 18.5000 s = 39.3333 s = 65.3750 s = 91.4167 s = 113.1181 s = 128.6190 s = 138.3072 s = 143.6895 s = 146.3806 s = 147.6038 s = 148.1135 s = 148.3096 s = 148.3796 y = 148.3096

3   Pass
x = 0.2; e=0.001 y_correct = 1.2213; tolerance = 1e-2; assert(abs((evalSum(x,e))-y_correct(1))<tolerance)

e = 1.0000e-03 s = 1.2000 s = 1.2200 s = 1.2213 s = 1.2214 y = 1.2213

4   Pass
x = 1; e=0.1 y_correct = 2.5000; tolerance = 1e-2; assert(abs((evalSum(x,e))-y_correct(1))<tolerance)

e = 0.1000 s = 2 s = 2.5000 s = 2.6667 y = 2.5000