Image Blog IMSL vs. Open Source
November 26, 2014

IMSL vs. Open Source Algorithms: Free Doesn’t Always Mean Better

Open Source
Embedded Analytics

When it comes to error handling, it's better to have it available and never use it than not have it and need it. In this article, I look at why the lack of error handling in open source algorithms can spell big problems for developers and end-users alike.

Error Handling in Open Source Algorithms

Recently, one of my account executives asked: “Why does IMSL go to such lengths to add error handling?”

Well, because our customers can’t afford even just one wrong answer.

I also get asked: “Why can’t I just use open source algorithms? Don’t they produce the same results?”

Simply put, open source algorithms are not always the best answer. IMSL Numerical Libraries offer more error handling than open source libraries (and sometimes, they offer none!). I hear stories of using open source libraries where research or business decisions are based on results from algorithms that are later found to be incorrect. Or the problems were ill-conditioned for the algorithm selected, yet the algorithm provided an answer.

How IMSL Handles Error Handling

IMSL has been around for over 40 years, so not only do our customers trust the results, but we have an established system for error handling.

We first verify proper input to set up the problem and, if something looks wrong, tell them why the input is incorrect. Second, we inform them during execution whether the algorithm is making good progress or not, we check for any ill-conditioning that cannot be determined strictly from input parameters, and we check for numerical instability that might cause the execution of the algorithm to crash unexpectedly. The resulting error message provides a nice exit from the algorithm and provides suggestions of what to do next. IMSL error messages can be caught, allowing the calling program to determine next steps based on the error caught from IMSL. Open source algorithms don’t offer this level of security.

Without proper error checking in IMSL, the algorithms might provide incorrect results or solve ill-conditioned problems and provide results that are incorrect. Worse case, without proper error checking, an algorithm could cause the application to crash unexpectedly.

IMSL Optional Arguments

Another critical feature about the IMSL algorithms is their optional arguments, which allow a great deal of flexibility, allowing the user to have control over how the algorithm behaves.

In IMSL, computations are not affected by underflow if the system replaces an underflow with the value zero. Therefore, normally system error messages indicating underflow can be ignored. IMSL also avoids overflow. A program that produces system error messages indicating overflow should be examined for programming errors such as incorrect input data, mismatch of argument types, or improper dimensions. In many cases, to help the developer out, the documentation for a function points out common pitfalls that can lead to failure of the algorithm.

Final Thoughts

When you want to know exactly what’s going on – and need to know whether the algorithm is working correctly – ditch the open source algorithms and use IMSL Numerical Libraries.

📘 Related Resource: Learn more about Open Source Security

Want to try an IMSL numerical library on your project? Click the button below to try free.

Try IMSL For Free