Maybe the reason is that f is not const in your anonymous function. Broadcasting is a higher order function applied on your function and in general if you include non const globals in your code you’re likely to get less than optimal inference etc
1 Like