From owner-freebsd-numerics@freebsd.org Tue Nov 7 17:54:01 2017 Return-Path: Delivered-To: freebsd-numerics@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34E93E5FFCE for ; Tue, 7 Nov 2017 17:54:01 +0000 (UTC) (envelope-from dimpase@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1A027B5F8 for ; Tue, 7 Nov 2017 17:54:00 +0000 (UTC) (envelope-from dimpase@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id n74so15263667wmi.1 for ; Tue, 07 Nov 2017 09:54:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rUMXPg/MEbuzBCGeMC+ZnqCHyYxS7vaASPYeyuBvBQE=; b=DHHeaK1Uquh2FGCsd7EXfuuKelrG5eaYvAAfy4tygkS5ReRh2KnZkitKK5cGGsQ22L BkGf3MegKoXcnaQeul4KcIZmX6Vg8E08JjMWB9qxLIDE00ZPWNH+ytyxvF6M+NjclOrw pIthWUuwgmDVZaR23TJWqGLeaWyulS0QsuGhGBWn7j357B6sAohdjjCfhN8/fV+QNbpQ KgcQ9YJqEHFuAX/HWTNBo3eVQxuPIaILWK8kQm3u8Y8lTmTQ9ZHtH3biXeFazZAd5cwl 8kSXA+6tUtXkA75x2bYqamav0qs/HrdZR9V1EGljyoh2SgpJyjGGbWq30lLk4Vbejsl2 oKlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rUMXPg/MEbuzBCGeMC+ZnqCHyYxS7vaASPYeyuBvBQE=; b=Tg5CHbQwUFBthlkcreDi+9K+aPL1hjiAIyYGS4yUKKVsCmplfym0cAmAEqneGsXA5R SHAag4B6EFqKGV9Kg13bmrxOt3Hu63JI1of/hIqWxRg7nFmkcUrJo+lhhb7HvomZemRq aOYih0CTtdi3HDzWdeRbBbvZ+Usgl0L3op7DFw19AwK1JOFGXttF3A7oPq6cIqgP6y4t 36o2e/JwXZi1v13YF1OjFBPzQihqnIv+bK0fR+Nd+rycg1zBziSsJSkDy5ILUEfGRHk5 /jca4oRu+pCPIWRM6gP7KtlBmp5JdybRbG0z3thB8bgnqKFE1cmbs4TU7jFGNZ0g5YoA Hj6g== X-Gm-Message-State: AJaThX4ezZ9xeZv12NUwHWo+srUudraXe519pMkW+yDx7DrNQnMl7LXB etKRDq62LF1CXGXCBNx8OMw+hHpz X-Google-Smtp-Source: ABhQp+QYtLHnid7Gz02hMB8CM48/jNSuZ7LtzAYLk14bT2QQjGwzwn8vZc2n5+u4Rd6exGu53w2C6Q== X-Received: by 10.80.164.183 with SMTP id w52mr28590edb.44.1510077238622; Tue, 07 Nov 2017 09:53:58 -0800 (PST) Received: from hilbert.cs.ox.ac.uk (cpc69402-oxfd27-2-0-cust392.4-3.cable.virginm.net. [82.14.197.137]) by smtp.gmail.com with ESMTPSA id h51sm1947596eda.56.2017.11.07.09.53.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 09:53:57 -0800 (PST) From: dimpase@gmail.com X-Google-Original-From: dimpase+freebsd@gmail.com Received: by hilbert.cs.ox.ac.uk (Postfix, from userid 1000) id 809DC74E96E; Tue, 7 Nov 2017 17:53:56 +0000 (GMT) Date: Tue, 7 Nov 2017 17:53:56 +0000 To: Steve Kargl Cc: Michael Danilov , freebsd-numerics@freebsd.org Subject: Re: cpow and clog Message-ID: <20171107175354.GA26733@hilbert> References: <20171106194937.GA87725@freebird> <20171106204121.GB37361@troutmask.apl.washington.edu> <20171107103858.GA8468@hilbert> <20171107153149.GA44102@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171107153149.GA44102@troutmask.apl.washington.edu> X-PGP-Key: http://keys.gnupg.net/pks/lookup?op=vindex&search=dimpase@cs.ox.ac.uk User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 17:54:01 -0000 On Tue, Nov 07, 2017 at 07:31:49AM -0800, Steve Kargl wrote: > On Tue, Nov 07, 2017 at 10:38:59AM +0000, dimpase@gmail.com wrote: > > On Mon, Nov 06, 2017 at 12:41:21PM -0800, Steve Kargl wrote: > > > On Mon, Nov 06, 2017 at 08:49:43PM +0100, Michael Danilov wrote: > > > > I would like to have some feedback on my attempt to import OpenBSD > > > > code for cpow and clog: > > > > > > > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221341 > > > > https://bugs.freebsd.org/bugzilla/attachment.cgi?id=187693 > > > > > > > > What happened to the alternative implementation mentioned in the thread below? > > > > > > bde has an implementation of clog[fl]. He may someday > > > commit it. I don't know if anyone ever worked on cpow[fl]. > > > I stopped working on powl and tgammal when I returned my > > > commit bit due to differences with "higher-ranking" committers. > > > > > > > And what had stopped the developers from just reusing the Net-i > > > > or OpenBSD code? > > > > > > How have you tested the NetBSD and/or OpenBSD code? What is the > > > quality? Have the long double clogl and cpowl been tested on both > > > ld80 and ld128 hardware? See FreeBSD's lib/msun/src/math_private.h > > > for a discussion of possible issues of using I from complex.h in this > > > code. > > > > I would like to point out that various FreeBSD ports already contain > > implementations of the functions in question. > > What is the quality of those implementations? Have you tested the > code? Do you have a testsuite for these functions? Perhaps it can be found somewhere, do you know? We are able to make bits of code needed for conformance to pass our tests in Sagemath on FreeBSD 11 (x86_64 only, although I probably can get FreeBSD running on aarch64 somehow) with various clang versions, and with gcc6. Basically I am talking about these functions from the Cephes library: http://files.sagemath.org/spkg/upstream/cephes/index.html > Have you read the comment in math_private.h concerning the > use of I in computations? I presume you refer to "...x+I*y is * currently unusable in general since gcc introduces many overflow, * underflow, sign and efficiency bugs..." We are building FreeBSD with clang, and not gcc, I don't know how relevant it is, for clang is a fast-moving target. By the way, https://wiki.freebsd.org/Numerics still mentiones FreeBSD 10 as "current"... > > > Sorry for being blunt, but IMHO the attitude on this list appears to be > > to let the numerics stack on FreeBSD die a slow death. > > You're talking to the one person who has spent decades trying to > improve libm through bug fixes and implementing missing functionality. > > > Indeed, most people hate to reinvent the wheel. It's > > really no fun at all to scramble to get these missing implementations > > somehow, there are certainly much better ways to use one's time and > > brainpower. On this list people prefer to point at some private code in > > uncertain shape, and hope that somehow by some magic FreeBSD will have > > the best humanely possible implementation of the complex transcendental > > functions... > > On this list, which is mostly Bruce and me it seems, people care about > the quality of the code. People, which is mostly Bruce and me, spend > quite a bit of time benchmarking proposed patches go ensure that users > aren't fed wrong results. > > > Why don't you first of all try to provide *some* reasonably > > working implementation (thus allowing porters not to have to reinvent > > this wheel, badly, for $n$-th time over, and then having *fun* making > > sure the tools know where to get these functions), and only then try to > > improve it? > > Who is 'you' here? I recently provided implementations of sinpi[fl], cospi[fl], > and tanpi[fl] for ISO/IEC TS 18661-4. Patches were submitted to this list > (check the archive). Well, this involves browsing entries of https://lists.freebsd.org/pipermail/freebsd-numerics/ Would you mind at least mention year and month? > Bruce is the only person to comment on the patch. I took > the time to fix the lang/python* ports, which break with this patch, and sent > the patches to freebsd-ports list where the patches are lost in time. Nowadays one would rather expect a git branch with the changes, not patches, as you might know. > > Check out the history of msun/src/imprecise.c. This is a 'workaround' > committed by David Chisnall so that FreeBSD could claim C++ conformance. > David has never lifted a finger to fix that kludge. I am the person > who has clean up that mess (until I stopped working on powl and tgammal). > This is exactly the the situation that people on this list are trying to > avoid when someone wants to simply "provide *some* reasonably working > implementation". See, it was great work, it has allowed him to publish stuff, e.g.: http://www.cl.cam.ac.uk/research/security/ctsrd/pdfs/201403-asiabsdcon2014-llvmbsd.pdf :-) His homepage however says that he's "Former Core Team member" of FreeBSD. If https://wiki.freebsd.org/Numerics is the right place to look at, this issue ought to be mentioned there, don't you think so? > > Instead of complaining about the people on this list, which is mostly > Bruce and me, why not help. So, I'll repeat myself here. What is the > quality of those implementations? Have you tested the code? Have you > read the comment in math_private.h concerning the use of I in computations? While I do have some time to spend on this in the coming year or so, I would like to understand how the developent process works in this particular case, who have rights to commit changes, how tests are run, whether there is any CI system to be used, etc. It seems that one has to start by setting up a set of tests for these functions. Dima > > -- > Steve