You should maybe ask the author of the function library:
Special Function(s) for C#[
^]. At the bottom of the article there is a discussion forum.
You could also download the source code and look at how he implemented that function.
Regards,
— Manfred