Sub Ex_Pchcm()
Const N = 4
Dim X(N - 1) As Double, Y(N - 1) As Double, D(N - 1) As Double
Dim Ismon(N - 1) As Long, Info As Long
'-- Data
X(0) = 0.1: Y(0) = -2.3026
X(1) = 0.11: Y(1) = -2.2073
X(2) = 0.12: Y(2) = -2.1203
X(3) = 0.13: Y(3) = -2.0402
'-- Cubic Hermite interpolation
Call Pchim(N, X(), Y(), D(), Info)
If Info <> 0 Then
Debug.Print "Error in Pchim: Info =", Info
Exit Sub
End If
'-- Check monotonicity
Call Pchcm(N, X(), Y(), D(), Ismon(), Info)
Debug.Print Ismon(0), Ismon(1), Ismon(2), Ismon(3)
Debug.Print "Info =", Info
End Sub