ivan-pi / y12m

Solution of Large and Sparse Systems of Linear Algebraic Equations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create double precision version of `y12mfe`

ivan-pi opened this issue · comments

The routine y12mfe applies Gaussian elimination with subsequent iterative refinement of the solution. The residuals are calculated in double precision, and then downcast to reals.

Since quadruple precision is not guaranteed to be available on all compilers, to create the double precision version y12mff preserve the original algorithm in y12mfe, some other trick is necessary.

The residuals are defined here (note only er,er1,er2 appear to be used)

double precision ext,er,er1,er2,err,e

We can use selected_real_kind to try and select a real kind with higher precision (either extended double precision or quadruple). If none of these are available the return value is negative. In that case we could use double-double arithmetic.

A few implementations are available for reference:

By the looks of things we only need subtraction and multiplication.