Changed .inject on magic_trig_func to be (0..100) because iterating to 1000 sometimes gave NaN results