# Round off in Mathematica Built-in functions [duplicate]

Is there a way to force Mathematica to use its Built-in functions instead basic functions?

For instance, the Hypergeometric1F1[a,b,x] function has a exponential form when its firsts parameters are integers. Mathematica replace for the exponential form automatically. For example,

Hypergeometric1F1[1,2,x] the Hypergeometric1F1[1,2,x] is transformed in (-1 + E^x)/x. It is a problem if you want to evaluate numerically for x near to 0, because the exponential form has round-off errors.

One way to avoid this problem is using delayed definitions, which evaluates the built-in functions before its replacement. But it is not enough if you want to use this functions in different operations, like differentiating, before evaluate it.

f[x_]:=Hypergeometric[1,2,x]
g[x_]=Hypergeometric[1,2,x]


The map f[x] will use the Build-in function in Mathematica, but g[x] will not. But if you differentiate both functions, you'll get the exponential form:

D[f[x],x]
D[g[x],x]


The result will be

-((-1 + E^x)/x^2) + E^x/x


Instead of

(1/2)*Hypergeometric1F1[2, 3, x]


I want to force Mathematica use its Hypergeometric Build-in function, but I don't know how.

• There are many, many things about Mathematica that I don't understand. If one just uses LogLogPlot[Hypergeometric1F1[1, 2, x], {x, 10^(-15), 10^(-5)}], it plots just fine. – JimB May 25 '16 at 15:58
• WorkingPrecision is a MUCH easier fix for plots with roundoff problems. LogLogPlot[{(-1+E^x)/x, Hypergeometric1F1[1,2,x]+10^-6}, {x,10^-15,10^-5}, WorkingPrecision->64, PlotRange->All] (I slightly vertically offset one plot so that you can see they are the same and not wonder why you only see one plot, perhaps because of PlotRange or because of having complex values.) – Bill May 25 '16 at 17:11
• @JimBaldwin - LogLogPlot has attribute HoldAll so the Hypergeometric1F1 does not get simplified prior to its numerical evaluation. The OP's plot command is equivalent to LogLogPlot[{Evaluate[Hypergeometric1F1[1, 2, x]], Hypergeometric1F1[1, 2, x]}, {x, 10^(-15), 10^(-5)}] – Bob Hanlon May 25 '16 at 19:26
• @JimBaldwin the WorkingPrecsion issue with log scales is a known bug : mathematica.stackexchange.com/q/15628/2079 . I think that's unrelated to this particular question though. – george2079 May 25 '16 at 21:55
• Better to post actual code instead of images of code. Nobody likes to rekey input by hand. – Daniel Lichtblau May 27 '16 at 20:42