Programmatically chosing y-axis limits for plotting functions having asymtotes

29 Views Asked by At

Plotting some arbitrary function having a vertical asymptote, $$ y = \frac{x}{1-x^2} $$ using WolframAlpha with $x\in[-5,5]$ and $x\in[-100,100]$, results in the following plots:

enter image description here

Now my question is, what would be a general method for programmatically choosing y-axis limits for displaying functions having vertical asymptotes?

Or more general, for relatively steep functions like $y=10^x$.