BUG: special: fix ufunc loop selection
BUG: special: fix ufunc loop selection

Prefer native ufunc signatures and sort signatures to cast order,
so that Numpy's ufunc machinery also picks the correct one.

jonycgn/scipy,anielsen001/scipy,maciejkula/scipy,efiring/scipy,chatcannon/scipy,mdhaber/scipy,vanpact/scipy,kalvdans/scipy,jjhelmus/scipy,aeklant/scipy,juliantaylor/scipy,gef756/scipy,Gillu13/scipy,vberaudi/scipy,trankmichael/scipy,ogrisel/scipy,endolith/scipy,behzadnouri/scipy,pschella/scipy,gertingold/scipy,apbard/scipy,vhaasteren/scipy,zxsted/scipy,fredrikw/scipy,matthewalbani/scipy,mikebenfield/scipy,mgaitan/scipy,behzadnouri/scipy,fredrikw/scipy,matthew-brett/scipy,mortada/scipy,Shaswat27/scipy,anntzer/scipy,hainm/scipy,hainm/scipy,ndchorley/scipy,mdhaber/scipy,mtrbean/scipy,aarchiba/scipy,maciejkula/scipy,Srisai85/scipy,Shaswat27/scipy,aman-iitj/scipy,gertingold/scipy,pbrod/scipy,cpaulik/scipy,aman-iitj/scipy,Dapid/scipy,jonycgn/scipy,haudren/scipy,ndchorley/scipy,jakevdp/scipy,vhaasteren/scipy,maniteja123/scipy,vigna/scipy,sauliusl/scipy,aman-iitj/scipy,pyramania/scipy,pyramania/scipy,pizzathief/scipy,nmayorov/scipy,josephcslater/scipy,gdooper/scipy,grlee77/scipy,kleskjr/scipy,witcxc/scipy,ortylp/scipy,giorgiop/scipy,scipy/scipy,sriki18/scipy,ortylp/scipy,vigna/scipy,felipebetancur/scipy,ales-erjavec/scipy,zaxliu/scipy,jseabold/scipy,tylerjereddy/scipy,pschella/scipy,Stefan-Endres/scipy,jseabold/scipy,sriki18/scipy,zxsted/scipy,ilayn/scipy,ortylp/scipy,befelix/scipy,ortylp/scipy,chatcannon/scipy,andyfaff/scipy,zaxliu/scipy,Dapid/scipy,andyfaff/scipy,Shaswat27/scipy,Stefan-Endres/scipy,ChanderG/scipy,trankmichael/scipy,maciejkula/scipy,kleskjr/scipy,Newman101/scipy,grlee77/scipy,newemailjdm/scipy,jamestwebber/scipy,nmayorov/scipy,sonnyhu/scipy,minhlongdo/scipy,arokem/scipy,hainm/scipy,richardotis/scipy,pschella/scipy,vanpact/scipy,vberaudi/scipy,jakevdp/scipy,pnedunuri/scipy,grlee77/scipy,apbard/scipy,jsilter/scipy,gef756/scipy,trankmichael/scipy,matthewalbani/scipy,niknow/scipy,anielsen001/scipy,pyramania/scipy,cpaulik/scipy,newemailjdm/scipy,person142/scipy,niknow/scipy,juliantaylor/scipy,scipy/scipy,apbard/scipy,ChanderG/scipy,kalvdans/scipy,dch312/scipy,Newman101/scipy,minhlongdo/scipy,aman-iitj/scipy,mikebenfield/scipy,nonhermitian/scipy,matthewalbani/scipy,haudren/scipy,cpaulik/scipy,njwilson23/scipy,piyush0609/scipy,bkendzior/scipy,mtrbean/scipy,futurulus/scipy,mikebenfield/scipy,bkendzior/scipy,behzadnouri/scipy,rmcgibbo/scipy,dominicelse/scipy,ChanderG/scipy,ales-erjavec/scipy,felipebetancur/scipy,futurulus/scipy,fernand/scipy,sargas/scipy,larsmans/scipy,richardotis/scipy,Srisai85/scipy,vanpact/scipy,mikebenfield/scipy,kalvdans/scipy,pbrod/scipy,gfyoung/scipy,Gillu13/scipy,futurulus/scipy,arokem/scipy,jseabold/scipy,richardotis/scipy,gdooper/scipy,maniteja123/scipy,minhlongdo/scipy,tylerjereddy/scipy,Eric89GXL/scipy,jor-/scipy,surhudm/scipy,jor-/scipy,raoulbq/scipy,mikebenfield/scipy,andim/scipy,gfyoung/scipy,jseabold/scipy,e-q/scipy,sonnyhu/scipy,ilayn/scipy,anntzer/scipy,Srisai85/scipy,woodscn/scipy,dch312/scipy,jamestwebber/scipy,maniteja123/scipy,larsmans/scipy,pizzathief/scipy,sriki18/scipy,gdooper/scipy,Kamp9/scipy,ilayn/scipy,befelix/scipy,matthew-brett/scipy,nmayorov/scipy,petebachant/scipy,njwilson23/scipy,befelix/scipy,njwilson23/scipy,sonnyhu/scipy,mhogg/scipy,lhilt/scipy,mhogg/scipy,perimosocordiae/scipy,aeklant/scipy,vberaudi/scipy,gertingold/scipy,sriki18/scipy,argriffing/scipy,zxsted/scipy,aarchiba/scipy,juliantaylor/scipy,mortonjt/scipy,newemailjdm/scipy,nonhermitian/scipy,vigna/scipy,lukauskas/scipy,FRidh/scipy,e-q/scipy,matthewalbani/scipy,aeklant/scipy,zerothi/scipy,befelix/scipy,efiring/scipy,argriffing/scipy,endolith/scipy,tylerjereddy/scipy,sriki18/scipy,jsilter/scipy,njwilson23/scipy,pnedunuri/scipy,trankmichael/scipy,josephcslater/scipy,ndchorley/scipy,person142/scipy,Newman101/scipy,pschella/scipy,person142/scipy,apbard/scipy,efiring/scipy,jseabold/scipy,mingwpy/scipy,surhudm/scipy,jakevdp/scipy,nonhermitian/scipy,fredrikw/scipy,pbrod/scipy,rgommers/scipy,dominicelse/scipy,nmayorov/scipy,Eric89GXL/scipy,matthewalbani/scipy,sauliusl/scipy,woodscn/scipy,rgommers/scipy,gef756/scipy,apbard/scipy,andyfaff/scipy,andyfaff/scipy,tylerjereddy/scipy,vigna/scipy,larsmans/scipy,nonhermitian/scipy,zerothi/scipy,zxsted/scipy,ogrisel/scipy,Stefan-Endres/scipy,andim/scipy,jamestwebber/scipy,gfyoung/scipy,Shaswat27/scipy,mgaitan/scipy,kleskjr/scipy,jakevdp/scipy,ortylp/scipy,FRidh/scipy,person142/scipy,larsmans/scipy,Kamp9/scipy,mingwpy/scipy,mtrbean/scipy,jamestwebber/scipy,woodscn/scipy,scipy/scipy,anntzer/scipy,jsilter/scipy,Eric89GXL/scipy,sonnyhu/scipy,Gillu13/scipy,pyramania/scipy,behzadnouri/scipy,felipebetancur/scipy,niknow/scipy,mhogg/scipy,jonycgn/scipy,jakevdp/scipy,aman-iitj/scipy,Kamp9/scipy,minhlongdo/scipy,mhogg/scipy,gdooper/scipy,gfyoung/scipy,gef756/scipy,argriffing/scipy,rmcgibbo/scipy,pyramania/scipy,matthew-brett/scipy,jjhelmus/scipy,zerothi/scipy,scipy/scipy,ales-erjavec/scipy,nvoron23/scipy,ogrisel/scipy,surhudm/scipy,mingwpy/scipy,njwilson23/scipy,zxsted/scipy,mingwpy/scipy,andyfaff/scipy,anntzer/scipy,sargas/scipy,jjhelmus/scipy,Kamp9/scipy,witcxc/scipy,bkendzior/scipy,mgaitan/scipy,scipy/scipy,perimosocordiae/scipy,mgaitan/scipy,pbrod/scipy,Eric89GXL/scipy,perimosocordiae/scipy,zerothi/scipy,raoulbq/scipy,matthew-brett/scipy,ilayn/scipy,niknow/scipy,petebachant/scipy,mortonjt/scipy,ilayn/scipy,mortonjt/scipy,felipebetancur/scipy,argriffing/scipy,vberaudi/scipy,Shaswat27/scipy,mdhaber/scipy,Shaswat27/scipy,matthew-brett/scipy,fernand/scipy,ogrisel/scipy,mdhaber/scipy,witcxc/scipy,chatcannon/scipy,rgommers/scipy,WillieMaddox/scipy,mdhaber/scipy,josephcslater/scipy,petebachant/scipy,josephcslater/scipy,andim/scipy,fernand/scipy,anielsen001/scipy,gertingold/scipy,Dapid/scipy,anntzer/scipy,hainm/scipy,woodscn/scipy,arokem/scipy,larsmans/scipy,lhilt/scipy,richardotis/scipy,jonycgn/scipy,niknow/scipy,dch312/scipy,maciejkula/scipy,zaxliu/scipy,WillieMaddox/scipy,zaxliu/scipy,cpaulik/scipy,Gillu13/scipy,nvoron23/scipy,maciejkula/scipy,fredrikw/scipy,pizzathief/scipy,futurulus/scipy,zaxliu/scipy,perimosocordiae/scipy,nvoron23/scipy,anntzer/scipy,efiring/scipy,vhaasteren/scipy,piyush0609/scipy,WarrenWeckesser/scipy,person142/scipy,ChanderG/scipy,futurulus/scipy,Newman101/scipy,dominicelse/scipy,behzadnouri/scipy,jsilter/scipy,aarchiba/scipy,endolith/scipy,rmcgibbo/scipy,vigna/scipy,minhlongdo/scipy,pbrod/scipy,bkendzior/scipy,Kamp9/scipy,kalvdans/scipy,pizzathief/scipy,mgaitan/scipy,Newman101/scipy,gertingold/scipy,nonhermitian/scipy,larsmans/scipy,Gillu13/scipy,cpaulik/scipy,mortonjt/scipy,gef756/scipy,Srisai85/scipy,witcxc/scipy,vhaasteren/scipy,haudren/scipy,pnedunuri/scipy,teoliphant/scipy,lukauskas/scipy,Stefan-Endres/scipy,lukauskas/scipy,FRidh/scipy,njwilson23/scipy,petebachant/scipy,jseabold/scipy,nvoron23/scipy,mtrbean/scipy,mgaitan/scipy,vanpact/scipy,fredrikw/scipy,fredrikw/scipy,niknow/scipy,Kamp9/scipy,WarrenWeckesser/scipy,grlee77/scipy,vberaudi/scipy,grlee77/scipy,mhogg/scipy,petebachant/scipy,behzadnouri/scipy,pnedunuri/scipy,teoliphant/scipy,mhogg/scipy,FRidh/scipy,surhudm/scipy,mtrbean/scipy,sargas/scipy,e-q/scipy,mortada/scipy,lhilt/scipy,lhilt/scipy,mingwpy/scipy,sargas/scipy,vhaasteren/scipy,perimosocordiae/scipy,rgommers/scipy,tylerjereddy/scipy,rmcgibbo/scipy,teoliphant/scipy,mortada/scipy,newemailjdm/scipy,jjhelmus/scipy,jsilter/scipy,richardotis/scipy,petebachant/scipy,vanpact/scipy,teoliphant/scipy,WillieMaddox/scipy,sauliusl/scipy,surhudm/scipy,sauliusl/scipy,WarrenWeckesser/scipy,efiring/scipy,WarrenWeckesser/scipy,lukauskas/scipy,aman-iitj/scipy,endolith/scipy,FRidh/scipy,sauliusl/scipy,jonycgn/scipy,chatcannon/scipy,Stefan-Endres/scipy,hainm/scipy,Dapid/scipy,arokem/scipy,WarrenWeckesser/scipy,ales-erjavec/scipy,zaxliu/scipy,pnedunuri/scipy,newemailjdm/scipy,aarchiba/scipy,WillieMaddox/scipy,vanpact/scipy,argriffing/scipy,hainm/scipy,maniteja123/scipy,Newman101/scipy,richardotis/scipy,juliantaylor/scipy,juliantaylor/scipy,aeklant/scipy,gfyoung/scipy,jjhelmus/scipy,argriffing/scipy,raoulbq/scipy,trankmichael/scipy,rgommers/scipy,piyush0609/scipy,lukauskas/scipy,ndchorley/scipy,pschella/scipy,arokem/scipy,chatcannon/scipy,vberaudi/scipy,Eric89GXL/scipy,andim/scipy,jor-/scipy,lhilt/scipy,gdooper/scipy,Eric89GXL/scipy,ChanderG/scipy,woodscn/scipy,ales-erjavec/scipy,felipebetancur/scipy,andim/scipy,zxsted/scipy,jor-/scipy,maniteja123/scipy,kalvdans/scipy,Dapid/scipy,jor-/scipy,fernand/scipy,maniteja123/scipy,FRidh/scipy,endolith/scipy,cpaulik/scipy,anielsen001/scipy,rmcgibbo/scipy,jamestwebber/scipy,haudren/scipy,piyush0609/scipy,zerothi/scipy,mingwpy/scipy,aarchiba/scipy,rmcgibbo/scipy,minhlongdo/scipy,perimosocordiae/scipy,zerothi/scipy,piyush0609/scipy,mortada/scipy,e-q/scipy,mortonjt/scipy,josephcslater/scipy,scipy/scipy,dominicelse/scipy,chatcannon/scipy,bkendzior/scipy,raoulbq/scipy,andim/scipy,ortylp/scipy,kleskjr/scipy,futurulus/scipy,befelix/scipy,mtrbean/scipy,newemailjdm/scipy,raoulbq/scipy,woodscn/scipy,mortada/scipy,endolith/scipy,giorgiop/scipy,felipebetancur/scipy,nvoron23/scipy,lukauskas/scipy,fernand/scipy,ndchorley/scipy,mdhaber/scipy,e-q/scipy,efiring/scipy,WillieMaddox/scipy,WarrenWeckesser/scipy,haudren/scipy,surhudm/scipy,pizzathief/scipy,anielsen001/scipy,haudren/scipy,nmayorov/scipy,ilayn/scipy,andyfaff/scipy,ales-erjavec/scipy,WillieMaddox/scipy,mortada/scipy,witcxc/scipy,aeklant/scipy,ndchorley/scipy,sargas/scipy,sonnyhu/scipy,sonnyhu/scipy,piyush0609/scipy,gef756/scipy,Srisai85/scipy,sriki18/scipy,giorgiop/scipy,dch312/scipy,Gillu13/scipy,Dapid/scipy,anielsen001/scipy,giorgiop/scipy,jonycgn/scipy,kleskjr/scipy,fernand/scipy,nvoron23/scipy,pbrod/scipy,raoulbq/scipy,dch312/scipy,Srisai85/scipy,Stefan-Endres/scipy,giorgiop/scipy,kleskjr/scipy,teoliphant/scipy,sauliusl/scipy,vhaasteren/scipy,ogrisel/scipy,trankmichael/scipy,mortonjt/scipy,pnedunuri/scipy,dominicelse/scipy,ChanderG/scipy,giorgiop/scipy