Caching makes the problem go away
memoize 'divide';
Now the function is fast
divide(134, [9, 12, 14, 17, 23, 32, 34, 40, 38, 49]);