MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: trap divide error with sqrt

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123464] Re: trap divide error with sqrt
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Thu, 8 Dec 2011 05:24:20 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201112071114.GAA04174@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

No... THIS is your matrix:

b = {{0.47500000000000003`, 0, 0, 0.45`}, {0, 0.025`, 0, 0}, {0, 0,
    0.025`, 0}, { 0.45`, 0, 0, 0.47500000000000003`}}

Try copying your version from e-mail and pasting into Mathematica, and see  
what happens.

Copy as InputForm (or usually just Copy) from Mathematica and Paste into  
e-mail will save a lot of trouble.

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)"

Bobby

On Wed, 07 Dec 2011 05:14:01 -0600, 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 mtrr 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
>


-- 
DrMajorBob at yahoo.com



  • Prev by Date: Re: trap divide error with sqrt
  • Next by Date: Re: Plot Legends For Side By Side Graphs
  • Previous by thread: Re: trap divide error with sqrt
  • Next by thread: Re: Ragged region boundary