Name

assert_powcond — Computes the condition number of the pow function.

Calling Sequence

   [c,y] = assert_powcond ( x , a )
   
   

Parameters

x :

a n-by-m matrix of doubles

a :

a n-by-m matrix of doubles

c :

a n-by-m matrix of doubles, the condition number

y :

a n-by-m, matrix of doubles, the function values

Description

Computes the condition number of the pow function. The pow function has a large condition number if a is large.

<latex> \begin{eqnarray} c(x) = |a| \end{eqnarray} </latex>

Examples

// Good condition
[c,y] = assert_powcond ( 2 , 5 )

// Extremelly bad condition
[c,y] = assert_powcond ( 1.000000000000001 , 1.e15 )
expected = 2.718281828459043876 // With Mathematica

// Another one : http://bugzilla.scilab.org/show_bug.cgi?id=4048
y = 0.9999999999999999^-18014398509482000
[c,y] = assert_powcond ( 0.9999999999999999 , -18014398509482000 )
expected = 6.05836432903779269 // With XCAS

   

Authors

Michael Baudin, DIGITEO, 2010