From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id F2106BC69 for ; Sat, 10 Feb 2007 01:00:00 +0100 (CET) Received: from pih-relay05.plus.net (pih-relay05.plus.net [212.159.14.132]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l19NxwsV011619 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Sat, 10 Feb 2007 01:00:00 +0100 Received: from [80.229.56.224] (helo=[10.0.0.5]) by pih-relay05.plus.net with esmtp (Exim) id 1HFfen-00058B-OZ for caml-list@yquem.inria.fr; Fri, 09 Feb 2007 23:59:57 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Multiplication of matrix in C and OCaml Date: Fri, 9 Feb 2007 23:53:09 +0000 User-Agent: KMail/1.9.5 References: <45CAF3E2.7020807@univ-paris12.fr> <45CCEDD8.3080907@fmf.uni-lj.si> <0364ab557o.fsf@hod.lan.m-e-leypold.de> In-Reply-To: <0364ab557o.fsf@hod.lan.m-e-leypold.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702092353.09173.jon@ffconsultancy.com> X-Miltered: at discorde with ID 45CD0AFE.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 compiler:01 gcc:01 flags:01 flags:01 gcc:01 rounding:01 ocaml:01 frog:98 compilers:01 wrote:01 caml-list:01 arithmetic:01 algorithms:03 languages:03 On Friday 09 February 2007 22:36, ls-ocaml-developer-2006@m-e-leypold.de wrote: > Still I think the compiler (GCC) might take the license to > optimize (a * b) *c == a * (b * c) to false with -O3. The -O* flags try to be correct but you can supply flags like -ffast-math to opt for faster but possibly less correct code: http://docs.freebsd.org/info//gcc/gcc.info.Optimize_Options.html Many compilers and languages sacrifice strict double-precision for performance (by not rounding from 80-bit), which is a major headache when you're implementing algorithms that rely upon it, e.g. the exact arithmetic in Triangle: http://www.soest.hawaii.edu/GMT/gmt/README.TRIANGLE -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. OCaml for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists