What is the best blas/lapack library for quad precision (128 bit floating point)?

I supposes that the reference fortran versions can be compiled as quad precision?

This library would need to be callable from both Fortran and C++. I would be using this with the __float128 datatype from the gnu compilers.


You could use the Eigen linear algebra template library for C++. It is pretty complete with regards to BLAS and LAPACK functions and the interfaces are much easier to use (in my opinion).

A word of warning: You might quickly run into problems with the __float128 datatype because fundamental operation like e.g. log are not implemented.

#include <Eigen/Core>

typedef Eigen::Matrix<__float128,Eigen::Dynamic,Eigen::Dynamic> MatrixXf128;

int main() {
    MatrixXf128 m(2,2);
    m << 1.0, 2.0, 3.0, 4.0;

    MatrixXf128 m2 = m * m;
|improve this answer|||||
  • Thanks for your answer. I did not want to rewrite my code, so I ended up compiling the blas/lapack routines I needed using gfortran with "-freal-8-real-16". gfortran maps transcendentals to intrinsic functions. The boost float128 header maps these functions similar to their double counterparts. – Juan Mar 19 '18 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.