# Question about an old IMSL routine LEQT2F

**URL:** <https://fortran-lang.discourse.group/t/question-about-an-old-imsl-routine-leqt2f/10717>\
**Category:** Help\
**Created:** [February 12, 2026, 10:39pm UTC](https://fortran-lang.discourse.group/t/question-about-an-old-imsl-routine-leqt2f/10717 "2026-02-12T22:39:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rwmsu](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@rwmsu](https://fortran-lang.discourse.group/u/rwmsu)\
**Post date:** [February 12, 2026, 10:39pm UTC](https://fortran-lang.discourse.group/t/question-about-an-old-imsl-routine-leqt2f/10717/1 "2026-02-12T22:39:45Z")

</div>

I’m trying to recreate a program I wrote in grad school about 40 years ago that used the IMSL LEQT2F routine to solve an overdetermined matrix system. Unfortunately I can’t find any mention of the routine on the current IMSL documentation. I think it’s been replaced by a newer routine. My main question is does anyone know what the underlying solution method (QR, normal equations/LU factorization etc) was used in this routine. I presume there are equivalent routines in LAPACK, MKL etc.

---

<div class="post-metadata">

**Author:** ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)\
**Post date:** [February 12, 2026, 11:57pm UTC](https://fortran-lang.discourse.group/t/question-about-an-old-imsl-routine-leqt2f/10717/2 "2026-02-12T23:57:32Z")

</div>

ChatGPT, [citing](https://chatgpt.com/share/698e680c-4dc4-8005-861c-5d035206d154) a [1982 NASA report](https://ntrs.nasa.gov/api/citations/19820024089/downloads/19820024089.pdf), says

> LEQT2F was not (by itself) an “overdetermined least-squares” solver. In the older IMSL Fortran libraries it is documented as:
> 
> - “Linear equation solution - full storage mode - high accuracy solution” (i.e., it solves a square system A X = B).
> 
> - Internally it used an LU decomposition via the Crout algorithm, with an optional accuracy test and iterative improvement (refinement).
> 
> So the underlying method was **LU factorization (Crout variant) + optional iterative refinement**, not QR.

---

<div class="post-metadata">

**Author:** ![rwmsu](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@rwmsu](https://fortran-lang.discourse.group/u/rwmsu)\
**Post date:** [February 13, 2026, 12:20am UTC](https://fortran-lang.discourse.group/t/question-about-an-old-imsl-routine-leqt2f/10717/3 "2026-02-13T00:20:06Z")

</div>

@Beliavsky, Thanks. You are correct. I took a closer look at the code and found the theory writeup I did on it that I had stored separate from the code listing. The system matrix solved by LEQT2F was formed from the normal equations. I was thrown by the comment I had in the code about solving an overdetermined system. Amazing how much you can forget in a mere 40 years 😀
