Custom distribution-optimized gradient tested