License of code accompanying a published article Given a paper that introduces a new algorithm and upon publication copyright is transferred to the publisher.

Is an implementation of the presented algorithm considered a derivative of the published article, hence falls under its copyright?
Or can someone implement the algorithm at any time making it available under GNU independently of the published paper?
What happens if the author published the code under GNU license before submitting the paper that derives and explains the algorithm in detail?

I guess, on a more abstract level, my question is, how paper and code relate to each other?
Copyright only protects the expression of a work that is written down or otherwise placed in a "fixed medium." It does not apply to ideas or concepts. 

In the case of a published article where copyright is transferred to the publisher, that copyright only applies to the written content and images in the article. It doesn't apply to the concepts in it. 

If you write source code based on concepts described in a paper, you can apply whatever license you want to it - the copyright status of the paper is not relevant. (If the idea is patented, you may have to deal with that... but that is not related to copyright of the published article.)

See Does copyright protect the author's creative ideas? for more information.