Skip Menu |
 

This queue is for tickets about the List-MoreUtils CPAN distribution.

Report information
The Basics
Id: 131309
Status: new
Priority: 0/
Queue: List-MoreUtils

People
Owner: Nobody in particular
Requestors: rvtol [...] isolution.nl
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



MIME-Version: 1.0
X-Spam-Status: No, score=-1.9 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9] autolearn=ham
X-Cmae-Envelope: MS4wfGiNrhOMCeSi0NnfCeQWVhH/gkn/AskE1BpJHhkNI8nvAb7HQGEqsofBHXUcEoDrhySzvT82uzsmlJ7TkgPLJhGeAOppO3ZzpW94D1AdgofF6v/IAZua dWOkPCCI98qZ+q145Sd/es6LHnCOZz/M27v3+FH97zyxnAp6XfIjGbsEkipOpG+BNLa4TPu7oivGLg==
X-Cpan.org: This message routed through the cpan.org mail forwarding service. Please use PAUSE pause.perl.org to configure your delivery settings.
X-Spam-Flag: NO
Content-Language: en-US
content-type: text/plain; charset="utf-8"; format="flowed"
Message-ID: <d84df66d-503c-a124-ddbf-8f2aba1c615a [...] isolution.nl>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -1.9
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 03D402401DA for <cpan-bug+list-moreutils [...] hipster.bestpractical.com>; Tue, 31 Dec 2019 08:05:51 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EkYoSzUAbBvr for <cpan-bug+list-moreutils [...] hipster.bestpractical.com>; Tue, 31 Dec 2019 08:05:49 -0500 (EST)
Received: from xx1.develooper.com (xx1.develooper.com [147.75.38.233]) by hipster.bestpractical.com (Postfix) with ESMTPS id 649852401D1 for <bug-list-moreutils [...] rt.cpan.org>; Tue, 31 Dec 2019 08:05:49 -0500 (EST)
Received: from localhost (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with ESMTP id C59CE7C1A3 for <bug-list-moreutils [...] rt.cpan.org>; Tue, 31 Dec 2019 05:05:48 -0800 (PST)
Received: from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id C3E207C1C1 for <bug-list-moreutils [...] rt.cpan.org>; Tue, 31 Dec 2019 05:05:46 -0800 (PST)
Received: from lb2-smtp-cloud8.xs4all.net (lb2-smtp-cloud8.xs4all.net [194.109.24.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by xx1.develooper.com (Postfix) with ESMTPS id 546897C1A3 for <bug-list-moreutils [...] rt.cpan.org>; Tue, 31 Dec 2019 05:05:45 -0800 (PST)
Received: from [192.168.178.36] ([80.101.219.78]) by smtp-cloud8.xs4all.net with ESMTPSA id mHDSixL4oTsDemHDTiqq2A; Tue, 31 Dec 2019 14:05:43 +0100
Delivered-To: cpan-bug+list-moreutils [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.3.1
Subject: add sumc() (Kahan)
Return-Path: <rvtol [...] isolution.nl>
X-RT-Mail-Extension: list-moreutils
X-Original-To: cpan-bug+list-moreutils [...] hipster.bestpractical.com
X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_500_599 0, BODY_SIZE_7000_LESS 0, KNOWN_MTA_TFX 0, SINGLE_URI_IN_BODY 0, SPF_NONE 0, SXL_IP_TFX_WM 0, URI_WITH_PATH_ONLY 0, __ANY_URI 0, __BODY_NO_MAILTO 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_MONEY_CURRENCY 0, __FRAUD_MONEY_CURRENCY_DOLLAR 0, __HAS_FROM 0, __HAS_MSGID 0, __HTTPS_URI 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __MOZILLA_USER_AGENT 0, __NO_HTML_TAG_RAW 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __SUBJ_ALPHA_START 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_IN_BODY 0, __URI_NOT_IMG 0, __URI_NO_MAILTO 0, __URI_NO_WWW 0, __URI_NS , __URI_WITH_PATH 0, __USER_AGENT 0, __blackholes.mail-abuse.org_ERROR , __zen.spamhaus.org_ERROR '
Date: Tue, 31 Dec 2019 14:05:40 +0100
X-Spam-Level:
X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2019.11.28.70017
To: bug-List-MoreUtils [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: "Ruud H.G. van Tol" <rvtol [...] isolution.nl>
X-RT-Original-Encoding: utf-8
X-RT-Interface: Email
Content-Length: 564
Download (untitled) / with headers
text/plain 564b
sub sumc { # Compensate for loss of precision. # See https://en.wikipedia.org/wiki/Kahan_summation_algorithm my ($sum, $corr)= (shift, 0); for my $v ( @_ ) { my $sum_next= $sum + $v; $corr+= ( abs($sum) >= abs($v) ) ? (($sum - $sum_next) + $v) : (($v - $sum_next) + $sum); $sum= $sum_next; } return $sum + $corr; } $ perl -Mstrict -MList::Util=sum -wE' sub sumc { ... } my @values= (1, 1e100, 1, -1e100); say for sum(@values), sumc(@values); ' 0 2 -- Greetings, Ruud


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.