Grzenio
Grzenio

Reputation: 36649

High precision numeric computations

I would like to explore numeric accuracy of a few different implementations of my algorithm (which works using standard double precision arithmetic). Unfortunately in many cases I don't know the correct result in closed form, so I need to find a way to calculate a benchmark result using some very high precision computations.

This is a fun project, so my constraints are: no budget for tools and preferably Linux platform. I know that Mathematica offers automatic error tracking and arbitrary-precision arithmetic, but I don't have the license. Execution speed is not an issue, because these high precision calculations are only going to be used for calculating the benchmarks.

What is the best way to code these high precision computations? I am looking for at least quad precision, but preferably even higher. My only idea so far was to use quad precision floating point types in C++.

Upvotes: 1

Views: 249

Answers (1)

Simon Byrne
Simon Byrne

Reputation: 7864

I find Julia great for this task. Among the advantages

  • It is very easy to write, and has a convenient REPL or can use the IPython notebook interface.
  • It comes with a native arbitrary-precision BigFloat type, which wraps the MPFR library, and a BigInt which wraps the GMP library.
  • It is very east to "peek under the hood", to see what other methods do, and look at the llvm and native assembly code.

Upvotes: 1

Related Questions