Name

assert_acoscond — Computes the condition number of the acos function.

Calling Sequence

   [c,y] = assert_acoscond ( x )
   
   

Parameters

x :

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 acos function. The acos function has a large condition number if

  • x is close to 1,
  • x is close to -1,

<latex> \begin{eqnarray} c(x) = \left| \frac{x}{\sqrt{1-x^2}\arccos(x)} \right| \end{eqnarray} </latex>

Examples

[c,y] = assert_acoscond ( 0.5 )        // c~1
[c,y] = assert_acoscond ( 1-%eps/2 )   // c~10^7
[c,y] = assert_acoscond ( -1+%eps/2 )  // c~10^7
assert_acoscond ( -1 ) // %inf
assert_acoscond ( 1 )  // %inf
assert_acoscond ( 0 )  // 0

assert_plotcond ( "acos" , linspace(-1,1,1000) );

   

Authors

Michael Baudin, DIGITEO, 2010