optimized handling of mixed signs

see issue #127