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.7 required=5.0 tests=AWL,NO_REAL_NAME 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 2C1AFBC69 for ; Fri, 9 Feb 2007 23:31:00 +0100 (CET) Received: from server2.thinkcrime.de (server2.thinkcrime.de [213.133.110.149]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l19MUxSu030607 for ; Fri, 9 Feb 2007 23:31:00 +0100 Received: from hod-sarge-2005-10.lan.m-e-leypold.de (dslb-088-072-200-144.pools.arcor-ip.net [88.72.200.144]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server2.thinkcrime.de (Postfix) with ESMTP id 70A84488032 for ; Fri, 9 Feb 2007 23:31:02 +0100 (CET) Received: by hod-sarge-2005-10.lan.m-e-leypold.de (Postfix, from userid 1003) id 5E324376C1; Fri, 9 Feb 2007 23:36:11 +0100 (CET) To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Multiplication of matrix in C and OCaml References: <45CAF3E2.7020807@univ-paris12.fr> <45CAFF5A.2020607@inria.fr> <45CB3ED0.9040200@univ-paris12.fr> <20070209.115842.106265091.garrigue@math.nagoya-u.ac.jp> <1171030953.5302.51.camel@rosella.wigram> <9e4ppv6m15.fsf@hod.lan.m-e-leypold.de> <45CCEDD8.3080907@fmf.uni-lj.si> Organization: Leypold, Software-Dienstleistungen und -Beratung From: ls-ocaml-developer-2006@m-e-leypold.de Date: Fri, 09 Feb 2007 23:36:11 +0100 In-Reply-To: <45CCEDD8.3080907@fmf.uni-lj.si> (Andrej Bauer's message of "Fri, 09 Feb 2007 22:55:36 +0100") Message-ID: <0364ab557o.fsf@hod.lan.m-e-leypold.de> User-Agent: Some cool user agent (SCUG) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at discorde with ID 45CCF623.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 andrej:01 andrej:01 associative:01 bool:01 compiler:01 gcc:01 gcc:01 semantics:01 afaik:01 associative:01 matrices:01 markus:01 1.3:98 2.1:98 Andrej Bauer writes: > I hate to add to this long discussion, but since when is floating > point multiplication associative? > > # 1.3 *. (0.7 *. 2.1) = (1.3 *. 0.7) *. 2.1 ;; > - : bool = false Which just means, that "testing assoicativity" wouldn't work as a benchmark. Still I think the compiler (GCC) might take the license to optimize (a * b) *c == a * (b * c) to false with -O3. Gcc 4.1 is optimizing pretty aggressivly (yes even to the extend of doubtful, sometimes simply wrong semantics) AFAIK. > The suggestion that the results be tested for validity by checking the > associative law of multipliciation won't worky very well, and neither > will commutativity. In this case, instead of checking that A = B > holds, it's better to output the difference between A and B (in case A > and B are matrices, output the sup norm of the difference to keep it > down to a single number). :-) But wasn't I/O what Maxim wanted to avoid in a benchmark? Regards -- Markus