From nobody Sat Dec 18 10:41:14 2021
X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
	by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9C65218E327C;
	Sat, 18 Dec 2021 10:41:18 +0000 (UTC)
	(envelope-from markm@FreeBSD.org)
Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (4096 bits) client-digest SHA256)
	(Client CN "smtp.freebsd.org", Issuer "R3" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4JGMpQ26Hnz4kBs;
	Sat, 18 Dec 2021 10:41:18 +0000 (UTC)
	(envelope-from markm@FreeBSD.org)
Received: from smtpclient.apple (unknown [IPv6:2a02:8011:300b:42:6dfc:850d:c1cd:d820])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client did not present a certificate)
	(Authenticated sender: markm)
	by smtp.freebsd.org (Postfix) with ESMTPSA id A3CC220844;
	Sat, 18 Dec 2021 10:41:17 +0000 (UTC)
	(envelope-from markm@FreeBSD.org)
Content-Type: multipart/signed;
	boundary="Apple-Mail=_D858C349-81E9-4783-9A72-6F9F7568A1F2";
	protocol="application/pgp-signature";
	micalg=pgp-sha512
List-Id: Technical discussions relating to FreeBSD <freebsd-hackers.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/freebsd-hackers
List-Help: <mailto:freebsd-hackers+help@freebsd.org>
List-Post: <mailto:freebsd-hackers@freebsd.org>
List-Subscribe: <mailto:freebsd-hackers+subscribe@freebsd.org>
List-Unsubscribe: <mailto:freebsd-hackers+unsubscribe@freebsd.org>
Sender: owner-freebsd-hackers@freebsd.org
Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\))
Subject: Re: What to do about tgammal?
From: Mark Murray <markm@FreeBSD.org>
In-Reply-To: <20211218035222.GA68916@troutmask.apl.washington.edu>
Date: Sat, 18 Dec 2021 10:41:14 +0000
Cc: freebsd-hackers@freebsd.org,
 freebsd-current@freebsd.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <6C888EBF-1734-4EDC-8DBF-D2BA2454C37D@FreeBSD.org>
References: <20211204185352.GA20452@troutmask.apl.washington.edu>
 <E5711C71-1095-4B6B-A33A-4CDFF123AB62@FreeBSD.org>
 <20211213022223.GA41440@troutmask.apl.washington.edu>
 <813F29E3-8478-4282-9518-5943DE7B5492@FreeBSD.org>
 <20211214215106.GA50381@troutmask.apl.washington.edu>
 <F63407DF-B7CF-4C7B-86AB-1D99EB6C6FC7@FreeBSD.org>
 <20211218035222.GA68916@troutmask.apl.washington.edu>
To: Steve Kargl <sgk@troutmask.apl.washington.edu>
X-Mailer: Apple Mail (2.3693.20.0.1.32)
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1639824078;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=/Ad3Lky0eNnvICrh1CZUgIH6Hu4GiGCutuqmFdwq1ow=;
	b=szq2Z/cwOKBb/3GIcFVjdmlT3Tt6dvTWNRiU/KYR8hRFbWMJ70MMBuGVdTb9bP6ekiozGg
	sQfmk/47PpDFd7y2TljtnfBW9SlKTemCfsGgcA4c8NDcsbvXpRYMgIkQN1IO+5A6UNo4Wd
	IporNE203CF2bdihJQmKcVtoXPiEaZlRci8/uT1bhZC0aWkvpJhZyGGt+cGkAvcF6vQ/2V
	JLcgK2tiIlk5AA09/S1hz1XQsy3gXnP/Qx3kDxc825mM4J7nsUBWNpov1yjenooNutd3vw
	z89JUbgnRKQnsuza1RPe7w6TJHC3dzECd8RHOaLpWS4oAFYuQoRGha/RhcfgcQ==
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639824078; a=rsa-sha256; cv=none;
	b=BVUsGMuoDwGcMRGoQL7wZ9UXzFE5uxTN2DzHwscP2uxA22GazGjk6wml3v4gPGBwDxuG92
	Vbzmlwo0Pv2ZrcQIBtu1ahHLsPq9LqCdeBNlG1k/gjjNGwhxw7jqYdBRrizIQUcKbVJ+Pd
	0ZPn3N7vcDb+BQkmFgOnalPPILIsX/2g+qM63C+4SWv1M3eHXiJoWCSuBL6hAXCk4IyNjh
	HSodVlseGiHJZC1HJNVjm1hVD1fxDT6cwkn5AIEx/JiBjhRBqmwxEt2Lysp5OUwPv9T2sZ
	aXiaHCZclcWbzxWvP4TM0rrp2k/SR31hiO23Gv+AHdQ9Mdu7DV6rgST8tJokpw==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
X-ThisMailContainsUnwantedMimeParts: N


--Apple-Mail=_D858C349-81E9-4783-9A72-6F9F7568A1F2
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii



> On 18 Dec 2021, at 03:52, Steve Kargl =
<sgk@troutmask.apl.washington.edu> wrote:
>=20
> On Tue, Dec 14, 2021 at 10:21:55PM +0000, Mark Murray wrote:
>> On 14 Dec 2021, at 21:51, Steve Kargl =
<sgk@troutmask.apl.washington.edu> wrote:
>>> Interval          max ULP          x at Max ULP
>>> [6,1755.1]        0.873414 at 1.480588145237629047468e+03
>>> [1.0662,6]        0.861508 at 1.999467927053585410537e+00
>>> [1.01e-17,1.0661] 0.938041 at 1.023286481537296307856e+00
>>> [-1.9999,-1.0001] 3.157770 at -1.246957268051453610329e+00
>>> [-2.9999,-2.0001] 2.987659 at -2.220949465449893090070e+00
>>>=20
>>> Note, 1.01e-17 can be reduced to soemthing like 1.01e-19 or
>>=20
>> Extra diffs most welcome!
>>=20
>=20
> Hi Mark,
>=20
> Don't know if you noticed, but I borroewed a few cpu cycles
> from grimoire.

Didn't notice a thing! :-)

>  My WIP is already better than the imprecise.c
> kludge from theraven@.  I need to work out the details of
> computing logl(x) in extra precision or see if I can leverage
> what Bruce did a few years ago.  Anywho, current results:
>=20
> Interval tested for tgammal: [128,1755]
> count: 1000000
>  xm =3D  1.71195767195767195767195767195767183e+03L
> libm =3D  7.79438030237108165017007606176403036e+4790L
> mpfr =3D  7.79438030237108165017007606175285456e+4790L
> ULP =3D 14869.19517
>=20
> Interval tested for tgammal: [16,128]
> count: 1000000
>  xm =3D  1.27687183687183687183687183687183690e+02L
> libm =3D  6.61421998891483212224382625339007663e+212L
> mpfr =3D  6.61421998891483212224382625338960267e+212L
> ULP =3D 731.00958
>=20
> Interval tested for tgammal: [10,16]
> count: 1000000
>  xm =3D  1.54261654261654261654261654261654251e+01L
> libm =3D  2.74203137295418912508367515208072654e+11L
> mpfr =3D  2.74203137295418912508367515208073861e+11L
> ULP =3D 45.61161
>=20
> Interval tested for tgammal: [1.2446e-60,10]
> count: 1000000
>  xm =3D  6.26200626138006138006138006138006065e-02L
> libm =3D  1.54507103764516989381203274093299079e+01L
> mpfr =3D  1.54507103764516989381203274093299091e+01L
> ULP =3D 0.76751

Hmm. I think my understanding of ULP is missing something?

I thought that ULP could not be greater than the mantissa size
in bits?

I.e., I thought it represents average rounding error (compared with
"perfect rounding"), not truncation error, as the above very large
ULPs suggest.

M
--
Mark R V Murray


--Apple-Mail=_D858C349-81E9-4783-9A72-6F9F7568A1F2
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.2
Comment: GPGTools - http://gpgtools.org

iQEzBAEBCgAdFiEEyzPHvybPbOpU9MCxQlsJDh9CUqAFAmG9usoACgkQQlsJDh9C
UqA2bwf/aSpM0ZVX02od/89cMjwD+Hy5U4QemDhs+qHx0hPQn/Ry5SyEEeqjAJrA
lde6OSxRhX3wBc5i/eN7vXdTz1WVj8C/QboXx0pkOBvVMOrb/9CpD5und8EIdekf
f5QixS6vqXURjgLqRCdmOViCfG58KF+BcLJHZAtwl1EwoVTo28H/o+gx+2iA84oT
qknObY4tKpMFqi5I5l7mmv7T/1Kiiwbe56KGAHvAMBY3u2048mOZpTGxJ/4qfSJI
D/ZZLu51KAVx6mp8gRqUObxVoUpaUpYY8v1C/1Qbegmc7GGPnzcQPV28SWtB6kSw
D3jkwnsxc1+GcIvHkFG2WE9Spaq5+w==
=gzh1
-----END PGP SIGNATURE-----

--Apple-Mail=_D858C349-81E9-4783-9A72-6F9F7568A1F2--