Cody

Solution 1890973

Submitted on 3 Aug 2019
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   Fail
n = 1; y_correct = -0.858407346410207; assert(abs(pi_approx(n)-y_correct)<(100*eps))

y = 0.2146

Assertion failed.

2   Fail
n = 2; y_correct = 0.474925986923126; assert(abs(pi_approx(n)-y_correct)<(100*eps))

y = -0.1187

Assertion failed.

3   Fail
n = 4; y_correct = 0.246354558351698; assert(abs(pi_approx(n)-y_correct)<(100*eps))

y = -0.0616

Assertion failed.

4   Fail
n = 7; y_correct = -0.142145830148691; assert(abs(pi_approx(n)-y_correct)<(100*eps))

y = 0.0355

Assertion failed.

5   Fail
n = 10; y_correct = 0.099753034660390; assert(abs(pi_approx(n)-y_correct)<(100*eps))

y = -0.0249

Assertion failed.

6   Fail
n = 14; y_correct = 0.071338035810608; assert(abs(pi_approx(n)-y_correct)<(100*eps))

y = -0.0178

Assertion failed.

7   Fail
n = 17; y_correct = -0.058772861819756; assert(abs(pi_approx(n)-y_correct)<(100*eps))

y = 0.0147

Assertion failed.

8   Fail
n = 20; y_correct = 0.049968846921953; assert(abs(pi_approx(n)-y_correct)<(100*eps))

y = -0.0125

Assertion failed.

9   Fail
n = 25; y_correct = -0.039984031845239; assert(abs(pi_approx(n)-y_correct)<(100*eps))

y = 0.0100

Assertion failed.

Suggested Problems

More from this Author139