qmul( x, x, z ); /* z = -x * x */
z[0] = -1;
qmov( qone, a ); /* a = 1.0 */
qmov( qone, t ); /* t = 1.0 */
qmov( qone, si ); /* si = 1.0 */
qclear( ci ); /* ci = 0.0 */
qmov( qtwo, k ); /* k = 2.0 */
jmax = 0;
/* x Bits of precision lost * *1011 *2025 *3039 *4053 *5068 *5575 *6082
*/
do
{
qdiv( k, z, t ); /* a *= z/k */
qmul( t, a, a );
qdiv( k, a, t ); /* ci += a/k */
qadd( ci, t, ci );
qadd( k, qone, k ); /* k += 1.0 */ /* if(t[1]>jmax) jmax=t[1];
*/
qdiv( k, a, a ); /* a /= k */
qdiv( k, a, t ); /* si += a/k */
qadd( si, t, si );
qadd( k, qone, k ); /* k += 1.0 */ /* if(t[1]>jmax) jmax=t[1];
*/
} while( ((int) si[1] - (int) a[1]) < NBITS/2 );
int qsicix( x, f, g )
QELT x[], f[], g[];
{
QELT sit[NQ], cit[NQ], t[NQ], c[NQ], s[NQ]; int jmin, jt; union
{ unsignedshort s[4]; double d;
} dx;
qtoe( x, dx.s );
/* error at crossover is 10**-21 */ if( dx.d > 55 ) goto asymp;
qsici( x, sit, cit );
qmov( qpi, t );
t[1] -= 1;
qsub( t, sit, sit );
qsin( x, s );
qcos( x, c );
qmul( cit, s, t ); /* ci * sin */
qmul( sit, c, f ); /* si * cos */
qsub( f, t, f ); /* f */
qmul( cit, c, c ); /* ci * cos */
qmul( sit, s, s ); /* si * sin */
qadd( c, s, g ); /* -g */
qneg( g ); return0;
asymp: /* Asymptotic expansion of auxiliary functions */
qmul( x, x, sit ); /* z = -x*x */
qneg( sit );
qmov( qone, cit ); /* a = 1.0;*/
qmov( qone, s ); /* s = 1.0;*/
qmov( qone, c ); /* c = 1.0;*/
qmov( qone, t ); /* k = 2.0;*/
t[1] += 1;
jmin = MAXEXP;
do
{
qdiv( sit, cit, cit ); /* a *= k/z;*/
qmul( t, cit, cit );
qadd( qone, t, t ); /* k += 1.0;*/
qadd( cit, s, s ); /* s += a;*/
qmul( cit, t, cit ); /* a *= k;*/
qadd( t, qone, t ); /* k += 1.0;*/
qadd( c, cit, c ); /* c += a;*/
jt = cit[1]; if( jt > jmin ) goto asydon;
jmin = jt;
} while( ((int) qone[1] - (int) cit[1]) < NBITS/2 ); /* converges to 43 decimals for x > 108 */
asydon: /* qtoe(cit,dx.s); printf("%d%.5e\n",qone[1]-jmin,dx.d);
*/
qdiv( x, s, f ); /* f = s / x;*/
sit[0] = 0;
qdiv( sit, c, g ); /* ci = c / fabs(z);*/ return0;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-14)
¤
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.