In the following code, numba.jit produces 7732.96... while python gives -6351.97... (digits omitted for brevity). What can I do to fix this? Is this numba's bug or my coding error? I used Python 3.7 (anaconda) on Spyder 3.
from numba import jit
import numpy as np
@jit(nopython=True)
def test(n):
sum = 0.0
arr = np.arange(2, n)
for x in np.sin(np.cos(arr ** 2)):
sum += x
return sum
a = test(100000000)
print(a)