Thanks! Yeah it struggles with periodic functions that are wide. For example it successfully crosses zero with sin(PIxN/5) and delivers reasonable results for sin(PIxN/3). For your specific example you would probably need to provide something like N=1 to N=50.