I hope no one is offended by this. Based on the comments there was potentially something wrong with the test cases anyway, so the reference and solution seemed appropriate.
meh, i should have thought of it sooner
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = 1;
c = infinite_series2(x);
c_correct = 0.8783264829967111;
assert(abs(c-c_correct)<50*eps*abs(c_correct))
|
2 | Pass |
%%
x = sqrt(3);
c = infinite_series2(x);
c_correct = 0.7603863252347075;
assert(abs(c-c_correct)<50*eps*abs(c_correct))
% %%
% x = 6.28318;
% c = infinite_series2(x);
% c_correct = 306.9401397805991110;
% assert(abs(c-c_correct)<50*eps*abs(c_correct))
|
3 | Pass |
%%
x = 39/7;
c = infinite_series2(x);
c_correct = 0.9836348579190693;
assert(abs(c-c_correct)<50*eps*abs(c_correct))
|
4 | Pass |
%%
x = 1.5e-5;
c = infinite_series2(x);
c_correct = 182.5748704878243416;
assert(abs(c-c_correct)<50*eps*abs(c_correct))
|
10765 Solvers
mathematics , probability problem
32 Solvers
134 Solvers
Create an index-powered vector
233 Solvers
92 Solvers