I'm developing an app to visualize mathematical functions in a coordinate system. I'm calculating $y$ for every pixel along the $x$ axis. This method works well with basic functions, like $f(x) = x$ or $sin(x)$ but only renders a few points when the function is $100x$ or $sin(10x)$.
So basically, I want to calculate $y$ more densely at places where the function is steeper. I would hope to find a universal solution, as the function could be anything the user provides.
This image illustrates my problem well, but I'm not sure if Chebyshev nodes are the right way to go as I only have a surface level knowledge regarding functions. https://i.stack.imgur.com/rqI3l.png