Maybe you should consider using an arbitrary-precision math library to calculate the graph and physics rather than relying on doubles.
In the future I'd like to have a parser that's fast enough to sample at least every pixel, but until then it's going to be a little janky.