I have found a GPL library (no dual license), which does exactly what I need. Unfortunately, the GPL license on the library is incompatible with the license of a different library I use. I have therefore decided to rewrite the GPL library, so the license can be changed.
My question is: How extensive do the changes need to be to the library in order to be able to change the license? In other words, what is the cheapest way to do this?