<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/index.php?action=history&amp;feed=atom&amp;title=Airy_zeta_function</id>
	<title>Airy zeta function - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/index.php?action=history&amp;feed=atom&amp;title=Airy_zeta_function"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/index.php?title=Airy_zeta_function&amp;action=history"/>
	<updated>2026-05-10T14:14:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0-wmf.28</generator>
	<entry>
		<id>https://en.formulasearchengine.com/index.php?title=Airy_zeta_function&amp;diff=25443&amp;oldid=prev</id>
		<title>46.115.90.113: MathWorld</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/index.php?title=Airy_zeta_function&amp;diff=25443&amp;oldid=prev"/>
		<updated>2013-11-09T20:18:32Z</updated>

		<summary type="html">&lt;p&gt;MathWorld&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In [[modular arithmetic]], &amp;#039;&amp;#039;&amp;#039;Barrett reduction&amp;#039;&amp;#039;&amp;#039; is a reduction [[algorithm]] introduced in 1986 by P.D. Barrett.&amp;lt;ref&amp;gt;{{cite doi|10.1007/3-540-47721-7_24}}&amp;lt;/ref&amp;gt; A naive way of computing  &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;c = a \,\bmod\, n. \, &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would be to use a fast [[division algorithm]].  Barrett reduction is an algorithm designed to optimize this operation assuming &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is constant, and &amp;lt;math&amp;gt;a&amp;lt;n^2&amp;lt;/math&amp;gt;, replacing divisions by multiplications.&lt;br /&gt;
&lt;br /&gt;
== Naive idea ==&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;m=1/n&amp;lt;/math&amp;gt; be the inverse of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; as a [[floating point]] number. Then &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;a \,\bmod\, n = a-\lfloor a m\rfloor n &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\lfloor x \rfloor&amp;lt;/math&amp;gt; denotes the [[floor function]],&lt;br /&gt;
assuming m was computed with sufficient accuracy.&lt;br /&gt;
&lt;br /&gt;
== Barrett algorithm ==&lt;br /&gt;
&lt;br /&gt;
Barrett algorithm is a [[fixed-point]] analog which expresses everything in terms of integers.&lt;br /&gt;
Let &amp;#039;&amp;#039;k&amp;#039;&amp;#039; be the smallest integer such that &amp;lt;math&amp;gt;2^k&amp;gt;n&amp;lt;/math&amp;gt;. Think of &amp;#039;&amp;#039;n&amp;#039;&amp;#039; as representing the fixed-point number &amp;lt;math&amp;gt; n 2^{-k} &amp;lt;/math&amp;gt;.&lt;br /&gt;
We precompute m such that &amp;lt;math&amp;gt; m = \lfloor 4^k/n \rfloor&amp;lt;/math&amp;gt;. Then &amp;#039;&amp;#039;m&amp;#039;&amp;#039; represents the fixed-point number &amp;lt;math&amp;gt; m 2^{-k} \approx (n 2^{-k})^{-1} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;q = \left\lfloor \frac{m a}{4^k} \right\rfloor &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r = a - q n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Clearly &amp;lt;math&amp;gt;a \equiv r \pmod{n}&amp;lt;/math&amp;gt;, and if &amp;lt;math&amp;gt;a&amp;lt;n^2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;r&amp;lt;2 n &amp;lt;/math&amp;gt;.&lt;br /&gt;
So&lt;br /&gt;
:&amp;lt;math&amp;gt;a \,\bmod\, n = \begin{cases} r &amp;amp; \text{if } r&amp;lt;n \\ r-n &amp;amp; \text{otherwise} \end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Barrett algorithm for polynomials ==&lt;br /&gt;
&lt;br /&gt;
It is also possible to use Barrett algorithm for polynomial division, by reversing polynomials &lt;br /&gt;
and using X-adic arithmetic.{{clarify|date=January 2014}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[[Montgomery reduction]] is another similar algorithm.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
*Chapter 14 of [[Alfred J. Menezes]], Paul C. van Oorschot, and [[Scott A. Vanstone]]. [http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf Handbook of Applied Cryptography]. CRC Press, 1996. ISBN 0-8493-8523-7.&lt;br /&gt;
*Bosselaers, &amp;#039;&amp;#039;et al.&amp;#039;&amp;#039;, &amp;quot;Comparison of Three Modular Reduction Functions,&amp;quot; Advances in Cryptology-Crypto&amp;#039;93, 1993. [http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.40.3779]&lt;br /&gt;
*W. Hasenplaugh, G. Gaubatz, V. Gopal, [http://www.acsel-lab.com/arithmetic/html/Hasenplaugh_W.html &amp;quot;Fast Modular Reduction&amp;quot;], ARITH 18&lt;br /&gt;
&lt;br /&gt;
[[Category:Computer arithmetic]]&lt;br /&gt;
[[Category:Cryptographic algorithms]]&lt;br /&gt;
[[Category:Modular arithmetic]]&lt;/div&gt;</summary>
		<author><name>46.115.90.113</name></author>
	</entry>
</feed>