Cody

Solution 1878696

Submitted on 19 Jul 2019 by Nikolaos Nikolaou
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
n = 1; y_correct = -0.858407346410207; assert(abs(pi_approx(n)-y_correct)<(100*eps))

y = -8.584073464102069e-01

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

y = 4.749259869231262e-01

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

y = 2.463545583516975e-01

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

y = -1.421458301486913e-01

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

y = 9.975303466038987e-02

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

y = 7.133803581060771e-02

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

y = -5.877286181975583e-02

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

y = 4.996884692195325e-02

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

y = -3.998403184523935e-02