From: "Bin.Cheng" <amker.cheng@gmail.com>
To: Ulrich Drepper <drepper@gmail.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
Jonathan Wakely <jwakely@redhat.com>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] libstdc++: add uniform on sphere distribution
Date: Wed, 13 Aug 2014 07:43:00 -0000 [thread overview]
Message-ID: <CAHFci2-w51Yu8indGKoPXG6o1SG9X85-sWqk2UKO9BX0L_CtwA@mail.gmail.com> (raw)
In-Reply-To: <CAHFci28FEot4B+2x4EWYWgtpG7gpWB0_rZN3ORrWPgid+iqUTw@mail.gmail.com>
On Wed, Aug 13, 2014 at 3:36 PM, Bin.Cheng <amker.cheng@gmail.com> wrote:
> On Sun, Aug 10, 2014 at 2:00 AM, Ulrich Drepper <drepper@gmail.com> wrote:
>> On Sat, Aug 9, 2014 at 1:40 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
>>> __x = result_type(2.0) * __aurng() - 1.0;
>>
>> You're right, we of course need the negatives as well.
>>
>>> Assuming the 2 coordinates are obtained through a rescaling x->2*x-1, if
>>> __sq is not exactly 0, it must be between 2^-103 and 1 (for ieee
>>> double), so I am not sure hypot gains that much (at least in my mind
>>> hypot was mostly a gain close to 0 or infinity, but maybe it has more
>>> advantages). It can only hurt speed though, so not a big issue.
>>
>> Depending on how similar in size the two values are, not using hypot()
>> can drop quite a few bits. Especially with the scaling through
>> division this error can be noticeable. Better be sure. Maybe at some
>> point I have time to investigate the worst case scenario for the
>> numbers in question but until this shows hypot isn't needed it's best
>> to leave it in.
>>
>> I've committed the patch.
>
> Hi,
>
> This causes lots of tests under libstdc++-v3/testsuite/ext/ failed on
> aarch64-none-elf and arm-none-eabi with below log message.
>
> In file included from
> /home/binche01/work/oban-work/build-aarch64-none-elf/obj/gcc2/aarch64-none-elf/libstdc++-v3/include/ext/random:3494:0,
> from
> /home/binche01/work/oban-work/src/gcc/libstdc++-v3/testsuite/ext/random/arcsine_distribution/cons/default.cc:23:
> /home/binche01/work/oban-work/src/gcc/libstdc++-v3/include/ext/random.tcc:
> In member function
> '__gnu_cxx::{anonymous}::uniform_on_sphere_helper<2ul,
> _RealType>::result_type
> __gnu_cxx::{anonymous}::uniform_on_sphere_helper<2ul,
> _RealType>::operator()(_NormalDistribution&,
> _UniformRandomNumberGenerator&)':
> /home/binche01/work/oban-work/src/gcc/libstdc++-v3/include/ext/random.tcc:1609:18:
> error: 'hypot' is not a member of 'std'
> auto __norm = std::hypot(__ret[0], __ret[1]);
> ^
> /home/binche01/work/oban-work/src/gcc/libstdc++-v3/include/ext/random.tcc:1609:18:
> note: suggested alternative:
> In file included from
> /home/binche01/work/oban-work/build-aarch64-none-elf/obj/gcc2/aarch64-none-elf/libstdc++-v3/include/cmath:44:0,
> from
> /home/binche01/work/oban-work/build-aarch64-none-elf/obj/gcc2/aarch64-none-elf/libstdc++-v3/include/random:38,
> from
> /home/binche01/work/oban-work/build-aarch64-none-elf/obj/gcc2/aarch64-none-elf/libstdc++-v3/include/ext/random:38,
> from
> /home/binche01/work/oban-work/src/gcc/libstdc++-v3/testsuite/ext/random/arcsine_distribution/cons/default.cc:23:
> /home/binche01/work/oban-work/target-aarch64-none-elf/aarch64-none-elf/include/math.h:306:15:
> note: 'hypot'
> extern double hypot _PARAMS((double, double));
> ^
>
> FAIL: ext/random/arcsine_distribution/cons/default.cc (test for excess errors)
> Excess errors:
> /home/binche01/work/oban-work/src/gcc/libstdc++-v3/include/ext/random.tcc:1609:18:
> error: 'hypot' is not a member of 'std'
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62118 filed.
Thanks,
bin
next prev parent reply other threads:[~2014-08-13 7:43 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-13 2:01 Ulrich Drepper
2014-07-13 2:06 ` Ulrich Drepper
2014-07-13 9:28 ` Paolo Carlini
2014-07-13 10:04 ` Ulrich Drepper
2014-07-13 10:40 ` Paolo Carlini
2014-07-23 10:05 ` Marc Glisse
2014-07-23 10:44 ` Jonathan Wakely
2014-07-24 22:14 ` Ulrich Drepper
2014-07-24 23:19 ` Jonathan Wakely
2014-08-08 23:24 ` Ulrich Drepper
2014-08-09 7:15 ` Marc Glisse
2014-08-09 11:55 ` Ulrich Drepper
2014-08-09 12:34 ` Marc Glisse
2014-08-09 15:24 ` Ulrich Drepper
2014-08-09 15:33 ` Marc Glisse
2014-08-09 16:55 ` Ed Smith-Rowland
2014-08-09 16:56 ` Ulrich Drepper
2014-08-09 17:40 ` Marc Glisse
2014-08-09 18:00 ` Ulrich Drepper
2014-08-13 7:36 ` Bin.Cheng
2014-08-13 7:43 ` Bin.Cheng [this message]
2014-08-13 8:41 ` Paolo Carlini
2014-08-13 11:25 ` Paolo Carlini
2014-08-13 11:32 ` Marc Glisse
2014-08-13 11:40 ` Paolo Carlini
2014-07-13 13:55 Ed Smith-Rowland
2014-07-13 14:12 ` Ulrich Drepper
2014-07-13 14:48 ` Ed Smith-Rowland
2014-07-13 15:47 ` Paolo Carlini
2014-07-13 16:04 ` Ulrich Drepper
2014-07-13 16:12 ` Paolo Carlini
2014-07-13 16:18 ` Ulrich Drepper
2014-07-13 16:29 ` Paolo Carlini
2014-07-13 16:45 ` Ulrich Drepper
2014-07-13 16:56 ` Paolo Carlini
2014-07-14 7:58 ` Andreas Schwab
2014-07-14 8:18 ` Paolo Carlini
2014-07-16 11:30 ` Ed Smith-Rowland
2014-07-16 15:03 ` Paolo Carlini
2014-07-16 17:38 ` Ulrich Drepper
2014-07-14 10:31 Dominique Dhumieres
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHFci2-w51Yu8indGKoPXG6o1SG9X85-sWqk2UKO9BX0L_CtwA@mail.gmail.com \
--to=amker.cheng@gmail.com \
--cc=drepper@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jwakely@redhat.com \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).