Boost C++ Libraries: Ticket #4471: Kahan sum https://svn.boost.org/trac10/ticket/4471 <p> Request to have Kahan algorithm added to accumulators. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4471 Trac 1.4.3 mendola@… Mon, 26 Jul 2010 23:05:57 GMT attachment set https://svn.boost.org/trac10/ticket/4471 https://svn.boost.org/trac10/ticket/4471 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch.txt</span> </li> </ul> <p> patch for kahan sum </p> Ticket Eric Niebler Tue, 12 Apr 2011 17:09:15 GMT <link>https://svn.boost.org/trac10/ticket/4471#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4471#comment:1</guid> <description> <p> From Gaetano: </p> <p> At this page: </p> <p> <a href="http://www.boost.org/doc/libs/1_43_0/doc/html/accumulators/user_s_guide.html#accumulators.user_s_guide.the_statistical_accumulators_library">http://www.boost.org/doc/libs/1_43_0/doc/html/accumulators/user_s_guide.html#accumulators.user_s_guide.the_statistical_accumulators_library</a> </p> <p> I would add a link sum_kahan pointing to this: </p> <pre class="wiki">sum_kahan Implements the summation kahan's algorithm, reducing the accumulation error in case of floating point types. Result Type sample-type Depends On none Variants none Initialization Parameters none Accumulator Parameters none Extractor Parameters none Accumulator Complexity O(1), however compared to naive sum this accumulator performs 4 sum operations for each element accumulated Extractor Complexity O(1) Header #include &lt;boost/accumulators/statistics/sum_kahan.hpp&gt; Example accumulator_set&lt;float, stats&lt;tag::sum_kahan&gt; &gt; acc; BOOST_CHECK_EQUAL(0.0f, sum_kahan(acc)); for (size_t i = 0; i &lt; 1e6; ++i) { acc(1e-6f); } BOOST_CHECK_EQUAL(1.0f, sum_kahan(acc)); </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Eric Niebler</dc:creator> <pubDate>Thu, 19 May 2011 12:06:17 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4471#comment:2 https://svn.boost.org/trac10/ticket/4471#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/72045" title="add kahan sum, fixes #4471">[72045]</a>) add kahan sum, fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4471" title="#4471: Feature Requests: Kahan sum (closed: fixed)">#4471</a> </p> Ticket