I would petition to add a reasonable machine accuracy margin to the final large test. Out of 4000 elements, my result differed from the correct answer in 134 elements with a maximum difference of < 1E-12!! Especially when going to the effort of making a properly vectorized solution avoiding arrayfun() and other "cheats" for this strict problem.