It's not about binary vs. non binary research, but about what your average slider gold rate is over many turns. If on average you run 25% gold and 75% science on the slider, then the library's bonus applies 3 times as often as the market's as long as we're considering the sources of commerce (rather than sources of raw gold like a shrine). So for example, on a city with 48 base commerce, library bonus science is 9 and market bonus gold is only 3 per turn, and market is 5/3 the cost of lib, so library starts generating a profit in 1/5 the time than market does. This is quite a difference and gets worse if you maintain a higher average slider rate.
But also to reply to the person above saying merchants are worse than scientists, this is not always the case. If you have libraries in all important commerce cities, 1000 gold from a trade mission is worth about 1500 final beakers of research, because it gets multiplied by 1.25 by the libraries and then the beakers applied to the tech are most often 1.2x the beakers generated by the slider because of the prereq bonus. BUT the payoff is long term whereas the GS bulb is immediate, and that's more important at high difficulties when you can gain a momentum advantage, trade a good tech, etc.