Version française
Home     About     Download     Resources     Contact us    
Browse thread
Multiplication of matrix in C and OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Multiplication of matrix in C and OCaml
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