If you draw a function and zoom in, you see it is composed of straight lines connecting points. You can increase the number of points to solve this.
TF1* func = new TF1("func","function", 0, 100); func->SetNpx(myNumberOfPoints);
The default for myNumberOfPoints
is 100.