The Impact of Compilation Flags and Choosing Single- or Double-Precision Variables in Linear Systems Solvers

R. C. Brum, M. C. S. de Castro, C. O. Faria


This paper intends to show the impact of compiler optimization flags and the variable's precision on direct methods to solve linear systems. The chosen six methods are simple direct methods, so our work could be a study for new researchers in this field. The methods are LU decomposition, LDU decomposition, Gaussian Elimination, Gauss-Jordan Elimination, Cholesky decomposition, and QR decomposition using the Gram-Schmidt orthogonalization process. Our study showed a huge difference in time between single- and double-precision in all methods, but the error encountered in the single-precision was not so high. Also, the best flags to these methods were the `-O3' and the `-Ofast' ones.


Linear systems, Compiler flags, Optimization, Variable precision

Full Text:



G. H. Golub and C. F. Van Loan, Matrix Computations (3rd Ed.). Baltimore, MD, USA: Johns Hopkins University Press, 1996.

J. W. Demmel, Applied Numerical Linear Algebra. SIAM, Jan. 1997.

D. S. Watkins, Fundamentals of matrix computations. Pure and applied mathematics, New York: Wiley-Interscience, 2nd ed ed., 2002.

M. C. C. Cunha, Métodos numéricos. Editora da UNICAMP, 2003.

D. A. Patterson and J. L. Hennessy, Organização e projeto de computadores: interface hardware/software. Elsevier Brasil, 2014.

A. F. G. Ascencio and E. A. V. d. Campos, Fundamentos da programação de computadores: algoritmos, Pascal, C/C++ e Java. São Paulo: Pearson Prentice Hall, 2008.

T. Botor and H. Habiballa, “Compiler optimization for scientific computation in C/C++,” (Thessaloniki, Greece), p. 030004, 2018.

K. Hoste and L. Eeckhout, “Cole: compiler optimization level exploration,” in Proceedings of the 6th annual IEEE/ACM international symposium on Code generation and optimization, pp. 165–174, ACM, 2008., 2016 (accessed December 6, 2018)., 2017 (accessed December 6, 2018).

M. A. G. Ruggiero and V. L. d. R. Lopes, Cálculo numérico: aspectos teóricos e computacionais. Makron Books do Brasil, 1997.


Article Metrics

Metrics Loading ...

Metrics powered by PLOS ALM


  • There are currently no refbacks.

Trends in Computational and Applied Mathematics

A publication of the Brazilian Society of Applied and Computational Mathematics (SBMAC)


Indexed in:




Desenvolvido por:

Logomarca da Lepidus Tecnologia