Gottfried Helms on Thu, 17 Nov 2022 13:44:02 +0100

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 Conversion of a function/closure with rational coefficients into one with real coefficients

• To: pari-users@pari.math.u-bordeaux.fr
• Subject: Conversion of a function/closure with rational coefficients into one with real coefficients
• From: Gottfried Helms <Gottfried.Helms@t-online.de>
• Date: Thu, 17 Nov 2022 13:42:58 +0100
• Delivery-date: Thu, 17 Nov 2022 13:44:02 +0100
• Reply-to: Gottfried.Helms@t-online.de
• User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.8.1.3) Gecko/20070326 MultiZilla/1.6.0.0e Thunderbird/2.0.0.0 Mnenhy/0.7.5.0

```I'm trying to optimize some bivariate function,
and found, that I can create a vector of polynomials p_r(x).
Let pp be a vector of closures, so for instance

...
pp[4](x) =  1/4*x^2-2/3*x+1/6
pp[5](x) = -1/8*x^3+31/48*x^2-7/12*x+1/24
...

But going in detail of the function I get vectors pp of
dimension 128 or 256 or the like, where in the denominators
are factorials of 128 or 256 and the like with very
long integer numbers.

By construction I get for all coefficients rational values,
but the complexity grows much with increasing index r
for pp[r](x).
That means, for numerical evaluation it should be much more
efficient to have that coefficients all in real values,
and I'm looking for a tool/procedure, to convert the
existing closures to that same functions, but with
coefficients expressed in real numbers.

I can't do, for instance, naive attempts like
ppr[5]=1.0*pp[5], or ppr[5](x)=1.0*pp[5](x).

What is a good idea to convert the full vector "pp" into
some -say- "ppr" ?
(Well, I could recalculate all polynomials again from
the generating script, but I rather want to learn
the Pari/GP inherent tools for such a problem.)

Gottfried

```