Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 06 Apr 2012 17:43:17 -0500 Message-ID: <4F7F7185.2958@mindspring.com> Date: Fri, 06 Apr 2012 18:43:17 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: template metaprogramming in C? References: <4f7d7070$0$1387$4fafbaef@reader2.news.tin.it> <4f7d7c00$0$1374$4fafbaef@reader1.news.tin.it> <4f7d82b9$0$1381$4fafbaef@reader2.news.tin.it> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 18 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.220.17 X-Trace: sv3-K3jRQ2joO6suH9rxW4J+I5J9W3R4028ktjMmZQN+7znnANPoGLkQm8V2H8eqSZ4j2sT80XC1GkoO3TM!g+Y4CfAbCfCDNsPSjzfjU97cvlek8kqNIcLHQAYQbY+Zf7SUSb0opYYB7ZZ6Ad4baJ56KjTkw9Hg!Q32/MOmymw== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1694 Xref: csiph.com comp.lang.c:19417 io_x wrote: > u32 rsqrt(double* r, double p, u32 ncs) > what about result? the last number of each line is the sys_sqrt(p) If you want to compare the result of rsqrt(&r, p, ncs) to sqrt(p), Then you should compare (p / rsqrt(&r, p, ncs) - rsqrt(&r, p, ncs)) against (p / sqrt(p) - sqrt(p)) The expression with the smaller magnitude, contains the more accurate square root function. -- pete