From owner-freebsd-current@FreeBSD.ORG Tue Jul 10 16:54:56 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B569C106564A; Tue, 10 Jul 2012 16:54:56 +0000 (UTC) (envelope-from rhurlin@gwdg.de) Received: from amailer.gwdg.de (amailer.gwdg.de [134.76.10.18]) by mx1.freebsd.org (Postfix) with ESMTP id 413C48FC14; Tue, 10 Jul 2012 16:54:56 +0000 (UTC) Received: from p508c758e.dip.t-dialin.net ([80.140.117.142] helo=krabat.raven.hur) by mailer.gwdg.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Sodi9-00040k-O5; Tue, 10 Jul 2012 18:54:53 +0200 Message-ID: <4FFC5E5D.8000502@gwdg.de> Date: Tue, 10 Jul 2012 18:54:53 +0200 From: Rainer Hurling User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120619 Thunderbird/13.0.1 MIME-Version: 1.0 To: David Schultz References: <4FC40DEA.8030703@missouri.edu> <20120529000756.GA77386@troutmask.apl.washington.edu> <4FC43C8F.5090509@missouri.edu> <20120529045612.GB4445@server.rulingia.com> <20120708124047.GA44061@zim.MIT.EDU> <210816F0-7ED7-4481-ABFF-C94A700A3EA0@bsdimp.com> <20120708233624.GA53462@troutmask.apl.washington.edu> <4FFBF16D.2030007@gwdg.de> <2A1DE516-ABB4-49D7-8C3D-2C4DA2D9FCF5@bsdimp.com> <4FFC412B.4090202@gwdg.de> <20120710151115.GA56950@zim.MIT.EDU> In-Reply-To: <20120710151115.GA56950@zim.MIT.EDU> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated: Id:rhurlin X-Spam-Level: - X-Virus-Scanned: (clean) by exiscan+sophie Cc: freebsd-current@FreeBSD.ORG, Peter Jeremy , Steve Kargl , Warner Losh Subject: Re: Use of C99 extra long double math functions after r236148 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 16:54:56 -0000 On 10.07.2012 17:11 (UTC+2), David Schultz wrote: > On Tue, Jul 10, 2012, Rainer Hurling wrote: >> On 10.07.2012 16:02 (UTC+2), Warner Losh wrote: >>> >>> On Jul 10, 2012, at 3:10 AM, Rainer Hurling wrote: >>>> As far as I understand from discussions on R mailing list >>>> (r-devel@r-project.org), they plan to reduce the emulation and/or >>>> workaround of long and complex math functions for FreeBSD and other >>>> systems with their next releases of R devel. So we could really need some >>>> progress with our C99 conform math functions ;-) >>> >>> Not having R would be a bit pain in my backside. That's one of the >>> practical considerations that I was talking about. It is very real, and >>> if I have to, I'll commit the #define junk I railed against to get it >>> back. Please, let's get some progress. I have some time to help. >> >> Yes, thank you Warner, that is also my problem. As I wrote some weeks >> ago (05/28/2012) when starting this thread, I am using FreeBSD as a >> scientific desktop because of its good scaling properties. For some >> years now, FreeBSD fits all our needs with R, SAGA GIS, PostgreSQL and >> some more. >> >> If I would not be able to run upcoming versions of R on FreeBSD any >> more, that would be really, really hard :-( > > Do you have a list of the essential functions here? There are 17 long > double functions and some complex functions missing, but only a > handful of those are of general interest. The reason I ask is that if > R is just looking for a few missing functions that are already mostly > implemented, then the best solution is probably to finish that work. > But if it's expecting us to have something arcane like long double > Bessel functions of the first kind, then we need to pursue a workaround > in the short term. > That is, what I found by grepping the sources of a recent R development version: expl: src/nmath/pnchisq.c log10l: src/extra/trio/trio.c log1pl: src/nmath/pnbeta.c logl: src/nmath/dnbeta.c src/nmath/pnbeta.c powl: src/extra/trio/triostr.c src/extra/trio/trio.c src/main/format.c In the R NEWS file I found the following three entries about C99 (complex) functions: NEWS:l2044 The C99 functions acosh, asinh, atanh, snprintf and vsnprintf are now required. NEWS:l3032 The C99 double complex type is now required. The C99 complex trigonometric functions (such as csin) are not currently required (FreeBSD lacks most of them): substitutes are used if they are missing. NEWS:l3277 Complex arithmetic (notably z^n for complex z and integer n) gave incorrect results since R 2.10.0 on platforms without C99 complex support. This and some lesser issues in trigonometric functions have been corrected. Such platforms were rare (we know of Cygwin and FreeBSD). However, because of new compiler optimizations in the way complex arguments are handled, the same code was selected on x86_64 Linux with gcc 4.5.x at the default -O2 optimization (but not at -O). From the discussions on the R-devel mailing list we could expect, that there will be more complex (long, longlong) functions introduced in the near future. (But it is very likely that b.f. does know much more about this.) Rainer BTW: There seems to be a discrepancy about missing functions listed in http://wiki.freebsd.org/MissingMathStuff and in http://svnweb.freebsd.org/base/head/lib/msun/src/math.h?r1=227472&r2=236148&pathrev=236148. So the wiki is a bit outdated now?