# Smallest Eigenvalue of a Moler Matrix

**URL:** https://discourse.julialang.org/t/smallest-eigenvalue-of-a-moler-matrix/10510
**Category:** Numerics
**Created:** [April 24, 2018, 5:20pm UTC](https://discourse.julialang.org/t/smallest-eigenvalue-of-a-moler-matrix/10510 "2018-04-24T17:20:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Hans\_W\_Borchers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hans_w_borchers/32/8481_2.png) [@Hans\_W\_Borchers](https://discourse.julialang.org/u/Hans_W_Borchers)
#### Post date: [April 24, 2018, 5:20pm UTC](https://discourse.julialang.org/t/smallest-eigenvalue-of-a-moler-matrix/10510/1 "2018-04-24T17:20:12Z")

</div>

For some (strange) reasons I got interested in the smallest eigenvalue of some larger Moler matrices.

```
using MatrixDepot
N = 100;
A = matrixdepot("moler", 100);

D, V = eig(A);
D
## -7.60989e-16 2.25006 ... 159.39 439.012 3934.28       

```

The small first value is not correct. Given that the determinant of A is always 1.0, and assuming that the larger eigenvalues (all except the first) are computed quite accurately, an estimate of the smallest eigenvalue would be

```
1 / prod(D[2:N])
## 5.600713750075904e-60

```

I confess I’m not sure how exact that might be – at least it looks plausible.

How can I use multi-precision arithmetic to compute the eigenvalues of such a matrix with high accuracy. Does the `eig()` function respect BigFloat numbers?  
Or how can I convert A to type Bigfloat, my attempt all ended in ERRORs.

---

<div class="post-metadata">

### Author: ![andreasnoack](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andreasnoack/32/27_2.png) [@andreasnoack](https://discourse.julialang.org/u/andreasnoack)
#### Post date: [April 24, 2018, 5:35pm UTC](https://discourse.julialang.org/t/smallest-eigenvalue-of-a-moler-matrix/10510/2 "2018-04-24T17:35:38Z")

</div>

> Does the eig() function respect BigFloat numbers?

No, but I have a generic version in my [`LinearAlgebra`](https://github.com/andreasnoack/LinearAlgebra.jl) package that does.

```julia
julia> eigvals(Hermitian(big.(A)))
100-element Array{BigFloat,1}:
 5.600713750075034165085810228763893486586071580437305200804564971581630599461852e-60
 2.250061901390757674844326435860334246692852862242433352735727313299503769592587
 2.250247728407830329429897008616706505028053480344333733662598874615179114153438
 2.250557850104686744287698216476708147421334753575430707168288163403483399462523
 2.250992883304446226119693246851165099984390400083428923194445049530425830741413
 2.251553695214128540284873292126553179600708061722409114892456975412502433101787
 2.252241407111241374948541997206620374265529867893736044272588337832369708647108
 2.253057399129699334219929420618106604897992407838617803516156434953817575465668
 2.25400331618029656891737571526405666210323626131091517498318264799251124406059
 2.255081075049581166883464571004909861498441236028020708438164489381035606694269
 2.256292872730104557075059659066177896488250463085521084681190440487074040600866
 2.257641196044752753963916591700358170038269760953492608071886381415099794399297
 ⋮
 9.534543173051246533291982300698306113562038414786506653860716803951035627223942
 1.101813340276408413756880604826630300368072844171881772952532155732374129842588e+01
 1.299439658160823658138349369301275110841621390165509428843594519674170322199607e+01
 1.570838225504344847997737477249262922458682047923149362289039789861749346374641e+01
 1.957885142309403665527591540265083421123154118766194484116338865402421870038438e+01
 2.537008100431492938594758173120782523596551601889930411223972698057345432324082e+01
 3.460031509982099631679977958357837776172910961364789714103547775039539510037556e+01
 5.064856634030538337039839892594914919243633180828954226948190245562885072384851e+01
 8.235182086884441378840856376255774780426258585671432930491446269986001400929265e+01
 1.593904552647182125308377757231958365456248837295405464512988882711449394962209e+02
 4.390117906183980337973418729447434347126292248782133964769880485462139855137129e+02
 3.934277448406249876105585619195395422788328735964810707337405408798242455345916e+03

```

So your estimate looks right.
