Enter forum description here ...
0
À l'étude

Performance of besselh function

Michael_ il y a 7 ans mis à jour par Pavel Holoborodko il y a 7 ans 1

Hello Pavel.


I noticed some performance issues with the besselh-function.

I used mp.Digits(34), mp.GuardDigits(0) and got the following


value=mp(rand(100,100));
tic
value1=besselh(mp('2'),2,mp('1i').*value);
toc
tic
value2=besselj(mp('2'),mp('1i').*value)-mp('1i')*bessely(mp('2'),mp('1i').*value);
toc
tic
value3=besselk(mp('2'),-value)*mp('2')/(mp('1i')*mp('pi'));
toc
Elapsed time is 3.986968 seconds.
Elapsed time is 1.879375 seconds.
Elapsed time is 0.772351 seconds.

which gives of course the same results for value1, value2 and value3. Any possibilty to enhance the performance of besselh to that of besselk?


Best regrads,

Michael


0
Résolu

Will the Multiprecision Computing Toolbox work under WindowsXP x32?

Segey il y a 7 ans mis à jour il y a 7 ans 2

Will the Multiprecision Computing Toolbox work under WindowsXP x32?

0
Corrigé

Bug in function isreal

Michael_ il y a 7 ans mis à jour par Pavel Holoborodko il y a 7 ans 2

Hello Pavel.


I found another bug in the isreal() function.


If we store real and complex data in the same array, the function isreal() gives always 0, even for entries with 0 imaginary part.


test(1,1)=mp('1i');
test(1,2)=mp('1');
isreal(test(1,1))
isreal(test(1,2))

ans =

  logical

   0

ans =

  logical

   0

This is differnt compared to the standard Matlab behaviour:


test(1,1)=1i;
test(1,2)=1;
isreal(test(1,1))
isreal(test(1,2))

ans =

  logical

   0

ans =

  logical

   1

Best regards,

Michael

0
Pas un bug

Error in contourf plots

Michael_ il y a 7 ans mis à jour il y a 7 ans 2

Hello Pavel.

There are some problems with contourf plots "contourf(X,Y,Z,v)" and multiprecision data. Setting the different levels with the parameter "v" does not work properly using multi-precision data. Furthermore using caxis(limits) with multiprecision data leads to an error.


Best regards,

Michael

0
Résolu

mp linprog support

Michal Kvasnicka il y a 7 ans mis à jour il y a 5 ans 4

Is there any possibility to use matlab function linprog with mp class?

0
Corrigé

Airy Functions of Imaginary Argument

Tom Wallace il y a 7 ans mis à jour par Pavel Holoborodko il y a 7 ans 2

There appears to be an error in computing the values of Airy functions and their derivatives of purely imaginary argument unless z is exactly 0. For example:


>> z = 1i; [ airy(0, z) airy(1, z) airy(2, z) airy(3, z) ].'

ans =

          0.331493305432141 -     0.317449858968444i
         -0.432492659841807 +    0.0980478562292432i
          0.648858208330395 +     0.344958634768048i
          0.135026646710819 -     0.128837386781255i

>> z = mp('1i'); [ airy(0, z) airy(1, z) airy(2, z) airy(3, z) ].'

ans =

        0    
        0    
        0    
        0  

This bug seems to affect only values of z with exactly zero real part:


>> z = mp('1e-100+1i'); [ airy(0, z) airy(1, z) airy(2, z) airy(3, z) ].'

ans =

         0.3314933054321411889845293326171343 -      0.3174498589684437734776429279092585i    
        -0.4324926598418070993062086217182285 +     0.09804785622924323238379104639440311i    
          0.648858208330394944584847653172865 +      0.3449586347680483702471086086672932i    
         0.1350266467108189726991698591958052 -       0.128837386781254879039817640967921i


Mathematica, for comparison


In[9]:= N[ { AiryAi[I], D[AiryAi[x], x] /. x -> I,  AiryBi[I],  D[AiryBi[x], x] /. x -> I }, 34]

Out[9]= {0.3314933054321411889845293326171343 -   0.3174498589684437734776429279092585 I,
-0.4324926598418070993062086217182286 +   0.0980478562292432323837910463944031 I,
 0.6488582083303949445848476531728650 +   0.3449586347680483702471086086672933 I,
 0.1350266467108189726991698591958051 -   0.1288373867812548790398176409679211 I}



0
Résolu

new releases policy

Michal Kvasnicka il y a 7 ans mis à jour par Pavel Holoborodko il y a 7 ans 2

There are obviously new releases for Windows during last few days, but not the same releases (relevant to same bug)  for Linux or OSX.


What is exactly the new releases policy? When will be available latest releases for Linux?

0
Corrigé

Error using mp/subsasgn: Subscripted assignment dimension mismatch.

Jon Vegard il y a 7 ans mis à jour par Manolis Chatzis il y a 3 ans 13

The following subscript assignment works fine in MATLAB, but not with the MP-toolbox. Obviously workaround exists, but this type of assignments are truly convenient.

A = zeros(3,3,3);
B = ones(3,1);
A(1,1,:) = B;

A = zeros(3,3,3,'mp');
B = ones(3,1,'mp');
A(1,1,:) = B;

0
Pas un bug

exp() speed windows vs linux comparison

Michal Kvasnicka il y a 7 ans mis à jour par Pavel Holoborodko il y a 7 ans 5

Hi I am trying to compare latest versions MCT exp() speed on two platforms (windows and linux). 

Windows:

Windows 7 Pro 64bit, Matlab R2017b, MCT 4.4.4 Build 12668

Linux:

Ubuntu 16.04.3 64bit, Matlab R2017b, MCT 4.4.4 Build 12666


I found very strange results:


rng(1), n = 1000;
A = randn(n); A_mp = mp(A,34);

t = clock; X = exp(A);     t_dp = etime(clock, t)
t = clock; X = exp(A_mp);  t_mp = etime(clock, t)


Windows:

t_dp =

    0.0260

t_mp =

    0.0550


Linux:

t_dp =

    0.0065

t_mp =

    0.2184


Windows and Linux PC has different HW (Linux PC is significantly faster ... see double precision timing), but on linux is quadruple precision computing significantly slower.


Is there some bug in Linux release?



0
Terminé

Overload element-wise operators

Jason Nicholson il y a 7 ans mis à jour par Pavel Holoborodko il y a 6 ans 4

I think element-wise operators need overloaded. Here is an example of why. With double precision in MATLAB, this works. I think it should work for the mp data type too.


>> x = 1:10, y = (11:20)'

x =

     1     2     3     4     5     6     7     8     9    10

y =

    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

>> A = x.*y

A =

    11    22    33    44    55    66    77    88    99   110
    12    24    36    48    60    72    84    96   108   120
    13    26    39    52    65    78    91   104   117   130
    14    28    42    56    70    84    98   112   126   140
    15    30    45    60    75    90   105   120   135   150
    16    32    48    64    80    96   112   128   144   160
    17    34    51    68    85   102   119   136   153   170
    18    36    54    72    90   108   126   144   162   180
    19    38    57    76    95   114   133   152   171   190
    20    40    60    80   100   120   140   160   180   200

>> A = mp(x).*mp(y)
Error using  .*  (line 1644)
Matrix dimensions must agree