From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2392 invoked by alias); 27 Apr 2007 11:01:23 -0000 Received: (qmail 2294 invoked by uid 48); 27 Apr 2007 11:01:07 -0000 Date: Fri, 27 Apr 2007 11:01:00 -0000 Message-ID: <20070427110107.2293.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/31723] Use reciprocal and reciprocal square root with -ffast-math In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jb at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-04/txt/msg02097.txt.bz2 ------- Comment #5 from jb at gcc dot gnu dot org 2007-04-27 12:01 ------- With the benchmarks at http://www.hlnum.org/english/doc/frsqrt/frsqrt.html I get ~/src/benchmark/rsqrt% g++ -O3 -funroll-loops -ffast-math -funit-at-a-time -march=k8 -mfpmath=sse frsqrt.cc ~/src/benchmark/rsqrt% ./a.out first example: 1 / sqrt(3) exact = 5.7735026918962584e-01 float = 5.7735025882720947e-01, error = 1.7948e-08 double = 5.7735026918962506e-01, error = 1.3461e-15 second example: 1 / sqrt(5) exact = 4.4721359549995793e-01 float = 4.4721359014511108e-01, error = 1.1974e-08 double = 4.4721359549995704e-01, error = 1.9860e-15 Benchmark (float) time for 1.0 / sqrt = 5.96 sec (res = 2.8450581250000000e+05) (float) time for rsqrt = 2.49 sec (res = 2.2360225000000000e+05) (double) time for 1.0 / sqrt = 7.35 sec (res = 5.9926234364635509e+05) (double) time for rsqrt = 7.49 sec (res = 5.9926234364355623e+05) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31723