/* Allocate new arrays */
pt1 = (double * )malloc(psize); /* used by polsbt */
pt2 = (double * )malloc(psize); /* used by polsbt */
pt3 = (double * )malloc(psize); /* used by polmul */
/* c = b + a.
*/ void poladd( a, na, b, nb, c ) double a[], b[], c[]; int na, nb;
{ int i, n;
if( na > nb )
n = na; else
n = nb;
if( n > MAXPOL )
n = MAXPOL;
for( i=0; i<=n; i++ )
{ if( i > na )
c[i] = b[i]; elseif( i > nb )
c[i] = a[i]; else
c[i] = b[i] + a[i];
}
}
/* c = b - a.
*/ void polsub( a, na, b, nb, c ) double a[], b[], c[]; int na, nb;
{ int i, n;
if( na > nb )
n = na; else
n = nb;
if( n > MAXPOL )
n = MAXPOL;
for( i=0; i<=n; i++ )
{ if( i > na )
c[i] = b[i]; elseif( i > nb )
c[i] = -a[i]; else
c[i] = b[i] - a[i];
}
}
/* c = b/a
*/ int poldiv( a, na, b, nb, c ) double a[], b[], c[]; int na, nb;
{ double quot; double *ta, *tb, *tq; int i, j, k, sing;
sing = 0;
/* Allocate temporary arrays. This would be quicker *ifdoneautomaticallyonthestack,butstackspace *maybehardtoobtainonasmallcomputer.
*/
ta = (double * )malloc( psize );
polclr( ta, MAXPOL );
polmov( a, na, ta );
for( i=1; i<=nb; i++ )
{ /* Form ith power of a. */
polmul( a, na, pt2, n2, pt2 );
n2 += na;
x = b[i]; /* Add the ith coefficient of b times the ith power of a. */ for( j=0; j<=n2; j++ )
{ if( j > MAXPOL ) break;
pt1[j] += x * pt2[j];
}
}
k = n2 + nb; if( k > MAXPOL )
k = MAXPOL; for( i=0; i<=k; i++ )
c[i] = pt1[i];
}
/* Evaluate polynomial a(t) at t = x.
*/ double poleva( a, na, x ) double a[]; int na; double x;
{ double s; int i;
s = a[na]; for( i=na-1; i>=0; i-- )
{
s = s * x + a[i];
} return(s);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-06-15)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.