I have a program that draws mathematical functions. The plot on the screenshot is 1/(x^2-2) so it have two asymptotes so the function grows really fast. I tried to fix it but it would work only if you didn't zoom out far enough and the asymototes would reappear and the plot would be abrupted again. I could increase the number of points even more but you could just zoom out even more. Is there a good fix for this.

I have a program that draws mathematical functions. The plot on the screenshot is 1/(x^2-2) so it have two asymptotes so the function grows really fast. I tried to fix it but it would work only if you didn't zoom out far enough and the asymototes would reappear and the plot would be abrupted again. I could increase the number of points even more but you could just zoom out even more. Is there a good fix for this.