Re: trap divide error with sqrt
- To: mathgroup at smc.vnet.net
- Subject: [mg123488] Re: trap divide error with sqrt
- From: Bob Hanlon <hanlonr357 at gmail.com>
- Date: Thu, 8 Dec 2011 05:29:03 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201112071114.GAA04174@smc.vnet.net>
No problem on my Mac with either v7 or v8 $Version "7.0 for Mac OS X x86 (64-bit) (November 11, 2008)" B = { {0.47500000000000003`, 0, 0, 0.45`}, {0, 0.025`, 0, 0}, {0, 0, 0.025`, 0}, {0.45`, 0, 0, 0.47500000000000003`}}; val = Eigenvalues[B] {0.925, 0.025, 0.025, 0.025} Sqrt[val] {0.961769, 0.158114, 0.158114, 0.158114} $Version "8.0 for Mac OS X x86 (64-bit) (October 5, 2011)" B = { {0.47500000000000003`, 0, 0, 0.45`}, {0, 0.025`, 0, 0}, {0, 0, 0.025`, 0}, {0.45`, 0, 0, 0.47500000000000003`}}; val = Eigenvalues[B] {0.925, 0.025, 0.025, 0.025} Sqrt[val] {0.961769, 0.158114, 0.158114, 0.158114} Bob Hanlon On Wed, Dec 7, 2011 at 6:14 AM, Silvio Abruzzo <silvio.abruzzo at gmail.com> wrote: > Dear all, > from some calculation I obtain the matrix: > > B=(0.47500000000000003` 0 0 0.45` > 0 0.025` 0 0 > 0 0 0.025` 0 > 0.45` 0 0 0.47500000000000003`) > > I would like to calculate the square root of its eigenvalues > > In[5]:= val=Eigenvalues[B] > Out[5]= {0.925,0.025,0.025,0.025} > In[6]:= Sqrt[val] > > after the last command everything becomes blue and if I run dmesg in a > linux console I obtain > > [ 364.840432] MathKernel[9605] trap divide error ip:18e7f18 sp: > 7fffd421c100 error:0 in MathKernel[400000+2547000] > > This is really strange and I don't understand the reason. > I would like to point out that if I calculate the single square root > with > > Table[Sqrt[val[[i]]], {i,1, Length[val]}], > I don't have any problems. > > Do you have any suggestions? Do you understand where is the problem in > my code? > I am using Mathematica 7 and my cpu is > > processor : 0 > vendor_id : GenuineIntel > cpu family : 6 > model : 42 > model name : Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz > stepping : 7 > cpu MHz : 800.000 > cache size : 3072 KB > physical id : 0 > siblings : 4 > core id : 0 > cpu cores : 2 > apicid : 0 > initial apicid : 0 > fpu : yes > fpu_exception : yes > cpuid level : 13 > wp : yes > flags : fpu vme de pse tsc msr pae mce cx8 apic sep m= trr pge > mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe > syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl > xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl > vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt xsave avx > lahf_lm arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept > vpid > bogomips : 4191.12 > clflush size : 64 > cache_alignment : 64 > address sizes : 36 bits physical, 48 bits virtual > power management: > > Thank you very much in advance. > Regards, > Silvio >
- References:
- trap divide error with sqrt
- From: Silvio Abruzzo <silvio.abruzzo@gmail.com>
- trap divide error with sqrt