I have a rather complicated function to invert numerically, which is nevertheless in certain situations close to being a first-order polynomial y=ax+b.
Although this seems to me to be the easiest case to invert, I find that I need to increase Npx to >1000 in order for TF1::GetX to give me the correct linear inverse function, without “steps” appearing in it.
I have tested GetX (ROOT v5.02 - I noticed the change from v4, but the old version does the same thing) using a TF1 that really is just “ax+b” and found exactly the same behaviour.
.L TestGetX_droite.C+
.L TestGetX.C+
TestGetX()
TestGetX(50)
TestGetX(4)
etc. etc.
With root_v5.02.00.Linux.slc3.gcc3.2.3 the first TestGetX() with the default value Npx=100 gives a discontinuity at (500,50). As Npx decreases, the discontinuities grow larger, further from the origin, until with the minimum Npx=4 there are several of them.
I cannot reproduce the problem that you describe.
Did you send the right files?
Could you post a canvas.gif file and the corresponding canvas.root files?
As I already said, I cannot reproduce this problem.
I can see in c1.root the problem, but I cannot understand how
the problem is produced in your original program.
Did you make changes to TF1, ??
Did you compile with a special optimisation option?
The example is compiled with ACliC (".L TestGetX.C+" etc.), so no special optimisation as far as I know. And as you can see in the code, I use a TF1 with no modifications. It seems strange that you cannot reproduce this problem, I have tried it on several different machines with the same results.