Cody

Problem 43564. Calculate sin(x) without sin(x)

Solution 3217353

Submitted on 15 Oct 2020
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
x = -pi/2; y_correct = sin(x); assert(abs(my_func(x)-y_correct)<0.0001)

a = Columns 1 through 17 1.2919 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 18 through 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 35 through 51 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 52 through 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 69 through 85 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 86 through 102 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 103 through 119 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 120 through 136 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 137 through 153 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 154 through 170 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 171 through 187 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 188 through 204 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 205 through 221 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 222 through 238 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 239 through 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 256 through 272 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 273 through 289 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 290 through 306 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 307 through 323 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 324 through 340 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 341 through 357 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 358 through 374 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 375 through 391 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 392 through 408 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 409 through 425 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 426 through 442 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 443 through 459 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 460 through 476 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 477 through 493 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 494 through 510 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 511 through 527 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 528 through 544 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 545 through 561 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 562 through 578 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 579 through 595 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 596 through 612 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 613 through 629 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 630 through 646 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 647 through 663 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 664 through 680 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 681 through 697 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 698 through 714 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 715 through 731 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 732 through 748 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 749 through 765 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 766 through 782 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 783 through 799 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 800 through 816 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 817 through 833 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 834 through 850 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 851 through 867 0 0 0...

Assertion failed.

2   Fail
x = rand(1)*2*pi; y_correct = sin(x); assert(abs(my_func(x)-y_correct)<0.0001)

a = Columns 1 through 17 -0.6495 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 18 through 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 35 through 51 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 52 through 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 69 through 85 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 86 through 102 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 103 through 119 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 120 through 136 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 137 through 153 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 154 through 170 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 171 through 187 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 188 through 204 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 205 through 221 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 222 through 238 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 239 through 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 256 through 272 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 273 through 289 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 290 through 306 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 307 through 323 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 324 through 340 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 341 through 357 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 358 through 374 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 375 through 391 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 392 through 408 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 409 through 425 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 426 through 442 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 443 through 459 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 460 through 476 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 477 through 493 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 494 through 510 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 511 through 527 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 528 through 544 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 545 through 561 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 562 through 578 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 579 through 595 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 596 through 612 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 613 through 629 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 630 through 646 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 647 through 663 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 664 through 680 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 681 through 697 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 698 through 714 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 715 through 731 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 732 through 748 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 749 through 765 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 766 through 782 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 783 through 799 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 800 through 816 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 817 through 833 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 834 through 850 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 851 through 867 0 0 0...

Assertion failed.

3   Pass
assessFunctionAbsence({'cos', 'sin'}, 'FileName', 'my_func.m');