First attempt at fusing Baerlocher's joint limit handling with
Mistry's priority scheme, with a little twist to distinguish hard from
soft joint limits. The new algorithm should in this case perform
exactly like Mistry's, but something is still amiss (noticed an
instability that appeared to be caused by the secondary slightly
influencing the primary).
Ah, I'm sure I made that mistake before:
std::numeric_limits<double>::min() is NOT the smallest value in the
sense of "the farthest towards the left". For that you need to say
"-std::numeric_limits<double>::max()".
Rough-cut joint limit handling works, but it is definitely too
simplistic: when a joint limit is hit, it sacrifices the primary task
no matter what and jumps to the soft limit. That creates rapid
oscillations as the joint limit is respected in the next step, which
pulls it into violation again, etc.

Will implement something smarter now...