YoushouldhavereceivedcopiesoftheGNUGeneralPublicLicenseandthe GNULesserGeneralPublicLicensealongwiththeGNUMPLibrary.Ifnot,
see https://www.gnu.org/licenses/. */
#define TOOM2_SQR_REC(p, a, n, ws) \ do { \ if (! MAYBE_sqr_toom2 \
|| BELOW_THRESHOLD (n, SQR_TOOM2_THRESHOLD)) \
mpn_sqr_basecase (p, a, n); \ else \
mpn_toom2_sqr (p, a, n, ws); \
} while (0)
/* v0, 2n limbs */
TOOM2_SQR_REC (v0, ap, n, scratch_out);
/* H(v0) + L(vinf) */
cy = mpn_add_n (pp + 2 * n, v0 + n, vinf, n);
/* L(v0) + H(v0) */
cy2 = cy + mpn_add_n (pp + n, pp + 2 * n, v0, n);
/* L(vinf) + H(vinf) */
cy += mpn_add (pp + 2 * n, pp + 2 * n, n, vinf + n, s + s - n);
cy -= mpn_sub_n (pp + n, pp + n, vm1, 2 * n);
ASSERT (cy + 1 <= 3);
ASSERT (cy2 <= 2);
if (LIKELY (cy <= 2)) {
MPN_INCR_U (pp + 2 * n, s + s, cy2);
MPN_INCR_U (pp + 3 * n, s + s - n, cy);
} else { /* cy is negative */ /* The total contribution of v0+vinf-vm1 can not be negative. */ #if WANT_ASSERT /* The borrow in cy stops the propagation of the carry cy2, */
ASSERT (cy2 == 1);
cy += mpn_add_1 (pp + 2 * n, pp + 2 * n, n, cy2);
ASSERT (cy == 0); #else /* we simply fill the area with zeros. */
MPN_FILL (pp + 2 * n, n, 0); #endif
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-10)
¤
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.