IANAL answer: if you want to release under a different license, you are urged to do a "clean room" implementation that could not possibly have derived anything from the original. If it's a mere translation from one language to another, your version of the library almost certainly falls under the "derivative work" category and needs to be GPL.
If your library implements a well-known algorithm, try to track down a text description of that algorithm (say, a research paper) and redo the code based on that original source. Looking at GPL code can contaminate your final product.