Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #14319
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Miles Bader <miles@gnu.org> |
| Newsgroups | comp.lang.c++ |
| Subject | Re: Writing efficient normal distribution function (for learning purposes). |
| Date | Mon, 20 Feb 2012 19:57:20 +0900 |
| Organization | NEC Electronics |
| Lines | 39 |
| Message-ID | <buoehtpbwmn.fsf@dhlpc061.dev.necel.com> (permalink) |
| References | <5969204.9.1329493277515.JavaMail.geo-discussion-forums@vbnd9> <xn0hugm6dngyx6i009@news.astraweb.com> <712803.2037.1329645562216.JavaMail.geo-discussion-forums@vbfm8> <27450340.18.1329648569770.JavaMail.geo-discussion-forums@vbpw21> <87r4xqzzgy.fsf@catnip.gol.com> <67abe3b8-4dbf-445d-bda9-d51864fe9584@pq6g2000pbc.googlegroups.com> <jhrs02$o2n$1@news-rocq.inria.fr> <4f421f54$0$2815$7b1e8fa0@news.nbl.fi> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| X-Trace | individual.net qbwHaGTbTBftVquupMnAQQlXqMPhsCIc5LJmIPc8x0kkhNtdAQ |
| Cancel-Lock | sha1:qeIbOv19el/BILekjJvLwNHejwk= sha1:TSK7C2akVTiDzSqzs6WLGmjnTP8= |
| System-Type | x86_64-unknown-linux-gnu |
| Blat | Foop |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.c++:14319 |
Show key headers only | View raw
Juha Nieminen <nospam@thanks.invalid> writes: >> And >> possibly -ffast-math if the OP is happy with imprecise (aka wrong) >> results. > > How are the results imprecise/wrong when using -ffast-math? > > Granted, I don't know every single detail, but I have the impression > that what it does is that it skips some of the most pedantic rules of > IEEE floating point math in favor of faster code. These minute pedantic > rules do not affect the accuracy of the end result in any significant > way (more than what can be expected from floating point values anyways). It's not that -ffast-math is bad or anything (I use it happily myself), but if precise results are important it's a good idea to check what it does in detail, and make sure things are OK. One can always, of course, use -ffast-math, and then _disable_ some of the finer-grained options it enabled. For instance: -ffast-math enables -funsafe-math-optimizations, which enables -freciprocal-math, which: "Allows the reciprocal of a value to be used instead of dividing by the value if this enables optimizations ... Note that this loses precision and increases the number of flops operating on the value." -funsafe-math-optimizations also enables fassociative-math, and changing the order of operations can affect the precision of the result in a way that the programmer didn't expect. -ffast-math also enables -ffinite-math-only, which of course will cause infinities etc to not be handled as expected. etc. -miles -- `There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.'
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Writing efficient normal distribution function (for learning purposes). Luca Cerone <luca.cerone@gmail.com> - 2012-02-17 07:41 -0800
Re: Writing efficient normal distribution function (for learning purposes). "Asger Joergensen" <Junk@Asger-P.dk> - 2012-02-17 16:45 +0000
Re: Writing efficient normal distribution function (for learning purposes). lucacerone <luca.cerone@gmail.com> - 2012-02-17 09:36 -0800
Re: Writing efficient normal distribution function (for learning purposes). "Asger Joergensen" <Junk@Asger-P.dk> - 2012-02-17 17:50 +0000
Re: Writing efficient normal distribution function (for learning purposes). lucacerone <luca.cerone@gmail.com> - 2012-02-19 01:59 -0800
Re: Writing efficient normal distribution function (for learning purposes). lucacerone <luca.cerone@gmail.com> - 2012-02-19 02:49 -0800
Re: Writing efficient normal distribution function (for learning purposes). "Asger Joergensen" <Junk@Asger-P.dk> - 2012-02-19 11:53 +0000
Re: Writing efficient normal distribution function (for learning purposes). Miles Bader <miles@gnu.org> - 2012-02-19 23:09 +0900
Re: Writing efficient normal distribution function (for learning purposes). Joshua Maurice <joshuamaurice@gmail.com> - 2012-02-19 13:34 -0800
Re: Writing efficient normal distribution function (for learning purposes). Marc <marc.glisse@gmail.com> - 2012-02-19 22:10 +0000
Re: Writing efficient normal distribution function (for learning purposes). Miles Bader <miles@gnu.org> - 2012-02-20 09:14 +0900
Re: Writing efficient normal distribution function (for learning purposes). Juha Nieminen <nospam@thanks.invalid> - 2012-02-20 10:24 +0000
Re: Writing efficient normal distribution function (for learning purposes). Miles Bader <miles@gnu.org> - 2012-02-20 19:57 +0900
Re: Writing efficient normal distribution function (for learning purposes). Dombo <dombo@disposable.invalid> - 2012-02-20 21:07 +0100
Re: Writing efficient normal distribution function (for learning purposes). Juha Nieminen <nospam@thanks.invalid> - 2012-02-21 08:41 +0000
Re: Writing efficient normal distribution function (for learning purposes). 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-21 01:10 -0800
Re: Writing efficient normal distribution function (for learning purposes). Miles Bader <miles@gnu.org> - 2012-02-20 09:04 +0900
Re: Writing efficient normal distribution function (for learning purposes). lucacerone <luca.cerone@gmail.com> - 2012-02-20 02:26 -0800
Re: Writing efficient normal distribution function (for learning purposes). Juha Nieminen <nospam@thanks.invalid> - 2012-02-17 20:42 +0000
Re: Writing efficient normal distribution function (for learning purposes). "Asger Joergensen" <Junk@Asger-P.dk> - 2012-02-17 22:20 +0000
Re: Writing efficient normal distribution function (for learning purposes). Juha Nieminen <nospam@thanks.invalid> - 2012-02-17 20:52 +0000
Re: Writing efficient normal distribution function (for learning purposes). Victor Bazarov <v.bazarov@comcast.invalid> - 2012-02-17 15:57 -0500
Re: Writing efficient normal distribution function (for learning purposes). Joshua Maurice <joshuamaurice@gmail.com> - 2012-02-17 15:01 -0800
Re: Writing efficient normal distribution function (for learning purposes). Victor Bazarov <v.bazarov@comcast.invalid> - 2012-02-18 08:44 -0500
Re: Writing efficient normal distribution function (for learning purposes). Paavo Helde <myfirstname@osa.pri.ee> - 2012-02-18 09:20 -0600
Re: Writing efficient normal distribution function (for learning purposes). Paavo Helde <myfirstname@osa.pri.ee> - 2012-02-18 09:36 -0600
Re: Writing efficient normal distribution function (for learning purposes). glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-02-18 20:19 +0000
Re: Writing efficient normal distribution function (for learning purposes). Miles Bader <miles@gnu.org> - 2012-02-19 10:32 +0900
Re: Writing efficient normal distribution function (for learning purposes). lucacerone <luca.cerone@gmail.com> - 2012-02-20 02:36 -0800
Re: Writing efficient normal distribution function (for learning purposes). gwowen <gwowen@gmail.com> - 2012-02-20 06:48 -0800
Re: Writing efficient normal distribution function (for learning purposes). lucacerone <luca.cerone@gmail.com> - 2012-02-21 04:32 -0800
csiph-web