I am using Mathica to treat rational functions, $ p (x) / q (x) $, where the polynomials, $ p, q $ have a high degree and coefficients with a high order of precision, for example:
The problem is that I need to use values that change from
x, and the rational function then seems
rational = p(x+7)/q(x+3)
Out: (a(1) x+ a(2)x^2+...)/(0.*10^-280+b(1)x+...)
a(n),b(n) they are real numbers When changing from x, of course, I lose some precision, so I'm fine (I also wouldn't mind being able to get more accuracy).
When i use
rational as a rational function everything works fine, but sometimes I need to evaluate it in
x=0. If I do it using
rational/.x->0, I got the following error:
"Infinite expression 1/0.*10^-280 encountered"
while the correct answer should be
a(1)/b(1). I managed to fix this error using
which gives me the correct answer However, I have many different polynomials and the loss of precision changes depends on their grade, coefficients, etc.
the rational function is an approximation of a function, which I to know It is not unique at the point evaluated, so I know that this zero precision is spurious. However, the coefficients are generated by another program over which I have no control, only high precision. Of course, that doesn't help here because by demanding more precision, it just pushed the problem forward.
Is there a way of best practices to deal with that kind of problem?