This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: different results for expf on x86_64
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: paul zimmermann <Paul dot Zimmermann at inria dot fr>, 'GNU C Library' <libc-alpha at sourceware dot org>
- Date: Thu, 6 Feb 2020 21:06:11 +0000
- Subject: Re: different results for expf on x86_64
- Ironport-sdr: Fx36fFbpGoDJcg3pe4Pzn6XSLUKzWGwVvGemZwOocdbv11efiw7EZNll0490K9mxUcBKbPPgtc CkH4TGtKVS2W7h+kFhHIVKtNDIIEeQlvmI3YtDXJpCNikq4BJrvkjM0ThAatwaFitJw8a5EEjH szbR2hkBZYKTGHHz/KeexfgiuBSFBez4DFkprE85hmGFEac593CE9L1dozYiSmhOJVFF+IBBMz zFxJlSbpap6aXCXT1MnhiWSS0ucwZ7FH6uERCtPBZxVoDUbSwOZtYFGEcfaK3K3q1SlCig+q/f C0Q=
- Ironport-sdr: RBayia2I+WtZqmZnY5E6stBko/Rw95nMMSBD6yqWENstwC3kdBeONS27a/r1SU/o7gJ4wZEM0p FNX22keXzX0aL7T8h1n5Bj1RhtfMcaOkhg4SxwKrjJcznGO2PHyss8eNPUwjwxTEIZnXPyZHQj obEkSp3LPNVakzymuQTcKFBvYlawOhZSQLgtizz8YaP96DsLO+JuLGNfdu+c+WxEWnT0O8NFWM QWWPl/XqZjUm7VqU8m0WXPMudGaz9H1/9FUcesyveZboWVA5tvnCCwaam1+8pgeJcqTbub7pfL fU0=
- References: <HE1PR0801MB20442D41B4F835ABCED48DEE83030@HE1PR0801MB2044.eurprd08.prod.outlook.com>
On Tue, 4 Feb 2020, Wilco Dijkstra wrote:
> In this particular case x86_64 uses the generic math code, but compiles expf
> with and without FMA. FMA causes minor rounding differences, but this is fine
> since the new math functions have been designed to be used with FMA (AArch64
> uses FMA by default so there is only one version).
Furthermore, you can get different results with different GCC versions (or
optimzation options) used to build glibc that is then run on the same
processor, because the compilers may make different choices about whether
to contract operations that were written as a*b+c to use FMA.
--
Joseph S. Myers
joseph@codesourcery.com