Re: Computer Algebra Algorithms lisp vs. C. BENCHMARKS?
- From: Jon Harrop <usenet@xxxxxxxxxxxxxx>
- Date: Wed, 20 Apr 2005 08:25:43 +0100
Richard Fateman wrote:
> If we can decide on a few algorithms to code, we could look at
> the programs, each written by an advocate of a particular language,
> and see which is
>
> smaller,
> faster
> more portable
> simpler to write
> more general.
Sounds like fun. :-)
> An example that comes to mind is Karatsuba-style multiplication
> of two polynomials.
Ok. I expect that many such programs have already been written in OCaml.
> (You can look up the method via google. I found a partial solution
> in "meta-Ocamal" at
> http://www.infosun.fmi.uni-passau.de/cl/metaprog/cmpp2004prog.ml
Just to clarify, MetaOCaml is a multistage programming language. In theory,
it allows you to specify parts of your program to be compiled first
(typically for partially specialising the program over part of the data).
For example, you could partially specialise an ipow function over the
exponent 3 to get a function which cubes its input, equivalent to:
let pow3 x = x *. x *. x;;
In practice, the MetaOCaml compiler currently only targets bytecode and not
native code.
> I have a solution in lisp, too.
> I assume someone has a solution in C.
This should make for an interesting comparison.
> There are some questions about what to include. For example, in C, or
> OCAML do you have to include the source code for the arbitrary precision
> arithmetic?
> In Lisp, Maple, Mathematica, etc. such facilities are part of the
> language.
Yes, this is also true of OCaml. If you have ocaml installed then just type
ocamlbrowser to get a GUI browser of the standard library. Have a look at
the "Num" module.
--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.
- References:
- Re: Computer Algebra Algorithms
- From: JohnCreighton_
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Bernard Parisse
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Jon Harrop
- Re: Computer Algebra Algorithms lisp vs. C.
- From: parisse
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Richard J. Fateman
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Jon Harrop
- Re: Computer Algebra Algorithms lisp vs. C.
- From: parisse
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Jon Harrop
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Bernard Parisse
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Jon Harrop
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Bernard Parisse
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Jon Harrop
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Bernard Parisse
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Jon Harrop
- Re: Computer Algebra Algorithms lisp vs. C.
- From: bernard parisse
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Jon Harrop
- Re: Computer Algebra Algorithms lisp vs. C.
- From: bernard parisse
- Re: Computer Algebra Algorithms lisp vs. C.
- From: Jon Harrop
- Re: Computer Algebra Algorithms lisp vs. C.
- From: bernard parisse
- Re: Computer Algebra Algorithms lisp vs. C. BENCHMARKS?
- From: Richard Fateman
- Re: Computer Algebra Algorithms
- Prev by Date: Re: Computer Algebra Algorithms lisp vs. C.
- Next by Date: Re: Computer Algebra Algorithms lisp vs. C.
- Previous by thread: Re: Computer Algebra Algorithms lisp vs. C. BENCHMARKS?
- Next by thread: Re: Computer Algebra Algorithms lisp vs. C. BENCHMARKS?
- Index(es):
Relevant Pages
|