_ufuncs.pyx 549 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240
  1. # This file is automatically generated by _generate_pyx.py.
  2. # Do not edit manually!
  3. from libc.math cimport NAN
  4. include "_ufuncs_extra_code_common.pxi"
  5. include "_ufuncs_extra_code.pxi"
  6. __all__ = ['agm', 'bdtr', 'bdtrc', 'bdtri', 'bdtrik', 'bdtrin', 'betainc', 'betaincc', 'betainccinv', 'betaincinv', 'boxcox', 'boxcox1p', 'btdtria', 'btdtrib', 'chdtr', 'chdtrc', 'chdtri', 'chdtriv', 'chndtr', 'chndtridf', 'chndtrinc', 'chndtrix', 'elliprc', 'elliprd', 'elliprf', 'elliprg', 'elliprj', 'entr', 'erfcinv', 'erfinv', 'eval_chebyc', 'eval_chebys', 'eval_chebyt', 'eval_chebyu', 'eval_gegenbauer', 'eval_genlaguerre', 'eval_hermite', 'eval_hermitenorm', 'eval_jacobi', 'eval_laguerre', 'eval_legendre', 'eval_sh_chebyt', 'eval_sh_chebyu', 'eval_sh_jacobi', 'eval_sh_legendre', 'expn', 'fdtr', 'fdtrc', 'fdtri', 'fdtridfd', 'gdtr', 'gdtrc', 'gdtria', 'gdtrib', 'gdtrix', 'huber', 'hyp0f1', 'hyp1f1', 'hyperu', 'inv_boxcox', 'inv_boxcox1p', 'kl_div', 'kn', 'kolmogi', 'kolmogorov', 'lpmv', 'nbdtr', 'nbdtrc', 'nbdtri', 'nbdtrik', 'nbdtrin', 'ncfdtr', 'ncfdtri', 'ncfdtridfd', 'ncfdtridfn', 'ncfdtrinc', 'nctdtr', 'nctdtridf', 'nctdtrinc', 'nctdtrit', 'ndtri', 'ndtri_exp', 'nrdtrimn', 'nrdtrisd', 'owens_t', 'pdtr', 'pdtrc', 'pdtri', 'pdtrik', 'poch', 'powm1', 'pseudo_huber', 'rel_entr', 'round', 'shichi', 'sici', 'smirnov', 'smirnovi', 'spence', 'stdtr', 'stdtridf', 'stdtrit', 'tklmbda', 'wrightomega', 'yn', 'geterr', 'seterr', 'errstate', 'jn', 'airy', 'airye', 'bei', 'beip', 'ber', 'berp', 'binom', 'exp1', 'expi', 'expit', 'exprel', 'gamma', 'gammaln', 'hankel1', 'hankel1e', 'hankel2', 'hankel2e', 'hyp2f1', 'it2i0k0', 'it2j0y0', 'it2struve0', 'itairy', 'iti0k0', 'itj0y0', 'itmodstruve0', 'itstruve0', 'iv', 'ive', 'jv', 'jve', 'kei', 'keip', 'kelvin', 'ker', 'kerp', 'kv', 'kve', 'log_expit', 'log_wright_bessel', 'loggamma', 'logit', 'mathieu_a', 'mathieu_b', 'mathieu_cem', 'mathieu_modcem1', 'mathieu_modcem2', 'mathieu_modsem1', 'mathieu_modsem2', 'mathieu_sem', 'modfresnelm', 'modfresnelp', 'obl_ang1', 'obl_ang1_cv', 'obl_cv', 'obl_rad1', 'obl_rad1_cv', 'obl_rad2', 'obl_rad2_cv', 'pbdv', 'pbvv', 'pbwa', 'pro_ang1', 'pro_ang1_cv', 'pro_cv', 'pro_rad1', 'pro_rad1_cv', 'pro_rad2', 'pro_rad2_cv', 'psi', 'rgamma', 'wright_bessel', 'yv', 'yve', 'zetac', 'sindg', 'cosdg', 'tandg', 'cotdg', 'i0', 'i0e', 'i1', 'i1e', 'k0', 'k0e', 'k1', 'k1e', 'y0', 'y1', 'j0', 'j1', 'struve', 'modstruve', 'beta', 'betaln', 'besselpoly', 'gammaln', 'gammasgn', 'cbrt', 'radian', 'cosm1', 'gammainc', 'gammaincinv', 'gammaincc', 'gammainccinv', 'fresnel', 'ellipe', 'ellipeinc', 'ellipk', 'ellipkinc', 'ellipkm1', 'ellipj', 'erf', 'erfc', 'erfcx', 'erfi', 'voigt_profile', 'wofz', 'dawsn', 'ndtr', 'log_ndtr', 'exp2', 'exp10', 'expm1', 'log1p', 'xlogy', 'xlog1py']
  7. cdef void loop_D_DDDD__As_DDDD_D(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  8. cdef np.npy_intp i, n = dims[0]
  9. cdef void *func = (<void**>data)[0]
  10. cdef char *func_name = <char*>(<void**>data)[1]
  11. cdef char *ip0 = args[0]
  12. cdef char *ip1 = args[1]
  13. cdef char *ip2 = args[2]
  14. cdef char *ip3 = args[3]
  15. cdef char *op0 = args[4]
  16. cdef double complex ov0
  17. for i in range(n):
  18. ov0 = (<double complex(*)(double complex, double complex, double complex, double complex) noexcept nogil>func)(<double complex>(<double complex*>ip0)[0], <double complex>(<double complex*>ip1)[0], <double complex>(<double complex*>ip2)[0], <double complex>(<double complex*>ip3)[0])
  19. (<double complex *>op0)[0] = <double complex>ov0
  20. ip0 += steps[0]
  21. ip1 += steps[1]
  22. ip2 += steps[2]
  23. ip3 += steps[3]
  24. op0 += steps[4]
  25. sf_error.check_fpe(func_name)
  26. cdef void loop_D_DDDD__As_FFFF_F(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  27. cdef np.npy_intp i, n = dims[0]
  28. cdef void *func = (<void**>data)[0]
  29. cdef char *func_name = <char*>(<void**>data)[1]
  30. cdef char *ip0 = args[0]
  31. cdef char *ip1 = args[1]
  32. cdef char *ip2 = args[2]
  33. cdef char *ip3 = args[3]
  34. cdef char *op0 = args[4]
  35. cdef double complex ov0
  36. for i in range(n):
  37. ov0 = (<double complex(*)(double complex, double complex, double complex, double complex) noexcept nogil>func)(<double complex>(<float complex*>ip0)[0], <double complex>(<float complex*>ip1)[0], <double complex>(<float complex*>ip2)[0], <double complex>(<float complex*>ip3)[0])
  38. (<float complex *>op0)[0] = <float complex>ov0
  39. ip0 += steps[0]
  40. ip1 += steps[1]
  41. ip2 += steps[2]
  42. ip3 += steps[3]
  43. op0 += steps[4]
  44. sf_error.check_fpe(func_name)
  45. cdef void loop_D_DDD__As_DDD_D(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  46. cdef np.npy_intp i, n = dims[0]
  47. cdef void *func = (<void**>data)[0]
  48. cdef char *func_name = <char*>(<void**>data)[1]
  49. cdef char *ip0 = args[0]
  50. cdef char *ip1 = args[1]
  51. cdef char *ip2 = args[2]
  52. cdef char *op0 = args[3]
  53. cdef double complex ov0
  54. for i in range(n):
  55. ov0 = (<double complex(*)(double complex, double complex, double complex) noexcept nogil>func)(<double complex>(<double complex*>ip0)[0], <double complex>(<double complex*>ip1)[0], <double complex>(<double complex*>ip2)[0])
  56. (<double complex *>op0)[0] = <double complex>ov0
  57. ip0 += steps[0]
  58. ip1 += steps[1]
  59. ip2 += steps[2]
  60. op0 += steps[3]
  61. sf_error.check_fpe(func_name)
  62. cdef void loop_D_DDD__As_FFF_F(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  63. cdef np.npy_intp i, n = dims[0]
  64. cdef void *func = (<void**>data)[0]
  65. cdef char *func_name = <char*>(<void**>data)[1]
  66. cdef char *ip0 = args[0]
  67. cdef char *ip1 = args[1]
  68. cdef char *ip2 = args[2]
  69. cdef char *op0 = args[3]
  70. cdef double complex ov0
  71. for i in range(n):
  72. ov0 = (<double complex(*)(double complex, double complex, double complex) noexcept nogil>func)(<double complex>(<float complex*>ip0)[0], <double complex>(<float complex*>ip1)[0], <double complex>(<float complex*>ip2)[0])
  73. (<float complex *>op0)[0] = <float complex>ov0
  74. ip0 += steps[0]
  75. ip1 += steps[1]
  76. ip2 += steps[2]
  77. op0 += steps[3]
  78. sf_error.check_fpe(func_name)
  79. cdef void loop_D_DD__As_DD_D(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  80. cdef np.npy_intp i, n = dims[0]
  81. cdef void *func = (<void**>data)[0]
  82. cdef char *func_name = <char*>(<void**>data)[1]
  83. cdef char *ip0 = args[0]
  84. cdef char *ip1 = args[1]
  85. cdef char *op0 = args[2]
  86. cdef double complex ov0
  87. for i in range(n):
  88. ov0 = (<double complex(*)(double complex, double complex) noexcept nogil>func)(<double complex>(<double complex*>ip0)[0], <double complex>(<double complex*>ip1)[0])
  89. (<double complex *>op0)[0] = <double complex>ov0
  90. ip0 += steps[0]
  91. ip1 += steps[1]
  92. op0 += steps[2]
  93. sf_error.check_fpe(func_name)
  94. cdef void loop_D_DD__As_FF_F(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  95. cdef np.npy_intp i, n = dims[0]
  96. cdef void *func = (<void**>data)[0]
  97. cdef char *func_name = <char*>(<void**>data)[1]
  98. cdef char *ip0 = args[0]
  99. cdef char *ip1 = args[1]
  100. cdef char *op0 = args[2]
  101. cdef double complex ov0
  102. for i in range(n):
  103. ov0 = (<double complex(*)(double complex, double complex) noexcept nogil>func)(<double complex>(<float complex*>ip0)[0], <double complex>(<float complex*>ip1)[0])
  104. (<float complex *>op0)[0] = <float complex>ov0
  105. ip0 += steps[0]
  106. ip1 += steps[1]
  107. op0 += steps[2]
  108. sf_error.check_fpe(func_name)
  109. cdef void loop_D_D__As_D_D(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  110. cdef np.npy_intp i, n = dims[0]
  111. cdef void *func = (<void**>data)[0]
  112. cdef char *func_name = <char*>(<void**>data)[1]
  113. cdef char *ip0 = args[0]
  114. cdef char *op0 = args[1]
  115. cdef double complex ov0
  116. for i in range(n):
  117. ov0 = (<double complex(*)(double complex) noexcept nogil>func)(<double complex>(<double complex*>ip0)[0])
  118. (<double complex *>op0)[0] = <double complex>ov0
  119. ip0 += steps[0]
  120. op0 += steps[1]
  121. sf_error.check_fpe(func_name)
  122. cdef void loop_D_D__As_F_F(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  123. cdef np.npy_intp i, n = dims[0]
  124. cdef void *func = (<void**>data)[0]
  125. cdef char *func_name = <char*>(<void**>data)[1]
  126. cdef char *ip0 = args[0]
  127. cdef char *op0 = args[1]
  128. cdef double complex ov0
  129. for i in range(n):
  130. ov0 = (<double complex(*)(double complex) noexcept nogil>func)(<double complex>(<float complex*>ip0)[0])
  131. (<float complex *>op0)[0] = <float complex>ov0
  132. ip0 += steps[0]
  133. op0 += steps[1]
  134. sf_error.check_fpe(func_name)
  135. cdef void loop_D_dD__As_dD_D(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  136. cdef np.npy_intp i, n = dims[0]
  137. cdef void *func = (<void**>data)[0]
  138. cdef char *func_name = <char*>(<void**>data)[1]
  139. cdef char *ip0 = args[0]
  140. cdef char *ip1 = args[1]
  141. cdef char *op0 = args[2]
  142. cdef double complex ov0
  143. for i in range(n):
  144. ov0 = (<double complex(*)(double, double complex) noexcept nogil>func)(<double>(<double*>ip0)[0], <double complex>(<double complex*>ip1)[0])
  145. (<double complex *>op0)[0] = <double complex>ov0
  146. ip0 += steps[0]
  147. ip1 += steps[1]
  148. op0 += steps[2]
  149. sf_error.check_fpe(func_name)
  150. cdef void loop_D_dD__As_fF_F(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  151. cdef np.npy_intp i, n = dims[0]
  152. cdef void *func = (<void**>data)[0]
  153. cdef char *func_name = <char*>(<void**>data)[1]
  154. cdef char *ip0 = args[0]
  155. cdef char *ip1 = args[1]
  156. cdef char *op0 = args[2]
  157. cdef double complex ov0
  158. for i in range(n):
  159. ov0 = (<double complex(*)(double, double complex) noexcept nogil>func)(<double>(<float*>ip0)[0], <double complex>(<float complex*>ip1)[0])
  160. (<float complex *>op0)[0] = <float complex>ov0
  161. ip0 += steps[0]
  162. ip1 += steps[1]
  163. op0 += steps[2]
  164. sf_error.check_fpe(func_name)
  165. cdef void loop_D_ddD__As_ddD_D(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  166. cdef np.npy_intp i, n = dims[0]
  167. cdef void *func = (<void**>data)[0]
  168. cdef char *func_name = <char*>(<void**>data)[1]
  169. cdef char *ip0 = args[0]
  170. cdef char *ip1 = args[1]
  171. cdef char *ip2 = args[2]
  172. cdef char *op0 = args[3]
  173. cdef double complex ov0
  174. for i in range(n):
  175. ov0 = (<double complex(*)(double, double, double complex) noexcept nogil>func)(<double>(<double*>ip0)[0], <double>(<double*>ip1)[0], <double complex>(<double complex*>ip2)[0])
  176. (<double complex *>op0)[0] = <double complex>ov0
  177. ip0 += steps[0]
  178. ip1 += steps[1]
  179. ip2 += steps[2]
  180. op0 += steps[3]
  181. sf_error.check_fpe(func_name)
  182. cdef void loop_D_ddD__As_ffF_F(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  183. cdef np.npy_intp i, n = dims[0]
  184. cdef void *func = (<void**>data)[0]
  185. cdef char *func_name = <char*>(<void**>data)[1]
  186. cdef char *ip0 = args[0]
  187. cdef char *ip1 = args[1]
  188. cdef char *ip2 = args[2]
  189. cdef char *op0 = args[3]
  190. cdef double complex ov0
  191. for i in range(n):
  192. ov0 = (<double complex(*)(double, double, double complex) noexcept nogil>func)(<double>(<float*>ip0)[0], <double>(<float*>ip1)[0], <double complex>(<float complex*>ip2)[0])
  193. (<float complex *>op0)[0] = <float complex>ov0
  194. ip0 += steps[0]
  195. ip1 += steps[1]
  196. ip2 += steps[2]
  197. op0 += steps[3]
  198. sf_error.check_fpe(func_name)
  199. cdef void loop_D_dddD__As_dddD_D(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  200. cdef np.npy_intp i, n = dims[0]
  201. cdef void *func = (<void**>data)[0]
  202. cdef char *func_name = <char*>(<void**>data)[1]
  203. cdef char *ip0 = args[0]
  204. cdef char *ip1 = args[1]
  205. cdef char *ip2 = args[2]
  206. cdef char *ip3 = args[3]
  207. cdef char *op0 = args[4]
  208. cdef double complex ov0
  209. for i in range(n):
  210. ov0 = (<double complex(*)(double, double, double, double complex) noexcept nogil>func)(<double>(<double*>ip0)[0], <double>(<double*>ip1)[0], <double>(<double*>ip2)[0], <double complex>(<double complex*>ip3)[0])
  211. (<double complex *>op0)[0] = <double complex>ov0
  212. ip0 += steps[0]
  213. ip1 += steps[1]
  214. ip2 += steps[2]
  215. ip3 += steps[3]
  216. op0 += steps[4]
  217. sf_error.check_fpe(func_name)
  218. cdef void loop_D_dddD__As_fffF_F(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  219. cdef np.npy_intp i, n = dims[0]
  220. cdef void *func = (<void**>data)[0]
  221. cdef char *func_name = <char*>(<void**>data)[1]
  222. cdef char *ip0 = args[0]
  223. cdef char *ip1 = args[1]
  224. cdef char *ip2 = args[2]
  225. cdef char *ip3 = args[3]
  226. cdef char *op0 = args[4]
  227. cdef double complex ov0
  228. for i in range(n):
  229. ov0 = (<double complex(*)(double, double, double, double complex) noexcept nogil>func)(<double>(<float*>ip0)[0], <double>(<float*>ip1)[0], <double>(<float*>ip2)[0], <double complex>(<float complex*>ip3)[0])
  230. (<float complex *>op0)[0] = <float complex>ov0
  231. ip0 += steps[0]
  232. ip1 += steps[1]
  233. ip2 += steps[2]
  234. ip3 += steps[3]
  235. op0 += steps[4]
  236. sf_error.check_fpe(func_name)
  237. cdef void loop_d_d__As_d_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  238. cdef np.npy_intp i, n = dims[0]
  239. cdef void *func = (<void**>data)[0]
  240. cdef char *func_name = <char*>(<void**>data)[1]
  241. cdef char *ip0 = args[0]
  242. cdef char *op0 = args[1]
  243. cdef double ov0
  244. for i in range(n):
  245. ov0 = (<double(*)(double) noexcept nogil>func)(<double>(<double*>ip0)[0])
  246. (<double *>op0)[0] = <double>ov0
  247. ip0 += steps[0]
  248. op0 += steps[1]
  249. sf_error.check_fpe(func_name)
  250. cdef void loop_d_d__As_f_f(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  251. cdef np.npy_intp i, n = dims[0]
  252. cdef void *func = (<void**>data)[0]
  253. cdef char *func_name = <char*>(<void**>data)[1]
  254. cdef char *ip0 = args[0]
  255. cdef char *op0 = args[1]
  256. cdef double ov0
  257. for i in range(n):
  258. ov0 = (<double(*)(double) noexcept nogil>func)(<double>(<float*>ip0)[0])
  259. (<float *>op0)[0] = <float>ov0
  260. ip0 += steps[0]
  261. op0 += steps[1]
  262. sf_error.check_fpe(func_name)
  263. cdef void loop_d_dd__As_dd_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  264. cdef np.npy_intp i, n = dims[0]
  265. cdef void *func = (<void**>data)[0]
  266. cdef char *func_name = <char*>(<void**>data)[1]
  267. cdef char *ip0 = args[0]
  268. cdef char *ip1 = args[1]
  269. cdef char *op0 = args[2]
  270. cdef double ov0
  271. for i in range(n):
  272. ov0 = (<double(*)(double, double) noexcept nogil>func)(<double>(<double*>ip0)[0], <double>(<double*>ip1)[0])
  273. (<double *>op0)[0] = <double>ov0
  274. ip0 += steps[0]
  275. ip1 += steps[1]
  276. op0 += steps[2]
  277. sf_error.check_fpe(func_name)
  278. cdef void loop_d_dd__As_ff_f(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  279. cdef np.npy_intp i, n = dims[0]
  280. cdef void *func = (<void**>data)[0]
  281. cdef char *func_name = <char*>(<void**>data)[1]
  282. cdef char *ip0 = args[0]
  283. cdef char *ip1 = args[1]
  284. cdef char *op0 = args[2]
  285. cdef double ov0
  286. for i in range(n):
  287. ov0 = (<double(*)(double, double) noexcept nogil>func)(<double>(<float*>ip0)[0], <double>(<float*>ip1)[0])
  288. (<float *>op0)[0] = <float>ov0
  289. ip0 += steps[0]
  290. ip1 += steps[1]
  291. op0 += steps[2]
  292. sf_error.check_fpe(func_name)
  293. cdef void loop_d_ddd__As_ddd_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  294. cdef np.npy_intp i, n = dims[0]
  295. cdef void *func = (<void**>data)[0]
  296. cdef char *func_name = <char*>(<void**>data)[1]
  297. cdef char *ip0 = args[0]
  298. cdef char *ip1 = args[1]
  299. cdef char *ip2 = args[2]
  300. cdef char *op0 = args[3]
  301. cdef double ov0
  302. for i in range(n):
  303. ov0 = (<double(*)(double, double, double) noexcept nogil>func)(<double>(<double*>ip0)[0], <double>(<double*>ip1)[0], <double>(<double*>ip2)[0])
  304. (<double *>op0)[0] = <double>ov0
  305. ip0 += steps[0]
  306. ip1 += steps[1]
  307. ip2 += steps[2]
  308. op0 += steps[3]
  309. sf_error.check_fpe(func_name)
  310. cdef void loop_d_ddd__As_fff_f(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  311. cdef np.npy_intp i, n = dims[0]
  312. cdef void *func = (<void**>data)[0]
  313. cdef char *func_name = <char*>(<void**>data)[1]
  314. cdef char *ip0 = args[0]
  315. cdef char *ip1 = args[1]
  316. cdef char *ip2 = args[2]
  317. cdef char *op0 = args[3]
  318. cdef double ov0
  319. for i in range(n):
  320. ov0 = (<double(*)(double, double, double) noexcept nogil>func)(<double>(<float*>ip0)[0], <double>(<float*>ip1)[0], <double>(<float*>ip2)[0])
  321. (<float *>op0)[0] = <float>ov0
  322. ip0 += steps[0]
  323. ip1 += steps[1]
  324. ip2 += steps[2]
  325. op0 += steps[3]
  326. sf_error.check_fpe(func_name)
  327. cdef void loop_d_dddd__As_dddd_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  328. cdef np.npy_intp i, n = dims[0]
  329. cdef void *func = (<void**>data)[0]
  330. cdef char *func_name = <char*>(<void**>data)[1]
  331. cdef char *ip0 = args[0]
  332. cdef char *ip1 = args[1]
  333. cdef char *ip2 = args[2]
  334. cdef char *ip3 = args[3]
  335. cdef char *op0 = args[4]
  336. cdef double ov0
  337. for i in range(n):
  338. ov0 = (<double(*)(double, double, double, double) noexcept nogil>func)(<double>(<double*>ip0)[0], <double>(<double*>ip1)[0], <double>(<double*>ip2)[0], <double>(<double*>ip3)[0])
  339. (<double *>op0)[0] = <double>ov0
  340. ip0 += steps[0]
  341. ip1 += steps[1]
  342. ip2 += steps[2]
  343. ip3 += steps[3]
  344. op0 += steps[4]
  345. sf_error.check_fpe(func_name)
  346. cdef void loop_d_dddd__As_ffff_f(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  347. cdef np.npy_intp i, n = dims[0]
  348. cdef void *func = (<void**>data)[0]
  349. cdef char *func_name = <char*>(<void**>data)[1]
  350. cdef char *ip0 = args[0]
  351. cdef char *ip1 = args[1]
  352. cdef char *ip2 = args[2]
  353. cdef char *ip3 = args[3]
  354. cdef char *op0 = args[4]
  355. cdef double ov0
  356. for i in range(n):
  357. ov0 = (<double(*)(double, double, double, double) noexcept nogil>func)(<double>(<float*>ip0)[0], <double>(<float*>ip1)[0], <double>(<float*>ip2)[0], <double>(<float*>ip3)[0])
  358. (<float *>op0)[0] = <float>ov0
  359. ip0 += steps[0]
  360. ip1 += steps[1]
  361. ip2 += steps[2]
  362. ip3 += steps[3]
  363. op0 += steps[4]
  364. sf_error.check_fpe(func_name)
  365. cdef void loop_d_ddddddd__As_ddddddd_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  366. cdef np.npy_intp i, n = dims[0]
  367. cdef void *func = (<void**>data)[0]
  368. cdef char *func_name = <char*>(<void**>data)[1]
  369. cdef char *ip0 = args[0]
  370. cdef char *ip1 = args[1]
  371. cdef char *ip2 = args[2]
  372. cdef char *ip3 = args[3]
  373. cdef char *ip4 = args[4]
  374. cdef char *ip5 = args[5]
  375. cdef char *ip6 = args[6]
  376. cdef char *op0 = args[7]
  377. cdef double ov0
  378. for i in range(n):
  379. ov0 = (<double(*)(double, double, double, double, double, double, double) noexcept nogil>func)(<double>(<double*>ip0)[0], <double>(<double*>ip1)[0], <double>(<double*>ip2)[0], <double>(<double*>ip3)[0], <double>(<double*>ip4)[0], <double>(<double*>ip5)[0], <double>(<double*>ip6)[0])
  380. (<double *>op0)[0] = <double>ov0
  381. ip0 += steps[0]
  382. ip1 += steps[1]
  383. ip2 += steps[2]
  384. ip3 += steps[3]
  385. ip4 += steps[4]
  386. ip5 += steps[5]
  387. ip6 += steps[6]
  388. op0 += steps[7]
  389. sf_error.check_fpe(func_name)
  390. cdef void loop_d_ddddddd__As_fffffff_f(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  391. cdef np.npy_intp i, n = dims[0]
  392. cdef void *func = (<void**>data)[0]
  393. cdef char *func_name = <char*>(<void**>data)[1]
  394. cdef char *ip0 = args[0]
  395. cdef char *ip1 = args[1]
  396. cdef char *ip2 = args[2]
  397. cdef char *ip3 = args[3]
  398. cdef char *ip4 = args[4]
  399. cdef char *ip5 = args[5]
  400. cdef char *ip6 = args[6]
  401. cdef char *op0 = args[7]
  402. cdef double ov0
  403. for i in range(n):
  404. ov0 = (<double(*)(double, double, double, double, double, double, double) noexcept nogil>func)(<double>(<float*>ip0)[0], <double>(<float*>ip1)[0], <double>(<float*>ip2)[0], <double>(<float*>ip3)[0], <double>(<float*>ip4)[0], <double>(<float*>ip5)[0], <double>(<float*>ip6)[0])
  405. (<float *>op0)[0] = <float>ov0
  406. ip0 += steps[0]
  407. ip1 += steps[1]
  408. ip2 += steps[2]
  409. ip3 += steps[3]
  410. ip4 += steps[4]
  411. ip5 += steps[5]
  412. ip6 += steps[6]
  413. op0 += steps[7]
  414. sf_error.check_fpe(func_name)
  415. cdef void loop_d_ddiiddd__As_ddllddd_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  416. cdef np.npy_intp i, n = dims[0]
  417. cdef void *func = (<void**>data)[0]
  418. cdef char *func_name = <char*>(<void**>data)[1]
  419. cdef char *ip0 = args[0]
  420. cdef char *ip1 = args[1]
  421. cdef char *ip2 = args[2]
  422. cdef char *ip3 = args[3]
  423. cdef char *ip4 = args[4]
  424. cdef char *ip5 = args[5]
  425. cdef char *ip6 = args[6]
  426. cdef char *op0 = args[7]
  427. cdef double ov0
  428. for i in range(n):
  429. if <int>(<long*>ip2)[0] == (<long*>ip2)[0] and <int>(<long*>ip3)[0] == (<long*>ip3)[0]:
  430. ov0 = (<double(*)(double, double, int, int, double, double, double) noexcept nogil>func)(<double>(<double*>ip0)[0], <double>(<double*>ip1)[0], <int>(<long*>ip2)[0], <int>(<long*>ip3)[0], <double>(<double*>ip4)[0], <double>(<double*>ip5)[0], <double>(<double*>ip6)[0])
  431. else:
  432. sf_error.error(func_name, sf_error.DOMAIN, "invalid input argument")
  433. ov0 = <double>NAN
  434. (<double *>op0)[0] = <double>ov0
  435. ip0 += steps[0]
  436. ip1 += steps[1]
  437. ip2 += steps[2]
  438. ip3 += steps[3]
  439. ip4 += steps[4]
  440. ip5 += steps[5]
  441. ip6 += steps[6]
  442. op0 += steps[7]
  443. sf_error.check_fpe(func_name)
  444. cdef void loop_d_ddp_d_As_ddp_dd(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  445. cdef np.npy_intp i, n = dims[0]
  446. cdef void *func = (<void**>data)[0]
  447. cdef char *func_name = <char*>(<void**>data)[1]
  448. cdef char *ip0 = args[0]
  449. cdef char *ip1 = args[1]
  450. cdef char *ip2 = args[2]
  451. cdef char *op0 = args[3]
  452. cdef char *op1 = args[4]
  453. cdef double ov0
  454. cdef double ov1
  455. for i in range(n):
  456. ov0 = (<double(*)(double, double, Py_ssize_t, double *) noexcept nogil>func)(<double>(<double*>ip0)[0], <double>(<double*>ip1)[0], <Py_ssize_t>(<Py_ssize_t*>ip2)[0], &ov1)
  457. (<double *>op0)[0] = <double>ov0
  458. (<double *>op1)[0] = <double>ov1
  459. ip0 += steps[0]
  460. ip1 += steps[1]
  461. ip2 += steps[2]
  462. op0 += steps[3]
  463. op1 += steps[4]
  464. sf_error.check_fpe(func_name)
  465. cdef void loop_d_dpd__As_dpd_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  466. cdef np.npy_intp i, n = dims[0]
  467. cdef void *func = (<void**>data)[0]
  468. cdef char *func_name = <char*>(<void**>data)[1]
  469. cdef char *ip0 = args[0]
  470. cdef char *ip1 = args[1]
  471. cdef char *ip2 = args[2]
  472. cdef char *op0 = args[3]
  473. cdef double ov0
  474. for i in range(n):
  475. ov0 = (<double(*)(double, Py_ssize_t, double) noexcept nogil>func)(<double>(<double*>ip0)[0], <Py_ssize_t>(<Py_ssize_t*>ip1)[0], <double>(<double*>ip2)[0])
  476. (<double *>op0)[0] = <double>ov0
  477. ip0 += steps[0]
  478. ip1 += steps[1]
  479. ip2 += steps[2]
  480. op0 += steps[3]
  481. sf_error.check_fpe(func_name)
  482. cdef void loop_d_pd__As_pd_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  483. cdef np.npy_intp i, n = dims[0]
  484. cdef void *func = (<void**>data)[0]
  485. cdef char *func_name = <char*>(<void**>data)[1]
  486. cdef char *ip0 = args[0]
  487. cdef char *ip1 = args[1]
  488. cdef char *op0 = args[2]
  489. cdef double ov0
  490. for i in range(n):
  491. ov0 = (<double(*)(Py_ssize_t, double) noexcept nogil>func)(<Py_ssize_t>(<Py_ssize_t*>ip0)[0], <double>(<double*>ip1)[0])
  492. (<double *>op0)[0] = <double>ov0
  493. ip0 += steps[0]
  494. ip1 += steps[1]
  495. op0 += steps[2]
  496. sf_error.check_fpe(func_name)
  497. cdef void loop_d_pdd__As_pdd_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  498. cdef np.npy_intp i, n = dims[0]
  499. cdef void *func = (<void**>data)[0]
  500. cdef char *func_name = <char*>(<void**>data)[1]
  501. cdef char *ip0 = args[0]
  502. cdef char *ip1 = args[1]
  503. cdef char *ip2 = args[2]
  504. cdef char *op0 = args[3]
  505. cdef double ov0
  506. for i in range(n):
  507. ov0 = (<double(*)(Py_ssize_t, double, double) noexcept nogil>func)(<Py_ssize_t>(<Py_ssize_t*>ip0)[0], <double>(<double*>ip1)[0], <double>(<double*>ip2)[0])
  508. (<double *>op0)[0] = <double>ov0
  509. ip0 += steps[0]
  510. ip1 += steps[1]
  511. ip2 += steps[2]
  512. op0 += steps[3]
  513. sf_error.check_fpe(func_name)
  514. cdef void loop_d_pddd__As_pddd_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  515. cdef np.npy_intp i, n = dims[0]
  516. cdef void *func = (<void**>data)[0]
  517. cdef char *func_name = <char*>(<void**>data)[1]
  518. cdef char *ip0 = args[0]
  519. cdef char *ip1 = args[1]
  520. cdef char *ip2 = args[2]
  521. cdef char *ip3 = args[3]
  522. cdef char *op0 = args[4]
  523. cdef double ov0
  524. for i in range(n):
  525. ov0 = (<double(*)(Py_ssize_t, double, double, double) noexcept nogil>func)(<Py_ssize_t>(<Py_ssize_t*>ip0)[0], <double>(<double*>ip1)[0], <double>(<double*>ip2)[0], <double>(<double*>ip3)[0])
  526. (<double *>op0)[0] = <double>ov0
  527. ip0 += steps[0]
  528. ip1 += steps[1]
  529. ip2 += steps[2]
  530. ip3 += steps[3]
  531. op0 += steps[4]
  532. sf_error.check_fpe(func_name)
  533. cdef void loop_d_ppd__As_ppd_d(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  534. cdef np.npy_intp i, n = dims[0]
  535. cdef void *func = (<void**>data)[0]
  536. cdef char *func_name = <char*>(<void**>data)[1]
  537. cdef char *ip0 = args[0]
  538. cdef char *ip1 = args[1]
  539. cdef char *ip2 = args[2]
  540. cdef char *op0 = args[3]
  541. cdef double ov0
  542. for i in range(n):
  543. ov0 = (<double(*)(Py_ssize_t, Py_ssize_t, double) noexcept nogil>func)(<Py_ssize_t>(<Py_ssize_t*>ip0)[0], <Py_ssize_t>(<Py_ssize_t*>ip1)[0], <double>(<double*>ip2)[0])
  544. (<double *>op0)[0] = <double>ov0
  545. ip0 += steps[0]
  546. ip1 += steps[1]
  547. ip2 += steps[2]
  548. op0 += steps[3]
  549. sf_error.check_fpe(func_name)
  550. cdef void loop_f_f__As_f_f(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  551. cdef np.npy_intp i, n = dims[0]
  552. cdef void *func = (<void**>data)[0]
  553. cdef char *func_name = <char*>(<void**>data)[1]
  554. cdef char *ip0 = args[0]
  555. cdef char *op0 = args[1]
  556. cdef float ov0
  557. for i in range(n):
  558. ov0 = (<float(*)(float) noexcept nogil>func)(<float>(<float*>ip0)[0])
  559. (<float *>op0)[0] = <float>ov0
  560. ip0 += steps[0]
  561. op0 += steps[1]
  562. sf_error.check_fpe(func_name)
  563. cdef void loop_f_ff__As_ff_f(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  564. cdef np.npy_intp i, n = dims[0]
  565. cdef void *func = (<void**>data)[0]
  566. cdef char *func_name = <char*>(<void**>data)[1]
  567. cdef char *ip0 = args[0]
  568. cdef char *ip1 = args[1]
  569. cdef char *op0 = args[2]
  570. cdef float ov0
  571. for i in range(n):
  572. ov0 = (<float(*)(float, float) noexcept nogil>func)(<float>(<float*>ip0)[0], <float>(<float*>ip1)[0])
  573. (<float *>op0)[0] = <float>ov0
  574. ip0 += steps[0]
  575. ip1 += steps[1]
  576. op0 += steps[2]
  577. sf_error.check_fpe(func_name)
  578. cdef void loop_f_fff__As_fff_f(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  579. cdef np.npy_intp i, n = dims[0]
  580. cdef void *func = (<void**>data)[0]
  581. cdef char *func_name = <char*>(<void**>data)[1]
  582. cdef char *ip0 = args[0]
  583. cdef char *ip1 = args[1]
  584. cdef char *ip2 = args[2]
  585. cdef char *op0 = args[3]
  586. cdef float ov0
  587. for i in range(n):
  588. ov0 = (<float(*)(float, float, float) noexcept nogil>func)(<float>(<float*>ip0)[0], <float>(<float*>ip1)[0], <float>(<float*>ip2)[0])
  589. (<float *>op0)[0] = <float>ov0
  590. ip0 += steps[0]
  591. ip1 += steps[1]
  592. ip2 += steps[2]
  593. op0 += steps[3]
  594. sf_error.check_fpe(func_name)
  595. cdef void loop_f_ffff__As_ffff_f(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  596. cdef np.npy_intp i, n = dims[0]
  597. cdef void *func = (<void**>data)[0]
  598. cdef char *func_name = <char*>(<void**>data)[1]
  599. cdef char *ip0 = args[0]
  600. cdef char *ip1 = args[1]
  601. cdef char *ip2 = args[2]
  602. cdef char *ip3 = args[3]
  603. cdef char *op0 = args[4]
  604. cdef float ov0
  605. for i in range(n):
  606. ov0 = (<float(*)(float, float, float, float) noexcept nogil>func)(<float>(<float*>ip0)[0], <float>(<float*>ip1)[0], <float>(<float*>ip2)[0], <float>(<float*>ip3)[0])
  607. (<float *>op0)[0] = <float>ov0
  608. ip0 += steps[0]
  609. ip1 += steps[1]
  610. ip2 += steps[2]
  611. ip3 += steps[3]
  612. op0 += steps[4]
  613. sf_error.check_fpe(func_name)
  614. cdef void loop_i_D_DD_As_D_DD(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  615. cdef np.npy_intp i, n = dims[0]
  616. cdef void *func = (<void**>data)[0]
  617. cdef char *func_name = <char*>(<void**>data)[1]
  618. cdef char *ip0 = args[0]
  619. cdef char *op0 = args[1]
  620. cdef char *op1 = args[2]
  621. cdef double complex ov0
  622. cdef double complex ov1
  623. for i in range(n):
  624. (<int(*)(double complex, double complex *, double complex *) noexcept nogil>func)(<double complex>(<double complex*>ip0)[0], &ov0, &ov1)
  625. (<double complex *>op0)[0] = <double complex>ov0
  626. (<double complex *>op1)[0] = <double complex>ov1
  627. ip0 += steps[0]
  628. op0 += steps[1]
  629. op1 += steps[2]
  630. sf_error.check_fpe(func_name)
  631. cdef void loop_i_D_DD_As_F_FF(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  632. cdef np.npy_intp i, n = dims[0]
  633. cdef void *func = (<void**>data)[0]
  634. cdef char *func_name = <char*>(<void**>data)[1]
  635. cdef char *ip0 = args[0]
  636. cdef char *op0 = args[1]
  637. cdef char *op1 = args[2]
  638. cdef double complex ov0
  639. cdef double complex ov1
  640. for i in range(n):
  641. (<int(*)(double complex, double complex *, double complex *) noexcept nogil>func)(<double complex>(<float complex*>ip0)[0], &ov0, &ov1)
  642. (<float complex *>op0)[0] = <float complex>ov0
  643. (<float complex *>op1)[0] = <float complex>ov1
  644. ip0 += steps[0]
  645. op0 += steps[1]
  646. op1 += steps[2]
  647. sf_error.check_fpe(func_name)
  648. cdef void loop_i_d_dd_As_d_dd(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  649. cdef np.npy_intp i, n = dims[0]
  650. cdef void *func = (<void**>data)[0]
  651. cdef char *func_name = <char*>(<void**>data)[1]
  652. cdef char *ip0 = args[0]
  653. cdef char *op0 = args[1]
  654. cdef char *op1 = args[2]
  655. cdef double ov0
  656. cdef double ov1
  657. for i in range(n):
  658. (<int(*)(double, double *, double *) noexcept nogil>func)(<double>(<double*>ip0)[0], &ov0, &ov1)
  659. (<double *>op0)[0] = <double>ov0
  660. (<double *>op1)[0] = <double>ov1
  661. ip0 += steps[0]
  662. op0 += steps[1]
  663. op1 += steps[2]
  664. sf_error.check_fpe(func_name)
  665. cdef void loop_i_d_dd_As_f_ff(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  666. cdef np.npy_intp i, n = dims[0]
  667. cdef void *func = (<void**>data)[0]
  668. cdef char *func_name = <char*>(<void**>data)[1]
  669. cdef char *ip0 = args[0]
  670. cdef char *op0 = args[1]
  671. cdef char *op1 = args[2]
  672. cdef double ov0
  673. cdef double ov1
  674. for i in range(n):
  675. (<int(*)(double, double *, double *) noexcept nogil>func)(<double>(<float*>ip0)[0], &ov0, &ov1)
  676. (<float *>op0)[0] = <float>ov0
  677. (<float *>op1)[0] = <float>ov1
  678. ip0 += steps[0]
  679. op0 += steps[1]
  680. op1 += steps[2]
  681. sf_error.check_fpe(func_name)
  682. cdef void loop_i_i__As_l_l(char **args, np.npy_intp *dims, np.npy_intp *steps, void *data) noexcept nogil:
  683. cdef np.npy_intp i, n = dims[0]
  684. cdef void *func = (<void**>data)[0]
  685. cdef char *func_name = <char*>(<void**>data)[1]
  686. cdef char *ip0 = args[0]
  687. cdef char *op0 = args[1]
  688. cdef int ov0
  689. for i in range(n):
  690. if <int>(<long*>ip0)[0] == (<long*>ip0)[0]:
  691. ov0 = (<int(*)(int) noexcept nogil>func)(<int>(<long*>ip0)[0])
  692. else:
  693. sf_error.error(func_name, sf_error.DOMAIN, "invalid input argument")
  694. ov0 = <int>0xbad0bad0
  695. (<long *>op0)[0] = <long>ov0
  696. ip0 += steps[0]
  697. op0 += steps[1]
  698. sf_error.check_fpe(func_name)
  699. cdef extern from r"_ufuncs_defs.h":
  700. cdef double _func_cosine_cdf "cosine_cdf"(double) noexcept nogil
  701. cdef extern from r"_ufuncs_defs.h":
  702. cdef double _func_cosine_invcdf "cosine_invcdf"(double) noexcept nogil
  703. from ._ellip_harm cimport ellip_harmonic as _func_ellip_harmonic
  704. ctypedef double _proto_ellip_harmonic_t(double, double, int, int, double, double, double) noexcept nogil
  705. cdef _proto_ellip_harmonic_t *_proto_ellip_harmonic_t_var = &_func_ellip_harmonic
  706. from ._legacy cimport ellip_harmonic_unsafe as _func_ellip_harmonic_unsafe
  707. ctypedef double _proto_ellip_harmonic_unsafe_t(double, double, double, double, double, double, double) noexcept nogil
  708. cdef _proto_ellip_harmonic_unsafe_t *_proto_ellip_harmonic_unsafe_t_var = &_func_ellip_harmonic_unsafe
  709. from ._factorial cimport _factorial as _func__factorial
  710. ctypedef double _proto__factorial_t(double) noexcept nogil
  711. cdef _proto__factorial_t *_proto__factorial_t_var = &_func__factorial
  712. cdef extern from r"_ufuncs_defs.h":
  713. cdef double _func_cephes_igam_fac "cephes_igam_fac"(double, double) noexcept nogil
  714. cdef extern from r"_ufuncs_defs.h":
  715. cdef double _func_xsf_kolmogc "xsf_kolmogc"(double) noexcept nogil
  716. cdef extern from r"_ufuncs_defs.h":
  717. cdef double _func_xsf_kolmogci "xsf_kolmogci"(double) noexcept nogil
  718. cdef extern from r"_ufuncs_defs.h":
  719. cdef double _func_xsf_kolmogp "xsf_kolmogp"(double) noexcept nogil
  720. cdef extern from r"_ufuncs_defs.h":
  721. cdef double _func_cephes_lanczos_sum_expg_scaled "cephes_lanczos_sum_expg_scaled"(double) noexcept nogil
  722. cdef extern from r"_ufuncs_defs.h":
  723. cdef double _func_cephes_lgam1p "cephes_lgam1p"(double) noexcept nogil
  724. from .sf_error cimport _sf_error_test_function as _func__sf_error_test_function
  725. ctypedef int _proto__sf_error_test_function_t(int) noexcept nogil
  726. cdef _proto__sf_error_test_function_t *_proto__sf_error_test_function_t_var = &_func__sf_error_test_function
  727. from ._legacy cimport smirnovc_unsafe as _func_smirnovc_unsafe
  728. ctypedef double _proto_smirnovc_unsafe_t(double, double) noexcept nogil
  729. cdef _proto_smirnovc_unsafe_t *_proto_smirnovc_unsafe_t_var = &_func_smirnovc_unsafe
  730. cdef extern from r"_ufuncs_defs.h":
  731. cdef double _func_cephes_smirnovc_wrap "cephes_smirnovc_wrap"(Py_ssize_t, double) noexcept nogil
  732. from ._legacy cimport smirnovci_unsafe as _func_smirnovci_unsafe
  733. ctypedef double _proto_smirnovci_unsafe_t(double, double) noexcept nogil
  734. cdef _proto_smirnovci_unsafe_t *_proto_smirnovci_unsafe_t_var = &_func_smirnovci_unsafe
  735. cdef extern from r"_ufuncs_defs.h":
  736. cdef double _func_cephes_smirnovci_wrap "cephes_smirnovci_wrap"(Py_ssize_t, double) noexcept nogil
  737. from ._legacy cimport smirnovp_unsafe as _func_smirnovp_unsafe
  738. ctypedef double _proto_smirnovp_unsafe_t(double, double) noexcept nogil
  739. cdef _proto_smirnovp_unsafe_t *_proto_smirnovp_unsafe_t_var = &_func_smirnovp_unsafe
  740. cdef extern from r"_ufuncs_defs.h":
  741. cdef double _func_cephes_smirnovp_wrap "cephes_smirnovp_wrap"(Py_ssize_t, double) noexcept nogil
  742. cdef extern from r"_ufuncs_defs.h":
  743. cdef double _func_cephes__struve_asymp_large_z "cephes__struve_asymp_large_z"(double, double, Py_ssize_t, double *) noexcept nogil
  744. cdef extern from r"_ufuncs_defs.h":
  745. cdef double _func_cephes__struve_bessel_series "cephes__struve_bessel_series"(double, double, Py_ssize_t, double *) noexcept nogil
  746. cdef extern from r"_ufuncs_defs.h":
  747. cdef double _func_cephes__struve_power_series "cephes__struve_power_series"(double, double, Py_ssize_t, double *) noexcept nogil
  748. from ._agm cimport agm as _func_agm
  749. ctypedef double _proto_agm_t(double, double) noexcept nogil
  750. cdef _proto_agm_t *_proto_agm_t_var = &_func_agm
  751. from ._legacy cimport bdtr_unsafe as _func_bdtr_unsafe
  752. ctypedef double _proto_bdtr_unsafe_t(double, double, double) noexcept nogil
  753. cdef _proto_bdtr_unsafe_t *_proto_bdtr_unsafe_t_var = &_func_bdtr_unsafe
  754. cdef extern from r"_ufuncs_defs.h":
  755. cdef double _func_cephes_bdtr_wrap "cephes_bdtr_wrap"(double, Py_ssize_t, double) noexcept nogil
  756. from ._legacy cimport bdtrc_unsafe as _func_bdtrc_unsafe
  757. ctypedef double _proto_bdtrc_unsafe_t(double, double, double) noexcept nogil
  758. cdef _proto_bdtrc_unsafe_t *_proto_bdtrc_unsafe_t_var = &_func_bdtrc_unsafe
  759. cdef extern from r"_ufuncs_defs.h":
  760. cdef double _func_cephes_bdtrc_wrap "cephes_bdtrc_wrap"(double, Py_ssize_t, double) noexcept nogil
  761. from ._legacy cimport bdtri_unsafe as _func_bdtri_unsafe
  762. ctypedef double _proto_bdtri_unsafe_t(double, double, double) noexcept nogil
  763. cdef _proto_bdtri_unsafe_t *_proto_bdtri_unsafe_t_var = &_func_bdtri_unsafe
  764. cdef extern from r"_ufuncs_defs.h":
  765. cdef double _func_cephes_bdtri_wrap "cephes_bdtri_wrap"(double, Py_ssize_t, double) noexcept nogil
  766. from ._cdflib_wrappers cimport bdtrik as _func_bdtrik
  767. ctypedef double _proto_bdtrik_t(double, double, double) noexcept nogil
  768. cdef _proto_bdtrik_t *_proto_bdtrik_t_var = &_func_bdtrik
  769. from ._cdflib_wrappers cimport bdtrin as _func_bdtrin
  770. ctypedef double _proto_bdtrin_t(double, double, double) noexcept nogil
  771. cdef _proto_bdtrin_t *_proto_bdtrin_t_var = &_func_bdtrin
  772. from ._boxcox cimport boxcox as _func_boxcox
  773. ctypedef double _proto_boxcox_t(double, double) noexcept nogil
  774. cdef _proto_boxcox_t *_proto_boxcox_t_var = &_func_boxcox
  775. from ._boxcox cimport boxcox1p as _func_boxcox1p
  776. ctypedef double _proto_boxcox1p_t(double, double) noexcept nogil
  777. cdef _proto_boxcox1p_t *_proto_boxcox1p_t_var = &_func_boxcox1p
  778. cdef extern from r"_ufuncs_defs.h":
  779. cdef double _func_xsf_chdtr "xsf_chdtr"(double, double) noexcept nogil
  780. cdef extern from r"_ufuncs_defs.h":
  781. cdef double _func_xsf_chdtrc "xsf_chdtrc"(double, double) noexcept nogil
  782. cdef extern from r"_ufuncs_defs.h":
  783. cdef double _func_xsf_chdtri "xsf_chdtri"(double, double) noexcept nogil
  784. from ._convex_analysis cimport entr as _func_entr
  785. ctypedef double _proto_entr_t(double) noexcept nogil
  786. cdef _proto_entr_t *_proto_entr_t_var = &_func_entr
  787. cdef extern from r"_ufuncs_defs.h":
  788. cdef double _func_cephes_erfcinv "cephes_erfcinv"(double) noexcept nogil
  789. from .orthogonal_eval cimport eval_chebyc as _func_eval_chebyc
  790. ctypedef double complex _proto_eval_chebyc_double_complex__t(double, double complex) noexcept nogil
  791. cdef _proto_eval_chebyc_double_complex__t *_proto_eval_chebyc_double_complex__t_var = &_func_eval_chebyc[double_complex]
  792. from .orthogonal_eval cimport eval_chebyc as _func_eval_chebyc
  793. ctypedef double _proto_eval_chebyc_double__t(double, double) noexcept nogil
  794. cdef _proto_eval_chebyc_double__t *_proto_eval_chebyc_double__t_var = &_func_eval_chebyc[double]
  795. from .orthogonal_eval cimport eval_chebyc_l as _func_eval_chebyc_l
  796. ctypedef double _proto_eval_chebyc_l_t(Py_ssize_t, double) noexcept nogil
  797. cdef _proto_eval_chebyc_l_t *_proto_eval_chebyc_l_t_var = &_func_eval_chebyc_l
  798. from .orthogonal_eval cimport eval_chebys as _func_eval_chebys
  799. ctypedef double complex _proto_eval_chebys_double_complex__t(double, double complex) noexcept nogil
  800. cdef _proto_eval_chebys_double_complex__t *_proto_eval_chebys_double_complex__t_var = &_func_eval_chebys[double_complex]
  801. from .orthogonal_eval cimport eval_chebys as _func_eval_chebys
  802. ctypedef double _proto_eval_chebys_double__t(double, double) noexcept nogil
  803. cdef _proto_eval_chebys_double__t *_proto_eval_chebys_double__t_var = &_func_eval_chebys[double]
  804. from .orthogonal_eval cimport eval_chebys_l as _func_eval_chebys_l
  805. ctypedef double _proto_eval_chebys_l_t(Py_ssize_t, double) noexcept nogil
  806. cdef _proto_eval_chebys_l_t *_proto_eval_chebys_l_t_var = &_func_eval_chebys_l
  807. from .orthogonal_eval cimport eval_chebyt as _func_eval_chebyt
  808. ctypedef double complex _proto_eval_chebyt_double_complex__t(double, double complex) noexcept nogil
  809. cdef _proto_eval_chebyt_double_complex__t *_proto_eval_chebyt_double_complex__t_var = &_func_eval_chebyt[double_complex]
  810. from .orthogonal_eval cimport eval_chebyt as _func_eval_chebyt
  811. ctypedef double _proto_eval_chebyt_double__t(double, double) noexcept nogil
  812. cdef _proto_eval_chebyt_double__t *_proto_eval_chebyt_double__t_var = &_func_eval_chebyt[double]
  813. from .orthogonal_eval cimport eval_chebyt_l as _func_eval_chebyt_l
  814. ctypedef double _proto_eval_chebyt_l_t(Py_ssize_t, double) noexcept nogil
  815. cdef _proto_eval_chebyt_l_t *_proto_eval_chebyt_l_t_var = &_func_eval_chebyt_l
  816. from .orthogonal_eval cimport eval_chebyu as _func_eval_chebyu
  817. ctypedef double complex _proto_eval_chebyu_double_complex__t(double, double complex) noexcept nogil
  818. cdef _proto_eval_chebyu_double_complex__t *_proto_eval_chebyu_double_complex__t_var = &_func_eval_chebyu[double_complex]
  819. from .orthogonal_eval cimport eval_chebyu as _func_eval_chebyu
  820. ctypedef double _proto_eval_chebyu_double__t(double, double) noexcept nogil
  821. cdef _proto_eval_chebyu_double__t *_proto_eval_chebyu_double__t_var = &_func_eval_chebyu[double]
  822. from .orthogonal_eval cimport eval_chebyu_l as _func_eval_chebyu_l
  823. ctypedef double _proto_eval_chebyu_l_t(Py_ssize_t, double) noexcept nogil
  824. cdef _proto_eval_chebyu_l_t *_proto_eval_chebyu_l_t_var = &_func_eval_chebyu_l
  825. from .orthogonal_eval cimport eval_gegenbauer as _func_eval_gegenbauer
  826. ctypedef double complex _proto_eval_gegenbauer_double_complex__t(double, double, double complex) noexcept nogil
  827. cdef _proto_eval_gegenbauer_double_complex__t *_proto_eval_gegenbauer_double_complex__t_var = &_func_eval_gegenbauer[double_complex]
  828. from .orthogonal_eval cimport eval_gegenbauer as _func_eval_gegenbauer
  829. ctypedef double _proto_eval_gegenbauer_double__t(double, double, double) noexcept nogil
  830. cdef _proto_eval_gegenbauer_double__t *_proto_eval_gegenbauer_double__t_var = &_func_eval_gegenbauer[double]
  831. from .orthogonal_eval cimport eval_gegenbauer_l as _func_eval_gegenbauer_l
  832. ctypedef double _proto_eval_gegenbauer_l_t(Py_ssize_t, double, double) noexcept nogil
  833. cdef _proto_eval_gegenbauer_l_t *_proto_eval_gegenbauer_l_t_var = &_func_eval_gegenbauer_l
  834. from .orthogonal_eval cimport eval_genlaguerre as _func_eval_genlaguerre
  835. ctypedef double complex _proto_eval_genlaguerre_double_complex__t(double, double, double complex) noexcept nogil
  836. cdef _proto_eval_genlaguerre_double_complex__t *_proto_eval_genlaguerre_double_complex__t_var = &_func_eval_genlaguerre[double_complex]
  837. from .orthogonal_eval cimport eval_genlaguerre as _func_eval_genlaguerre
  838. ctypedef double _proto_eval_genlaguerre_double__t(double, double, double) noexcept nogil
  839. cdef _proto_eval_genlaguerre_double__t *_proto_eval_genlaguerre_double__t_var = &_func_eval_genlaguerre[double]
  840. from .orthogonal_eval cimport eval_genlaguerre_l as _func_eval_genlaguerre_l
  841. ctypedef double _proto_eval_genlaguerre_l_t(Py_ssize_t, double, double) noexcept nogil
  842. cdef _proto_eval_genlaguerre_l_t *_proto_eval_genlaguerre_l_t_var = &_func_eval_genlaguerre_l
  843. from .orthogonal_eval cimport eval_hermite as _func_eval_hermite
  844. ctypedef double _proto_eval_hermite_t(Py_ssize_t, double) noexcept nogil
  845. cdef _proto_eval_hermite_t *_proto_eval_hermite_t_var = &_func_eval_hermite
  846. from .orthogonal_eval cimport eval_hermitenorm as _func_eval_hermitenorm
  847. ctypedef double _proto_eval_hermitenorm_t(Py_ssize_t, double) noexcept nogil
  848. cdef _proto_eval_hermitenorm_t *_proto_eval_hermitenorm_t_var = &_func_eval_hermitenorm
  849. from .orthogonal_eval cimport eval_jacobi as _func_eval_jacobi
  850. ctypedef double complex _proto_eval_jacobi_double_complex__t(double, double, double, double complex) noexcept nogil
  851. cdef _proto_eval_jacobi_double_complex__t *_proto_eval_jacobi_double_complex__t_var = &_func_eval_jacobi[double_complex]
  852. from .orthogonal_eval cimport eval_jacobi as _func_eval_jacobi
  853. ctypedef double _proto_eval_jacobi_double__t(double, double, double, double) noexcept nogil
  854. cdef _proto_eval_jacobi_double__t *_proto_eval_jacobi_double__t_var = &_func_eval_jacobi[double]
  855. from .orthogonal_eval cimport eval_jacobi_l as _func_eval_jacobi_l
  856. ctypedef double _proto_eval_jacobi_l_t(Py_ssize_t, double, double, double) noexcept nogil
  857. cdef _proto_eval_jacobi_l_t *_proto_eval_jacobi_l_t_var = &_func_eval_jacobi_l
  858. from .orthogonal_eval cimport eval_laguerre as _func_eval_laguerre
  859. ctypedef double complex _proto_eval_laguerre_double_complex__t(double, double complex) noexcept nogil
  860. cdef _proto_eval_laguerre_double_complex__t *_proto_eval_laguerre_double_complex__t_var = &_func_eval_laguerre[double_complex]
  861. from .orthogonal_eval cimport eval_laguerre as _func_eval_laguerre
  862. ctypedef double _proto_eval_laguerre_double__t(double, double) noexcept nogil
  863. cdef _proto_eval_laguerre_double__t *_proto_eval_laguerre_double__t_var = &_func_eval_laguerre[double]
  864. from .orthogonal_eval cimport eval_laguerre_l as _func_eval_laguerre_l
  865. ctypedef double _proto_eval_laguerre_l_t(Py_ssize_t, double) noexcept nogil
  866. cdef _proto_eval_laguerre_l_t *_proto_eval_laguerre_l_t_var = &_func_eval_laguerre_l
  867. from .orthogonal_eval cimport eval_legendre as _func_eval_legendre
  868. ctypedef double complex _proto_eval_legendre_double_complex__t(double, double complex) noexcept nogil
  869. cdef _proto_eval_legendre_double_complex__t *_proto_eval_legendre_double_complex__t_var = &_func_eval_legendre[double_complex]
  870. from .orthogonal_eval cimport eval_legendre as _func_eval_legendre
  871. ctypedef double _proto_eval_legendre_double__t(double, double) noexcept nogil
  872. cdef _proto_eval_legendre_double__t *_proto_eval_legendre_double__t_var = &_func_eval_legendre[double]
  873. from .orthogonal_eval cimport eval_legendre_l as _func_eval_legendre_l
  874. ctypedef double _proto_eval_legendre_l_t(Py_ssize_t, double) noexcept nogil
  875. cdef _proto_eval_legendre_l_t *_proto_eval_legendre_l_t_var = &_func_eval_legendre_l
  876. from .orthogonal_eval cimport eval_sh_chebyt as _func_eval_sh_chebyt
  877. ctypedef double complex _proto_eval_sh_chebyt_double_complex__t(double, double complex) noexcept nogil
  878. cdef _proto_eval_sh_chebyt_double_complex__t *_proto_eval_sh_chebyt_double_complex__t_var = &_func_eval_sh_chebyt[double_complex]
  879. from .orthogonal_eval cimport eval_sh_chebyt as _func_eval_sh_chebyt
  880. ctypedef double _proto_eval_sh_chebyt_double__t(double, double) noexcept nogil
  881. cdef _proto_eval_sh_chebyt_double__t *_proto_eval_sh_chebyt_double__t_var = &_func_eval_sh_chebyt[double]
  882. from .orthogonal_eval cimport eval_sh_chebyt_l as _func_eval_sh_chebyt_l
  883. ctypedef double _proto_eval_sh_chebyt_l_t(Py_ssize_t, double) noexcept nogil
  884. cdef _proto_eval_sh_chebyt_l_t *_proto_eval_sh_chebyt_l_t_var = &_func_eval_sh_chebyt_l
  885. from .orthogonal_eval cimport eval_sh_chebyu as _func_eval_sh_chebyu
  886. ctypedef double complex _proto_eval_sh_chebyu_double_complex__t(double, double complex) noexcept nogil
  887. cdef _proto_eval_sh_chebyu_double_complex__t *_proto_eval_sh_chebyu_double_complex__t_var = &_func_eval_sh_chebyu[double_complex]
  888. from .orthogonal_eval cimport eval_sh_chebyu as _func_eval_sh_chebyu
  889. ctypedef double _proto_eval_sh_chebyu_double__t(double, double) noexcept nogil
  890. cdef _proto_eval_sh_chebyu_double__t *_proto_eval_sh_chebyu_double__t_var = &_func_eval_sh_chebyu[double]
  891. from .orthogonal_eval cimport eval_sh_chebyu_l as _func_eval_sh_chebyu_l
  892. ctypedef double _proto_eval_sh_chebyu_l_t(Py_ssize_t, double) noexcept nogil
  893. cdef _proto_eval_sh_chebyu_l_t *_proto_eval_sh_chebyu_l_t_var = &_func_eval_sh_chebyu_l
  894. from .orthogonal_eval cimport eval_sh_jacobi as _func_eval_sh_jacobi
  895. ctypedef double complex _proto_eval_sh_jacobi_double_complex__t(double, double, double, double complex) noexcept nogil
  896. cdef _proto_eval_sh_jacobi_double_complex__t *_proto_eval_sh_jacobi_double_complex__t_var = &_func_eval_sh_jacobi[double_complex]
  897. from .orthogonal_eval cimport eval_sh_jacobi as _func_eval_sh_jacobi
  898. ctypedef double _proto_eval_sh_jacobi_double__t(double, double, double, double) noexcept nogil
  899. cdef _proto_eval_sh_jacobi_double__t *_proto_eval_sh_jacobi_double__t_var = &_func_eval_sh_jacobi[double]
  900. from .orthogonal_eval cimport eval_sh_jacobi_l as _func_eval_sh_jacobi_l
  901. ctypedef double _proto_eval_sh_jacobi_l_t(Py_ssize_t, double, double, double) noexcept nogil
  902. cdef _proto_eval_sh_jacobi_l_t *_proto_eval_sh_jacobi_l_t_var = &_func_eval_sh_jacobi_l
  903. from .orthogonal_eval cimport eval_sh_legendre as _func_eval_sh_legendre
  904. ctypedef double complex _proto_eval_sh_legendre_double_complex__t(double, double complex) noexcept nogil
  905. cdef _proto_eval_sh_legendre_double_complex__t *_proto_eval_sh_legendre_double_complex__t_var = &_func_eval_sh_legendre[double_complex]
  906. from .orthogonal_eval cimport eval_sh_legendre as _func_eval_sh_legendre
  907. ctypedef double _proto_eval_sh_legendre_double__t(double, double) noexcept nogil
  908. cdef _proto_eval_sh_legendre_double__t *_proto_eval_sh_legendre_double__t_var = &_func_eval_sh_legendre[double]
  909. from .orthogonal_eval cimport eval_sh_legendre_l as _func_eval_sh_legendre_l
  910. ctypedef double _proto_eval_sh_legendre_l_t(Py_ssize_t, double) noexcept nogil
  911. cdef _proto_eval_sh_legendre_l_t *_proto_eval_sh_legendre_l_t_var = &_func_eval_sh_legendre_l
  912. from ._legacy cimport expn_unsafe as _func_expn_unsafe
  913. ctypedef double _proto_expn_unsafe_t(double, double) noexcept nogil
  914. cdef _proto_expn_unsafe_t *_proto_expn_unsafe_t_var = &_func_expn_unsafe
  915. cdef extern from r"_ufuncs_defs.h":
  916. cdef double _func_cephes_expn_wrap "cephes_expn_wrap"(Py_ssize_t, double) noexcept nogil
  917. from ._cdflib_wrappers cimport fdtridfd as _func_fdtridfd
  918. ctypedef double _proto_fdtridfd_t(double, double, double) noexcept nogil
  919. cdef _proto_fdtridfd_t *_proto_fdtridfd_t_var = &_func_fdtridfd
  920. cdef extern from r"_ufuncs_defs.h":
  921. cdef double _func_xsf_gdtr "xsf_gdtr"(double, double, double) noexcept nogil
  922. cdef extern from r"_ufuncs_defs.h":
  923. cdef double _func_xsf_gdtrc "xsf_gdtrc"(double, double, double) noexcept nogil
  924. cdef extern from r"_ufuncs_defs.h":
  925. cdef double _func_special_gdtria "special_gdtria"(double, double, double) noexcept nogil
  926. cdef extern from r"_ufuncs_defs.h":
  927. cdef double _func_xsf_gdtrib "xsf_gdtrib"(double, double, double) noexcept nogil
  928. cdef extern from r"_ufuncs_defs.h":
  929. cdef double _func_special_gdtrix "special_gdtrix"(double, double, double) noexcept nogil
  930. from ._convex_analysis cimport huber as _func_huber
  931. ctypedef double _proto_huber_t(double, double) noexcept nogil
  932. cdef _proto_huber_t *_proto_huber_t_var = &_func_huber
  933. from ._hyp0f1 cimport _hyp0f1_cmplx as _func__hyp0f1_cmplx
  934. ctypedef double complex _proto__hyp0f1_cmplx_t(double, double complex) noexcept nogil
  935. cdef _proto__hyp0f1_cmplx_t *_proto__hyp0f1_cmplx_t_var = &_func__hyp0f1_cmplx
  936. from ._hyp0f1 cimport _hyp0f1_real as _func__hyp0f1_real
  937. ctypedef double _proto__hyp0f1_real_t(double, double) noexcept nogil
  938. cdef _proto__hyp0f1_real_t *_proto__hyp0f1_real_t_var = &_func__hyp0f1_real
  939. cdef extern from r"_ufuncs_defs.h":
  940. cdef double complex _func_chyp1f1_wrap "chyp1f1_wrap"(double, double, double complex) noexcept nogil
  941. from ._hypergeometric cimport hyperu as _func_hyperu
  942. ctypedef double _proto_hyperu_t(double, double, double) noexcept nogil
  943. cdef _proto_hyperu_t *_proto_hyperu_t_var = &_func_hyperu
  944. from ._boxcox cimport inv_boxcox as _func_inv_boxcox
  945. ctypedef double _proto_inv_boxcox_t(double, double) noexcept nogil
  946. cdef _proto_inv_boxcox_t *_proto_inv_boxcox_t_var = &_func_inv_boxcox
  947. from ._boxcox cimport inv_boxcox1p as _func_inv_boxcox1p
  948. ctypedef double _proto_inv_boxcox1p_t(double, double) noexcept nogil
  949. cdef _proto_inv_boxcox1p_t *_proto_inv_boxcox1p_t_var = &_func_inv_boxcox1p
  950. from ._convex_analysis cimport kl_div as _func_kl_div
  951. ctypedef double _proto_kl_div_t(double, double) noexcept nogil
  952. cdef _proto_kl_div_t *_proto_kl_div_t_var = &_func_kl_div
  953. from ._legacy cimport kn_unsafe as _func_kn_unsafe
  954. ctypedef double _proto_kn_unsafe_t(double, double) noexcept nogil
  955. cdef _proto_kn_unsafe_t *_proto_kn_unsafe_t_var = &_func_kn_unsafe
  956. cdef extern from r"_ufuncs_defs.h":
  957. cdef double _func_special_cyl_bessel_k_int "special_cyl_bessel_k_int"(Py_ssize_t, double) noexcept nogil
  958. cdef extern from r"_ufuncs_defs.h":
  959. cdef double _func_xsf_kolmogi "xsf_kolmogi"(double) noexcept nogil
  960. cdef extern from r"_ufuncs_defs.h":
  961. cdef double _func_xsf_kolmogorov "xsf_kolmogorov"(double) noexcept nogil
  962. cdef extern from r"_ufuncs_defs.h":
  963. cdef double _func_pmv_wrap "pmv_wrap"(double, double, double) noexcept nogil
  964. from ._legacy cimport nbdtr_unsafe as _func_nbdtr_unsafe
  965. ctypedef double _proto_nbdtr_unsafe_t(double, double, double) noexcept nogil
  966. cdef _proto_nbdtr_unsafe_t *_proto_nbdtr_unsafe_t_var = &_func_nbdtr_unsafe
  967. cdef extern from r"_ufuncs_defs.h":
  968. cdef double _func_cephes_nbdtr_wrap "cephes_nbdtr_wrap"(Py_ssize_t, Py_ssize_t, double) noexcept nogil
  969. from ._legacy cimport nbdtrc_unsafe as _func_nbdtrc_unsafe
  970. ctypedef double _proto_nbdtrc_unsafe_t(double, double, double) noexcept nogil
  971. cdef _proto_nbdtrc_unsafe_t *_proto_nbdtrc_unsafe_t_var = &_func_nbdtrc_unsafe
  972. cdef extern from r"_ufuncs_defs.h":
  973. cdef double _func_cephes_nbdtrc_wrap "cephes_nbdtrc_wrap"(Py_ssize_t, Py_ssize_t, double) noexcept nogil
  974. from ._legacy cimport nbdtri_unsafe as _func_nbdtri_unsafe
  975. ctypedef double _proto_nbdtri_unsafe_t(double, double, double) noexcept nogil
  976. cdef _proto_nbdtri_unsafe_t *_proto_nbdtri_unsafe_t_var = &_func_nbdtri_unsafe
  977. cdef extern from r"_ufuncs_defs.h":
  978. cdef double _func_cephes_nbdtri_wrap "cephes_nbdtri_wrap"(Py_ssize_t, Py_ssize_t, double) noexcept nogil
  979. from ._cdflib_wrappers cimport nbdtrik as _func_nbdtrik
  980. ctypedef double _proto_nbdtrik_t(double, double, double) noexcept nogil
  981. cdef _proto_nbdtrik_t *_proto_nbdtrik_t_var = &_func_nbdtrik
  982. from ._cdflib_wrappers cimport nbdtrin as _func_nbdtrin
  983. ctypedef double _proto_nbdtrin_t(double, double, double) noexcept nogil
  984. cdef _proto_nbdtrin_t *_proto_nbdtrin_t_var = &_func_nbdtrin
  985. from ._cdflib_wrappers cimport ncfdtridfd as _func_ncfdtridfd
  986. ctypedef double _proto_ncfdtridfd_t(double, double, double, double) noexcept nogil
  987. cdef _proto_ncfdtridfd_t *_proto_ncfdtridfd_t_var = &_func_ncfdtridfd
  988. from ._cdflib_wrappers cimport ncfdtridfn as _func_ncfdtridfn
  989. ctypedef double _proto_ncfdtridfn_t(double, double, double, double) noexcept nogil
  990. cdef _proto_ncfdtridfn_t *_proto_ncfdtridfn_t_var = &_func_ncfdtridfn
  991. from ._cdflib_wrappers cimport ncfdtrinc as _func_ncfdtrinc
  992. ctypedef double _proto_ncfdtrinc_t(double, double, double, double) noexcept nogil
  993. cdef _proto_ncfdtrinc_t *_proto_ncfdtrinc_t_var = &_func_ncfdtrinc
  994. from ._cdflib_wrappers cimport nctdtridf as _func_nctdtridf
  995. ctypedef double _proto_nctdtridf_t(double, double, double) noexcept nogil
  996. cdef _proto_nctdtridf_t *_proto_nctdtridf_t_var = &_func_nctdtridf
  997. from ._cdflib_wrappers cimport nctdtrinc as _func_nctdtrinc
  998. ctypedef double _proto_nctdtrinc_t(double, double, double) noexcept nogil
  999. cdef _proto_nctdtrinc_t *_proto_nctdtrinc_t_var = &_func_nctdtrinc
  1000. cdef extern from r"_ufuncs_defs.h":
  1001. cdef double _func_xsf_ndtri "xsf_ndtri"(double) noexcept nogil
  1002. from ._ndtri_exp cimport ndtri_exp as _func_ndtri_exp
  1003. ctypedef double _proto_ndtri_exp_t(double) noexcept nogil
  1004. cdef _proto_ndtri_exp_t *_proto_ndtri_exp_t_var = &_func_ndtri_exp
  1005. from ._cdflib_wrappers cimport nrdtrimn as _func_nrdtrimn
  1006. ctypedef double _proto_nrdtrimn_t(double, double, double) noexcept nogil
  1007. cdef _proto_nrdtrimn_t *_proto_nrdtrimn_t_var = &_func_nrdtrimn
  1008. from ._cdflib_wrappers cimport nrdtrisd as _func_nrdtrisd
  1009. ctypedef double _proto_nrdtrisd_t(double, double, double) noexcept nogil
  1010. cdef _proto_nrdtrisd_t *_proto_nrdtrisd_t_var = &_func_nrdtrisd
  1011. cdef extern from r"_ufuncs_defs.h":
  1012. cdef double _func_xsf_owens_t "xsf_owens_t"(double, double) noexcept nogil
  1013. cdef extern from r"_ufuncs_defs.h":
  1014. cdef double _func_xsf_pdtr "xsf_pdtr"(double, double) noexcept nogil
  1015. cdef extern from r"_ufuncs_defs.h":
  1016. cdef double _func_xsf_pdtrc "xsf_pdtrc"(double, double) noexcept nogil
  1017. from ._legacy cimport pdtri_unsafe as _func_pdtri_unsafe
  1018. ctypedef double _proto_pdtri_unsafe_t(double, double) noexcept nogil
  1019. cdef _proto_pdtri_unsafe_t *_proto_pdtri_unsafe_t_var = &_func_pdtri_unsafe
  1020. cdef extern from r"_ufuncs_defs.h":
  1021. cdef double _func_cephes_pdtri_wrap "cephes_pdtri_wrap"(Py_ssize_t, double) noexcept nogil
  1022. cdef extern from r"_ufuncs_defs.h":
  1023. cdef double _func_cephes_poch "cephes_poch"(double, double) noexcept nogil
  1024. from ._convex_analysis cimport pseudo_huber as _func_pseudo_huber
  1025. ctypedef double _proto_pseudo_huber_t(double, double) noexcept nogil
  1026. cdef _proto_pseudo_huber_t *_proto_pseudo_huber_t_var = &_func_pseudo_huber
  1027. from ._convex_analysis cimport rel_entr as _func_rel_entr
  1028. ctypedef double _proto_rel_entr_t(double, double) noexcept nogil
  1029. cdef _proto_rel_entr_t *_proto_rel_entr_t_var = &_func_rel_entr
  1030. cdef extern from r"_ufuncs_defs.h":
  1031. cdef double _func_cephes_round "cephes_round"(double) noexcept nogil
  1032. cdef extern from r"_ufuncs_defs.h":
  1033. cdef int _func_xsf_cshichi "xsf_cshichi"(double complex, double complex *, double complex *) noexcept nogil
  1034. cdef extern from r"_ufuncs_defs.h":
  1035. cdef int _func_xsf_shichi "xsf_shichi"(double, double *, double *) noexcept nogil
  1036. cdef extern from r"_ufuncs_defs.h":
  1037. cdef int _func_xsf_csici "xsf_csici"(double complex, double complex *, double complex *) noexcept nogil
  1038. cdef extern from r"_ufuncs_defs.h":
  1039. cdef int _func_xsf_sici "xsf_sici"(double, double *, double *) noexcept nogil
  1040. from ._legacy cimport smirnov_unsafe as _func_smirnov_unsafe
  1041. ctypedef double _proto_smirnov_unsafe_t(double, double) noexcept nogil
  1042. cdef _proto_smirnov_unsafe_t *_proto_smirnov_unsafe_t_var = &_func_smirnov_unsafe
  1043. cdef extern from r"_ufuncs_defs.h":
  1044. cdef double _func_cephes_smirnov_wrap "cephes_smirnov_wrap"(Py_ssize_t, double) noexcept nogil
  1045. from ._legacy cimport smirnovi_unsafe as _func_smirnovi_unsafe
  1046. ctypedef double _proto_smirnovi_unsafe_t(double, double) noexcept nogil
  1047. cdef _proto_smirnovi_unsafe_t *_proto_smirnovi_unsafe_t_var = &_func_smirnovi_unsafe
  1048. cdef extern from r"_ufuncs_defs.h":
  1049. cdef double _func_cephes_smirnovi_wrap "cephes_smirnovi_wrap"(Py_ssize_t, double) noexcept nogil
  1050. from ._spence cimport cspence as _func_cspence
  1051. ctypedef double complex _proto_cspence_t(double complex) noexcept nogil
  1052. cdef _proto_cspence_t *_proto_cspence_t_var = &_func_cspence
  1053. cdef extern from r"_ufuncs_defs.h":
  1054. cdef double _func_cephes_spence "cephes_spence"(double) noexcept nogil
  1055. from ._cdflib_wrappers cimport stdtridf as _func_stdtridf
  1056. ctypedef double _proto_stdtridf_t(double, double) noexcept nogil
  1057. cdef _proto_stdtridf_t *_proto_stdtridf_t_var = &_func_stdtridf
  1058. cdef extern from r"_ufuncs_defs.h":
  1059. cdef double _func_xsf_tukeylambdacdf "xsf_tukeylambdacdf"(double, double) noexcept nogil
  1060. from ._legacy cimport yn_unsafe as _func_yn_unsafe
  1061. ctypedef double _proto_yn_unsafe_t(double, double) noexcept nogil
  1062. cdef _proto_yn_unsafe_t *_proto_yn_unsafe_t_var = &_func_yn_unsafe
  1063. cdef extern from r"_ufuncs_defs.h":
  1064. cdef double _func_cephes_yn_wrap "cephes_yn_wrap"(Py_ssize_t, double) noexcept nogil
  1065. cdef np.PyUFuncGenericFunction ufunc__beta_pdf_loops[2]
  1066. cdef void *ufunc__beta_pdf_ptr[4]
  1067. cdef void *ufunc__beta_pdf_data[2]
  1068. cdef char ufunc__beta_pdf_types[8]
  1069. cdef char *ufunc__beta_pdf_doc = (
  1070. "_beta_pdf(x, a, b)\n"
  1071. "\n"
  1072. "Probability density function of beta distribution.\n"
  1073. "\n"
  1074. "Parameters\n"
  1075. "----------\n"
  1076. "x : array_like\n"
  1077. " Real-valued such that :math:`0 \\leq x \\leq 1`,\n"
  1078. " the upper limit of integration\n"
  1079. "a, b : array_like\n"
  1080. " Positive, real-valued parameters\n"
  1081. "\n"
  1082. "Returns\n"
  1083. "-------\n"
  1084. "scalar or ndarray")
  1085. ufunc__beta_pdf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1086. ufunc__beta_pdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1087. ufunc__beta_pdf_types[0] = <char>NPY_FLOAT
  1088. ufunc__beta_pdf_types[1] = <char>NPY_FLOAT
  1089. ufunc__beta_pdf_types[2] = <char>NPY_FLOAT
  1090. ufunc__beta_pdf_types[3] = <char>NPY_FLOAT
  1091. ufunc__beta_pdf_types[4] = <char>NPY_DOUBLE
  1092. ufunc__beta_pdf_types[5] = <char>NPY_DOUBLE
  1093. ufunc__beta_pdf_types[6] = <char>NPY_DOUBLE
  1094. ufunc__beta_pdf_types[7] = <char>NPY_DOUBLE
  1095. ufunc__beta_pdf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_beta_pdf_float
  1096. ufunc__beta_pdf_ptr[2*0+1] = <void*>(<char*>"_beta_pdf")
  1097. ufunc__beta_pdf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_beta_pdf_double
  1098. ufunc__beta_pdf_ptr[2*1+1] = <void*>(<char*>"_beta_pdf")
  1099. ufunc__beta_pdf_data[0] = &ufunc__beta_pdf_ptr[2*0]
  1100. ufunc__beta_pdf_data[1] = &ufunc__beta_pdf_ptr[2*1]
  1101. _beta_pdf = np.PyUFunc_FromFuncAndData(ufunc__beta_pdf_loops, ufunc__beta_pdf_data, ufunc__beta_pdf_types, 2, 3, 1, 0, '_beta_pdf', ufunc__beta_pdf_doc, 0)
  1102. cdef np.PyUFuncGenericFunction ufunc__beta_ppf_loops[2]
  1103. cdef void *ufunc__beta_ppf_ptr[4]
  1104. cdef void *ufunc__beta_ppf_data[2]
  1105. cdef char ufunc__beta_ppf_types[8]
  1106. cdef char *ufunc__beta_ppf_doc = (
  1107. "_beta_ppf(x, a, b)\n"
  1108. "\n"
  1109. "Percent point function of beta distribution.\n"
  1110. "\n"
  1111. "Parameters\n"
  1112. "----------\n"
  1113. "x : array_like\n"
  1114. " Real-valued such that :math:`0 \\leq x \\leq 1`,\n"
  1115. " the upper limit of integration\n"
  1116. "a, b : array_like\n"
  1117. " Positive, real-valued parameters\n"
  1118. "\n"
  1119. "Returns\n"
  1120. "-------\n"
  1121. "scalar or ndarray")
  1122. ufunc__beta_ppf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1123. ufunc__beta_ppf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1124. ufunc__beta_ppf_types[0] = <char>NPY_FLOAT
  1125. ufunc__beta_ppf_types[1] = <char>NPY_FLOAT
  1126. ufunc__beta_ppf_types[2] = <char>NPY_FLOAT
  1127. ufunc__beta_ppf_types[3] = <char>NPY_FLOAT
  1128. ufunc__beta_ppf_types[4] = <char>NPY_DOUBLE
  1129. ufunc__beta_ppf_types[5] = <char>NPY_DOUBLE
  1130. ufunc__beta_ppf_types[6] = <char>NPY_DOUBLE
  1131. ufunc__beta_ppf_types[7] = <char>NPY_DOUBLE
  1132. ufunc__beta_ppf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_beta_ppf_float
  1133. ufunc__beta_ppf_ptr[2*0+1] = <void*>(<char*>"_beta_ppf")
  1134. ufunc__beta_ppf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_beta_ppf_double
  1135. ufunc__beta_ppf_ptr[2*1+1] = <void*>(<char*>"_beta_ppf")
  1136. ufunc__beta_ppf_data[0] = &ufunc__beta_ppf_ptr[2*0]
  1137. ufunc__beta_ppf_data[1] = &ufunc__beta_ppf_ptr[2*1]
  1138. _beta_ppf = np.PyUFunc_FromFuncAndData(ufunc__beta_ppf_loops, ufunc__beta_ppf_data, ufunc__beta_ppf_types, 2, 3, 1, 0, '_beta_ppf', ufunc__beta_ppf_doc, 0)
  1139. cdef np.PyUFuncGenericFunction ufunc__binom_cdf_loops[2]
  1140. cdef void *ufunc__binom_cdf_ptr[4]
  1141. cdef void *ufunc__binom_cdf_data[2]
  1142. cdef char ufunc__binom_cdf_types[8]
  1143. cdef char *ufunc__binom_cdf_doc = (
  1144. "_binom_cdf(x, n, p)\n"
  1145. "\n"
  1146. "Cumulative density function of binomial distribution.\n"
  1147. "\n"
  1148. "Parameters\n"
  1149. "----------\n"
  1150. "x : array_like\n"
  1151. " Real-valued\n"
  1152. "n : array_like\n"
  1153. " Positive, integer-valued parameter\n"
  1154. "p : array_like\n"
  1155. " Positive, real-valued parameter\n"
  1156. "\n"
  1157. "Returns\n"
  1158. "-------\n"
  1159. "scalar or ndarray")
  1160. ufunc__binom_cdf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1161. ufunc__binom_cdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1162. ufunc__binom_cdf_types[0] = <char>NPY_FLOAT
  1163. ufunc__binom_cdf_types[1] = <char>NPY_FLOAT
  1164. ufunc__binom_cdf_types[2] = <char>NPY_FLOAT
  1165. ufunc__binom_cdf_types[3] = <char>NPY_FLOAT
  1166. ufunc__binom_cdf_types[4] = <char>NPY_DOUBLE
  1167. ufunc__binom_cdf_types[5] = <char>NPY_DOUBLE
  1168. ufunc__binom_cdf_types[6] = <char>NPY_DOUBLE
  1169. ufunc__binom_cdf_types[7] = <char>NPY_DOUBLE
  1170. ufunc__binom_cdf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_binom_cdf_float
  1171. ufunc__binom_cdf_ptr[2*0+1] = <void*>(<char*>"_binom_cdf")
  1172. ufunc__binom_cdf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_binom_cdf_double
  1173. ufunc__binom_cdf_ptr[2*1+1] = <void*>(<char*>"_binom_cdf")
  1174. ufunc__binom_cdf_data[0] = &ufunc__binom_cdf_ptr[2*0]
  1175. ufunc__binom_cdf_data[1] = &ufunc__binom_cdf_ptr[2*1]
  1176. _binom_cdf = np.PyUFunc_FromFuncAndData(ufunc__binom_cdf_loops, ufunc__binom_cdf_data, ufunc__binom_cdf_types, 2, 3, 1, 0, '_binom_cdf', ufunc__binom_cdf_doc, 0)
  1177. cdef np.PyUFuncGenericFunction ufunc__binom_isf_loops[2]
  1178. cdef void *ufunc__binom_isf_ptr[4]
  1179. cdef void *ufunc__binom_isf_data[2]
  1180. cdef char ufunc__binom_isf_types[8]
  1181. cdef char *ufunc__binom_isf_doc = (
  1182. "_binom_isf(x, n, p)\n"
  1183. "\n"
  1184. "Inverse survival function of binomial distribution.\n"
  1185. "\n"
  1186. "Parameters\n"
  1187. "----------\n"
  1188. "x : array_like\n"
  1189. " Real-valued\n"
  1190. "n : array_like\n"
  1191. " Positive, integer-valued parameter\n"
  1192. "p : array_like\n"
  1193. " Positive, real-valued parameter\n"
  1194. "\n"
  1195. "Returns\n"
  1196. "-------\n"
  1197. "scalar or ndarray")
  1198. ufunc__binom_isf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1199. ufunc__binom_isf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1200. ufunc__binom_isf_types[0] = <char>NPY_FLOAT
  1201. ufunc__binom_isf_types[1] = <char>NPY_FLOAT
  1202. ufunc__binom_isf_types[2] = <char>NPY_FLOAT
  1203. ufunc__binom_isf_types[3] = <char>NPY_FLOAT
  1204. ufunc__binom_isf_types[4] = <char>NPY_DOUBLE
  1205. ufunc__binom_isf_types[5] = <char>NPY_DOUBLE
  1206. ufunc__binom_isf_types[6] = <char>NPY_DOUBLE
  1207. ufunc__binom_isf_types[7] = <char>NPY_DOUBLE
  1208. ufunc__binom_isf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_binom_isf_float
  1209. ufunc__binom_isf_ptr[2*0+1] = <void*>(<char*>"_binom_isf")
  1210. ufunc__binom_isf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_binom_isf_double
  1211. ufunc__binom_isf_ptr[2*1+1] = <void*>(<char*>"_binom_isf")
  1212. ufunc__binom_isf_data[0] = &ufunc__binom_isf_ptr[2*0]
  1213. ufunc__binom_isf_data[1] = &ufunc__binom_isf_ptr[2*1]
  1214. _binom_isf = np.PyUFunc_FromFuncAndData(ufunc__binom_isf_loops, ufunc__binom_isf_data, ufunc__binom_isf_types, 2, 3, 1, 0, '_binom_isf', ufunc__binom_isf_doc, 0)
  1215. cdef np.PyUFuncGenericFunction ufunc__binom_pmf_loops[2]
  1216. cdef void *ufunc__binom_pmf_ptr[4]
  1217. cdef void *ufunc__binom_pmf_data[2]
  1218. cdef char ufunc__binom_pmf_types[8]
  1219. cdef char *ufunc__binom_pmf_doc = (
  1220. "_binom_pmf(x, n, p)\n"
  1221. "\n"
  1222. "Probability mass function of binomial distribution.\n"
  1223. "\n"
  1224. "Parameters\n"
  1225. "----------\n"
  1226. "x : array_like\n"
  1227. " Real-valued\n"
  1228. "n : array_like\n"
  1229. " Positive, integer-valued parameter\n"
  1230. "p : array_like\n"
  1231. " Positive, real-valued parameter\n"
  1232. "\n"
  1233. "Returns\n"
  1234. "-------\n"
  1235. "scalar or ndarray")
  1236. ufunc__binom_pmf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1237. ufunc__binom_pmf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1238. ufunc__binom_pmf_types[0] = <char>NPY_FLOAT
  1239. ufunc__binom_pmf_types[1] = <char>NPY_FLOAT
  1240. ufunc__binom_pmf_types[2] = <char>NPY_FLOAT
  1241. ufunc__binom_pmf_types[3] = <char>NPY_FLOAT
  1242. ufunc__binom_pmf_types[4] = <char>NPY_DOUBLE
  1243. ufunc__binom_pmf_types[5] = <char>NPY_DOUBLE
  1244. ufunc__binom_pmf_types[6] = <char>NPY_DOUBLE
  1245. ufunc__binom_pmf_types[7] = <char>NPY_DOUBLE
  1246. ufunc__binom_pmf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_binom_pmf_float
  1247. ufunc__binom_pmf_ptr[2*0+1] = <void*>(<char*>"_binom_pmf")
  1248. ufunc__binom_pmf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_binom_pmf_double
  1249. ufunc__binom_pmf_ptr[2*1+1] = <void*>(<char*>"_binom_pmf")
  1250. ufunc__binom_pmf_data[0] = &ufunc__binom_pmf_ptr[2*0]
  1251. ufunc__binom_pmf_data[1] = &ufunc__binom_pmf_ptr[2*1]
  1252. _binom_pmf = np.PyUFunc_FromFuncAndData(ufunc__binom_pmf_loops, ufunc__binom_pmf_data, ufunc__binom_pmf_types, 2, 3, 1, 0, '_binom_pmf', ufunc__binom_pmf_doc, 0)
  1253. cdef np.PyUFuncGenericFunction ufunc__binom_ppf_loops[2]
  1254. cdef void *ufunc__binom_ppf_ptr[4]
  1255. cdef void *ufunc__binom_ppf_data[2]
  1256. cdef char ufunc__binom_ppf_types[8]
  1257. cdef char *ufunc__binom_ppf_doc = (
  1258. "_binom_ppf(x, n, p)\n"
  1259. "\n"
  1260. "Percent point function of binomial distribution.\n"
  1261. "\n"
  1262. "Parameters\n"
  1263. "----------\n"
  1264. "x : array_like\n"
  1265. " Real-valued\n"
  1266. "n : array_like\n"
  1267. " Positive, integer-valued parameter\n"
  1268. "p : array_like\n"
  1269. " Positive, real-valued parameter\n"
  1270. "\n"
  1271. "Returns\n"
  1272. "-------\n"
  1273. "scalar or ndarray")
  1274. ufunc__binom_ppf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1275. ufunc__binom_ppf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1276. ufunc__binom_ppf_types[0] = <char>NPY_FLOAT
  1277. ufunc__binom_ppf_types[1] = <char>NPY_FLOAT
  1278. ufunc__binom_ppf_types[2] = <char>NPY_FLOAT
  1279. ufunc__binom_ppf_types[3] = <char>NPY_FLOAT
  1280. ufunc__binom_ppf_types[4] = <char>NPY_DOUBLE
  1281. ufunc__binom_ppf_types[5] = <char>NPY_DOUBLE
  1282. ufunc__binom_ppf_types[6] = <char>NPY_DOUBLE
  1283. ufunc__binom_ppf_types[7] = <char>NPY_DOUBLE
  1284. ufunc__binom_ppf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_binom_ppf_float
  1285. ufunc__binom_ppf_ptr[2*0+1] = <void*>(<char*>"_binom_ppf")
  1286. ufunc__binom_ppf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_binom_ppf_double
  1287. ufunc__binom_ppf_ptr[2*1+1] = <void*>(<char*>"_binom_ppf")
  1288. ufunc__binom_ppf_data[0] = &ufunc__binom_ppf_ptr[2*0]
  1289. ufunc__binom_ppf_data[1] = &ufunc__binom_ppf_ptr[2*1]
  1290. _binom_ppf = np.PyUFunc_FromFuncAndData(ufunc__binom_ppf_loops, ufunc__binom_ppf_data, ufunc__binom_ppf_types, 2, 3, 1, 0, '_binom_ppf', ufunc__binom_ppf_doc, 0)
  1291. cdef np.PyUFuncGenericFunction ufunc__binom_sf_loops[2]
  1292. cdef void *ufunc__binom_sf_ptr[4]
  1293. cdef void *ufunc__binom_sf_data[2]
  1294. cdef char ufunc__binom_sf_types[8]
  1295. cdef char *ufunc__binom_sf_doc = (
  1296. "_binom_sf(x, n, p)\n"
  1297. "\n"
  1298. "Survival function of binomial distribution.\n"
  1299. "\n"
  1300. "Parameters\n"
  1301. "----------\n"
  1302. "x : array_like\n"
  1303. " Real-valued\n"
  1304. "n : array_like\n"
  1305. " Positive, integer-valued parameter\n"
  1306. "p : array_like\n"
  1307. " Positive, real-valued parameter\n"
  1308. "\n"
  1309. "Returns\n"
  1310. "-------\n"
  1311. "scalar or ndarray")
  1312. ufunc__binom_sf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1313. ufunc__binom_sf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1314. ufunc__binom_sf_types[0] = <char>NPY_FLOAT
  1315. ufunc__binom_sf_types[1] = <char>NPY_FLOAT
  1316. ufunc__binom_sf_types[2] = <char>NPY_FLOAT
  1317. ufunc__binom_sf_types[3] = <char>NPY_FLOAT
  1318. ufunc__binom_sf_types[4] = <char>NPY_DOUBLE
  1319. ufunc__binom_sf_types[5] = <char>NPY_DOUBLE
  1320. ufunc__binom_sf_types[6] = <char>NPY_DOUBLE
  1321. ufunc__binom_sf_types[7] = <char>NPY_DOUBLE
  1322. ufunc__binom_sf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_binom_sf_float
  1323. ufunc__binom_sf_ptr[2*0+1] = <void*>(<char*>"_binom_sf")
  1324. ufunc__binom_sf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_binom_sf_double
  1325. ufunc__binom_sf_ptr[2*1+1] = <void*>(<char*>"_binom_sf")
  1326. ufunc__binom_sf_data[0] = &ufunc__binom_sf_ptr[2*0]
  1327. ufunc__binom_sf_data[1] = &ufunc__binom_sf_ptr[2*1]
  1328. _binom_sf = np.PyUFunc_FromFuncAndData(ufunc__binom_sf_loops, ufunc__binom_sf_data, ufunc__binom_sf_types, 2, 3, 1, 0, '_binom_sf', ufunc__binom_sf_doc, 0)
  1329. cdef np.PyUFuncGenericFunction ufunc__cauchy_isf_loops[2]
  1330. cdef void *ufunc__cauchy_isf_ptr[4]
  1331. cdef void *ufunc__cauchy_isf_data[2]
  1332. cdef char ufunc__cauchy_isf_types[8]
  1333. cdef char *ufunc__cauchy_isf_doc = (
  1334. "_cauchy_isf(p, loc, scale)\n"
  1335. "\n"
  1336. "Inverse survival function of the Cauchy distribution.\n"
  1337. "\n"
  1338. "Parameters\n"
  1339. "----------\n"
  1340. "p : array_like\n"
  1341. " Probabilities\n"
  1342. "loc : array_like\n"
  1343. " Location parameter of the distribution.\n"
  1344. "scale : array_like\n"
  1345. " Scale parameter of the distribution.\n"
  1346. "\n"
  1347. "Returns\n"
  1348. "-------\n"
  1349. "scalar or ndarray")
  1350. ufunc__cauchy_isf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1351. ufunc__cauchy_isf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1352. ufunc__cauchy_isf_types[0] = <char>NPY_FLOAT
  1353. ufunc__cauchy_isf_types[1] = <char>NPY_FLOAT
  1354. ufunc__cauchy_isf_types[2] = <char>NPY_FLOAT
  1355. ufunc__cauchy_isf_types[3] = <char>NPY_FLOAT
  1356. ufunc__cauchy_isf_types[4] = <char>NPY_DOUBLE
  1357. ufunc__cauchy_isf_types[5] = <char>NPY_DOUBLE
  1358. ufunc__cauchy_isf_types[6] = <char>NPY_DOUBLE
  1359. ufunc__cauchy_isf_types[7] = <char>NPY_DOUBLE
  1360. ufunc__cauchy_isf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_cauchy_isf_float
  1361. ufunc__cauchy_isf_ptr[2*0+1] = <void*>(<char*>"_cauchy_isf")
  1362. ufunc__cauchy_isf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_cauchy_isf_double
  1363. ufunc__cauchy_isf_ptr[2*1+1] = <void*>(<char*>"_cauchy_isf")
  1364. ufunc__cauchy_isf_data[0] = &ufunc__cauchy_isf_ptr[2*0]
  1365. ufunc__cauchy_isf_data[1] = &ufunc__cauchy_isf_ptr[2*1]
  1366. _cauchy_isf = np.PyUFunc_FromFuncAndData(ufunc__cauchy_isf_loops, ufunc__cauchy_isf_data, ufunc__cauchy_isf_types, 2, 3, 1, 0, '_cauchy_isf', ufunc__cauchy_isf_doc, 0)
  1367. cdef np.PyUFuncGenericFunction ufunc__cauchy_ppf_loops[2]
  1368. cdef void *ufunc__cauchy_ppf_ptr[4]
  1369. cdef void *ufunc__cauchy_ppf_data[2]
  1370. cdef char ufunc__cauchy_ppf_types[8]
  1371. cdef char *ufunc__cauchy_ppf_doc = (
  1372. "_cauchy_ppf(p, loc, scale)\n"
  1373. "\n"
  1374. "Percent point function (i.e. quantile) of the Cauchy distribution.\n"
  1375. "\n"
  1376. "Parameters\n"
  1377. "----------\n"
  1378. "p : array_like\n"
  1379. " Probabilities\n"
  1380. "loc : array_like\n"
  1381. " Location parameter of the distribution.\n"
  1382. "scale : array_like\n"
  1383. " Scale parameter of the distribution.\n"
  1384. "\n"
  1385. "Returns\n"
  1386. "-------\n"
  1387. "scalar or ndarray")
  1388. ufunc__cauchy_ppf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1389. ufunc__cauchy_ppf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1390. ufunc__cauchy_ppf_types[0] = <char>NPY_FLOAT
  1391. ufunc__cauchy_ppf_types[1] = <char>NPY_FLOAT
  1392. ufunc__cauchy_ppf_types[2] = <char>NPY_FLOAT
  1393. ufunc__cauchy_ppf_types[3] = <char>NPY_FLOAT
  1394. ufunc__cauchy_ppf_types[4] = <char>NPY_DOUBLE
  1395. ufunc__cauchy_ppf_types[5] = <char>NPY_DOUBLE
  1396. ufunc__cauchy_ppf_types[6] = <char>NPY_DOUBLE
  1397. ufunc__cauchy_ppf_types[7] = <char>NPY_DOUBLE
  1398. ufunc__cauchy_ppf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_cauchy_ppf_float
  1399. ufunc__cauchy_ppf_ptr[2*0+1] = <void*>(<char*>"_cauchy_ppf")
  1400. ufunc__cauchy_ppf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_cauchy_ppf_double
  1401. ufunc__cauchy_ppf_ptr[2*1+1] = <void*>(<char*>"_cauchy_ppf")
  1402. ufunc__cauchy_ppf_data[0] = &ufunc__cauchy_ppf_ptr[2*0]
  1403. ufunc__cauchy_ppf_data[1] = &ufunc__cauchy_ppf_ptr[2*1]
  1404. _cauchy_ppf = np.PyUFunc_FromFuncAndData(ufunc__cauchy_ppf_loops, ufunc__cauchy_ppf_data, ufunc__cauchy_ppf_types, 2, 3, 1, 0, '_cauchy_ppf', ufunc__cauchy_ppf_doc, 0)
  1405. cdef np.PyUFuncGenericFunction ufunc__cosine_cdf_loops[2]
  1406. cdef void *ufunc__cosine_cdf_ptr[4]
  1407. cdef void *ufunc__cosine_cdf_data[2]
  1408. cdef char ufunc__cosine_cdf_types[4]
  1409. cdef char *ufunc__cosine_cdf_doc = (
  1410. "_cosine_cdf(x)\n"
  1411. "\n"
  1412. "Cumulative distribution function (CDF) of the cosine distribution::\n"
  1413. "\n"
  1414. " { 0, x < -pi\n"
  1415. " cdf(x) = { (pi + x + sin(x))/(2*pi), -pi <= x <= pi\n"
  1416. " { 1, x > pi\n"
  1417. "\n"
  1418. "Parameters\n"
  1419. "----------\n"
  1420. "x : array_like\n"
  1421. " `x` must contain real numbers.\n"
  1422. "\n"
  1423. "Returns\n"
  1424. "-------\n"
  1425. "scalar or ndarray\n"
  1426. " The cosine distribution CDF evaluated at `x`.")
  1427. ufunc__cosine_cdf_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  1428. ufunc__cosine_cdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  1429. ufunc__cosine_cdf_types[0] = <char>NPY_FLOAT
  1430. ufunc__cosine_cdf_types[1] = <char>NPY_FLOAT
  1431. ufunc__cosine_cdf_types[2] = <char>NPY_DOUBLE
  1432. ufunc__cosine_cdf_types[3] = <char>NPY_DOUBLE
  1433. ufunc__cosine_cdf_ptr[2*0] = <void*>_func_cosine_cdf
  1434. ufunc__cosine_cdf_ptr[2*0+1] = <void*>(<char*>"_cosine_cdf")
  1435. ufunc__cosine_cdf_ptr[2*1] = <void*>_func_cosine_cdf
  1436. ufunc__cosine_cdf_ptr[2*1+1] = <void*>(<char*>"_cosine_cdf")
  1437. ufunc__cosine_cdf_data[0] = &ufunc__cosine_cdf_ptr[2*0]
  1438. ufunc__cosine_cdf_data[1] = &ufunc__cosine_cdf_ptr[2*1]
  1439. _cosine_cdf = np.PyUFunc_FromFuncAndData(ufunc__cosine_cdf_loops, ufunc__cosine_cdf_data, ufunc__cosine_cdf_types, 2, 1, 1, 0, '_cosine_cdf', ufunc__cosine_cdf_doc, 0)
  1440. cdef np.PyUFuncGenericFunction ufunc__cosine_invcdf_loops[2]
  1441. cdef void *ufunc__cosine_invcdf_ptr[4]
  1442. cdef void *ufunc__cosine_invcdf_data[2]
  1443. cdef char ufunc__cosine_invcdf_types[4]
  1444. cdef char *ufunc__cosine_invcdf_doc = (
  1445. "_cosine_invcdf(p)\n"
  1446. "\n"
  1447. "Inverse of the cumulative distribution function (CDF) of the cosine\n"
  1448. "distribution.\n"
  1449. "\n"
  1450. "The CDF of the cosine distribution is::\n"
  1451. "\n"
  1452. " cdf(x) = (pi + x + sin(x))/(2*pi)\n"
  1453. "\n"
  1454. "This function computes the inverse of cdf(x).\n"
  1455. "\n"
  1456. "Parameters\n"
  1457. "----------\n"
  1458. "p : array_like\n"
  1459. " `p` must contain real numbers in the interval ``0 <= p <= 1``.\n"
  1460. " `nan` is returned for values of `p` outside the interval [0, 1].\n"
  1461. "\n"
  1462. "Returns\n"
  1463. "-------\n"
  1464. "scalar or ndarray\n"
  1465. " The inverse of the cosine distribution CDF evaluated at `p`.")
  1466. ufunc__cosine_invcdf_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  1467. ufunc__cosine_invcdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  1468. ufunc__cosine_invcdf_types[0] = <char>NPY_FLOAT
  1469. ufunc__cosine_invcdf_types[1] = <char>NPY_FLOAT
  1470. ufunc__cosine_invcdf_types[2] = <char>NPY_DOUBLE
  1471. ufunc__cosine_invcdf_types[3] = <char>NPY_DOUBLE
  1472. ufunc__cosine_invcdf_ptr[2*0] = <void*>_func_cosine_invcdf
  1473. ufunc__cosine_invcdf_ptr[2*0+1] = <void*>(<char*>"_cosine_invcdf")
  1474. ufunc__cosine_invcdf_ptr[2*1] = <void*>_func_cosine_invcdf
  1475. ufunc__cosine_invcdf_ptr[2*1+1] = <void*>(<char*>"_cosine_invcdf")
  1476. ufunc__cosine_invcdf_data[0] = &ufunc__cosine_invcdf_ptr[2*0]
  1477. ufunc__cosine_invcdf_data[1] = &ufunc__cosine_invcdf_ptr[2*1]
  1478. _cosine_invcdf = np.PyUFunc_FromFuncAndData(ufunc__cosine_invcdf_loops, ufunc__cosine_invcdf_data, ufunc__cosine_invcdf_types, 2, 1, 1, 0, '_cosine_invcdf', ufunc__cosine_invcdf_doc, 0)
  1479. cdef np.PyUFuncGenericFunction ufunc__ellip_harm_loops[3]
  1480. cdef void *ufunc__ellip_harm_ptr[6]
  1481. cdef void *ufunc__ellip_harm_data[3]
  1482. cdef char ufunc__ellip_harm_types[24]
  1483. cdef char *ufunc__ellip_harm_doc = (
  1484. "Internal function, use `ellip_harm` instead.")
  1485. ufunc__ellip_harm_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddddddd__As_fffffff_f
  1486. ufunc__ellip_harm_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddiiddd__As_ddllddd_d
  1487. ufunc__ellip_harm_loops[2] = <np.PyUFuncGenericFunction>loop_d_ddddddd__As_ddddddd_d
  1488. ufunc__ellip_harm_types[0] = <char>NPY_FLOAT
  1489. ufunc__ellip_harm_types[1] = <char>NPY_FLOAT
  1490. ufunc__ellip_harm_types[2] = <char>NPY_FLOAT
  1491. ufunc__ellip_harm_types[3] = <char>NPY_FLOAT
  1492. ufunc__ellip_harm_types[4] = <char>NPY_FLOAT
  1493. ufunc__ellip_harm_types[5] = <char>NPY_FLOAT
  1494. ufunc__ellip_harm_types[6] = <char>NPY_FLOAT
  1495. ufunc__ellip_harm_types[7] = <char>NPY_FLOAT
  1496. ufunc__ellip_harm_types[8] = <char>NPY_DOUBLE
  1497. ufunc__ellip_harm_types[9] = <char>NPY_DOUBLE
  1498. ufunc__ellip_harm_types[10] = <char>NPY_LONG
  1499. ufunc__ellip_harm_types[11] = <char>NPY_LONG
  1500. ufunc__ellip_harm_types[12] = <char>NPY_DOUBLE
  1501. ufunc__ellip_harm_types[13] = <char>NPY_DOUBLE
  1502. ufunc__ellip_harm_types[14] = <char>NPY_DOUBLE
  1503. ufunc__ellip_harm_types[15] = <char>NPY_DOUBLE
  1504. ufunc__ellip_harm_types[16] = <char>NPY_DOUBLE
  1505. ufunc__ellip_harm_types[17] = <char>NPY_DOUBLE
  1506. ufunc__ellip_harm_types[18] = <char>NPY_DOUBLE
  1507. ufunc__ellip_harm_types[19] = <char>NPY_DOUBLE
  1508. ufunc__ellip_harm_types[20] = <char>NPY_DOUBLE
  1509. ufunc__ellip_harm_types[21] = <char>NPY_DOUBLE
  1510. ufunc__ellip_harm_types[22] = <char>NPY_DOUBLE
  1511. ufunc__ellip_harm_types[23] = <char>NPY_DOUBLE
  1512. ufunc__ellip_harm_ptr[2*0] = <void*>_func_ellip_harmonic_unsafe
  1513. ufunc__ellip_harm_ptr[2*0+1] = <void*>(<char*>"_ellip_harm")
  1514. ufunc__ellip_harm_ptr[2*1] = <void*>_func_ellip_harmonic
  1515. ufunc__ellip_harm_ptr[2*1+1] = <void*>(<char*>"_ellip_harm")
  1516. ufunc__ellip_harm_ptr[2*2] = <void*>_func_ellip_harmonic_unsafe
  1517. ufunc__ellip_harm_ptr[2*2+1] = <void*>(<char*>"_ellip_harm")
  1518. ufunc__ellip_harm_data[0] = &ufunc__ellip_harm_ptr[2*0]
  1519. ufunc__ellip_harm_data[1] = &ufunc__ellip_harm_ptr[2*1]
  1520. ufunc__ellip_harm_data[2] = &ufunc__ellip_harm_ptr[2*2]
  1521. _ellip_harm = np.PyUFunc_FromFuncAndData(ufunc__ellip_harm_loops, ufunc__ellip_harm_data, ufunc__ellip_harm_types, 3, 7, 1, 0, '_ellip_harm', ufunc__ellip_harm_doc, 0)
  1522. cdef np.PyUFuncGenericFunction ufunc__factorial_loops[2]
  1523. cdef void *ufunc__factorial_ptr[4]
  1524. cdef void *ufunc__factorial_data[2]
  1525. cdef char ufunc__factorial_types[4]
  1526. cdef char *ufunc__factorial_doc = (
  1527. "Internal function, do not use.")
  1528. ufunc__factorial_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  1529. ufunc__factorial_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  1530. ufunc__factorial_types[0] = <char>NPY_FLOAT
  1531. ufunc__factorial_types[1] = <char>NPY_FLOAT
  1532. ufunc__factorial_types[2] = <char>NPY_DOUBLE
  1533. ufunc__factorial_types[3] = <char>NPY_DOUBLE
  1534. ufunc__factorial_ptr[2*0] = <void*>_func__factorial
  1535. ufunc__factorial_ptr[2*0+1] = <void*>(<char*>"_factorial")
  1536. ufunc__factorial_ptr[2*1] = <void*>_func__factorial
  1537. ufunc__factorial_ptr[2*1+1] = <void*>(<char*>"_factorial")
  1538. ufunc__factorial_data[0] = &ufunc__factorial_ptr[2*0]
  1539. ufunc__factorial_data[1] = &ufunc__factorial_ptr[2*1]
  1540. _factorial = np.PyUFunc_FromFuncAndData(ufunc__factorial_loops, ufunc__factorial_data, ufunc__factorial_types, 2, 1, 1, 0, '_factorial', ufunc__factorial_doc, 0)
  1541. cdef np.PyUFuncGenericFunction ufunc__hypergeom_cdf_loops[2]
  1542. cdef void *ufunc__hypergeom_cdf_ptr[4]
  1543. cdef void *ufunc__hypergeom_cdf_data[2]
  1544. cdef char ufunc__hypergeom_cdf_types[10]
  1545. cdef char *ufunc__hypergeom_cdf_doc = (
  1546. "_hypergeom_cdf(x, r, N, M)\n"
  1547. "\n"
  1548. "Cumulative density function of hypergeometric distribution.\n"
  1549. "\n"
  1550. "Parameters\n"
  1551. "----------\n"
  1552. "x : array_like\n"
  1553. " Real-valued\n"
  1554. "r, N, M : array_like\n"
  1555. " Positive, integer-valued parameter\n"
  1556. "\n"
  1557. "Returns\n"
  1558. "-------\n"
  1559. "scalar or ndarray")
  1560. ufunc__hypergeom_cdf_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  1561. ufunc__hypergeom_cdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  1562. ufunc__hypergeom_cdf_types[0] = <char>NPY_FLOAT
  1563. ufunc__hypergeom_cdf_types[1] = <char>NPY_FLOAT
  1564. ufunc__hypergeom_cdf_types[2] = <char>NPY_FLOAT
  1565. ufunc__hypergeom_cdf_types[3] = <char>NPY_FLOAT
  1566. ufunc__hypergeom_cdf_types[4] = <char>NPY_FLOAT
  1567. ufunc__hypergeom_cdf_types[5] = <char>NPY_DOUBLE
  1568. ufunc__hypergeom_cdf_types[6] = <char>NPY_DOUBLE
  1569. ufunc__hypergeom_cdf_types[7] = <char>NPY_DOUBLE
  1570. ufunc__hypergeom_cdf_types[8] = <char>NPY_DOUBLE
  1571. ufunc__hypergeom_cdf_types[9] = <char>NPY_DOUBLE
  1572. ufunc__hypergeom_cdf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_cdf_float
  1573. ufunc__hypergeom_cdf_ptr[2*0+1] = <void*>(<char*>"_hypergeom_cdf")
  1574. ufunc__hypergeom_cdf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_cdf_double
  1575. ufunc__hypergeom_cdf_ptr[2*1+1] = <void*>(<char*>"_hypergeom_cdf")
  1576. ufunc__hypergeom_cdf_data[0] = &ufunc__hypergeom_cdf_ptr[2*0]
  1577. ufunc__hypergeom_cdf_data[1] = &ufunc__hypergeom_cdf_ptr[2*1]
  1578. _hypergeom_cdf = np.PyUFunc_FromFuncAndData(ufunc__hypergeom_cdf_loops, ufunc__hypergeom_cdf_data, ufunc__hypergeom_cdf_types, 2, 4, 1, 0, '_hypergeom_cdf', ufunc__hypergeom_cdf_doc, 0)
  1579. cdef np.PyUFuncGenericFunction ufunc__hypergeom_mean_loops[2]
  1580. cdef void *ufunc__hypergeom_mean_ptr[4]
  1581. cdef void *ufunc__hypergeom_mean_data[2]
  1582. cdef char ufunc__hypergeom_mean_types[8]
  1583. cdef char *ufunc__hypergeom_mean_doc = (
  1584. "_hypergeom_mean(r, N, M)\n"
  1585. "\n"
  1586. "Mean of hypergeometric distribution.\n"
  1587. "\n"
  1588. "Parameters\n"
  1589. "----------\n"
  1590. "r, N, M : array_like\n"
  1591. " Positive, integer-valued parameter\n"
  1592. "\n"
  1593. "Returns\n"
  1594. "-------\n"
  1595. "scalar or ndarray")
  1596. ufunc__hypergeom_mean_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1597. ufunc__hypergeom_mean_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1598. ufunc__hypergeom_mean_types[0] = <char>NPY_FLOAT
  1599. ufunc__hypergeom_mean_types[1] = <char>NPY_FLOAT
  1600. ufunc__hypergeom_mean_types[2] = <char>NPY_FLOAT
  1601. ufunc__hypergeom_mean_types[3] = <char>NPY_FLOAT
  1602. ufunc__hypergeom_mean_types[4] = <char>NPY_DOUBLE
  1603. ufunc__hypergeom_mean_types[5] = <char>NPY_DOUBLE
  1604. ufunc__hypergeom_mean_types[6] = <char>NPY_DOUBLE
  1605. ufunc__hypergeom_mean_types[7] = <char>NPY_DOUBLE
  1606. ufunc__hypergeom_mean_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_mean_float
  1607. ufunc__hypergeom_mean_ptr[2*0+1] = <void*>(<char*>"_hypergeom_mean")
  1608. ufunc__hypergeom_mean_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_mean_double
  1609. ufunc__hypergeom_mean_ptr[2*1+1] = <void*>(<char*>"_hypergeom_mean")
  1610. ufunc__hypergeom_mean_data[0] = &ufunc__hypergeom_mean_ptr[2*0]
  1611. ufunc__hypergeom_mean_data[1] = &ufunc__hypergeom_mean_ptr[2*1]
  1612. _hypergeom_mean = np.PyUFunc_FromFuncAndData(ufunc__hypergeom_mean_loops, ufunc__hypergeom_mean_data, ufunc__hypergeom_mean_types, 2, 3, 1, 0, '_hypergeom_mean', ufunc__hypergeom_mean_doc, 0)
  1613. cdef np.PyUFuncGenericFunction ufunc__hypergeom_pmf_loops[2]
  1614. cdef void *ufunc__hypergeom_pmf_ptr[4]
  1615. cdef void *ufunc__hypergeom_pmf_data[2]
  1616. cdef char ufunc__hypergeom_pmf_types[10]
  1617. cdef char *ufunc__hypergeom_pmf_doc = (
  1618. "_hypergeom_pmf(x, r, N, M)\n"
  1619. "\n"
  1620. "Probability mass function of hypergeometric distribution.\n"
  1621. "\n"
  1622. "Parameters\n"
  1623. "----------\n"
  1624. "x : array_like\n"
  1625. " Real-valued\n"
  1626. "r, N, M : array_like\n"
  1627. " Positive, integer-valued parameter\n"
  1628. "\n"
  1629. "Returns\n"
  1630. "-------\n"
  1631. "scalar or ndarray")
  1632. ufunc__hypergeom_pmf_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  1633. ufunc__hypergeom_pmf_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  1634. ufunc__hypergeom_pmf_types[0] = <char>NPY_FLOAT
  1635. ufunc__hypergeom_pmf_types[1] = <char>NPY_FLOAT
  1636. ufunc__hypergeom_pmf_types[2] = <char>NPY_FLOAT
  1637. ufunc__hypergeom_pmf_types[3] = <char>NPY_FLOAT
  1638. ufunc__hypergeom_pmf_types[4] = <char>NPY_FLOAT
  1639. ufunc__hypergeom_pmf_types[5] = <char>NPY_DOUBLE
  1640. ufunc__hypergeom_pmf_types[6] = <char>NPY_DOUBLE
  1641. ufunc__hypergeom_pmf_types[7] = <char>NPY_DOUBLE
  1642. ufunc__hypergeom_pmf_types[8] = <char>NPY_DOUBLE
  1643. ufunc__hypergeom_pmf_types[9] = <char>NPY_DOUBLE
  1644. ufunc__hypergeom_pmf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_pmf_float
  1645. ufunc__hypergeom_pmf_ptr[2*0+1] = <void*>(<char*>"_hypergeom_pmf")
  1646. ufunc__hypergeom_pmf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_pmf_double
  1647. ufunc__hypergeom_pmf_ptr[2*1+1] = <void*>(<char*>"_hypergeom_pmf")
  1648. ufunc__hypergeom_pmf_data[0] = &ufunc__hypergeom_pmf_ptr[2*0]
  1649. ufunc__hypergeom_pmf_data[1] = &ufunc__hypergeom_pmf_ptr[2*1]
  1650. _hypergeom_pmf = np.PyUFunc_FromFuncAndData(ufunc__hypergeom_pmf_loops, ufunc__hypergeom_pmf_data, ufunc__hypergeom_pmf_types, 2, 4, 1, 0, '_hypergeom_pmf', ufunc__hypergeom_pmf_doc, 0)
  1651. cdef np.PyUFuncGenericFunction ufunc__hypergeom_sf_loops[2]
  1652. cdef void *ufunc__hypergeom_sf_ptr[4]
  1653. cdef void *ufunc__hypergeom_sf_data[2]
  1654. cdef char ufunc__hypergeom_sf_types[10]
  1655. cdef char *ufunc__hypergeom_sf_doc = (
  1656. "_hypergeom_sf(x, r, N, M)\n"
  1657. "\n"
  1658. "Survival function of hypergeometric distribution.\n"
  1659. "\n"
  1660. "Parameters\n"
  1661. "----------\n"
  1662. "x : array_like\n"
  1663. " Real-valued\n"
  1664. "r, N, M : array_like\n"
  1665. " Positive, integer-valued parameter\n"
  1666. "\n"
  1667. "Returns\n"
  1668. "-------\n"
  1669. "scalar or ndarray")
  1670. ufunc__hypergeom_sf_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  1671. ufunc__hypergeom_sf_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  1672. ufunc__hypergeom_sf_types[0] = <char>NPY_FLOAT
  1673. ufunc__hypergeom_sf_types[1] = <char>NPY_FLOAT
  1674. ufunc__hypergeom_sf_types[2] = <char>NPY_FLOAT
  1675. ufunc__hypergeom_sf_types[3] = <char>NPY_FLOAT
  1676. ufunc__hypergeom_sf_types[4] = <char>NPY_FLOAT
  1677. ufunc__hypergeom_sf_types[5] = <char>NPY_DOUBLE
  1678. ufunc__hypergeom_sf_types[6] = <char>NPY_DOUBLE
  1679. ufunc__hypergeom_sf_types[7] = <char>NPY_DOUBLE
  1680. ufunc__hypergeom_sf_types[8] = <char>NPY_DOUBLE
  1681. ufunc__hypergeom_sf_types[9] = <char>NPY_DOUBLE
  1682. ufunc__hypergeom_sf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_sf_float
  1683. ufunc__hypergeom_sf_ptr[2*0+1] = <void*>(<char*>"_hypergeom_sf")
  1684. ufunc__hypergeom_sf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_sf_double
  1685. ufunc__hypergeom_sf_ptr[2*1+1] = <void*>(<char*>"_hypergeom_sf")
  1686. ufunc__hypergeom_sf_data[0] = &ufunc__hypergeom_sf_ptr[2*0]
  1687. ufunc__hypergeom_sf_data[1] = &ufunc__hypergeom_sf_ptr[2*1]
  1688. _hypergeom_sf = np.PyUFunc_FromFuncAndData(ufunc__hypergeom_sf_loops, ufunc__hypergeom_sf_data, ufunc__hypergeom_sf_types, 2, 4, 1, 0, '_hypergeom_sf', ufunc__hypergeom_sf_doc, 0)
  1689. cdef np.PyUFuncGenericFunction ufunc__hypergeom_skewness_loops[2]
  1690. cdef void *ufunc__hypergeom_skewness_ptr[4]
  1691. cdef void *ufunc__hypergeom_skewness_data[2]
  1692. cdef char ufunc__hypergeom_skewness_types[8]
  1693. cdef char *ufunc__hypergeom_skewness_doc = (
  1694. "_hypergeom_skewness(r, N, M)\n"
  1695. "\n"
  1696. "Skewness of hypergeometric distribution.\n"
  1697. "\n"
  1698. "Parameters\n"
  1699. "----------\n"
  1700. "r, N, M : array_like\n"
  1701. " Positive, integer-valued parameter\n"
  1702. "\n"
  1703. "Returns\n"
  1704. "-------\n"
  1705. "scalar or ndarray")
  1706. ufunc__hypergeom_skewness_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1707. ufunc__hypergeom_skewness_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1708. ufunc__hypergeom_skewness_types[0] = <char>NPY_FLOAT
  1709. ufunc__hypergeom_skewness_types[1] = <char>NPY_FLOAT
  1710. ufunc__hypergeom_skewness_types[2] = <char>NPY_FLOAT
  1711. ufunc__hypergeom_skewness_types[3] = <char>NPY_FLOAT
  1712. ufunc__hypergeom_skewness_types[4] = <char>NPY_DOUBLE
  1713. ufunc__hypergeom_skewness_types[5] = <char>NPY_DOUBLE
  1714. ufunc__hypergeom_skewness_types[6] = <char>NPY_DOUBLE
  1715. ufunc__hypergeom_skewness_types[7] = <char>NPY_DOUBLE
  1716. ufunc__hypergeom_skewness_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_skewness_float
  1717. ufunc__hypergeom_skewness_ptr[2*0+1] = <void*>(<char*>"_hypergeom_skewness")
  1718. ufunc__hypergeom_skewness_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_skewness_double
  1719. ufunc__hypergeom_skewness_ptr[2*1+1] = <void*>(<char*>"_hypergeom_skewness")
  1720. ufunc__hypergeom_skewness_data[0] = &ufunc__hypergeom_skewness_ptr[2*0]
  1721. ufunc__hypergeom_skewness_data[1] = &ufunc__hypergeom_skewness_ptr[2*1]
  1722. _hypergeom_skewness = np.PyUFunc_FromFuncAndData(ufunc__hypergeom_skewness_loops, ufunc__hypergeom_skewness_data, ufunc__hypergeom_skewness_types, 2, 3, 1, 0, '_hypergeom_skewness', ufunc__hypergeom_skewness_doc, 0)
  1723. cdef np.PyUFuncGenericFunction ufunc__hypergeom_variance_loops[2]
  1724. cdef void *ufunc__hypergeom_variance_ptr[4]
  1725. cdef void *ufunc__hypergeom_variance_data[2]
  1726. cdef char ufunc__hypergeom_variance_types[8]
  1727. cdef char *ufunc__hypergeom_variance_doc = (
  1728. "_hypergeom_variance(r, N, M)\n"
  1729. "\n"
  1730. "Mean of hypergeometric distribution.\n"
  1731. "\n"
  1732. "Parameters\n"
  1733. "----------\n"
  1734. "r, N, M : array_like\n"
  1735. " Positive, integer-valued parameter\n"
  1736. "\n"
  1737. "Returns\n"
  1738. "-------\n"
  1739. "scalar or ndarray")
  1740. ufunc__hypergeom_variance_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1741. ufunc__hypergeom_variance_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1742. ufunc__hypergeom_variance_types[0] = <char>NPY_FLOAT
  1743. ufunc__hypergeom_variance_types[1] = <char>NPY_FLOAT
  1744. ufunc__hypergeom_variance_types[2] = <char>NPY_FLOAT
  1745. ufunc__hypergeom_variance_types[3] = <char>NPY_FLOAT
  1746. ufunc__hypergeom_variance_types[4] = <char>NPY_DOUBLE
  1747. ufunc__hypergeom_variance_types[5] = <char>NPY_DOUBLE
  1748. ufunc__hypergeom_variance_types[6] = <char>NPY_DOUBLE
  1749. ufunc__hypergeom_variance_types[7] = <char>NPY_DOUBLE
  1750. ufunc__hypergeom_variance_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_variance_float
  1751. ufunc__hypergeom_variance_ptr[2*0+1] = <void*>(<char*>"_hypergeom_variance")
  1752. ufunc__hypergeom_variance_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_hypergeom_variance_double
  1753. ufunc__hypergeom_variance_ptr[2*1+1] = <void*>(<char*>"_hypergeom_variance")
  1754. ufunc__hypergeom_variance_data[0] = &ufunc__hypergeom_variance_ptr[2*0]
  1755. ufunc__hypergeom_variance_data[1] = &ufunc__hypergeom_variance_ptr[2*1]
  1756. _hypergeom_variance = np.PyUFunc_FromFuncAndData(ufunc__hypergeom_variance_loops, ufunc__hypergeom_variance_data, ufunc__hypergeom_variance_types, 2, 3, 1, 0, '_hypergeom_variance', ufunc__hypergeom_variance_doc, 0)
  1757. cdef np.PyUFuncGenericFunction ufunc__igam_fac_loops[2]
  1758. cdef void *ufunc__igam_fac_ptr[4]
  1759. cdef void *ufunc__igam_fac_data[2]
  1760. cdef char ufunc__igam_fac_types[6]
  1761. cdef char *ufunc__igam_fac_doc = (
  1762. "Internal function, do not use.")
  1763. ufunc__igam_fac_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  1764. ufunc__igam_fac_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  1765. ufunc__igam_fac_types[0] = <char>NPY_FLOAT
  1766. ufunc__igam_fac_types[1] = <char>NPY_FLOAT
  1767. ufunc__igam_fac_types[2] = <char>NPY_FLOAT
  1768. ufunc__igam_fac_types[3] = <char>NPY_DOUBLE
  1769. ufunc__igam_fac_types[4] = <char>NPY_DOUBLE
  1770. ufunc__igam_fac_types[5] = <char>NPY_DOUBLE
  1771. ufunc__igam_fac_ptr[2*0] = <void*>_func_cephes_igam_fac
  1772. ufunc__igam_fac_ptr[2*0+1] = <void*>(<char*>"_igam_fac")
  1773. ufunc__igam_fac_ptr[2*1] = <void*>_func_cephes_igam_fac
  1774. ufunc__igam_fac_ptr[2*1+1] = <void*>(<char*>"_igam_fac")
  1775. ufunc__igam_fac_data[0] = &ufunc__igam_fac_ptr[2*0]
  1776. ufunc__igam_fac_data[1] = &ufunc__igam_fac_ptr[2*1]
  1777. _igam_fac = np.PyUFunc_FromFuncAndData(ufunc__igam_fac_loops, ufunc__igam_fac_data, ufunc__igam_fac_types, 2, 2, 1, 0, '_igam_fac', ufunc__igam_fac_doc, 0)
  1778. cdef np.PyUFuncGenericFunction ufunc__invgauss_isf_loops[2]
  1779. cdef void *ufunc__invgauss_isf_ptr[4]
  1780. cdef void *ufunc__invgauss_isf_data[2]
  1781. cdef char ufunc__invgauss_isf_types[8]
  1782. cdef char *ufunc__invgauss_isf_doc = (
  1783. "_invgauss_isf(x, mu, s)\n"
  1784. "\n"
  1785. "Inverse survival function of inverse gaussian distribution.\n"
  1786. "\n"
  1787. "Parameters\n"
  1788. "----------\n"
  1789. "x : array_like\n"
  1790. " Positive real-valued\n"
  1791. "mu : array_like\n"
  1792. " Positive, real-valued parameters\n"
  1793. "s : array_like\n"
  1794. " Positive, real-valued parameters\n"
  1795. "\n"
  1796. "Returns\n"
  1797. "-------\n"
  1798. "scalar or ndarray")
  1799. ufunc__invgauss_isf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1800. ufunc__invgauss_isf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1801. ufunc__invgauss_isf_types[0] = <char>NPY_FLOAT
  1802. ufunc__invgauss_isf_types[1] = <char>NPY_FLOAT
  1803. ufunc__invgauss_isf_types[2] = <char>NPY_FLOAT
  1804. ufunc__invgauss_isf_types[3] = <char>NPY_FLOAT
  1805. ufunc__invgauss_isf_types[4] = <char>NPY_DOUBLE
  1806. ufunc__invgauss_isf_types[5] = <char>NPY_DOUBLE
  1807. ufunc__invgauss_isf_types[6] = <char>NPY_DOUBLE
  1808. ufunc__invgauss_isf_types[7] = <char>NPY_DOUBLE
  1809. ufunc__invgauss_isf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_invgauss_isf_float
  1810. ufunc__invgauss_isf_ptr[2*0+1] = <void*>(<char*>"_invgauss_isf")
  1811. ufunc__invgauss_isf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_invgauss_isf_double
  1812. ufunc__invgauss_isf_ptr[2*1+1] = <void*>(<char*>"_invgauss_isf")
  1813. ufunc__invgauss_isf_data[0] = &ufunc__invgauss_isf_ptr[2*0]
  1814. ufunc__invgauss_isf_data[1] = &ufunc__invgauss_isf_ptr[2*1]
  1815. _invgauss_isf = np.PyUFunc_FromFuncAndData(ufunc__invgauss_isf_loops, ufunc__invgauss_isf_data, ufunc__invgauss_isf_types, 2, 3, 1, 0, '_invgauss_isf', ufunc__invgauss_isf_doc, 0)
  1816. cdef np.PyUFuncGenericFunction ufunc__invgauss_ppf_loops[2]
  1817. cdef void *ufunc__invgauss_ppf_ptr[4]
  1818. cdef void *ufunc__invgauss_ppf_data[2]
  1819. cdef char ufunc__invgauss_ppf_types[8]
  1820. cdef char *ufunc__invgauss_ppf_doc = (
  1821. "_invgauss_ppf(x, mu)\n"
  1822. "\n"
  1823. "Percent point function of inverse gaussian distribution.\n"
  1824. "\n"
  1825. "Parameters\n"
  1826. "----------\n"
  1827. "x : array_like\n"
  1828. " Positive real-valued\n"
  1829. "mu : array_like\n"
  1830. " Positive, real-valued parameters\n"
  1831. "\n"
  1832. "Returns\n"
  1833. "-------\n"
  1834. "scalar or ndarray")
  1835. ufunc__invgauss_ppf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1836. ufunc__invgauss_ppf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1837. ufunc__invgauss_ppf_types[0] = <char>NPY_FLOAT
  1838. ufunc__invgauss_ppf_types[1] = <char>NPY_FLOAT
  1839. ufunc__invgauss_ppf_types[2] = <char>NPY_FLOAT
  1840. ufunc__invgauss_ppf_types[3] = <char>NPY_FLOAT
  1841. ufunc__invgauss_ppf_types[4] = <char>NPY_DOUBLE
  1842. ufunc__invgauss_ppf_types[5] = <char>NPY_DOUBLE
  1843. ufunc__invgauss_ppf_types[6] = <char>NPY_DOUBLE
  1844. ufunc__invgauss_ppf_types[7] = <char>NPY_DOUBLE
  1845. ufunc__invgauss_ppf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_invgauss_ppf_float
  1846. ufunc__invgauss_ppf_ptr[2*0+1] = <void*>(<char*>"_invgauss_ppf")
  1847. ufunc__invgauss_ppf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_invgauss_ppf_double
  1848. ufunc__invgauss_ppf_ptr[2*1+1] = <void*>(<char*>"_invgauss_ppf")
  1849. ufunc__invgauss_ppf_data[0] = &ufunc__invgauss_ppf_ptr[2*0]
  1850. ufunc__invgauss_ppf_data[1] = &ufunc__invgauss_ppf_ptr[2*1]
  1851. _invgauss_ppf = np.PyUFunc_FromFuncAndData(ufunc__invgauss_ppf_loops, ufunc__invgauss_ppf_data, ufunc__invgauss_ppf_types, 2, 3, 1, 0, '_invgauss_ppf', ufunc__invgauss_ppf_doc, 0)
  1852. cdef np.PyUFuncGenericFunction ufunc__kolmogc_loops[2]
  1853. cdef void *ufunc__kolmogc_ptr[4]
  1854. cdef void *ufunc__kolmogc_data[2]
  1855. cdef char ufunc__kolmogc_types[4]
  1856. cdef char *ufunc__kolmogc_doc = (
  1857. "Internal function, do not use.")
  1858. ufunc__kolmogc_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  1859. ufunc__kolmogc_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  1860. ufunc__kolmogc_types[0] = <char>NPY_FLOAT
  1861. ufunc__kolmogc_types[1] = <char>NPY_FLOAT
  1862. ufunc__kolmogc_types[2] = <char>NPY_DOUBLE
  1863. ufunc__kolmogc_types[3] = <char>NPY_DOUBLE
  1864. ufunc__kolmogc_ptr[2*0] = <void*>_func_xsf_kolmogc
  1865. ufunc__kolmogc_ptr[2*0+1] = <void*>(<char*>"_kolmogc")
  1866. ufunc__kolmogc_ptr[2*1] = <void*>_func_xsf_kolmogc
  1867. ufunc__kolmogc_ptr[2*1+1] = <void*>(<char*>"_kolmogc")
  1868. ufunc__kolmogc_data[0] = &ufunc__kolmogc_ptr[2*0]
  1869. ufunc__kolmogc_data[1] = &ufunc__kolmogc_ptr[2*1]
  1870. _kolmogc = np.PyUFunc_FromFuncAndData(ufunc__kolmogc_loops, ufunc__kolmogc_data, ufunc__kolmogc_types, 2, 1, 1, 0, '_kolmogc', ufunc__kolmogc_doc, 0)
  1871. cdef np.PyUFuncGenericFunction ufunc__kolmogci_loops[2]
  1872. cdef void *ufunc__kolmogci_ptr[4]
  1873. cdef void *ufunc__kolmogci_data[2]
  1874. cdef char ufunc__kolmogci_types[4]
  1875. cdef char *ufunc__kolmogci_doc = (
  1876. "Internal function, do not use.")
  1877. ufunc__kolmogci_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  1878. ufunc__kolmogci_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  1879. ufunc__kolmogci_types[0] = <char>NPY_FLOAT
  1880. ufunc__kolmogci_types[1] = <char>NPY_FLOAT
  1881. ufunc__kolmogci_types[2] = <char>NPY_DOUBLE
  1882. ufunc__kolmogci_types[3] = <char>NPY_DOUBLE
  1883. ufunc__kolmogci_ptr[2*0] = <void*>_func_xsf_kolmogci
  1884. ufunc__kolmogci_ptr[2*0+1] = <void*>(<char*>"_kolmogci")
  1885. ufunc__kolmogci_ptr[2*1] = <void*>_func_xsf_kolmogci
  1886. ufunc__kolmogci_ptr[2*1+1] = <void*>(<char*>"_kolmogci")
  1887. ufunc__kolmogci_data[0] = &ufunc__kolmogci_ptr[2*0]
  1888. ufunc__kolmogci_data[1] = &ufunc__kolmogci_ptr[2*1]
  1889. _kolmogci = np.PyUFunc_FromFuncAndData(ufunc__kolmogci_loops, ufunc__kolmogci_data, ufunc__kolmogci_types, 2, 1, 1, 0, '_kolmogci', ufunc__kolmogci_doc, 0)
  1890. cdef np.PyUFuncGenericFunction ufunc__kolmogp_loops[2]
  1891. cdef void *ufunc__kolmogp_ptr[4]
  1892. cdef void *ufunc__kolmogp_data[2]
  1893. cdef char ufunc__kolmogp_types[4]
  1894. cdef char *ufunc__kolmogp_doc = (
  1895. "Internal function, do not use.")
  1896. ufunc__kolmogp_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  1897. ufunc__kolmogp_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  1898. ufunc__kolmogp_types[0] = <char>NPY_FLOAT
  1899. ufunc__kolmogp_types[1] = <char>NPY_FLOAT
  1900. ufunc__kolmogp_types[2] = <char>NPY_DOUBLE
  1901. ufunc__kolmogp_types[3] = <char>NPY_DOUBLE
  1902. ufunc__kolmogp_ptr[2*0] = <void*>_func_xsf_kolmogp
  1903. ufunc__kolmogp_ptr[2*0+1] = <void*>(<char*>"_kolmogp")
  1904. ufunc__kolmogp_ptr[2*1] = <void*>_func_xsf_kolmogp
  1905. ufunc__kolmogp_ptr[2*1+1] = <void*>(<char*>"_kolmogp")
  1906. ufunc__kolmogp_data[0] = &ufunc__kolmogp_ptr[2*0]
  1907. ufunc__kolmogp_data[1] = &ufunc__kolmogp_ptr[2*1]
  1908. _kolmogp = np.PyUFunc_FromFuncAndData(ufunc__kolmogp_loops, ufunc__kolmogp_data, ufunc__kolmogp_types, 2, 1, 1, 0, '_kolmogp', ufunc__kolmogp_doc, 0)
  1909. cdef np.PyUFuncGenericFunction ufunc__lanczos_sum_expg_scaled_loops[2]
  1910. cdef void *ufunc__lanczos_sum_expg_scaled_ptr[4]
  1911. cdef void *ufunc__lanczos_sum_expg_scaled_data[2]
  1912. cdef char ufunc__lanczos_sum_expg_scaled_types[4]
  1913. cdef char *ufunc__lanczos_sum_expg_scaled_doc = (
  1914. "Internal function, do not use.")
  1915. ufunc__lanczos_sum_expg_scaled_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  1916. ufunc__lanczos_sum_expg_scaled_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  1917. ufunc__lanczos_sum_expg_scaled_types[0] = <char>NPY_FLOAT
  1918. ufunc__lanczos_sum_expg_scaled_types[1] = <char>NPY_FLOAT
  1919. ufunc__lanczos_sum_expg_scaled_types[2] = <char>NPY_DOUBLE
  1920. ufunc__lanczos_sum_expg_scaled_types[3] = <char>NPY_DOUBLE
  1921. ufunc__lanczos_sum_expg_scaled_ptr[2*0] = <void*>_func_cephes_lanczos_sum_expg_scaled
  1922. ufunc__lanczos_sum_expg_scaled_ptr[2*0+1] = <void*>(<char*>"_lanczos_sum_expg_scaled")
  1923. ufunc__lanczos_sum_expg_scaled_ptr[2*1] = <void*>_func_cephes_lanczos_sum_expg_scaled
  1924. ufunc__lanczos_sum_expg_scaled_ptr[2*1+1] = <void*>(<char*>"_lanczos_sum_expg_scaled")
  1925. ufunc__lanczos_sum_expg_scaled_data[0] = &ufunc__lanczos_sum_expg_scaled_ptr[2*0]
  1926. ufunc__lanczos_sum_expg_scaled_data[1] = &ufunc__lanczos_sum_expg_scaled_ptr[2*1]
  1927. _lanczos_sum_expg_scaled = np.PyUFunc_FromFuncAndData(ufunc__lanczos_sum_expg_scaled_loops, ufunc__lanczos_sum_expg_scaled_data, ufunc__lanczos_sum_expg_scaled_types, 2, 1, 1, 0, '_lanczos_sum_expg_scaled', ufunc__lanczos_sum_expg_scaled_doc, 0)
  1928. cdef np.PyUFuncGenericFunction ufunc__landau_cdf_loops[2]
  1929. cdef void *ufunc__landau_cdf_ptr[4]
  1930. cdef void *ufunc__landau_cdf_data[2]
  1931. cdef char ufunc__landau_cdf_types[8]
  1932. cdef char *ufunc__landau_cdf_doc = (
  1933. "_landau_cdf(x, loc, scale)\n"
  1934. "\n"
  1935. "Cumulative distribution function of the Landau distribution.\n"
  1936. "\n"
  1937. "Parameters\n"
  1938. "----------\n"
  1939. "x : array_like\n"
  1940. " Real-valued argument\n"
  1941. "loc : array_like\n"
  1942. " Real-valued distribution location\n"
  1943. "scale : array_like\n"
  1944. " Positive, real-valued distribution scale\n"
  1945. "\n"
  1946. "Returns\n"
  1947. "-------\n"
  1948. "scalar or ndarray")
  1949. ufunc__landau_cdf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1950. ufunc__landau_cdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1951. ufunc__landau_cdf_types[0] = <char>NPY_FLOAT
  1952. ufunc__landau_cdf_types[1] = <char>NPY_FLOAT
  1953. ufunc__landau_cdf_types[2] = <char>NPY_FLOAT
  1954. ufunc__landau_cdf_types[3] = <char>NPY_FLOAT
  1955. ufunc__landau_cdf_types[4] = <char>NPY_DOUBLE
  1956. ufunc__landau_cdf_types[5] = <char>NPY_DOUBLE
  1957. ufunc__landau_cdf_types[6] = <char>NPY_DOUBLE
  1958. ufunc__landau_cdf_types[7] = <char>NPY_DOUBLE
  1959. ufunc__landau_cdf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_landau_cdf_float
  1960. ufunc__landau_cdf_ptr[2*0+1] = <void*>(<char*>"_landau_cdf")
  1961. ufunc__landau_cdf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_landau_cdf_double
  1962. ufunc__landau_cdf_ptr[2*1+1] = <void*>(<char*>"_landau_cdf")
  1963. ufunc__landau_cdf_data[0] = &ufunc__landau_cdf_ptr[2*0]
  1964. ufunc__landau_cdf_data[1] = &ufunc__landau_cdf_ptr[2*1]
  1965. _landau_cdf = np.PyUFunc_FromFuncAndData(ufunc__landau_cdf_loops, ufunc__landau_cdf_data, ufunc__landau_cdf_types, 2, 3, 1, 0, '_landau_cdf', ufunc__landau_cdf_doc, 0)
  1966. cdef np.PyUFuncGenericFunction ufunc__landau_isf_loops[2]
  1967. cdef void *ufunc__landau_isf_ptr[4]
  1968. cdef void *ufunc__landau_isf_data[2]
  1969. cdef char ufunc__landau_isf_types[8]
  1970. cdef char *ufunc__landau_isf_doc = (
  1971. "_landau_isf(p, loc, scale)\n"
  1972. "\n"
  1973. "Inverse survival function of the Landau distribution.\n"
  1974. "\n"
  1975. "Parameters\n"
  1976. "----------\n"
  1977. "p : array_like\n"
  1978. " Real-valued argument between 0 and 1\n"
  1979. "loc : array_like\n"
  1980. " Real-valued distribution location\n"
  1981. "scale : array_like\n"
  1982. " Positive, real-valued distribution scale\n"
  1983. "\n"
  1984. "Returns\n"
  1985. "-------\n"
  1986. "scalar or ndarray")
  1987. ufunc__landau_isf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  1988. ufunc__landau_isf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  1989. ufunc__landau_isf_types[0] = <char>NPY_FLOAT
  1990. ufunc__landau_isf_types[1] = <char>NPY_FLOAT
  1991. ufunc__landau_isf_types[2] = <char>NPY_FLOAT
  1992. ufunc__landau_isf_types[3] = <char>NPY_FLOAT
  1993. ufunc__landau_isf_types[4] = <char>NPY_DOUBLE
  1994. ufunc__landau_isf_types[5] = <char>NPY_DOUBLE
  1995. ufunc__landau_isf_types[6] = <char>NPY_DOUBLE
  1996. ufunc__landau_isf_types[7] = <char>NPY_DOUBLE
  1997. ufunc__landau_isf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_landau_isf_float
  1998. ufunc__landau_isf_ptr[2*0+1] = <void*>(<char*>"_landau_isf")
  1999. ufunc__landau_isf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_landau_isf_double
  2000. ufunc__landau_isf_ptr[2*1+1] = <void*>(<char*>"_landau_isf")
  2001. ufunc__landau_isf_data[0] = &ufunc__landau_isf_ptr[2*0]
  2002. ufunc__landau_isf_data[1] = &ufunc__landau_isf_ptr[2*1]
  2003. _landau_isf = np.PyUFunc_FromFuncAndData(ufunc__landau_isf_loops, ufunc__landau_isf_data, ufunc__landau_isf_types, 2, 3, 1, 0, '_landau_isf', ufunc__landau_isf_doc, 0)
  2004. cdef np.PyUFuncGenericFunction ufunc__landau_pdf_loops[2]
  2005. cdef void *ufunc__landau_pdf_ptr[4]
  2006. cdef void *ufunc__landau_pdf_data[2]
  2007. cdef char ufunc__landau_pdf_types[8]
  2008. cdef char *ufunc__landau_pdf_doc = (
  2009. "_landau_pdf(x, loc, scale)\n"
  2010. "\n"
  2011. "Probability density function of the Landau distribution.\n"
  2012. "\n"
  2013. "Parameters\n"
  2014. "----------\n"
  2015. "x : array_like\n"
  2016. " Real-valued argument\n"
  2017. "loc : array_like\n"
  2018. " Real-valued distribution location\n"
  2019. "scale : array_like\n"
  2020. " Positive, real-valued distribution scale\n"
  2021. "\n"
  2022. "Returns\n"
  2023. "-------\n"
  2024. "scalar or ndarray")
  2025. ufunc__landau_pdf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2026. ufunc__landau_pdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2027. ufunc__landau_pdf_types[0] = <char>NPY_FLOAT
  2028. ufunc__landau_pdf_types[1] = <char>NPY_FLOAT
  2029. ufunc__landau_pdf_types[2] = <char>NPY_FLOAT
  2030. ufunc__landau_pdf_types[3] = <char>NPY_FLOAT
  2031. ufunc__landau_pdf_types[4] = <char>NPY_DOUBLE
  2032. ufunc__landau_pdf_types[5] = <char>NPY_DOUBLE
  2033. ufunc__landau_pdf_types[6] = <char>NPY_DOUBLE
  2034. ufunc__landau_pdf_types[7] = <char>NPY_DOUBLE
  2035. ufunc__landau_pdf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_landau_pdf_float
  2036. ufunc__landau_pdf_ptr[2*0+1] = <void*>(<char*>"_landau_pdf")
  2037. ufunc__landau_pdf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_landau_pdf_double
  2038. ufunc__landau_pdf_ptr[2*1+1] = <void*>(<char*>"_landau_pdf")
  2039. ufunc__landau_pdf_data[0] = &ufunc__landau_pdf_ptr[2*0]
  2040. ufunc__landau_pdf_data[1] = &ufunc__landau_pdf_ptr[2*1]
  2041. _landau_pdf = np.PyUFunc_FromFuncAndData(ufunc__landau_pdf_loops, ufunc__landau_pdf_data, ufunc__landau_pdf_types, 2, 3, 1, 0, '_landau_pdf', ufunc__landau_pdf_doc, 0)
  2042. cdef np.PyUFuncGenericFunction ufunc__landau_ppf_loops[2]
  2043. cdef void *ufunc__landau_ppf_ptr[4]
  2044. cdef void *ufunc__landau_ppf_data[2]
  2045. cdef char ufunc__landau_ppf_types[8]
  2046. cdef char *ufunc__landau_ppf_doc = (
  2047. "_landau_ppf(p, loc, scale)\n"
  2048. "\n"
  2049. "Percent point function of the Landau distribution.\n"
  2050. "\n"
  2051. "Parameters\n"
  2052. "----------\n"
  2053. "p : array_like\n"
  2054. " Real-valued argument between 0 and 1\n"
  2055. "loc : array_like\n"
  2056. " Real-valued distribution location\n"
  2057. "scale : array_like\n"
  2058. " Positive, real-valued distribution scale\n"
  2059. "\n"
  2060. "Returns\n"
  2061. "-------\n"
  2062. "scalar or ndarray")
  2063. ufunc__landau_ppf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2064. ufunc__landau_ppf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2065. ufunc__landau_ppf_types[0] = <char>NPY_FLOAT
  2066. ufunc__landau_ppf_types[1] = <char>NPY_FLOAT
  2067. ufunc__landau_ppf_types[2] = <char>NPY_FLOAT
  2068. ufunc__landau_ppf_types[3] = <char>NPY_FLOAT
  2069. ufunc__landau_ppf_types[4] = <char>NPY_DOUBLE
  2070. ufunc__landau_ppf_types[5] = <char>NPY_DOUBLE
  2071. ufunc__landau_ppf_types[6] = <char>NPY_DOUBLE
  2072. ufunc__landau_ppf_types[7] = <char>NPY_DOUBLE
  2073. ufunc__landau_ppf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_landau_ppf_float
  2074. ufunc__landau_ppf_ptr[2*0+1] = <void*>(<char*>"_landau_ppf")
  2075. ufunc__landau_ppf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_landau_ppf_double
  2076. ufunc__landau_ppf_ptr[2*1+1] = <void*>(<char*>"_landau_ppf")
  2077. ufunc__landau_ppf_data[0] = &ufunc__landau_ppf_ptr[2*0]
  2078. ufunc__landau_ppf_data[1] = &ufunc__landau_ppf_ptr[2*1]
  2079. _landau_ppf = np.PyUFunc_FromFuncAndData(ufunc__landau_ppf_loops, ufunc__landau_ppf_data, ufunc__landau_ppf_types, 2, 3, 1, 0, '_landau_ppf', ufunc__landau_ppf_doc, 0)
  2080. cdef np.PyUFuncGenericFunction ufunc__landau_sf_loops[2]
  2081. cdef void *ufunc__landau_sf_ptr[4]
  2082. cdef void *ufunc__landau_sf_data[2]
  2083. cdef char ufunc__landau_sf_types[8]
  2084. cdef char *ufunc__landau_sf_doc = (
  2085. "_landau_sf(x, loc, scale)\n"
  2086. "\n"
  2087. "Survival function of the Landau distribution.\n"
  2088. "\n"
  2089. "Parameters\n"
  2090. "----------\n"
  2091. "x : array_like\n"
  2092. " Real-valued argument\n"
  2093. "loc : array_like\n"
  2094. " Real-valued distribution location\n"
  2095. "scale : array_like\n"
  2096. " Positive, real-valued distribution scale\n"
  2097. "\n"
  2098. "Returns\n"
  2099. "-------\n"
  2100. "scalar or ndarray")
  2101. ufunc__landau_sf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2102. ufunc__landau_sf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2103. ufunc__landau_sf_types[0] = <char>NPY_FLOAT
  2104. ufunc__landau_sf_types[1] = <char>NPY_FLOAT
  2105. ufunc__landau_sf_types[2] = <char>NPY_FLOAT
  2106. ufunc__landau_sf_types[3] = <char>NPY_FLOAT
  2107. ufunc__landau_sf_types[4] = <char>NPY_DOUBLE
  2108. ufunc__landau_sf_types[5] = <char>NPY_DOUBLE
  2109. ufunc__landau_sf_types[6] = <char>NPY_DOUBLE
  2110. ufunc__landau_sf_types[7] = <char>NPY_DOUBLE
  2111. ufunc__landau_sf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_landau_sf_float
  2112. ufunc__landau_sf_ptr[2*0+1] = <void*>(<char*>"_landau_sf")
  2113. ufunc__landau_sf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_landau_sf_double
  2114. ufunc__landau_sf_ptr[2*1+1] = <void*>(<char*>"_landau_sf")
  2115. ufunc__landau_sf_data[0] = &ufunc__landau_sf_ptr[2*0]
  2116. ufunc__landau_sf_data[1] = &ufunc__landau_sf_ptr[2*1]
  2117. _landau_sf = np.PyUFunc_FromFuncAndData(ufunc__landau_sf_loops, ufunc__landau_sf_data, ufunc__landau_sf_types, 2, 3, 1, 0, '_landau_sf', ufunc__landau_sf_doc, 0)
  2118. cdef np.PyUFuncGenericFunction ufunc__lgam1p_loops[2]
  2119. cdef void *ufunc__lgam1p_ptr[4]
  2120. cdef void *ufunc__lgam1p_data[2]
  2121. cdef char ufunc__lgam1p_types[4]
  2122. cdef char *ufunc__lgam1p_doc = (
  2123. "Internal function, do not use.")
  2124. ufunc__lgam1p_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  2125. ufunc__lgam1p_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  2126. ufunc__lgam1p_types[0] = <char>NPY_FLOAT
  2127. ufunc__lgam1p_types[1] = <char>NPY_FLOAT
  2128. ufunc__lgam1p_types[2] = <char>NPY_DOUBLE
  2129. ufunc__lgam1p_types[3] = <char>NPY_DOUBLE
  2130. ufunc__lgam1p_ptr[2*0] = <void*>_func_cephes_lgam1p
  2131. ufunc__lgam1p_ptr[2*0+1] = <void*>(<char*>"_lgam1p")
  2132. ufunc__lgam1p_ptr[2*1] = <void*>_func_cephes_lgam1p
  2133. ufunc__lgam1p_ptr[2*1+1] = <void*>(<char*>"_lgam1p")
  2134. ufunc__lgam1p_data[0] = &ufunc__lgam1p_ptr[2*0]
  2135. ufunc__lgam1p_data[1] = &ufunc__lgam1p_ptr[2*1]
  2136. _lgam1p = np.PyUFunc_FromFuncAndData(ufunc__lgam1p_loops, ufunc__lgam1p_data, ufunc__lgam1p_types, 2, 1, 1, 0, '_lgam1p', ufunc__lgam1p_doc, 0)
  2137. cdef np.PyUFuncGenericFunction ufunc__nbinom_cdf_loops[2]
  2138. cdef void *ufunc__nbinom_cdf_ptr[4]
  2139. cdef void *ufunc__nbinom_cdf_data[2]
  2140. cdef char ufunc__nbinom_cdf_types[8]
  2141. cdef char *ufunc__nbinom_cdf_doc = (
  2142. "_nbinom_cdf(x, r, p)\n"
  2143. "\n"
  2144. "Cumulative density function of negative binomial distribution.\n"
  2145. "\n"
  2146. "Parameters\n"
  2147. "----------\n"
  2148. "x : array_like\n"
  2149. " Real-valued\n"
  2150. "r : array_like\n"
  2151. " Positive, integer-valued parameter\n"
  2152. "p : array_like\n"
  2153. " Positive, real-valued parameter\n"
  2154. "\n"
  2155. "Returns\n"
  2156. "-------\n"
  2157. "scalar or ndarray")
  2158. ufunc__nbinom_cdf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2159. ufunc__nbinom_cdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2160. ufunc__nbinom_cdf_types[0] = <char>NPY_FLOAT
  2161. ufunc__nbinom_cdf_types[1] = <char>NPY_FLOAT
  2162. ufunc__nbinom_cdf_types[2] = <char>NPY_FLOAT
  2163. ufunc__nbinom_cdf_types[3] = <char>NPY_FLOAT
  2164. ufunc__nbinom_cdf_types[4] = <char>NPY_DOUBLE
  2165. ufunc__nbinom_cdf_types[5] = <char>NPY_DOUBLE
  2166. ufunc__nbinom_cdf_types[6] = <char>NPY_DOUBLE
  2167. ufunc__nbinom_cdf_types[7] = <char>NPY_DOUBLE
  2168. ufunc__nbinom_cdf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nbinom_cdf_float
  2169. ufunc__nbinom_cdf_ptr[2*0+1] = <void*>(<char*>"_nbinom_cdf")
  2170. ufunc__nbinom_cdf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nbinom_cdf_double
  2171. ufunc__nbinom_cdf_ptr[2*1+1] = <void*>(<char*>"_nbinom_cdf")
  2172. ufunc__nbinom_cdf_data[0] = &ufunc__nbinom_cdf_ptr[2*0]
  2173. ufunc__nbinom_cdf_data[1] = &ufunc__nbinom_cdf_ptr[2*1]
  2174. _nbinom_cdf = np.PyUFunc_FromFuncAndData(ufunc__nbinom_cdf_loops, ufunc__nbinom_cdf_data, ufunc__nbinom_cdf_types, 2, 3, 1, 0, '_nbinom_cdf', ufunc__nbinom_cdf_doc, 0)
  2175. cdef np.PyUFuncGenericFunction ufunc__nbinom_isf_loops[2]
  2176. cdef void *ufunc__nbinom_isf_ptr[4]
  2177. cdef void *ufunc__nbinom_isf_data[2]
  2178. cdef char ufunc__nbinom_isf_types[8]
  2179. cdef char *ufunc__nbinom_isf_doc = (
  2180. "_nbinom_isf(x, r, p)\n"
  2181. "\n"
  2182. "Inverse survival function of negative binomial distribution.\n"
  2183. "\n"
  2184. "Parameters\n"
  2185. "----------\n"
  2186. "x : array_like\n"
  2187. " Real-valued\n"
  2188. "r : array_like\n"
  2189. " Positive, integer-valued parameter\n"
  2190. "p : array_like\n"
  2191. " Positive, real-valued parameter\n"
  2192. "\n"
  2193. "Returns\n"
  2194. "-------\n"
  2195. "scalar or ndarray")
  2196. ufunc__nbinom_isf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2197. ufunc__nbinom_isf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2198. ufunc__nbinom_isf_types[0] = <char>NPY_FLOAT
  2199. ufunc__nbinom_isf_types[1] = <char>NPY_FLOAT
  2200. ufunc__nbinom_isf_types[2] = <char>NPY_FLOAT
  2201. ufunc__nbinom_isf_types[3] = <char>NPY_FLOAT
  2202. ufunc__nbinom_isf_types[4] = <char>NPY_DOUBLE
  2203. ufunc__nbinom_isf_types[5] = <char>NPY_DOUBLE
  2204. ufunc__nbinom_isf_types[6] = <char>NPY_DOUBLE
  2205. ufunc__nbinom_isf_types[7] = <char>NPY_DOUBLE
  2206. ufunc__nbinom_isf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nbinom_isf_float
  2207. ufunc__nbinom_isf_ptr[2*0+1] = <void*>(<char*>"_nbinom_isf")
  2208. ufunc__nbinom_isf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nbinom_isf_double
  2209. ufunc__nbinom_isf_ptr[2*1+1] = <void*>(<char*>"_nbinom_isf")
  2210. ufunc__nbinom_isf_data[0] = &ufunc__nbinom_isf_ptr[2*0]
  2211. ufunc__nbinom_isf_data[1] = &ufunc__nbinom_isf_ptr[2*1]
  2212. _nbinom_isf = np.PyUFunc_FromFuncAndData(ufunc__nbinom_isf_loops, ufunc__nbinom_isf_data, ufunc__nbinom_isf_types, 2, 3, 1, 0, '_nbinom_isf', ufunc__nbinom_isf_doc, 0)
  2213. cdef np.PyUFuncGenericFunction ufunc__nbinom_kurtosis_excess_loops[2]
  2214. cdef void *ufunc__nbinom_kurtosis_excess_ptr[4]
  2215. cdef void *ufunc__nbinom_kurtosis_excess_data[2]
  2216. cdef char ufunc__nbinom_kurtosis_excess_types[6]
  2217. cdef char *ufunc__nbinom_kurtosis_excess_doc = (
  2218. "_nbinom_kurtosis_excess(r, p)\n"
  2219. "\n"
  2220. "Kurtosis excess of negative binomial distribution.\n"
  2221. "\n"
  2222. "Parameters\n"
  2223. "----------\n"
  2224. "r : array_like\n"
  2225. " Positive, integer-valued parameter\n"
  2226. "p : array_like\n"
  2227. " Positive, real-valued parameter\n"
  2228. "\n"
  2229. "Returns\n"
  2230. "-------\n"
  2231. "scalar or ndarray")
  2232. ufunc__nbinom_kurtosis_excess_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  2233. ufunc__nbinom_kurtosis_excess_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  2234. ufunc__nbinom_kurtosis_excess_types[0] = <char>NPY_FLOAT
  2235. ufunc__nbinom_kurtosis_excess_types[1] = <char>NPY_FLOAT
  2236. ufunc__nbinom_kurtosis_excess_types[2] = <char>NPY_FLOAT
  2237. ufunc__nbinom_kurtosis_excess_types[3] = <char>NPY_DOUBLE
  2238. ufunc__nbinom_kurtosis_excess_types[4] = <char>NPY_DOUBLE
  2239. ufunc__nbinom_kurtosis_excess_types[5] = <char>NPY_DOUBLE
  2240. ufunc__nbinom_kurtosis_excess_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nbinom_kurtosis_excess_float
  2241. ufunc__nbinom_kurtosis_excess_ptr[2*0+1] = <void*>(<char*>"_nbinom_kurtosis_excess")
  2242. ufunc__nbinom_kurtosis_excess_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nbinom_kurtosis_excess_double
  2243. ufunc__nbinom_kurtosis_excess_ptr[2*1+1] = <void*>(<char*>"_nbinom_kurtosis_excess")
  2244. ufunc__nbinom_kurtosis_excess_data[0] = &ufunc__nbinom_kurtosis_excess_ptr[2*0]
  2245. ufunc__nbinom_kurtosis_excess_data[1] = &ufunc__nbinom_kurtosis_excess_ptr[2*1]
  2246. _nbinom_kurtosis_excess = np.PyUFunc_FromFuncAndData(ufunc__nbinom_kurtosis_excess_loops, ufunc__nbinom_kurtosis_excess_data, ufunc__nbinom_kurtosis_excess_types, 2, 2, 1, 0, '_nbinom_kurtosis_excess', ufunc__nbinom_kurtosis_excess_doc, 0)
  2247. cdef np.PyUFuncGenericFunction ufunc__nbinom_mean_loops[2]
  2248. cdef void *ufunc__nbinom_mean_ptr[4]
  2249. cdef void *ufunc__nbinom_mean_data[2]
  2250. cdef char ufunc__nbinom_mean_types[6]
  2251. cdef char *ufunc__nbinom_mean_doc = (
  2252. "_nbinom_mean(r, p)\n"
  2253. "\n"
  2254. "Mean of negative binomial distribution.\n"
  2255. "\n"
  2256. "Parameters\n"
  2257. "----------\n"
  2258. "r : array_like\n"
  2259. " Positive, integer-valued parameter\n"
  2260. "p : array_like\n"
  2261. " Positive, real-valued parameter\n"
  2262. "\n"
  2263. "Returns\n"
  2264. "-------\n"
  2265. "scalar or ndarray")
  2266. ufunc__nbinom_mean_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  2267. ufunc__nbinom_mean_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  2268. ufunc__nbinom_mean_types[0] = <char>NPY_FLOAT
  2269. ufunc__nbinom_mean_types[1] = <char>NPY_FLOAT
  2270. ufunc__nbinom_mean_types[2] = <char>NPY_FLOAT
  2271. ufunc__nbinom_mean_types[3] = <char>NPY_DOUBLE
  2272. ufunc__nbinom_mean_types[4] = <char>NPY_DOUBLE
  2273. ufunc__nbinom_mean_types[5] = <char>NPY_DOUBLE
  2274. ufunc__nbinom_mean_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nbinom_mean_float
  2275. ufunc__nbinom_mean_ptr[2*0+1] = <void*>(<char*>"_nbinom_mean")
  2276. ufunc__nbinom_mean_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nbinom_mean_double
  2277. ufunc__nbinom_mean_ptr[2*1+1] = <void*>(<char*>"_nbinom_mean")
  2278. ufunc__nbinom_mean_data[0] = &ufunc__nbinom_mean_ptr[2*0]
  2279. ufunc__nbinom_mean_data[1] = &ufunc__nbinom_mean_ptr[2*1]
  2280. _nbinom_mean = np.PyUFunc_FromFuncAndData(ufunc__nbinom_mean_loops, ufunc__nbinom_mean_data, ufunc__nbinom_mean_types, 2, 2, 1, 0, '_nbinom_mean', ufunc__nbinom_mean_doc, 0)
  2281. cdef np.PyUFuncGenericFunction ufunc__nbinom_pmf_loops[2]
  2282. cdef void *ufunc__nbinom_pmf_ptr[4]
  2283. cdef void *ufunc__nbinom_pmf_data[2]
  2284. cdef char ufunc__nbinom_pmf_types[8]
  2285. cdef char *ufunc__nbinom_pmf_doc = (
  2286. "_nbinom_pmf(x, r, p)\n"
  2287. "\n"
  2288. "Probability mass function of negative binomial distribution.\n"
  2289. "\n"
  2290. "Parameters\n"
  2291. "----------\n"
  2292. "x : array_like\n"
  2293. " Real-valued\n"
  2294. "r : array_like\n"
  2295. " Positive, integer-valued parameter\n"
  2296. "p : array_like\n"
  2297. " Positive, real-valued parameter\n"
  2298. "\n"
  2299. "Returns\n"
  2300. "-------\n"
  2301. "scalar or ndarray")
  2302. ufunc__nbinom_pmf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2303. ufunc__nbinom_pmf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2304. ufunc__nbinom_pmf_types[0] = <char>NPY_FLOAT
  2305. ufunc__nbinom_pmf_types[1] = <char>NPY_FLOAT
  2306. ufunc__nbinom_pmf_types[2] = <char>NPY_FLOAT
  2307. ufunc__nbinom_pmf_types[3] = <char>NPY_FLOAT
  2308. ufunc__nbinom_pmf_types[4] = <char>NPY_DOUBLE
  2309. ufunc__nbinom_pmf_types[5] = <char>NPY_DOUBLE
  2310. ufunc__nbinom_pmf_types[6] = <char>NPY_DOUBLE
  2311. ufunc__nbinom_pmf_types[7] = <char>NPY_DOUBLE
  2312. ufunc__nbinom_pmf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nbinom_pmf_float
  2313. ufunc__nbinom_pmf_ptr[2*0+1] = <void*>(<char*>"_nbinom_pmf")
  2314. ufunc__nbinom_pmf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nbinom_pmf_double
  2315. ufunc__nbinom_pmf_ptr[2*1+1] = <void*>(<char*>"_nbinom_pmf")
  2316. ufunc__nbinom_pmf_data[0] = &ufunc__nbinom_pmf_ptr[2*0]
  2317. ufunc__nbinom_pmf_data[1] = &ufunc__nbinom_pmf_ptr[2*1]
  2318. _nbinom_pmf = np.PyUFunc_FromFuncAndData(ufunc__nbinom_pmf_loops, ufunc__nbinom_pmf_data, ufunc__nbinom_pmf_types, 2, 3, 1, 0, '_nbinom_pmf', ufunc__nbinom_pmf_doc, 0)
  2319. cdef np.PyUFuncGenericFunction ufunc__nbinom_ppf_loops[2]
  2320. cdef void *ufunc__nbinom_ppf_ptr[4]
  2321. cdef void *ufunc__nbinom_ppf_data[2]
  2322. cdef char ufunc__nbinom_ppf_types[8]
  2323. cdef char *ufunc__nbinom_ppf_doc = (
  2324. "_nbinom_ppf(x, r, p)\n"
  2325. "\n"
  2326. "Percent point function of negative binomial distribution.\n"
  2327. "\n"
  2328. "Parameters\n"
  2329. "----------\n"
  2330. "x : array_like\n"
  2331. " Real-valued\n"
  2332. "r : array_like\n"
  2333. " Positive, integer-valued parameter\n"
  2334. "p : array_like\n"
  2335. " Positive, real-valued parameter\n"
  2336. "\n"
  2337. "Returns\n"
  2338. "-------\n"
  2339. "scalar or ndarray")
  2340. ufunc__nbinom_ppf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2341. ufunc__nbinom_ppf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2342. ufunc__nbinom_ppf_types[0] = <char>NPY_FLOAT
  2343. ufunc__nbinom_ppf_types[1] = <char>NPY_FLOAT
  2344. ufunc__nbinom_ppf_types[2] = <char>NPY_FLOAT
  2345. ufunc__nbinom_ppf_types[3] = <char>NPY_FLOAT
  2346. ufunc__nbinom_ppf_types[4] = <char>NPY_DOUBLE
  2347. ufunc__nbinom_ppf_types[5] = <char>NPY_DOUBLE
  2348. ufunc__nbinom_ppf_types[6] = <char>NPY_DOUBLE
  2349. ufunc__nbinom_ppf_types[7] = <char>NPY_DOUBLE
  2350. ufunc__nbinom_ppf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nbinom_ppf_float
  2351. ufunc__nbinom_ppf_ptr[2*0+1] = <void*>(<char*>"_nbinom_ppf")
  2352. ufunc__nbinom_ppf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nbinom_ppf_double
  2353. ufunc__nbinom_ppf_ptr[2*1+1] = <void*>(<char*>"_nbinom_ppf")
  2354. ufunc__nbinom_ppf_data[0] = &ufunc__nbinom_ppf_ptr[2*0]
  2355. ufunc__nbinom_ppf_data[1] = &ufunc__nbinom_ppf_ptr[2*1]
  2356. _nbinom_ppf = np.PyUFunc_FromFuncAndData(ufunc__nbinom_ppf_loops, ufunc__nbinom_ppf_data, ufunc__nbinom_ppf_types, 2, 3, 1, 0, '_nbinom_ppf', ufunc__nbinom_ppf_doc, 0)
  2357. cdef np.PyUFuncGenericFunction ufunc__nbinom_sf_loops[2]
  2358. cdef void *ufunc__nbinom_sf_ptr[4]
  2359. cdef void *ufunc__nbinom_sf_data[2]
  2360. cdef char ufunc__nbinom_sf_types[8]
  2361. cdef char *ufunc__nbinom_sf_doc = (
  2362. "_nbinom_sf(x, r, p)\n"
  2363. "\n"
  2364. "Survival function of negative binomial distribution.\n"
  2365. "\n"
  2366. "Parameters\n"
  2367. "----------\n"
  2368. "x : array_like\n"
  2369. " Real-valued\n"
  2370. "r : array_like\n"
  2371. " Positive, integer-valued parameter\n"
  2372. "p : array_like\n"
  2373. " Positive, real-valued parameter\n"
  2374. "\n"
  2375. "Returns\n"
  2376. "-------\n"
  2377. "scalar or ndarray")
  2378. ufunc__nbinom_sf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2379. ufunc__nbinom_sf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2380. ufunc__nbinom_sf_types[0] = <char>NPY_FLOAT
  2381. ufunc__nbinom_sf_types[1] = <char>NPY_FLOAT
  2382. ufunc__nbinom_sf_types[2] = <char>NPY_FLOAT
  2383. ufunc__nbinom_sf_types[3] = <char>NPY_FLOAT
  2384. ufunc__nbinom_sf_types[4] = <char>NPY_DOUBLE
  2385. ufunc__nbinom_sf_types[5] = <char>NPY_DOUBLE
  2386. ufunc__nbinom_sf_types[6] = <char>NPY_DOUBLE
  2387. ufunc__nbinom_sf_types[7] = <char>NPY_DOUBLE
  2388. ufunc__nbinom_sf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nbinom_sf_float
  2389. ufunc__nbinom_sf_ptr[2*0+1] = <void*>(<char*>"_nbinom_sf")
  2390. ufunc__nbinom_sf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nbinom_sf_double
  2391. ufunc__nbinom_sf_ptr[2*1+1] = <void*>(<char*>"_nbinom_sf")
  2392. ufunc__nbinom_sf_data[0] = &ufunc__nbinom_sf_ptr[2*0]
  2393. ufunc__nbinom_sf_data[1] = &ufunc__nbinom_sf_ptr[2*1]
  2394. _nbinom_sf = np.PyUFunc_FromFuncAndData(ufunc__nbinom_sf_loops, ufunc__nbinom_sf_data, ufunc__nbinom_sf_types, 2, 3, 1, 0, '_nbinom_sf', ufunc__nbinom_sf_doc, 0)
  2395. cdef np.PyUFuncGenericFunction ufunc__nbinom_skewness_loops[2]
  2396. cdef void *ufunc__nbinom_skewness_ptr[4]
  2397. cdef void *ufunc__nbinom_skewness_data[2]
  2398. cdef char ufunc__nbinom_skewness_types[6]
  2399. cdef char *ufunc__nbinom_skewness_doc = (
  2400. "_nbinom_skewness(r, p)\n"
  2401. "\n"
  2402. "Skewness of negative binomial distribution.\n"
  2403. "\n"
  2404. "Parameters\n"
  2405. "----------\n"
  2406. "r : array_like\n"
  2407. " Positive, integer-valued parameter\n"
  2408. "p : array_like\n"
  2409. " Positive, real-valued parameter\n"
  2410. "\n"
  2411. "Returns\n"
  2412. "-------\n"
  2413. "scalar or ndarray")
  2414. ufunc__nbinom_skewness_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  2415. ufunc__nbinom_skewness_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  2416. ufunc__nbinom_skewness_types[0] = <char>NPY_FLOAT
  2417. ufunc__nbinom_skewness_types[1] = <char>NPY_FLOAT
  2418. ufunc__nbinom_skewness_types[2] = <char>NPY_FLOAT
  2419. ufunc__nbinom_skewness_types[3] = <char>NPY_DOUBLE
  2420. ufunc__nbinom_skewness_types[4] = <char>NPY_DOUBLE
  2421. ufunc__nbinom_skewness_types[5] = <char>NPY_DOUBLE
  2422. ufunc__nbinom_skewness_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nbinom_skewness_float
  2423. ufunc__nbinom_skewness_ptr[2*0+1] = <void*>(<char*>"_nbinom_skewness")
  2424. ufunc__nbinom_skewness_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nbinom_skewness_double
  2425. ufunc__nbinom_skewness_ptr[2*1+1] = <void*>(<char*>"_nbinom_skewness")
  2426. ufunc__nbinom_skewness_data[0] = &ufunc__nbinom_skewness_ptr[2*0]
  2427. ufunc__nbinom_skewness_data[1] = &ufunc__nbinom_skewness_ptr[2*1]
  2428. _nbinom_skewness = np.PyUFunc_FromFuncAndData(ufunc__nbinom_skewness_loops, ufunc__nbinom_skewness_data, ufunc__nbinom_skewness_types, 2, 2, 1, 0, '_nbinom_skewness', ufunc__nbinom_skewness_doc, 0)
  2429. cdef np.PyUFuncGenericFunction ufunc__nbinom_variance_loops[2]
  2430. cdef void *ufunc__nbinom_variance_ptr[4]
  2431. cdef void *ufunc__nbinom_variance_data[2]
  2432. cdef char ufunc__nbinom_variance_types[6]
  2433. cdef char *ufunc__nbinom_variance_doc = (
  2434. "_nbinom_variance(r, p)\n"
  2435. "\n"
  2436. "Variance of negative binomial distribution.\n"
  2437. "\n"
  2438. "Parameters\n"
  2439. "----------\n"
  2440. "r : array_like\n"
  2441. " Positive, integer-valued parameter\n"
  2442. "p : array_like\n"
  2443. " Positive, real-valued parameter\n"
  2444. "\n"
  2445. "Returns\n"
  2446. "-------\n"
  2447. "scalar or ndarray")
  2448. ufunc__nbinom_variance_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  2449. ufunc__nbinom_variance_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  2450. ufunc__nbinom_variance_types[0] = <char>NPY_FLOAT
  2451. ufunc__nbinom_variance_types[1] = <char>NPY_FLOAT
  2452. ufunc__nbinom_variance_types[2] = <char>NPY_FLOAT
  2453. ufunc__nbinom_variance_types[3] = <char>NPY_DOUBLE
  2454. ufunc__nbinom_variance_types[4] = <char>NPY_DOUBLE
  2455. ufunc__nbinom_variance_types[5] = <char>NPY_DOUBLE
  2456. ufunc__nbinom_variance_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nbinom_variance_float
  2457. ufunc__nbinom_variance_ptr[2*0+1] = <void*>(<char*>"_nbinom_variance")
  2458. ufunc__nbinom_variance_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nbinom_variance_double
  2459. ufunc__nbinom_variance_ptr[2*1+1] = <void*>(<char*>"_nbinom_variance")
  2460. ufunc__nbinom_variance_data[0] = &ufunc__nbinom_variance_ptr[2*0]
  2461. ufunc__nbinom_variance_data[1] = &ufunc__nbinom_variance_ptr[2*1]
  2462. _nbinom_variance = np.PyUFunc_FromFuncAndData(ufunc__nbinom_variance_loops, ufunc__nbinom_variance_data, ufunc__nbinom_variance_types, 2, 2, 1, 0, '_nbinom_variance', ufunc__nbinom_variance_doc, 0)
  2463. cdef np.PyUFuncGenericFunction ufunc__ncf_isf_loops[2]
  2464. cdef void *ufunc__ncf_isf_ptr[4]
  2465. cdef void *ufunc__ncf_isf_data[2]
  2466. cdef char ufunc__ncf_isf_types[10]
  2467. cdef char *ufunc__ncf_isf_doc = (
  2468. "_ncf_isf(x, v1, v2, l)\n"
  2469. "\n"
  2470. "Inverse survival function of noncentral F-distribution.\n"
  2471. "\n"
  2472. "Parameters\n"
  2473. "----------\n"
  2474. "x : array_like\n"
  2475. " Positive real-valued\n"
  2476. "v1, v2, l : array_like\n"
  2477. " Positive, real-valued parameters\n"
  2478. "\n"
  2479. "Returns\n"
  2480. "-------\n"
  2481. "scalar or ndarray")
  2482. ufunc__ncf_isf_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  2483. ufunc__ncf_isf_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  2484. ufunc__ncf_isf_types[0] = <char>NPY_FLOAT
  2485. ufunc__ncf_isf_types[1] = <char>NPY_FLOAT
  2486. ufunc__ncf_isf_types[2] = <char>NPY_FLOAT
  2487. ufunc__ncf_isf_types[3] = <char>NPY_FLOAT
  2488. ufunc__ncf_isf_types[4] = <char>NPY_FLOAT
  2489. ufunc__ncf_isf_types[5] = <char>NPY_DOUBLE
  2490. ufunc__ncf_isf_types[6] = <char>NPY_DOUBLE
  2491. ufunc__ncf_isf_types[7] = <char>NPY_DOUBLE
  2492. ufunc__ncf_isf_types[8] = <char>NPY_DOUBLE
  2493. ufunc__ncf_isf_types[9] = <char>NPY_DOUBLE
  2494. ufunc__ncf_isf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncf_isf_float
  2495. ufunc__ncf_isf_ptr[2*0+1] = <void*>(<char*>"_ncf_isf")
  2496. ufunc__ncf_isf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncf_isf_double
  2497. ufunc__ncf_isf_ptr[2*1+1] = <void*>(<char*>"_ncf_isf")
  2498. ufunc__ncf_isf_data[0] = &ufunc__ncf_isf_ptr[2*0]
  2499. ufunc__ncf_isf_data[1] = &ufunc__ncf_isf_ptr[2*1]
  2500. _ncf_isf = np.PyUFunc_FromFuncAndData(ufunc__ncf_isf_loops, ufunc__ncf_isf_data, ufunc__ncf_isf_types, 2, 4, 1, 0, '_ncf_isf', ufunc__ncf_isf_doc, 0)
  2501. cdef np.PyUFuncGenericFunction ufunc__ncf_kurtosis_excess_loops[2]
  2502. cdef void *ufunc__ncf_kurtosis_excess_ptr[4]
  2503. cdef void *ufunc__ncf_kurtosis_excess_data[2]
  2504. cdef char ufunc__ncf_kurtosis_excess_types[8]
  2505. cdef char *ufunc__ncf_kurtosis_excess_doc = (
  2506. "_ncf_kurtosis_excess(v1, v2, l)\n"
  2507. "\n"
  2508. "Kurtosis excess of noncentral F-distribution.\n"
  2509. "\n"
  2510. "Parameters\n"
  2511. "----------\n"
  2512. "v1, v2, l : array_like\n"
  2513. " Positive, real-valued parameters\n"
  2514. "\n"
  2515. "Returns\n"
  2516. "-------\n"
  2517. "scalar or ndarray")
  2518. ufunc__ncf_kurtosis_excess_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2519. ufunc__ncf_kurtosis_excess_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2520. ufunc__ncf_kurtosis_excess_types[0] = <char>NPY_FLOAT
  2521. ufunc__ncf_kurtosis_excess_types[1] = <char>NPY_FLOAT
  2522. ufunc__ncf_kurtosis_excess_types[2] = <char>NPY_FLOAT
  2523. ufunc__ncf_kurtosis_excess_types[3] = <char>NPY_FLOAT
  2524. ufunc__ncf_kurtosis_excess_types[4] = <char>NPY_DOUBLE
  2525. ufunc__ncf_kurtosis_excess_types[5] = <char>NPY_DOUBLE
  2526. ufunc__ncf_kurtosis_excess_types[6] = <char>NPY_DOUBLE
  2527. ufunc__ncf_kurtosis_excess_types[7] = <char>NPY_DOUBLE
  2528. ufunc__ncf_kurtosis_excess_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncf_kurtosis_excess_float
  2529. ufunc__ncf_kurtosis_excess_ptr[2*0+1] = <void*>(<char*>"_ncf_kurtosis_excess")
  2530. ufunc__ncf_kurtosis_excess_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncf_kurtosis_excess_double
  2531. ufunc__ncf_kurtosis_excess_ptr[2*1+1] = <void*>(<char*>"_ncf_kurtosis_excess")
  2532. ufunc__ncf_kurtosis_excess_data[0] = &ufunc__ncf_kurtosis_excess_ptr[2*0]
  2533. ufunc__ncf_kurtosis_excess_data[1] = &ufunc__ncf_kurtosis_excess_ptr[2*1]
  2534. _ncf_kurtosis_excess = np.PyUFunc_FromFuncAndData(ufunc__ncf_kurtosis_excess_loops, ufunc__ncf_kurtosis_excess_data, ufunc__ncf_kurtosis_excess_types, 2, 3, 1, 0, '_ncf_kurtosis_excess', ufunc__ncf_kurtosis_excess_doc, 0)
  2535. cdef np.PyUFuncGenericFunction ufunc__ncf_mean_loops[2]
  2536. cdef void *ufunc__ncf_mean_ptr[4]
  2537. cdef void *ufunc__ncf_mean_data[2]
  2538. cdef char ufunc__ncf_mean_types[8]
  2539. cdef char *ufunc__ncf_mean_doc = (
  2540. "_ncf_mean(v1, v2, l)\n"
  2541. "\n"
  2542. "Mean of noncentral F-distribution.\n"
  2543. "\n"
  2544. "Parameters\n"
  2545. "----------\n"
  2546. "v1, v2, l : array_like\n"
  2547. " Positive, real-valued parameters\n"
  2548. "\n"
  2549. "Returns\n"
  2550. "-------\n"
  2551. "scalar or ndarray")
  2552. ufunc__ncf_mean_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2553. ufunc__ncf_mean_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2554. ufunc__ncf_mean_types[0] = <char>NPY_FLOAT
  2555. ufunc__ncf_mean_types[1] = <char>NPY_FLOAT
  2556. ufunc__ncf_mean_types[2] = <char>NPY_FLOAT
  2557. ufunc__ncf_mean_types[3] = <char>NPY_FLOAT
  2558. ufunc__ncf_mean_types[4] = <char>NPY_DOUBLE
  2559. ufunc__ncf_mean_types[5] = <char>NPY_DOUBLE
  2560. ufunc__ncf_mean_types[6] = <char>NPY_DOUBLE
  2561. ufunc__ncf_mean_types[7] = <char>NPY_DOUBLE
  2562. ufunc__ncf_mean_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncf_mean_float
  2563. ufunc__ncf_mean_ptr[2*0+1] = <void*>(<char*>"_ncf_mean")
  2564. ufunc__ncf_mean_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncf_mean_double
  2565. ufunc__ncf_mean_ptr[2*1+1] = <void*>(<char*>"_ncf_mean")
  2566. ufunc__ncf_mean_data[0] = &ufunc__ncf_mean_ptr[2*0]
  2567. ufunc__ncf_mean_data[1] = &ufunc__ncf_mean_ptr[2*1]
  2568. _ncf_mean = np.PyUFunc_FromFuncAndData(ufunc__ncf_mean_loops, ufunc__ncf_mean_data, ufunc__ncf_mean_types, 2, 3, 1, 0, '_ncf_mean', ufunc__ncf_mean_doc, 0)
  2569. cdef np.PyUFuncGenericFunction ufunc__ncf_pdf_loops[2]
  2570. cdef void *ufunc__ncf_pdf_ptr[4]
  2571. cdef void *ufunc__ncf_pdf_data[2]
  2572. cdef char ufunc__ncf_pdf_types[10]
  2573. cdef char *ufunc__ncf_pdf_doc = (
  2574. "_ncf_pdf(x, v1, v2, l)\n"
  2575. "\n"
  2576. "Probability density function of noncentral F-distribution.\n"
  2577. "\n"
  2578. "Parameters\n"
  2579. "----------\n"
  2580. "x : array_like\n"
  2581. " Positive real-valued\n"
  2582. "v1, v2, l : array_like\n"
  2583. " Positive, real-valued parameters\n"
  2584. "\n"
  2585. "Returns\n"
  2586. "-------\n"
  2587. "scalar or ndarray")
  2588. ufunc__ncf_pdf_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  2589. ufunc__ncf_pdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  2590. ufunc__ncf_pdf_types[0] = <char>NPY_FLOAT
  2591. ufunc__ncf_pdf_types[1] = <char>NPY_FLOAT
  2592. ufunc__ncf_pdf_types[2] = <char>NPY_FLOAT
  2593. ufunc__ncf_pdf_types[3] = <char>NPY_FLOAT
  2594. ufunc__ncf_pdf_types[4] = <char>NPY_FLOAT
  2595. ufunc__ncf_pdf_types[5] = <char>NPY_DOUBLE
  2596. ufunc__ncf_pdf_types[6] = <char>NPY_DOUBLE
  2597. ufunc__ncf_pdf_types[7] = <char>NPY_DOUBLE
  2598. ufunc__ncf_pdf_types[8] = <char>NPY_DOUBLE
  2599. ufunc__ncf_pdf_types[9] = <char>NPY_DOUBLE
  2600. ufunc__ncf_pdf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncf_pdf_float
  2601. ufunc__ncf_pdf_ptr[2*0+1] = <void*>(<char*>"_ncf_pdf")
  2602. ufunc__ncf_pdf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncf_pdf_double
  2603. ufunc__ncf_pdf_ptr[2*1+1] = <void*>(<char*>"_ncf_pdf")
  2604. ufunc__ncf_pdf_data[0] = &ufunc__ncf_pdf_ptr[2*0]
  2605. ufunc__ncf_pdf_data[1] = &ufunc__ncf_pdf_ptr[2*1]
  2606. _ncf_pdf = np.PyUFunc_FromFuncAndData(ufunc__ncf_pdf_loops, ufunc__ncf_pdf_data, ufunc__ncf_pdf_types, 2, 4, 1, 0, '_ncf_pdf', ufunc__ncf_pdf_doc, 0)
  2607. cdef np.PyUFuncGenericFunction ufunc__ncf_sf_loops[2]
  2608. cdef void *ufunc__ncf_sf_ptr[4]
  2609. cdef void *ufunc__ncf_sf_data[2]
  2610. cdef char ufunc__ncf_sf_types[10]
  2611. cdef char *ufunc__ncf_sf_doc = (
  2612. "_ncf_sf(x, v1, v2, l)\n"
  2613. "\n"
  2614. "Survival function of noncentral F-distribution.\n"
  2615. "\n"
  2616. "Parameters\n"
  2617. "----------\n"
  2618. "x : array_like\n"
  2619. " Positive real-valued\n"
  2620. "v1, v2, l : array_like\n"
  2621. " Positive, real-valued parameters\n"
  2622. "\n"
  2623. "Returns\n"
  2624. "-------\n"
  2625. "scalar or ndarray")
  2626. ufunc__ncf_sf_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  2627. ufunc__ncf_sf_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  2628. ufunc__ncf_sf_types[0] = <char>NPY_FLOAT
  2629. ufunc__ncf_sf_types[1] = <char>NPY_FLOAT
  2630. ufunc__ncf_sf_types[2] = <char>NPY_FLOAT
  2631. ufunc__ncf_sf_types[3] = <char>NPY_FLOAT
  2632. ufunc__ncf_sf_types[4] = <char>NPY_FLOAT
  2633. ufunc__ncf_sf_types[5] = <char>NPY_DOUBLE
  2634. ufunc__ncf_sf_types[6] = <char>NPY_DOUBLE
  2635. ufunc__ncf_sf_types[7] = <char>NPY_DOUBLE
  2636. ufunc__ncf_sf_types[8] = <char>NPY_DOUBLE
  2637. ufunc__ncf_sf_types[9] = <char>NPY_DOUBLE
  2638. ufunc__ncf_sf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncf_sf_float
  2639. ufunc__ncf_sf_ptr[2*0+1] = <void*>(<char*>"_ncf_sf")
  2640. ufunc__ncf_sf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncf_sf_double
  2641. ufunc__ncf_sf_ptr[2*1+1] = <void*>(<char*>"_ncf_sf")
  2642. ufunc__ncf_sf_data[0] = &ufunc__ncf_sf_ptr[2*0]
  2643. ufunc__ncf_sf_data[1] = &ufunc__ncf_sf_ptr[2*1]
  2644. _ncf_sf = np.PyUFunc_FromFuncAndData(ufunc__ncf_sf_loops, ufunc__ncf_sf_data, ufunc__ncf_sf_types, 2, 4, 1, 0, '_ncf_sf', ufunc__ncf_sf_doc, 0)
  2645. cdef np.PyUFuncGenericFunction ufunc__ncf_skewness_loops[2]
  2646. cdef void *ufunc__ncf_skewness_ptr[4]
  2647. cdef void *ufunc__ncf_skewness_data[2]
  2648. cdef char ufunc__ncf_skewness_types[8]
  2649. cdef char *ufunc__ncf_skewness_doc = (
  2650. "_ncf_skewness(v1, v2, l)\n"
  2651. "\n"
  2652. "Skewness of noncentral F-distribution.\n"
  2653. "\n"
  2654. "Parameters\n"
  2655. "----------\n"
  2656. "v1, v2, l : array_like\n"
  2657. " Positive, real-valued parameters\n"
  2658. "\n"
  2659. "Returns\n"
  2660. "-------\n"
  2661. "scalar or ndarray")
  2662. ufunc__ncf_skewness_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2663. ufunc__ncf_skewness_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2664. ufunc__ncf_skewness_types[0] = <char>NPY_FLOAT
  2665. ufunc__ncf_skewness_types[1] = <char>NPY_FLOAT
  2666. ufunc__ncf_skewness_types[2] = <char>NPY_FLOAT
  2667. ufunc__ncf_skewness_types[3] = <char>NPY_FLOAT
  2668. ufunc__ncf_skewness_types[4] = <char>NPY_DOUBLE
  2669. ufunc__ncf_skewness_types[5] = <char>NPY_DOUBLE
  2670. ufunc__ncf_skewness_types[6] = <char>NPY_DOUBLE
  2671. ufunc__ncf_skewness_types[7] = <char>NPY_DOUBLE
  2672. ufunc__ncf_skewness_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncf_skewness_float
  2673. ufunc__ncf_skewness_ptr[2*0+1] = <void*>(<char*>"_ncf_skewness")
  2674. ufunc__ncf_skewness_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncf_skewness_double
  2675. ufunc__ncf_skewness_ptr[2*1+1] = <void*>(<char*>"_ncf_skewness")
  2676. ufunc__ncf_skewness_data[0] = &ufunc__ncf_skewness_ptr[2*0]
  2677. ufunc__ncf_skewness_data[1] = &ufunc__ncf_skewness_ptr[2*1]
  2678. _ncf_skewness = np.PyUFunc_FromFuncAndData(ufunc__ncf_skewness_loops, ufunc__ncf_skewness_data, ufunc__ncf_skewness_types, 2, 3, 1, 0, '_ncf_skewness', ufunc__ncf_skewness_doc, 0)
  2679. cdef np.PyUFuncGenericFunction ufunc__ncf_variance_loops[2]
  2680. cdef void *ufunc__ncf_variance_ptr[4]
  2681. cdef void *ufunc__ncf_variance_data[2]
  2682. cdef char ufunc__ncf_variance_types[8]
  2683. cdef char *ufunc__ncf_variance_doc = (
  2684. "_ncf_variance(v1, v2, l)\n"
  2685. "\n"
  2686. "Variance of noncentral F-distribution.\n"
  2687. "\n"
  2688. "Parameters\n"
  2689. "----------\n"
  2690. "v1, v2, l : array_like\n"
  2691. " Positive, real-valued parameters\n"
  2692. "\n"
  2693. "Returns\n"
  2694. "-------\n"
  2695. "scalar or ndarray")
  2696. ufunc__ncf_variance_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2697. ufunc__ncf_variance_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2698. ufunc__ncf_variance_types[0] = <char>NPY_FLOAT
  2699. ufunc__ncf_variance_types[1] = <char>NPY_FLOAT
  2700. ufunc__ncf_variance_types[2] = <char>NPY_FLOAT
  2701. ufunc__ncf_variance_types[3] = <char>NPY_FLOAT
  2702. ufunc__ncf_variance_types[4] = <char>NPY_DOUBLE
  2703. ufunc__ncf_variance_types[5] = <char>NPY_DOUBLE
  2704. ufunc__ncf_variance_types[6] = <char>NPY_DOUBLE
  2705. ufunc__ncf_variance_types[7] = <char>NPY_DOUBLE
  2706. ufunc__ncf_variance_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncf_variance_float
  2707. ufunc__ncf_variance_ptr[2*0+1] = <void*>(<char*>"_ncf_variance")
  2708. ufunc__ncf_variance_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncf_variance_double
  2709. ufunc__ncf_variance_ptr[2*1+1] = <void*>(<char*>"_ncf_variance")
  2710. ufunc__ncf_variance_data[0] = &ufunc__ncf_variance_ptr[2*0]
  2711. ufunc__ncf_variance_data[1] = &ufunc__ncf_variance_ptr[2*1]
  2712. _ncf_variance = np.PyUFunc_FromFuncAndData(ufunc__ncf_variance_loops, ufunc__ncf_variance_data, ufunc__ncf_variance_types, 2, 3, 1, 0, '_ncf_variance', ufunc__ncf_variance_doc, 0)
  2713. cdef np.PyUFuncGenericFunction ufunc__nct_isf_loops[2]
  2714. cdef void *ufunc__nct_isf_ptr[4]
  2715. cdef void *ufunc__nct_isf_data[2]
  2716. cdef char ufunc__nct_isf_types[8]
  2717. cdef char *ufunc__nct_isf_doc = (
  2718. "_nct_isf(x, v, l)\n"
  2719. "\n"
  2720. "Inverse survival function of noncentral t-distribution.\n"
  2721. "\n"
  2722. "Parameters\n"
  2723. "----------\n"
  2724. "x : array_like\n"
  2725. " Real-valued\n"
  2726. "v : array_like\n"
  2727. " Positive, real-valued parameters\n"
  2728. "l : array_like\n"
  2729. " Real-valued parameters\n"
  2730. "\n"
  2731. "Returns\n"
  2732. "-------\n"
  2733. "scalar or ndarray")
  2734. ufunc__nct_isf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2735. ufunc__nct_isf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2736. ufunc__nct_isf_types[0] = <char>NPY_FLOAT
  2737. ufunc__nct_isf_types[1] = <char>NPY_FLOAT
  2738. ufunc__nct_isf_types[2] = <char>NPY_FLOAT
  2739. ufunc__nct_isf_types[3] = <char>NPY_FLOAT
  2740. ufunc__nct_isf_types[4] = <char>NPY_DOUBLE
  2741. ufunc__nct_isf_types[5] = <char>NPY_DOUBLE
  2742. ufunc__nct_isf_types[6] = <char>NPY_DOUBLE
  2743. ufunc__nct_isf_types[7] = <char>NPY_DOUBLE
  2744. ufunc__nct_isf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nct_isf_float
  2745. ufunc__nct_isf_ptr[2*0+1] = <void*>(<char*>"_nct_isf")
  2746. ufunc__nct_isf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nct_isf_double
  2747. ufunc__nct_isf_ptr[2*1+1] = <void*>(<char*>"_nct_isf")
  2748. ufunc__nct_isf_data[0] = &ufunc__nct_isf_ptr[2*0]
  2749. ufunc__nct_isf_data[1] = &ufunc__nct_isf_ptr[2*1]
  2750. _nct_isf = np.PyUFunc_FromFuncAndData(ufunc__nct_isf_loops, ufunc__nct_isf_data, ufunc__nct_isf_types, 2, 3, 1, 0, '_nct_isf', ufunc__nct_isf_doc, 0)
  2751. cdef np.PyUFuncGenericFunction ufunc__nct_kurtosis_excess_loops[2]
  2752. cdef void *ufunc__nct_kurtosis_excess_ptr[4]
  2753. cdef void *ufunc__nct_kurtosis_excess_data[2]
  2754. cdef char ufunc__nct_kurtosis_excess_types[6]
  2755. cdef char *ufunc__nct_kurtosis_excess_doc = (
  2756. "_nct_kurtosis_excess(v, l)\n"
  2757. "\n"
  2758. "Kurtosis excess of noncentral t-distribution.\n"
  2759. "\n"
  2760. "Parameters\n"
  2761. "----------\n"
  2762. "v : array_like\n"
  2763. " Positive, real-valued parameters\n"
  2764. "l : array_like\n"
  2765. " Real-valued parameters\n"
  2766. "\n"
  2767. "Returns\n"
  2768. "-------\n"
  2769. "scalar or ndarray")
  2770. ufunc__nct_kurtosis_excess_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  2771. ufunc__nct_kurtosis_excess_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  2772. ufunc__nct_kurtosis_excess_types[0] = <char>NPY_FLOAT
  2773. ufunc__nct_kurtosis_excess_types[1] = <char>NPY_FLOAT
  2774. ufunc__nct_kurtosis_excess_types[2] = <char>NPY_FLOAT
  2775. ufunc__nct_kurtosis_excess_types[3] = <char>NPY_DOUBLE
  2776. ufunc__nct_kurtosis_excess_types[4] = <char>NPY_DOUBLE
  2777. ufunc__nct_kurtosis_excess_types[5] = <char>NPY_DOUBLE
  2778. ufunc__nct_kurtosis_excess_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nct_kurtosis_excess_float
  2779. ufunc__nct_kurtosis_excess_ptr[2*0+1] = <void*>(<char*>"_nct_kurtosis_excess")
  2780. ufunc__nct_kurtosis_excess_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nct_kurtosis_excess_double
  2781. ufunc__nct_kurtosis_excess_ptr[2*1+1] = <void*>(<char*>"_nct_kurtosis_excess")
  2782. ufunc__nct_kurtosis_excess_data[0] = &ufunc__nct_kurtosis_excess_ptr[2*0]
  2783. ufunc__nct_kurtosis_excess_data[1] = &ufunc__nct_kurtosis_excess_ptr[2*1]
  2784. _nct_kurtosis_excess = np.PyUFunc_FromFuncAndData(ufunc__nct_kurtosis_excess_loops, ufunc__nct_kurtosis_excess_data, ufunc__nct_kurtosis_excess_types, 2, 2, 1, 0, '_nct_kurtosis_excess', ufunc__nct_kurtosis_excess_doc, 0)
  2785. cdef np.PyUFuncGenericFunction ufunc__nct_mean_loops[2]
  2786. cdef void *ufunc__nct_mean_ptr[4]
  2787. cdef void *ufunc__nct_mean_data[2]
  2788. cdef char ufunc__nct_mean_types[6]
  2789. cdef char *ufunc__nct_mean_doc = (
  2790. "_nct_mean(v, l)\n"
  2791. "\n"
  2792. "Mean of noncentral t-distribution.\n"
  2793. "\n"
  2794. "Parameters\n"
  2795. "----------\n"
  2796. "v : array_like\n"
  2797. " Positive, real-valued parameters\n"
  2798. "l : array_like\n"
  2799. " Real-valued parameters\n"
  2800. "\n"
  2801. "Returns\n"
  2802. "-------\n"
  2803. "scalar or ndarray")
  2804. ufunc__nct_mean_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  2805. ufunc__nct_mean_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  2806. ufunc__nct_mean_types[0] = <char>NPY_FLOAT
  2807. ufunc__nct_mean_types[1] = <char>NPY_FLOAT
  2808. ufunc__nct_mean_types[2] = <char>NPY_FLOAT
  2809. ufunc__nct_mean_types[3] = <char>NPY_DOUBLE
  2810. ufunc__nct_mean_types[4] = <char>NPY_DOUBLE
  2811. ufunc__nct_mean_types[5] = <char>NPY_DOUBLE
  2812. ufunc__nct_mean_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nct_mean_float
  2813. ufunc__nct_mean_ptr[2*0+1] = <void*>(<char*>"_nct_mean")
  2814. ufunc__nct_mean_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nct_mean_double
  2815. ufunc__nct_mean_ptr[2*1+1] = <void*>(<char*>"_nct_mean")
  2816. ufunc__nct_mean_data[0] = &ufunc__nct_mean_ptr[2*0]
  2817. ufunc__nct_mean_data[1] = &ufunc__nct_mean_ptr[2*1]
  2818. _nct_mean = np.PyUFunc_FromFuncAndData(ufunc__nct_mean_loops, ufunc__nct_mean_data, ufunc__nct_mean_types, 2, 2, 1, 0, '_nct_mean', ufunc__nct_mean_doc, 0)
  2819. cdef np.PyUFuncGenericFunction ufunc__nct_pdf_loops[2]
  2820. cdef void *ufunc__nct_pdf_ptr[4]
  2821. cdef void *ufunc__nct_pdf_data[2]
  2822. cdef char ufunc__nct_pdf_types[8]
  2823. cdef char *ufunc__nct_pdf_doc = (
  2824. "_nct_pdf(x, v, l)\n"
  2825. "\n"
  2826. "Probability density function of noncentral t-distribution.\n"
  2827. "\n"
  2828. "Parameters\n"
  2829. "----------\n"
  2830. "x : array_like\n"
  2831. " Real-valued\n"
  2832. "v : array_like\n"
  2833. " Positive, real-valued parameters\n"
  2834. "l : array_like\n"
  2835. " Real-valued parameters\n"
  2836. "\n"
  2837. "Returns\n"
  2838. "-------\n"
  2839. "scalar or ndarray")
  2840. ufunc__nct_pdf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2841. ufunc__nct_pdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2842. ufunc__nct_pdf_types[0] = <char>NPY_FLOAT
  2843. ufunc__nct_pdf_types[1] = <char>NPY_FLOAT
  2844. ufunc__nct_pdf_types[2] = <char>NPY_FLOAT
  2845. ufunc__nct_pdf_types[3] = <char>NPY_FLOAT
  2846. ufunc__nct_pdf_types[4] = <char>NPY_DOUBLE
  2847. ufunc__nct_pdf_types[5] = <char>NPY_DOUBLE
  2848. ufunc__nct_pdf_types[6] = <char>NPY_DOUBLE
  2849. ufunc__nct_pdf_types[7] = <char>NPY_DOUBLE
  2850. ufunc__nct_pdf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nct_pdf_float
  2851. ufunc__nct_pdf_ptr[2*0+1] = <void*>(<char*>"_nct_pdf")
  2852. ufunc__nct_pdf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nct_pdf_double
  2853. ufunc__nct_pdf_ptr[2*1+1] = <void*>(<char*>"_nct_pdf")
  2854. ufunc__nct_pdf_data[0] = &ufunc__nct_pdf_ptr[2*0]
  2855. ufunc__nct_pdf_data[1] = &ufunc__nct_pdf_ptr[2*1]
  2856. _nct_pdf = np.PyUFunc_FromFuncAndData(ufunc__nct_pdf_loops, ufunc__nct_pdf_data, ufunc__nct_pdf_types, 2, 3, 1, 0, '_nct_pdf', ufunc__nct_pdf_doc, 0)
  2857. cdef np.PyUFuncGenericFunction ufunc__nct_sf_loops[2]
  2858. cdef void *ufunc__nct_sf_ptr[4]
  2859. cdef void *ufunc__nct_sf_data[2]
  2860. cdef char ufunc__nct_sf_types[8]
  2861. cdef char *ufunc__nct_sf_doc = (
  2862. "_nct_sf(x, v, l)\n"
  2863. "\n"
  2864. "Survival function of noncentral t-distribution.\n"
  2865. "\n"
  2866. "Parameters\n"
  2867. "----------\n"
  2868. "x : array_like\n"
  2869. " Real-valued\n"
  2870. "v : array_like\n"
  2871. " Positive, real-valued parameters\n"
  2872. "l : array_like\n"
  2873. " Real-valued parameters\n"
  2874. "\n"
  2875. "Returns\n"
  2876. "-------\n"
  2877. "scalar or ndarray")
  2878. ufunc__nct_sf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2879. ufunc__nct_sf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2880. ufunc__nct_sf_types[0] = <char>NPY_FLOAT
  2881. ufunc__nct_sf_types[1] = <char>NPY_FLOAT
  2882. ufunc__nct_sf_types[2] = <char>NPY_FLOAT
  2883. ufunc__nct_sf_types[3] = <char>NPY_FLOAT
  2884. ufunc__nct_sf_types[4] = <char>NPY_DOUBLE
  2885. ufunc__nct_sf_types[5] = <char>NPY_DOUBLE
  2886. ufunc__nct_sf_types[6] = <char>NPY_DOUBLE
  2887. ufunc__nct_sf_types[7] = <char>NPY_DOUBLE
  2888. ufunc__nct_sf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nct_sf_float
  2889. ufunc__nct_sf_ptr[2*0+1] = <void*>(<char*>"_nct_sf")
  2890. ufunc__nct_sf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nct_sf_double
  2891. ufunc__nct_sf_ptr[2*1+1] = <void*>(<char*>"_nct_sf")
  2892. ufunc__nct_sf_data[0] = &ufunc__nct_sf_ptr[2*0]
  2893. ufunc__nct_sf_data[1] = &ufunc__nct_sf_ptr[2*1]
  2894. _nct_sf = np.PyUFunc_FromFuncAndData(ufunc__nct_sf_loops, ufunc__nct_sf_data, ufunc__nct_sf_types, 2, 3, 1, 0, '_nct_sf', ufunc__nct_sf_doc, 0)
  2895. cdef np.PyUFuncGenericFunction ufunc__nct_skewness_loops[2]
  2896. cdef void *ufunc__nct_skewness_ptr[4]
  2897. cdef void *ufunc__nct_skewness_data[2]
  2898. cdef char ufunc__nct_skewness_types[6]
  2899. cdef char *ufunc__nct_skewness_doc = (
  2900. "_nct_skewness(v, l)\n"
  2901. "\n"
  2902. "Skewness of noncentral t-distribution.\n"
  2903. "\n"
  2904. "Parameters\n"
  2905. "----------\n"
  2906. "v : array_like\n"
  2907. " Positive, real-valued parameters\n"
  2908. "l : array_like\n"
  2909. " Real-valued parameters\n"
  2910. "\n"
  2911. "Returns\n"
  2912. "-------\n"
  2913. "scalar or ndarray")
  2914. ufunc__nct_skewness_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  2915. ufunc__nct_skewness_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  2916. ufunc__nct_skewness_types[0] = <char>NPY_FLOAT
  2917. ufunc__nct_skewness_types[1] = <char>NPY_FLOAT
  2918. ufunc__nct_skewness_types[2] = <char>NPY_FLOAT
  2919. ufunc__nct_skewness_types[3] = <char>NPY_DOUBLE
  2920. ufunc__nct_skewness_types[4] = <char>NPY_DOUBLE
  2921. ufunc__nct_skewness_types[5] = <char>NPY_DOUBLE
  2922. ufunc__nct_skewness_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nct_skewness_float
  2923. ufunc__nct_skewness_ptr[2*0+1] = <void*>(<char*>"_nct_skewness")
  2924. ufunc__nct_skewness_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nct_skewness_double
  2925. ufunc__nct_skewness_ptr[2*1+1] = <void*>(<char*>"_nct_skewness")
  2926. ufunc__nct_skewness_data[0] = &ufunc__nct_skewness_ptr[2*0]
  2927. ufunc__nct_skewness_data[1] = &ufunc__nct_skewness_ptr[2*1]
  2928. _nct_skewness = np.PyUFunc_FromFuncAndData(ufunc__nct_skewness_loops, ufunc__nct_skewness_data, ufunc__nct_skewness_types, 2, 2, 1, 0, '_nct_skewness', ufunc__nct_skewness_doc, 0)
  2929. cdef np.PyUFuncGenericFunction ufunc__nct_variance_loops[2]
  2930. cdef void *ufunc__nct_variance_ptr[4]
  2931. cdef void *ufunc__nct_variance_data[2]
  2932. cdef char ufunc__nct_variance_types[6]
  2933. cdef char *ufunc__nct_variance_doc = (
  2934. "_nct_variance(v, l)\n"
  2935. "\n"
  2936. "Variance of noncentral t-distribution.\n"
  2937. "\n"
  2938. "Parameters\n"
  2939. "----------\n"
  2940. "v : array_like\n"
  2941. " Positive, real-valued parameters\n"
  2942. "l : array_like\n"
  2943. " Real-valued parameters\n"
  2944. "\n"
  2945. "Returns\n"
  2946. "-------\n"
  2947. "scalar or ndarray")
  2948. ufunc__nct_variance_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  2949. ufunc__nct_variance_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  2950. ufunc__nct_variance_types[0] = <char>NPY_FLOAT
  2951. ufunc__nct_variance_types[1] = <char>NPY_FLOAT
  2952. ufunc__nct_variance_types[2] = <char>NPY_FLOAT
  2953. ufunc__nct_variance_types[3] = <char>NPY_DOUBLE
  2954. ufunc__nct_variance_types[4] = <char>NPY_DOUBLE
  2955. ufunc__nct_variance_types[5] = <char>NPY_DOUBLE
  2956. ufunc__nct_variance_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nct_variance_float
  2957. ufunc__nct_variance_ptr[2*0+1] = <void*>(<char*>"_nct_variance")
  2958. ufunc__nct_variance_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nct_variance_double
  2959. ufunc__nct_variance_ptr[2*1+1] = <void*>(<char*>"_nct_variance")
  2960. ufunc__nct_variance_data[0] = &ufunc__nct_variance_ptr[2*0]
  2961. ufunc__nct_variance_data[1] = &ufunc__nct_variance_ptr[2*1]
  2962. _nct_variance = np.PyUFunc_FromFuncAndData(ufunc__nct_variance_loops, ufunc__nct_variance_data, ufunc__nct_variance_types, 2, 2, 1, 0, '_nct_variance', ufunc__nct_variance_doc, 0)
  2963. cdef np.PyUFuncGenericFunction ufunc__ncx2_isf_loops[2]
  2964. cdef void *ufunc__ncx2_isf_ptr[4]
  2965. cdef void *ufunc__ncx2_isf_data[2]
  2966. cdef char ufunc__ncx2_isf_types[8]
  2967. cdef char *ufunc__ncx2_isf_doc = (
  2968. "_ncx2_isf(x, k, l)\n"
  2969. "\n"
  2970. "Inverse survival function of Non-central chi-squared distribution.\n"
  2971. "\n"
  2972. "Parameters\n"
  2973. "----------\n"
  2974. "x : array_like\n"
  2975. " Positive real-valued\n"
  2976. "k, l : array_like\n"
  2977. " Positive, real-valued parameters\n"
  2978. "\n"
  2979. "Returns\n"
  2980. "-------\n"
  2981. "scalar or ndarray")
  2982. ufunc__ncx2_isf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  2983. ufunc__ncx2_isf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  2984. ufunc__ncx2_isf_types[0] = <char>NPY_FLOAT
  2985. ufunc__ncx2_isf_types[1] = <char>NPY_FLOAT
  2986. ufunc__ncx2_isf_types[2] = <char>NPY_FLOAT
  2987. ufunc__ncx2_isf_types[3] = <char>NPY_FLOAT
  2988. ufunc__ncx2_isf_types[4] = <char>NPY_DOUBLE
  2989. ufunc__ncx2_isf_types[5] = <char>NPY_DOUBLE
  2990. ufunc__ncx2_isf_types[6] = <char>NPY_DOUBLE
  2991. ufunc__ncx2_isf_types[7] = <char>NPY_DOUBLE
  2992. ufunc__ncx2_isf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncx2_isf_float
  2993. ufunc__ncx2_isf_ptr[2*0+1] = <void*>(<char*>"_ncx2_isf")
  2994. ufunc__ncx2_isf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncx2_isf_double
  2995. ufunc__ncx2_isf_ptr[2*1+1] = <void*>(<char*>"_ncx2_isf")
  2996. ufunc__ncx2_isf_data[0] = &ufunc__ncx2_isf_ptr[2*0]
  2997. ufunc__ncx2_isf_data[1] = &ufunc__ncx2_isf_ptr[2*1]
  2998. _ncx2_isf = np.PyUFunc_FromFuncAndData(ufunc__ncx2_isf_loops, ufunc__ncx2_isf_data, ufunc__ncx2_isf_types, 2, 3, 1, 0, '_ncx2_isf', ufunc__ncx2_isf_doc, 0)
  2999. cdef np.PyUFuncGenericFunction ufunc__ncx2_pdf_loops[2]
  3000. cdef void *ufunc__ncx2_pdf_ptr[4]
  3001. cdef void *ufunc__ncx2_pdf_data[2]
  3002. cdef char ufunc__ncx2_pdf_types[8]
  3003. cdef char *ufunc__ncx2_pdf_doc = (
  3004. "_ncx2_pdf(x, k, l)\n"
  3005. "\n"
  3006. "Probability density function of Non-central chi-squared distribution.\n"
  3007. "\n"
  3008. "Parameters\n"
  3009. "----------\n"
  3010. "x : array_like\n"
  3011. " Positive real-valued\n"
  3012. "k, l : array_like\n"
  3013. " Positive, real-valued parameters\n"
  3014. "\n"
  3015. "Returns\n"
  3016. "-------\n"
  3017. "scalar or ndarray")
  3018. ufunc__ncx2_pdf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  3019. ufunc__ncx2_pdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  3020. ufunc__ncx2_pdf_types[0] = <char>NPY_FLOAT
  3021. ufunc__ncx2_pdf_types[1] = <char>NPY_FLOAT
  3022. ufunc__ncx2_pdf_types[2] = <char>NPY_FLOAT
  3023. ufunc__ncx2_pdf_types[3] = <char>NPY_FLOAT
  3024. ufunc__ncx2_pdf_types[4] = <char>NPY_DOUBLE
  3025. ufunc__ncx2_pdf_types[5] = <char>NPY_DOUBLE
  3026. ufunc__ncx2_pdf_types[6] = <char>NPY_DOUBLE
  3027. ufunc__ncx2_pdf_types[7] = <char>NPY_DOUBLE
  3028. ufunc__ncx2_pdf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncx2_pdf_float
  3029. ufunc__ncx2_pdf_ptr[2*0+1] = <void*>(<char*>"_ncx2_pdf")
  3030. ufunc__ncx2_pdf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncx2_pdf_double
  3031. ufunc__ncx2_pdf_ptr[2*1+1] = <void*>(<char*>"_ncx2_pdf")
  3032. ufunc__ncx2_pdf_data[0] = &ufunc__ncx2_pdf_ptr[2*0]
  3033. ufunc__ncx2_pdf_data[1] = &ufunc__ncx2_pdf_ptr[2*1]
  3034. _ncx2_pdf = np.PyUFunc_FromFuncAndData(ufunc__ncx2_pdf_loops, ufunc__ncx2_pdf_data, ufunc__ncx2_pdf_types, 2, 3, 1, 0, '_ncx2_pdf', ufunc__ncx2_pdf_doc, 0)
  3035. cdef np.PyUFuncGenericFunction ufunc__ncx2_sf_loops[2]
  3036. cdef void *ufunc__ncx2_sf_ptr[4]
  3037. cdef void *ufunc__ncx2_sf_data[2]
  3038. cdef char ufunc__ncx2_sf_types[8]
  3039. cdef char *ufunc__ncx2_sf_doc = (
  3040. "_ncx2_sf(x, k, l)\n"
  3041. "\n"
  3042. "Survival function of Non-central chi-squared distribution.\n"
  3043. "\n"
  3044. "Parameters\n"
  3045. "----------\n"
  3046. "x : array_like\n"
  3047. " Positive real-valued\n"
  3048. "k, l : array_like\n"
  3049. " Positive, real-valued parameters\n"
  3050. "\n"
  3051. "Returns\n"
  3052. "-------\n"
  3053. "scalar or ndarray")
  3054. ufunc__ncx2_sf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  3055. ufunc__ncx2_sf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  3056. ufunc__ncx2_sf_types[0] = <char>NPY_FLOAT
  3057. ufunc__ncx2_sf_types[1] = <char>NPY_FLOAT
  3058. ufunc__ncx2_sf_types[2] = <char>NPY_FLOAT
  3059. ufunc__ncx2_sf_types[3] = <char>NPY_FLOAT
  3060. ufunc__ncx2_sf_types[4] = <char>NPY_DOUBLE
  3061. ufunc__ncx2_sf_types[5] = <char>NPY_DOUBLE
  3062. ufunc__ncx2_sf_types[6] = <char>NPY_DOUBLE
  3063. ufunc__ncx2_sf_types[7] = <char>NPY_DOUBLE
  3064. ufunc__ncx2_sf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncx2_sf_float
  3065. ufunc__ncx2_sf_ptr[2*0+1] = <void*>(<char*>"_ncx2_sf")
  3066. ufunc__ncx2_sf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncx2_sf_double
  3067. ufunc__ncx2_sf_ptr[2*1+1] = <void*>(<char*>"_ncx2_sf")
  3068. ufunc__ncx2_sf_data[0] = &ufunc__ncx2_sf_ptr[2*0]
  3069. ufunc__ncx2_sf_data[1] = &ufunc__ncx2_sf_ptr[2*1]
  3070. _ncx2_sf = np.PyUFunc_FromFuncAndData(ufunc__ncx2_sf_loops, ufunc__ncx2_sf_data, ufunc__ncx2_sf_types, 2, 3, 1, 0, '_ncx2_sf', ufunc__ncx2_sf_doc, 0)
  3071. cdef np.PyUFuncGenericFunction ufunc__sf_error_test_function_loops[1]
  3072. cdef void *ufunc__sf_error_test_function_ptr[2]
  3073. cdef void *ufunc__sf_error_test_function_data[1]
  3074. cdef char ufunc__sf_error_test_function_types[2]
  3075. cdef char *ufunc__sf_error_test_function_doc = (
  3076. "Private function; do not use.")
  3077. ufunc__sf_error_test_function_loops[0] = <np.PyUFuncGenericFunction>loop_i_i__As_l_l
  3078. ufunc__sf_error_test_function_types[0] = <char>NPY_LONG
  3079. ufunc__sf_error_test_function_types[1] = <char>NPY_LONG
  3080. ufunc__sf_error_test_function_ptr[2*0] = <void*>_func__sf_error_test_function
  3081. ufunc__sf_error_test_function_ptr[2*0+1] = <void*>(<char*>"_sf_error_test_function")
  3082. ufunc__sf_error_test_function_data[0] = &ufunc__sf_error_test_function_ptr[2*0]
  3083. _sf_error_test_function = np.PyUFunc_FromFuncAndData(ufunc__sf_error_test_function_loops, ufunc__sf_error_test_function_data, ufunc__sf_error_test_function_types, 1, 1, 1, 0, '_sf_error_test_function', ufunc__sf_error_test_function_doc, 0)
  3084. cdef np.PyUFuncGenericFunction ufunc__skewnorm_cdf_loops[2]
  3085. cdef void *ufunc__skewnorm_cdf_ptr[4]
  3086. cdef void *ufunc__skewnorm_cdf_data[2]
  3087. cdef char ufunc__skewnorm_cdf_types[10]
  3088. cdef char *ufunc__skewnorm_cdf_doc = (
  3089. "_skewnorm_cdf(x, l, sc, sh)\n"
  3090. "\n"
  3091. "Cumulative density function of skewnorm distribution.\n"
  3092. "\n"
  3093. "Parameters\n"
  3094. "----------\n"
  3095. "x : array_like\n"
  3096. " Real-valued\n"
  3097. "l : array_like\n"
  3098. " Real-valued parameters\n"
  3099. "sc : array_like\n"
  3100. " Positive, Real-valued parameters\n"
  3101. "sh : array_like\n"
  3102. " Real-valued parameters\n"
  3103. "\n"
  3104. "Returns\n"
  3105. "-------\n"
  3106. "scalar or ndarray")
  3107. ufunc__skewnorm_cdf_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  3108. ufunc__skewnorm_cdf_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  3109. ufunc__skewnorm_cdf_types[0] = <char>NPY_FLOAT
  3110. ufunc__skewnorm_cdf_types[1] = <char>NPY_FLOAT
  3111. ufunc__skewnorm_cdf_types[2] = <char>NPY_FLOAT
  3112. ufunc__skewnorm_cdf_types[3] = <char>NPY_FLOAT
  3113. ufunc__skewnorm_cdf_types[4] = <char>NPY_FLOAT
  3114. ufunc__skewnorm_cdf_types[5] = <char>NPY_DOUBLE
  3115. ufunc__skewnorm_cdf_types[6] = <char>NPY_DOUBLE
  3116. ufunc__skewnorm_cdf_types[7] = <char>NPY_DOUBLE
  3117. ufunc__skewnorm_cdf_types[8] = <char>NPY_DOUBLE
  3118. ufunc__skewnorm_cdf_types[9] = <char>NPY_DOUBLE
  3119. ufunc__skewnorm_cdf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_skewnorm_cdf_float
  3120. ufunc__skewnorm_cdf_ptr[2*0+1] = <void*>(<char*>"_skewnorm_cdf")
  3121. ufunc__skewnorm_cdf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_skewnorm_cdf_double
  3122. ufunc__skewnorm_cdf_ptr[2*1+1] = <void*>(<char*>"_skewnorm_cdf")
  3123. ufunc__skewnorm_cdf_data[0] = &ufunc__skewnorm_cdf_ptr[2*0]
  3124. ufunc__skewnorm_cdf_data[1] = &ufunc__skewnorm_cdf_ptr[2*1]
  3125. _skewnorm_cdf = np.PyUFunc_FromFuncAndData(ufunc__skewnorm_cdf_loops, ufunc__skewnorm_cdf_data, ufunc__skewnorm_cdf_types, 2, 4, 1, 0, '_skewnorm_cdf', ufunc__skewnorm_cdf_doc, 0)
  3126. cdef np.PyUFuncGenericFunction ufunc__skewnorm_isf_loops[2]
  3127. cdef void *ufunc__skewnorm_isf_ptr[4]
  3128. cdef void *ufunc__skewnorm_isf_data[2]
  3129. cdef char ufunc__skewnorm_isf_types[10]
  3130. cdef char *ufunc__skewnorm_isf_doc = (
  3131. "_skewnorm_isf(x, l, sc, sh)\n"
  3132. "\n"
  3133. "Inverse survival function of skewnorm distribution.\n"
  3134. "\n"
  3135. "Parameters\n"
  3136. "----------\n"
  3137. "x : array_like\n"
  3138. " Real-valued\n"
  3139. "l : array_like\n"
  3140. " Real-valued parameters\n"
  3141. "sc : array_like\n"
  3142. " Positive, Real-valued parameters\n"
  3143. "sh : array_like\n"
  3144. " Real-valued parameters\n"
  3145. "\n"
  3146. "Returns\n"
  3147. "-------\n"
  3148. "scalar or ndarray")
  3149. ufunc__skewnorm_isf_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  3150. ufunc__skewnorm_isf_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  3151. ufunc__skewnorm_isf_types[0] = <char>NPY_FLOAT
  3152. ufunc__skewnorm_isf_types[1] = <char>NPY_FLOAT
  3153. ufunc__skewnorm_isf_types[2] = <char>NPY_FLOAT
  3154. ufunc__skewnorm_isf_types[3] = <char>NPY_FLOAT
  3155. ufunc__skewnorm_isf_types[4] = <char>NPY_FLOAT
  3156. ufunc__skewnorm_isf_types[5] = <char>NPY_DOUBLE
  3157. ufunc__skewnorm_isf_types[6] = <char>NPY_DOUBLE
  3158. ufunc__skewnorm_isf_types[7] = <char>NPY_DOUBLE
  3159. ufunc__skewnorm_isf_types[8] = <char>NPY_DOUBLE
  3160. ufunc__skewnorm_isf_types[9] = <char>NPY_DOUBLE
  3161. ufunc__skewnorm_isf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_skewnorm_isf_float
  3162. ufunc__skewnorm_isf_ptr[2*0+1] = <void*>(<char*>"_skewnorm_isf")
  3163. ufunc__skewnorm_isf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_skewnorm_isf_double
  3164. ufunc__skewnorm_isf_ptr[2*1+1] = <void*>(<char*>"_skewnorm_isf")
  3165. ufunc__skewnorm_isf_data[0] = &ufunc__skewnorm_isf_ptr[2*0]
  3166. ufunc__skewnorm_isf_data[1] = &ufunc__skewnorm_isf_ptr[2*1]
  3167. _skewnorm_isf = np.PyUFunc_FromFuncAndData(ufunc__skewnorm_isf_loops, ufunc__skewnorm_isf_data, ufunc__skewnorm_isf_types, 2, 4, 1, 0, '_skewnorm_isf', ufunc__skewnorm_isf_doc, 0)
  3168. cdef np.PyUFuncGenericFunction ufunc__skewnorm_ppf_loops[2]
  3169. cdef void *ufunc__skewnorm_ppf_ptr[4]
  3170. cdef void *ufunc__skewnorm_ppf_data[2]
  3171. cdef char ufunc__skewnorm_ppf_types[10]
  3172. cdef char *ufunc__skewnorm_ppf_doc = (
  3173. "_skewnorm_ppf(x, l, sc, sh)\n"
  3174. "\n"
  3175. "Percent point function of skewnorm distribution.\n"
  3176. "\n"
  3177. "Parameters\n"
  3178. "----------\n"
  3179. "x : array_like\n"
  3180. " Real-valued\n"
  3181. "l : array_like\n"
  3182. " Real-valued parameters\n"
  3183. "sc : array_like\n"
  3184. " Positive, Real-valued parameters\n"
  3185. "sh : array_like\n"
  3186. " Real-valued parameters\n"
  3187. "\n"
  3188. "Returns\n"
  3189. "-------\n"
  3190. "scalar or ndarray")
  3191. ufunc__skewnorm_ppf_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  3192. ufunc__skewnorm_ppf_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  3193. ufunc__skewnorm_ppf_types[0] = <char>NPY_FLOAT
  3194. ufunc__skewnorm_ppf_types[1] = <char>NPY_FLOAT
  3195. ufunc__skewnorm_ppf_types[2] = <char>NPY_FLOAT
  3196. ufunc__skewnorm_ppf_types[3] = <char>NPY_FLOAT
  3197. ufunc__skewnorm_ppf_types[4] = <char>NPY_FLOAT
  3198. ufunc__skewnorm_ppf_types[5] = <char>NPY_DOUBLE
  3199. ufunc__skewnorm_ppf_types[6] = <char>NPY_DOUBLE
  3200. ufunc__skewnorm_ppf_types[7] = <char>NPY_DOUBLE
  3201. ufunc__skewnorm_ppf_types[8] = <char>NPY_DOUBLE
  3202. ufunc__skewnorm_ppf_types[9] = <char>NPY_DOUBLE
  3203. ufunc__skewnorm_ppf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_skewnorm_ppf_float
  3204. ufunc__skewnorm_ppf_ptr[2*0+1] = <void*>(<char*>"_skewnorm_ppf")
  3205. ufunc__skewnorm_ppf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_skewnorm_ppf_double
  3206. ufunc__skewnorm_ppf_ptr[2*1+1] = <void*>(<char*>"_skewnorm_ppf")
  3207. ufunc__skewnorm_ppf_data[0] = &ufunc__skewnorm_ppf_ptr[2*0]
  3208. ufunc__skewnorm_ppf_data[1] = &ufunc__skewnorm_ppf_ptr[2*1]
  3209. _skewnorm_ppf = np.PyUFunc_FromFuncAndData(ufunc__skewnorm_ppf_loops, ufunc__skewnorm_ppf_data, ufunc__skewnorm_ppf_types, 2, 4, 1, 0, '_skewnorm_ppf', ufunc__skewnorm_ppf_doc, 0)
  3210. cdef np.PyUFuncGenericFunction ufunc__smirnovc_loops[3]
  3211. cdef void *ufunc__smirnovc_ptr[6]
  3212. cdef void *ufunc__smirnovc_data[3]
  3213. cdef char ufunc__smirnovc_types[9]
  3214. cdef char *ufunc__smirnovc_doc = (
  3215. "_smirnovc(n, d)\n"
  3216. " Internal function, do not use.")
  3217. ufunc__smirnovc_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  3218. ufunc__smirnovc_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  3219. ufunc__smirnovc_loops[2] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  3220. ufunc__smirnovc_types[0] = <char>NPY_INTP
  3221. ufunc__smirnovc_types[1] = <char>NPY_DOUBLE
  3222. ufunc__smirnovc_types[2] = <char>NPY_DOUBLE
  3223. ufunc__smirnovc_types[3] = <char>NPY_FLOAT
  3224. ufunc__smirnovc_types[4] = <char>NPY_FLOAT
  3225. ufunc__smirnovc_types[5] = <char>NPY_FLOAT
  3226. ufunc__smirnovc_types[6] = <char>NPY_DOUBLE
  3227. ufunc__smirnovc_types[7] = <char>NPY_DOUBLE
  3228. ufunc__smirnovc_types[8] = <char>NPY_DOUBLE
  3229. ufunc__smirnovc_ptr[2*0] = <void*>_func_cephes_smirnovc_wrap
  3230. ufunc__smirnovc_ptr[2*0+1] = <void*>(<char*>"_smirnovc")
  3231. ufunc__smirnovc_ptr[2*1] = <void*>_func_smirnovc_unsafe
  3232. ufunc__smirnovc_ptr[2*1+1] = <void*>(<char*>"_smirnovc")
  3233. ufunc__smirnovc_ptr[2*2] = <void*>_func_smirnovc_unsafe
  3234. ufunc__smirnovc_ptr[2*2+1] = <void*>(<char*>"_smirnovc")
  3235. ufunc__smirnovc_data[0] = &ufunc__smirnovc_ptr[2*0]
  3236. ufunc__smirnovc_data[1] = &ufunc__smirnovc_ptr[2*1]
  3237. ufunc__smirnovc_data[2] = &ufunc__smirnovc_ptr[2*2]
  3238. _smirnovc = np.PyUFunc_FromFuncAndData(ufunc__smirnovc_loops, ufunc__smirnovc_data, ufunc__smirnovc_types, 3, 2, 1, 0, '_smirnovc', ufunc__smirnovc_doc, 0)
  3239. cdef np.PyUFuncGenericFunction ufunc__smirnovci_loops[3]
  3240. cdef void *ufunc__smirnovci_ptr[6]
  3241. cdef void *ufunc__smirnovci_data[3]
  3242. cdef char ufunc__smirnovci_types[9]
  3243. cdef char *ufunc__smirnovci_doc = (
  3244. "Internal function, do not use.")
  3245. ufunc__smirnovci_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  3246. ufunc__smirnovci_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  3247. ufunc__smirnovci_loops[2] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  3248. ufunc__smirnovci_types[0] = <char>NPY_INTP
  3249. ufunc__smirnovci_types[1] = <char>NPY_DOUBLE
  3250. ufunc__smirnovci_types[2] = <char>NPY_DOUBLE
  3251. ufunc__smirnovci_types[3] = <char>NPY_FLOAT
  3252. ufunc__smirnovci_types[4] = <char>NPY_FLOAT
  3253. ufunc__smirnovci_types[5] = <char>NPY_FLOAT
  3254. ufunc__smirnovci_types[6] = <char>NPY_DOUBLE
  3255. ufunc__smirnovci_types[7] = <char>NPY_DOUBLE
  3256. ufunc__smirnovci_types[8] = <char>NPY_DOUBLE
  3257. ufunc__smirnovci_ptr[2*0] = <void*>_func_cephes_smirnovci_wrap
  3258. ufunc__smirnovci_ptr[2*0+1] = <void*>(<char*>"_smirnovci")
  3259. ufunc__smirnovci_ptr[2*1] = <void*>_func_smirnovci_unsafe
  3260. ufunc__smirnovci_ptr[2*1+1] = <void*>(<char*>"_smirnovci")
  3261. ufunc__smirnovci_ptr[2*2] = <void*>_func_smirnovci_unsafe
  3262. ufunc__smirnovci_ptr[2*2+1] = <void*>(<char*>"_smirnovci")
  3263. ufunc__smirnovci_data[0] = &ufunc__smirnovci_ptr[2*0]
  3264. ufunc__smirnovci_data[1] = &ufunc__smirnovci_ptr[2*1]
  3265. ufunc__smirnovci_data[2] = &ufunc__smirnovci_ptr[2*2]
  3266. _smirnovci = np.PyUFunc_FromFuncAndData(ufunc__smirnovci_loops, ufunc__smirnovci_data, ufunc__smirnovci_types, 3, 2, 1, 0, '_smirnovci', ufunc__smirnovci_doc, 0)
  3267. cdef np.PyUFuncGenericFunction ufunc__smirnovp_loops[3]
  3268. cdef void *ufunc__smirnovp_ptr[6]
  3269. cdef void *ufunc__smirnovp_data[3]
  3270. cdef char ufunc__smirnovp_types[9]
  3271. cdef char *ufunc__smirnovp_doc = (
  3272. "_smirnovp(n, p)\n"
  3273. " Internal function, do not use.")
  3274. ufunc__smirnovp_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  3275. ufunc__smirnovp_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  3276. ufunc__smirnovp_loops[2] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  3277. ufunc__smirnovp_types[0] = <char>NPY_INTP
  3278. ufunc__smirnovp_types[1] = <char>NPY_DOUBLE
  3279. ufunc__smirnovp_types[2] = <char>NPY_DOUBLE
  3280. ufunc__smirnovp_types[3] = <char>NPY_FLOAT
  3281. ufunc__smirnovp_types[4] = <char>NPY_FLOAT
  3282. ufunc__smirnovp_types[5] = <char>NPY_FLOAT
  3283. ufunc__smirnovp_types[6] = <char>NPY_DOUBLE
  3284. ufunc__smirnovp_types[7] = <char>NPY_DOUBLE
  3285. ufunc__smirnovp_types[8] = <char>NPY_DOUBLE
  3286. ufunc__smirnovp_ptr[2*0] = <void*>_func_cephes_smirnovp_wrap
  3287. ufunc__smirnovp_ptr[2*0+1] = <void*>(<char*>"_smirnovp")
  3288. ufunc__smirnovp_ptr[2*1] = <void*>_func_smirnovp_unsafe
  3289. ufunc__smirnovp_ptr[2*1+1] = <void*>(<char*>"_smirnovp")
  3290. ufunc__smirnovp_ptr[2*2] = <void*>_func_smirnovp_unsafe
  3291. ufunc__smirnovp_ptr[2*2+1] = <void*>(<char*>"_smirnovp")
  3292. ufunc__smirnovp_data[0] = &ufunc__smirnovp_ptr[2*0]
  3293. ufunc__smirnovp_data[1] = &ufunc__smirnovp_ptr[2*1]
  3294. ufunc__smirnovp_data[2] = &ufunc__smirnovp_ptr[2*2]
  3295. _smirnovp = np.PyUFunc_FromFuncAndData(ufunc__smirnovp_loops, ufunc__smirnovp_data, ufunc__smirnovp_types, 3, 2, 1, 0, '_smirnovp', ufunc__smirnovp_doc, 0)
  3296. cdef np.PyUFuncGenericFunction ufunc__stirling2_inexact_loops[2]
  3297. cdef void *ufunc__stirling2_inexact_ptr[4]
  3298. cdef void *ufunc__stirling2_inexact_data[2]
  3299. cdef char ufunc__stirling2_inexact_types[6]
  3300. cdef char *ufunc__stirling2_inexact_doc = (
  3301. "Internal function, do not use.")
  3302. ufunc__stirling2_inexact_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  3303. ufunc__stirling2_inexact_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  3304. ufunc__stirling2_inexact_types[0] = <char>NPY_FLOAT
  3305. ufunc__stirling2_inexact_types[1] = <char>NPY_FLOAT
  3306. ufunc__stirling2_inexact_types[2] = <char>NPY_FLOAT
  3307. ufunc__stirling2_inexact_types[3] = <char>NPY_DOUBLE
  3308. ufunc__stirling2_inexact_types[4] = <char>NPY_DOUBLE
  3309. ufunc__stirling2_inexact_types[5] = <char>NPY_DOUBLE
  3310. ufunc__stirling2_inexact_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export__stirling2_inexact
  3311. ufunc__stirling2_inexact_ptr[2*0+1] = <void*>(<char*>"_stirling2_inexact")
  3312. ufunc__stirling2_inexact_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export__stirling2_inexact
  3313. ufunc__stirling2_inexact_ptr[2*1+1] = <void*>(<char*>"_stirling2_inexact")
  3314. ufunc__stirling2_inexact_data[0] = &ufunc__stirling2_inexact_ptr[2*0]
  3315. ufunc__stirling2_inexact_data[1] = &ufunc__stirling2_inexact_ptr[2*1]
  3316. _stirling2_inexact = np.PyUFunc_FromFuncAndData(ufunc__stirling2_inexact_loops, ufunc__stirling2_inexact_data, ufunc__stirling2_inexact_types, 2, 2, 1, 0, '_stirling2_inexact', ufunc__stirling2_inexact_doc, 0)
  3317. cdef np.PyUFuncGenericFunction ufunc__struve_asymp_large_z_loops[1]
  3318. cdef void *ufunc__struve_asymp_large_z_ptr[2]
  3319. cdef void *ufunc__struve_asymp_large_z_data[1]
  3320. cdef char ufunc__struve_asymp_large_z_types[5]
  3321. cdef char *ufunc__struve_asymp_large_z_doc = (
  3322. "_struve_asymp_large_z(v, z, is_h)\n"
  3323. "\n"
  3324. "Internal function for testing `struve` & `modstruve`\n"
  3325. "\n"
  3326. "Evaluates using asymptotic expansion\n"
  3327. "\n"
  3328. "Returns\n"
  3329. "-------\n"
  3330. "v, err")
  3331. ufunc__struve_asymp_large_z_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddp_d_As_ddp_dd
  3332. ufunc__struve_asymp_large_z_types[0] = <char>NPY_DOUBLE
  3333. ufunc__struve_asymp_large_z_types[1] = <char>NPY_DOUBLE
  3334. ufunc__struve_asymp_large_z_types[2] = <char>NPY_INTP
  3335. ufunc__struve_asymp_large_z_types[3] = <char>NPY_DOUBLE
  3336. ufunc__struve_asymp_large_z_types[4] = <char>NPY_DOUBLE
  3337. ufunc__struve_asymp_large_z_ptr[2*0] = <void*>_func_cephes__struve_asymp_large_z
  3338. ufunc__struve_asymp_large_z_ptr[2*0+1] = <void*>(<char*>"_struve_asymp_large_z")
  3339. ufunc__struve_asymp_large_z_data[0] = &ufunc__struve_asymp_large_z_ptr[2*0]
  3340. _struve_asymp_large_z = np.PyUFunc_FromFuncAndData(ufunc__struve_asymp_large_z_loops, ufunc__struve_asymp_large_z_data, ufunc__struve_asymp_large_z_types, 1, 3, 2, 0, '_struve_asymp_large_z', ufunc__struve_asymp_large_z_doc, 0)
  3341. cdef np.PyUFuncGenericFunction ufunc__struve_bessel_series_loops[1]
  3342. cdef void *ufunc__struve_bessel_series_ptr[2]
  3343. cdef void *ufunc__struve_bessel_series_data[1]
  3344. cdef char ufunc__struve_bessel_series_types[5]
  3345. cdef char *ufunc__struve_bessel_series_doc = (
  3346. "_struve_bessel_series(v, z, is_h)\n"
  3347. "\n"
  3348. "Internal function for testing `struve` & `modstruve`\n"
  3349. "\n"
  3350. "Evaluates using Bessel function series\n"
  3351. "\n"
  3352. "Returns\n"
  3353. "-------\n"
  3354. "v, err")
  3355. ufunc__struve_bessel_series_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddp_d_As_ddp_dd
  3356. ufunc__struve_bessel_series_types[0] = <char>NPY_DOUBLE
  3357. ufunc__struve_bessel_series_types[1] = <char>NPY_DOUBLE
  3358. ufunc__struve_bessel_series_types[2] = <char>NPY_INTP
  3359. ufunc__struve_bessel_series_types[3] = <char>NPY_DOUBLE
  3360. ufunc__struve_bessel_series_types[4] = <char>NPY_DOUBLE
  3361. ufunc__struve_bessel_series_ptr[2*0] = <void*>_func_cephes__struve_bessel_series
  3362. ufunc__struve_bessel_series_ptr[2*0+1] = <void*>(<char*>"_struve_bessel_series")
  3363. ufunc__struve_bessel_series_data[0] = &ufunc__struve_bessel_series_ptr[2*0]
  3364. _struve_bessel_series = np.PyUFunc_FromFuncAndData(ufunc__struve_bessel_series_loops, ufunc__struve_bessel_series_data, ufunc__struve_bessel_series_types, 1, 3, 2, 0, '_struve_bessel_series', ufunc__struve_bessel_series_doc, 0)
  3365. cdef np.PyUFuncGenericFunction ufunc__struve_power_series_loops[1]
  3366. cdef void *ufunc__struve_power_series_ptr[2]
  3367. cdef void *ufunc__struve_power_series_data[1]
  3368. cdef char ufunc__struve_power_series_types[5]
  3369. cdef char *ufunc__struve_power_series_doc = (
  3370. "_struve_power_series(v, z, is_h)\n"
  3371. "\n"
  3372. "Internal function for testing `struve` & `modstruve`\n"
  3373. "\n"
  3374. "Evaluates using power series\n"
  3375. "\n"
  3376. "Returns\n"
  3377. "-------\n"
  3378. "v, err")
  3379. ufunc__struve_power_series_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddp_d_As_ddp_dd
  3380. ufunc__struve_power_series_types[0] = <char>NPY_DOUBLE
  3381. ufunc__struve_power_series_types[1] = <char>NPY_DOUBLE
  3382. ufunc__struve_power_series_types[2] = <char>NPY_INTP
  3383. ufunc__struve_power_series_types[3] = <char>NPY_DOUBLE
  3384. ufunc__struve_power_series_types[4] = <char>NPY_DOUBLE
  3385. ufunc__struve_power_series_ptr[2*0] = <void*>_func_cephes__struve_power_series
  3386. ufunc__struve_power_series_ptr[2*0+1] = <void*>(<char*>"_struve_power_series")
  3387. ufunc__struve_power_series_data[0] = &ufunc__struve_power_series_ptr[2*0]
  3388. _struve_power_series = np.PyUFunc_FromFuncAndData(ufunc__struve_power_series_loops, ufunc__struve_power_series_data, ufunc__struve_power_series_types, 1, 3, 2, 0, '_struve_power_series', ufunc__struve_power_series_doc, 0)
  3389. cdef np.PyUFuncGenericFunction ufunc_agm_loops[2]
  3390. cdef void *ufunc_agm_ptr[4]
  3391. cdef void *ufunc_agm_data[2]
  3392. cdef char ufunc_agm_types[6]
  3393. cdef char *ufunc_agm_doc = (
  3394. "agm(a, b, out=None)\n"
  3395. "\n"
  3396. "Compute the arithmetic-geometric mean of `a` and `b`.\n"
  3397. "\n"
  3398. "Start with a_0 = a and b_0 = b and iteratively compute::\n"
  3399. "\n"
  3400. " a_{n+1} = (a_n + b_n)/2\n"
  3401. " b_{n+1} = sqrt(a_n*b_n)\n"
  3402. "\n"
  3403. "a_n and b_n converge to the same limit as n increases; their common\n"
  3404. "limit is agm(a, b).\n"
  3405. "\n"
  3406. "Parameters\n"
  3407. "----------\n"
  3408. "a, b : array_like\n"
  3409. " Real values only. If the values are both negative, the result\n"
  3410. " is negative. If one value is negative and the other is positive,\n"
  3411. " `nan` is returned.\n"
  3412. "out : ndarray, optional\n"
  3413. " Optional output array for the function values\n"
  3414. "\n"
  3415. "Returns\n"
  3416. "-------\n"
  3417. "scalar or ndarray\n"
  3418. " The arithmetic-geometric mean of `a` and `b`.\n"
  3419. "\n"
  3420. "Examples\n"
  3421. "--------\n"
  3422. ">>> import numpy as np\n"
  3423. ">>> from scipy.special import agm\n"
  3424. ">>> a, b = 24.0, 6.0\n"
  3425. ">>> agm(a, b)\n"
  3426. "13.458171481725614\n"
  3427. "\n"
  3428. "Compare that result to the iteration:\n"
  3429. "\n"
  3430. ">>> while a != b:\n"
  3431. "... a, b = (a + b)/2, np.sqrt(a*b)\n"
  3432. "... print(\"a = %19.16f b=%19.16f\" % (a, b))\n"
  3433. "...\n"
  3434. "a = 15.0000000000000000 b=12.0000000000000000\n"
  3435. "a = 13.5000000000000000 b=13.4164078649987388\n"
  3436. "a = 13.4582039324993694 b=13.4581390309909850\n"
  3437. "a = 13.4581714817451772 b=13.4581714817060547\n"
  3438. "a = 13.4581714817256159 b=13.4581714817256159\n"
  3439. "\n"
  3440. "When array-like arguments are given, broadcasting applies:\n"
  3441. "\n"
  3442. ">>> a = np.array([[1.5], [3], [6]]) # a has shape (3, 1).\n"
  3443. ">>> b = np.array([6, 12, 24, 48]) # b has shape (4,).\n"
  3444. ">>> agm(a, b)\n"
  3445. "array([[ 3.36454287, 5.42363427, 9.05798751, 15.53650756],\n"
  3446. " [ 4.37037309, 6.72908574, 10.84726853, 18.11597502],\n"
  3447. " [ 6. , 8.74074619, 13.45817148, 21.69453707]])")
  3448. ufunc_agm_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  3449. ufunc_agm_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  3450. ufunc_agm_types[0] = <char>NPY_FLOAT
  3451. ufunc_agm_types[1] = <char>NPY_FLOAT
  3452. ufunc_agm_types[2] = <char>NPY_FLOAT
  3453. ufunc_agm_types[3] = <char>NPY_DOUBLE
  3454. ufunc_agm_types[4] = <char>NPY_DOUBLE
  3455. ufunc_agm_types[5] = <char>NPY_DOUBLE
  3456. ufunc_agm_ptr[2*0] = <void*>_func_agm
  3457. ufunc_agm_ptr[2*0+1] = <void*>(<char*>"agm")
  3458. ufunc_agm_ptr[2*1] = <void*>_func_agm
  3459. ufunc_agm_ptr[2*1+1] = <void*>(<char*>"agm")
  3460. ufunc_agm_data[0] = &ufunc_agm_ptr[2*0]
  3461. ufunc_agm_data[1] = &ufunc_agm_ptr[2*1]
  3462. agm = np.PyUFunc_FromFuncAndData(ufunc_agm_loops, ufunc_agm_data, ufunc_agm_types, 2, 2, 1, 0, 'agm', ufunc_agm_doc, 0)
  3463. cdef np.PyUFuncGenericFunction ufunc_bdtr_loops[3]
  3464. cdef void *ufunc_bdtr_ptr[6]
  3465. cdef void *ufunc_bdtr_data[3]
  3466. cdef char ufunc_bdtr_types[12]
  3467. cdef char *ufunc_bdtr_doc = (
  3468. "bdtr(k, n, p, out=None)\n"
  3469. "\n"
  3470. "Binomial distribution cumulative distribution function.\n"
  3471. "\n"
  3472. "Sum of the terms 0 through `floor(k)` of the Binomial probability density.\n"
  3473. "\n"
  3474. ".. math::\n"
  3475. " \\mathrm{bdtr}(k, n, p) =\n"
  3476. " \\sum_{j=0}^{\\lfloor k \\rfloor} {{n}\\choose{j}} p^j (1-p)^{n-j}\n"
  3477. "\n"
  3478. "Parameters\n"
  3479. "----------\n"
  3480. "k : array_like\n"
  3481. " Number of successes (double), rounded down to the nearest integer.\n"
  3482. "n : array_like\n"
  3483. " Number of events (int).\n"
  3484. "p : array_like\n"
  3485. " Probability of success in a single event (float).\n"
  3486. "out : ndarray, optional\n"
  3487. " Optional output array for the function values\n"
  3488. "\n"
  3489. "Returns\n"
  3490. "-------\n"
  3491. "y : scalar or ndarray\n"
  3492. " Probability of `floor(k)` or fewer successes in `n` independent events with\n"
  3493. " success probabilities of `p`.\n"
  3494. "\n"
  3495. "Notes\n"
  3496. "-----\n"
  3497. "The terms are not summed directly; instead the regularized incomplete beta\n"
  3498. "function is employed, according to the formula,\n"
  3499. "\n"
  3500. ".. math::\n"
  3501. " \\mathrm{bdtr}(k, n, p) =\n"
  3502. " I_{1 - p}(n - \\lfloor k \\rfloor, \\lfloor k \\rfloor + 1).\n"
  3503. "\n"
  3504. "Wrapper for the Cephes [1]_ routine `bdtr`.\n"
  3505. "\n"
  3506. "References\n"
  3507. "----------\n"
  3508. ".. [1] Cephes Mathematical Functions Library,\n"
  3509. " http://www.netlib.org/cephes/")
  3510. ufunc_bdtr_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  3511. ufunc_bdtr_loops[1] = <np.PyUFuncGenericFunction>loop_d_dpd__As_dpd_d
  3512. ufunc_bdtr_loops[2] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  3513. ufunc_bdtr_types[0] = <char>NPY_FLOAT
  3514. ufunc_bdtr_types[1] = <char>NPY_FLOAT
  3515. ufunc_bdtr_types[2] = <char>NPY_FLOAT
  3516. ufunc_bdtr_types[3] = <char>NPY_FLOAT
  3517. ufunc_bdtr_types[4] = <char>NPY_DOUBLE
  3518. ufunc_bdtr_types[5] = <char>NPY_INTP
  3519. ufunc_bdtr_types[6] = <char>NPY_DOUBLE
  3520. ufunc_bdtr_types[7] = <char>NPY_DOUBLE
  3521. ufunc_bdtr_types[8] = <char>NPY_DOUBLE
  3522. ufunc_bdtr_types[9] = <char>NPY_DOUBLE
  3523. ufunc_bdtr_types[10] = <char>NPY_DOUBLE
  3524. ufunc_bdtr_types[11] = <char>NPY_DOUBLE
  3525. ufunc_bdtr_ptr[2*0] = <void*>_func_bdtr_unsafe
  3526. ufunc_bdtr_ptr[2*0+1] = <void*>(<char*>"bdtr")
  3527. ufunc_bdtr_ptr[2*1] = <void*>_func_cephes_bdtr_wrap
  3528. ufunc_bdtr_ptr[2*1+1] = <void*>(<char*>"bdtr")
  3529. ufunc_bdtr_ptr[2*2] = <void*>_func_bdtr_unsafe
  3530. ufunc_bdtr_ptr[2*2+1] = <void*>(<char*>"bdtr")
  3531. ufunc_bdtr_data[0] = &ufunc_bdtr_ptr[2*0]
  3532. ufunc_bdtr_data[1] = &ufunc_bdtr_ptr[2*1]
  3533. ufunc_bdtr_data[2] = &ufunc_bdtr_ptr[2*2]
  3534. bdtr = np.PyUFunc_FromFuncAndData(ufunc_bdtr_loops, ufunc_bdtr_data, ufunc_bdtr_types, 3, 3, 1, 0, 'bdtr', ufunc_bdtr_doc, 0)
  3535. cdef np.PyUFuncGenericFunction ufunc_bdtrc_loops[3]
  3536. cdef void *ufunc_bdtrc_ptr[6]
  3537. cdef void *ufunc_bdtrc_data[3]
  3538. cdef char ufunc_bdtrc_types[12]
  3539. cdef char *ufunc_bdtrc_doc = (
  3540. "bdtrc(k, n, p, out=None)\n"
  3541. "\n"
  3542. "Binomial distribution survival function.\n"
  3543. "\n"
  3544. "Sum of the terms `floor(k) + 1` through `n` of the binomial probability\n"
  3545. "density,\n"
  3546. "\n"
  3547. ".. math::\n"
  3548. " \\mathrm{bdtrc}(k, n, p) =\n"
  3549. " \\sum_{j=\\lfloor k \\rfloor +1}^n {{n}\\choose{j}} p^j (1-p)^{n-j}\n"
  3550. "\n"
  3551. "Parameters\n"
  3552. "----------\n"
  3553. "k : array_like\n"
  3554. " Number of successes (double), rounded down to nearest integer.\n"
  3555. "n : array_like\n"
  3556. " Number of events (int)\n"
  3557. "p : array_like\n"
  3558. " Probability of success in a single event.\n"
  3559. "out : ndarray, optional\n"
  3560. " Optional output array for the function values\n"
  3561. "\n"
  3562. "Returns\n"
  3563. "-------\n"
  3564. "y : scalar or ndarray\n"
  3565. " Probability of `floor(k) + 1` or more successes in `n` independent\n"
  3566. " events with success probabilities of `p`.\n"
  3567. "\n"
  3568. "See Also\n"
  3569. "--------\n"
  3570. "bdtr\n"
  3571. "betainc\n"
  3572. "\n"
  3573. "Notes\n"
  3574. "-----\n"
  3575. "The terms are not summed directly; instead the regularized incomplete beta\n"
  3576. "function is employed, according to the formula,\n"
  3577. "\n"
  3578. ".. math::\n"
  3579. " \\mathrm{bdtrc}(k, n, p) = I_{p}(\\lfloor k \\rfloor + 1, n - \\lfloor k \\rfloor).\n"
  3580. "\n"
  3581. "Wrapper for the Cephes [1]_ routine `bdtrc`.\n"
  3582. "\n"
  3583. "References\n"
  3584. "----------\n"
  3585. ".. [1] Cephes Mathematical Functions Library,\n"
  3586. " http://www.netlib.org/cephes/")
  3587. ufunc_bdtrc_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  3588. ufunc_bdtrc_loops[1] = <np.PyUFuncGenericFunction>loop_d_dpd__As_dpd_d
  3589. ufunc_bdtrc_loops[2] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  3590. ufunc_bdtrc_types[0] = <char>NPY_FLOAT
  3591. ufunc_bdtrc_types[1] = <char>NPY_FLOAT
  3592. ufunc_bdtrc_types[2] = <char>NPY_FLOAT
  3593. ufunc_bdtrc_types[3] = <char>NPY_FLOAT
  3594. ufunc_bdtrc_types[4] = <char>NPY_DOUBLE
  3595. ufunc_bdtrc_types[5] = <char>NPY_INTP
  3596. ufunc_bdtrc_types[6] = <char>NPY_DOUBLE
  3597. ufunc_bdtrc_types[7] = <char>NPY_DOUBLE
  3598. ufunc_bdtrc_types[8] = <char>NPY_DOUBLE
  3599. ufunc_bdtrc_types[9] = <char>NPY_DOUBLE
  3600. ufunc_bdtrc_types[10] = <char>NPY_DOUBLE
  3601. ufunc_bdtrc_types[11] = <char>NPY_DOUBLE
  3602. ufunc_bdtrc_ptr[2*0] = <void*>_func_bdtrc_unsafe
  3603. ufunc_bdtrc_ptr[2*0+1] = <void*>(<char*>"bdtrc")
  3604. ufunc_bdtrc_ptr[2*1] = <void*>_func_cephes_bdtrc_wrap
  3605. ufunc_bdtrc_ptr[2*1+1] = <void*>(<char*>"bdtrc")
  3606. ufunc_bdtrc_ptr[2*2] = <void*>_func_bdtrc_unsafe
  3607. ufunc_bdtrc_ptr[2*2+1] = <void*>(<char*>"bdtrc")
  3608. ufunc_bdtrc_data[0] = &ufunc_bdtrc_ptr[2*0]
  3609. ufunc_bdtrc_data[1] = &ufunc_bdtrc_ptr[2*1]
  3610. ufunc_bdtrc_data[2] = &ufunc_bdtrc_ptr[2*2]
  3611. bdtrc = np.PyUFunc_FromFuncAndData(ufunc_bdtrc_loops, ufunc_bdtrc_data, ufunc_bdtrc_types, 3, 3, 1, 0, 'bdtrc', ufunc_bdtrc_doc, 0)
  3612. cdef np.PyUFuncGenericFunction ufunc_bdtri_loops[3]
  3613. cdef void *ufunc_bdtri_ptr[6]
  3614. cdef void *ufunc_bdtri_data[3]
  3615. cdef char ufunc_bdtri_types[12]
  3616. cdef char *ufunc_bdtri_doc = (
  3617. "bdtri(k, n, y, out=None)\n"
  3618. "\n"
  3619. "Inverse function to `bdtr` with respect to `p`.\n"
  3620. "\n"
  3621. "Finds the event probability `p` such that the sum of the terms 0 through\n"
  3622. "`k` of the binomial probability density is equal to the given cumulative\n"
  3623. "probability `y`.\n"
  3624. "\n"
  3625. "Parameters\n"
  3626. "----------\n"
  3627. "k : array_like\n"
  3628. " Number of successes (float), rounded down to the nearest integer.\n"
  3629. "n : array_like\n"
  3630. " Number of events (float)\n"
  3631. "y : array_like\n"
  3632. " Cumulative probability (probability of `k` or fewer successes in `n`\n"
  3633. " events).\n"
  3634. "out : ndarray, optional\n"
  3635. " Optional output array for the function values\n"
  3636. "\n"
  3637. "Returns\n"
  3638. "-------\n"
  3639. "p : scalar or ndarray\n"
  3640. " The event probability such that `bdtr(\\lfloor k \\rfloor, n, p) = y`.\n"
  3641. "\n"
  3642. "See Also\n"
  3643. "--------\n"
  3644. "bdtr\n"
  3645. "betaincinv\n"
  3646. "\n"
  3647. "Notes\n"
  3648. "-----\n"
  3649. "The computation is carried out using the inverse beta integral function\n"
  3650. "and the relation,::\n"
  3651. "\n"
  3652. " 1 - p = betaincinv(n - k, k + 1, y).\n"
  3653. "\n"
  3654. "Wrapper for the Cephes [1]_ routine `bdtri`.\n"
  3655. "\n"
  3656. "References\n"
  3657. "----------\n"
  3658. ".. [1] Cephes Mathematical Functions Library,\n"
  3659. " http://www.netlib.org/cephes/")
  3660. ufunc_bdtri_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  3661. ufunc_bdtri_loops[1] = <np.PyUFuncGenericFunction>loop_d_dpd__As_dpd_d
  3662. ufunc_bdtri_loops[2] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  3663. ufunc_bdtri_types[0] = <char>NPY_FLOAT
  3664. ufunc_bdtri_types[1] = <char>NPY_FLOAT
  3665. ufunc_bdtri_types[2] = <char>NPY_FLOAT
  3666. ufunc_bdtri_types[3] = <char>NPY_FLOAT
  3667. ufunc_bdtri_types[4] = <char>NPY_DOUBLE
  3668. ufunc_bdtri_types[5] = <char>NPY_INTP
  3669. ufunc_bdtri_types[6] = <char>NPY_DOUBLE
  3670. ufunc_bdtri_types[7] = <char>NPY_DOUBLE
  3671. ufunc_bdtri_types[8] = <char>NPY_DOUBLE
  3672. ufunc_bdtri_types[9] = <char>NPY_DOUBLE
  3673. ufunc_bdtri_types[10] = <char>NPY_DOUBLE
  3674. ufunc_bdtri_types[11] = <char>NPY_DOUBLE
  3675. ufunc_bdtri_ptr[2*0] = <void*>_func_bdtri_unsafe
  3676. ufunc_bdtri_ptr[2*0+1] = <void*>(<char*>"bdtri")
  3677. ufunc_bdtri_ptr[2*1] = <void*>_func_cephes_bdtri_wrap
  3678. ufunc_bdtri_ptr[2*1+1] = <void*>(<char*>"bdtri")
  3679. ufunc_bdtri_ptr[2*2] = <void*>_func_bdtri_unsafe
  3680. ufunc_bdtri_ptr[2*2+1] = <void*>(<char*>"bdtri")
  3681. ufunc_bdtri_data[0] = &ufunc_bdtri_ptr[2*0]
  3682. ufunc_bdtri_data[1] = &ufunc_bdtri_ptr[2*1]
  3683. ufunc_bdtri_data[2] = &ufunc_bdtri_ptr[2*2]
  3684. bdtri = np.PyUFunc_FromFuncAndData(ufunc_bdtri_loops, ufunc_bdtri_data, ufunc_bdtri_types, 3, 3, 1, 0, 'bdtri', ufunc_bdtri_doc, 0)
  3685. cdef np.PyUFuncGenericFunction ufunc_bdtrik_loops[2]
  3686. cdef void *ufunc_bdtrik_ptr[4]
  3687. cdef void *ufunc_bdtrik_data[2]
  3688. cdef char ufunc_bdtrik_types[8]
  3689. cdef char *ufunc_bdtrik_doc = (
  3690. "bdtrik(y, n, p, out=None)\n"
  3691. "\n"
  3692. "Inverse function to `bdtr` with respect to `k`.\n"
  3693. "\n"
  3694. "Finds the number of successes `k` such that the sum of the terms 0 through\n"
  3695. "`k` of the Binomial probability density for `n` events with probability\n"
  3696. "`p` is equal to the given cumulative probability `y`.\n"
  3697. "\n"
  3698. "Parameters\n"
  3699. "----------\n"
  3700. "y : array_like\n"
  3701. " Cumulative probability (probability of `k` or fewer successes in `n`\n"
  3702. " events).\n"
  3703. "n : array_like\n"
  3704. " Number of events (float).\n"
  3705. "p : array_like\n"
  3706. " Success probability (float).\n"
  3707. "out : ndarray, optional\n"
  3708. " Optional output array for the function values\n"
  3709. "\n"
  3710. "Returns\n"
  3711. "-------\n"
  3712. "k : scalar or ndarray\n"
  3713. " The number of successes `k` such that `bdtr(k, n, p) = y`.\n"
  3714. "\n"
  3715. "See Also\n"
  3716. "--------\n"
  3717. "bdtr\n"
  3718. "\n"
  3719. "Notes\n"
  3720. "-----\n"
  3721. "Formula 26.5.24 of [1]_ (or equivalently [2]_) is used to reduce the binomial\n"
  3722. "distribution to the cumulative incomplete beta distribution.\n"
  3723. "\n"
  3724. "Computation of `k` involves a search for a value that produces the desired\n"
  3725. "value of `y`. The search relies on the monotonicity of `y` with `k`.\n"
  3726. "\n"
  3727. "Wrapper for the CDFLIB [3]_ Fortran routine `cdfbin`.\n"
  3728. "\n"
  3729. "References\n"
  3730. "----------\n"
  3731. ".. [1] Milton Abramowitz and Irene A. Stegun, eds.\n"
  3732. " Handbook of Mathematical Functions with Formulas,\n"
  3733. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  3734. ".. [2] NIST Digital Library of Mathematical Functions\n"
  3735. " https://dlmf.nist.gov/8.17.5#E5\n"
  3736. ".. [3] Barry Brown, James Lovato, and Kathy Russell,\n"
  3737. " CDFLIB: Library of Fortran Routines for Cumulative Distribution\n"
  3738. " Functions, Inverses, and Other Parameters.")
  3739. ufunc_bdtrik_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  3740. ufunc_bdtrik_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  3741. ufunc_bdtrik_types[0] = <char>NPY_FLOAT
  3742. ufunc_bdtrik_types[1] = <char>NPY_FLOAT
  3743. ufunc_bdtrik_types[2] = <char>NPY_FLOAT
  3744. ufunc_bdtrik_types[3] = <char>NPY_FLOAT
  3745. ufunc_bdtrik_types[4] = <char>NPY_DOUBLE
  3746. ufunc_bdtrik_types[5] = <char>NPY_DOUBLE
  3747. ufunc_bdtrik_types[6] = <char>NPY_DOUBLE
  3748. ufunc_bdtrik_types[7] = <char>NPY_DOUBLE
  3749. ufunc_bdtrik_ptr[2*0] = <void*>_func_bdtrik
  3750. ufunc_bdtrik_ptr[2*0+1] = <void*>(<char*>"bdtrik")
  3751. ufunc_bdtrik_ptr[2*1] = <void*>_func_bdtrik
  3752. ufunc_bdtrik_ptr[2*1+1] = <void*>(<char*>"bdtrik")
  3753. ufunc_bdtrik_data[0] = &ufunc_bdtrik_ptr[2*0]
  3754. ufunc_bdtrik_data[1] = &ufunc_bdtrik_ptr[2*1]
  3755. bdtrik = np.PyUFunc_FromFuncAndData(ufunc_bdtrik_loops, ufunc_bdtrik_data, ufunc_bdtrik_types, 2, 3, 1, 0, 'bdtrik', ufunc_bdtrik_doc, 0)
  3756. cdef np.PyUFuncGenericFunction ufunc_bdtrin_loops[2]
  3757. cdef void *ufunc_bdtrin_ptr[4]
  3758. cdef void *ufunc_bdtrin_data[2]
  3759. cdef char ufunc_bdtrin_types[8]
  3760. cdef char *ufunc_bdtrin_doc = (
  3761. "bdtrin(k, y, p, out=None)\n"
  3762. "\n"
  3763. "Inverse function to `bdtr` with respect to `n`.\n"
  3764. "\n"
  3765. "Finds the number of events `n` such that the sum of the terms 0 through\n"
  3766. "`k` of the Binomial probability density for events with probability `p` is\n"
  3767. "equal to the given cumulative probability `y`.\n"
  3768. "\n"
  3769. "Parameters\n"
  3770. "----------\n"
  3771. "k : array_like\n"
  3772. " Number of successes (float).\n"
  3773. "y : array_like\n"
  3774. " Cumulative probability (probability of `k` or fewer successes in `n`\n"
  3775. " events).\n"
  3776. "p : array_like\n"
  3777. " Success probability (float).\n"
  3778. "out : ndarray, optional\n"
  3779. " Optional output array for the function values\n"
  3780. "\n"
  3781. "Returns\n"
  3782. "-------\n"
  3783. "n : scalar or ndarray\n"
  3784. " The number of events `n` such that `bdtr(k, n, p) = y`.\n"
  3785. "\n"
  3786. "See Also\n"
  3787. "--------\n"
  3788. "bdtr\n"
  3789. "\n"
  3790. "Notes\n"
  3791. "-----\n"
  3792. "Formula 26.5.24 of [1]_ (or equivalently [2]_) is used to reduce the binomial\n"
  3793. "distribution to the cumulative incomplete beta distribution.\n"
  3794. "\n"
  3795. "Computation of `n` involves a search for a value that produces the desired\n"
  3796. "value of `y`. The search relies on the monotonicity of `y` with `n`.\n"
  3797. "\n"
  3798. "Wrapper for the CDFLIB [3]_ Fortran routine `cdfbin`.\n"
  3799. "\n"
  3800. "References\n"
  3801. "----------\n"
  3802. ".. [1] Milton Abramowitz and Irene A. Stegun, eds.\n"
  3803. " Handbook of Mathematical Functions with Formulas,\n"
  3804. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  3805. ".. [2] NIST Digital Library of Mathematical Functions\n"
  3806. " https://dlmf.nist.gov/8.17.5#E5\n"
  3807. ".. [3] Barry Brown, James Lovato, and Kathy Russell,\n"
  3808. " CDFLIB: Library of Fortran Routines for Cumulative Distribution\n"
  3809. " Functions, Inverses, and Other Parameters.")
  3810. ufunc_bdtrin_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  3811. ufunc_bdtrin_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  3812. ufunc_bdtrin_types[0] = <char>NPY_FLOAT
  3813. ufunc_bdtrin_types[1] = <char>NPY_FLOAT
  3814. ufunc_bdtrin_types[2] = <char>NPY_FLOAT
  3815. ufunc_bdtrin_types[3] = <char>NPY_FLOAT
  3816. ufunc_bdtrin_types[4] = <char>NPY_DOUBLE
  3817. ufunc_bdtrin_types[5] = <char>NPY_DOUBLE
  3818. ufunc_bdtrin_types[6] = <char>NPY_DOUBLE
  3819. ufunc_bdtrin_types[7] = <char>NPY_DOUBLE
  3820. ufunc_bdtrin_ptr[2*0] = <void*>_func_bdtrin
  3821. ufunc_bdtrin_ptr[2*0+1] = <void*>(<char*>"bdtrin")
  3822. ufunc_bdtrin_ptr[2*1] = <void*>_func_bdtrin
  3823. ufunc_bdtrin_ptr[2*1+1] = <void*>(<char*>"bdtrin")
  3824. ufunc_bdtrin_data[0] = &ufunc_bdtrin_ptr[2*0]
  3825. ufunc_bdtrin_data[1] = &ufunc_bdtrin_ptr[2*1]
  3826. bdtrin = np.PyUFunc_FromFuncAndData(ufunc_bdtrin_loops, ufunc_bdtrin_data, ufunc_bdtrin_types, 2, 3, 1, 0, 'bdtrin', ufunc_bdtrin_doc, 0)
  3827. cdef np.PyUFuncGenericFunction ufunc_betainc_loops[2]
  3828. cdef void *ufunc_betainc_ptr[4]
  3829. cdef void *ufunc_betainc_data[2]
  3830. cdef char ufunc_betainc_types[8]
  3831. cdef char *ufunc_betainc_doc = (
  3832. "betainc(a, b, x, out=None)\n"
  3833. "\n"
  3834. "Regularized incomplete beta function.\n"
  3835. "\n"
  3836. "Computes the regularized incomplete beta function, defined as [1]_:\n"
  3837. "\n"
  3838. ".. math::\n"
  3839. "\n"
  3840. " I_x(a, b) = \\frac{\\Gamma(a+b)}{\\Gamma(a)\\Gamma(b)} \\int_0^x\n"
  3841. " t^{a-1}(1-t)^{b-1}dt,\n"
  3842. "\n"
  3843. "for :math:`0 \\leq x \\leq 1`.\n"
  3844. "\n"
  3845. "This function is the cumulative distribution function for the beta\n"
  3846. "distribution; its range is [0, 1].\n"
  3847. "\n"
  3848. "Parameters\n"
  3849. "----------\n"
  3850. "a, b : array_like\n"
  3851. " Positive, real-valued parameters\n"
  3852. "x : array_like\n"
  3853. " Real-valued such that :math:`0 \\leq x \\leq 1`,\n"
  3854. " the upper limit of integration\n"
  3855. "out : ndarray, optional\n"
  3856. " Optional output array for the function values\n"
  3857. "\n"
  3858. "Returns\n"
  3859. "-------\n"
  3860. "scalar or ndarray\n"
  3861. " Value of the regularized incomplete beta function\n"
  3862. "\n"
  3863. "See Also\n"
  3864. "--------\n"
  3865. "beta : beta function\n"
  3866. "betaincinv : inverse of the regularized incomplete beta function\n"
  3867. "betaincc : complement of the regularized incomplete beta function\n"
  3868. "scipy.stats.beta : beta distribution\n"
  3869. "\n"
  3870. "Notes\n"
  3871. "-----\n"
  3872. "The term *regularized* in the name of this function refers to the\n"
  3873. "scaling of the function by the gamma function terms shown in the\n"
  3874. "formula. When not qualified as *regularized*, the name *incomplete\n"
  3875. "beta function* often refers to just the integral expression,\n"
  3876. "without the gamma terms. One can use the function `beta` from\n"
  3877. "`scipy.special` to get this \"nonregularized\" incomplete beta\n"
  3878. "function by multiplying the result of ``betainc(a, b, x)`` by\n"
  3879. "``beta(a, b)``.\n"
  3880. "\n"
  3881. "``betainc(a, b, x)`` is treated as a two parameter family of functions\n"
  3882. "of a single variable `x`, rather than as a function of three variables.\n"
  3883. "This impacts only the limiting cases ``a = 0``, ``b = 0``, ``a = inf``,\n"
  3884. "``b = inf``.\n"
  3885. "\n"
  3886. "In general\n"
  3887. "\n"
  3888. ".. math::\n"
  3889. "\n"
  3890. " \\lim_{(a, b) \\rightarrow (a_0, b_0)} \\mathrm{betainc}(a, b, x)\n"
  3891. "\n"
  3892. "is treated as a pointwise limit in ``x``. Thus for example,\n"
  3893. "``betainc(0, b, 0)`` equals ``0`` for ``b > 0``, although it would be\n"
  3894. "indeterminate when considering the simultaneous limit ``(a, x) -> (0+, 0+)``.\n"
  3895. "\n"
  3896. "This function wraps the ``ibeta`` routine from the\n"
  3897. "Boost Math C++ library [2]_.\n"
  3898. "\n"
  3899. "References\n"
  3900. "----------\n"
  3901. ".. [1] NIST Digital Library of Mathematical Functions\n"
  3902. " https://dlmf.nist.gov/8.17\n"
  3903. ".. [2] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  3904. "\n"
  3905. "Examples\n"
  3906. "--------\n"
  3907. "\n"
  3908. "Let :math:`B(a, b)` be the `beta` function.\n"
  3909. "\n"
  3910. ">>> import scipy.special as sc\n"
  3911. "\n"
  3912. "The coefficient in terms of `gamma` is equal to\n"
  3913. ":math:`1/B(a, b)`. Also, when :math:`x=1`\n"
  3914. "the integral is equal to :math:`B(a, b)`.\n"
  3915. "Therefore, :math:`I_{x=1}(a, b) = 1` for any :math:`a, b`.\n"
  3916. "\n"
  3917. ">>> sc.betainc(0.2, 3.5, 1.0)\n"
  3918. "1.0\n"
  3919. "\n"
  3920. "It satisfies\n"
  3921. ":math:`I_x(a, b) = x^a F(a, 1-b, a+1, x)/ (aB(a, b))`,\n"
  3922. "where :math:`F` is the hypergeometric function `hyp2f1`:\n"
  3923. "\n"
  3924. ">>> a, b, x = 1.4, 3.1, 0.5\n"
  3925. ">>> x**a * sc.hyp2f1(a, 1 - b, a + 1, x)/(a * sc.beta(a, b))\n"
  3926. "0.8148904036225295\n"
  3927. ">>> sc.betainc(a, b, x)\n"
  3928. "0.8148904036225296\n"
  3929. "\n"
  3930. "This functions satisfies the relationship\n"
  3931. ":math:`I_x(a, b) = 1 - I_{1-x}(b, a)`:\n"
  3932. "\n"
  3933. ">>> sc.betainc(2.2, 3.1, 0.4)\n"
  3934. "0.49339638807619446\n"
  3935. ">>> 1 - sc.betainc(3.1, 2.2, 1 - 0.4)\n"
  3936. "0.49339638807619446")
  3937. ufunc_betainc_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  3938. ufunc_betainc_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  3939. ufunc_betainc_types[0] = <char>NPY_FLOAT
  3940. ufunc_betainc_types[1] = <char>NPY_FLOAT
  3941. ufunc_betainc_types[2] = <char>NPY_FLOAT
  3942. ufunc_betainc_types[3] = <char>NPY_FLOAT
  3943. ufunc_betainc_types[4] = <char>NPY_DOUBLE
  3944. ufunc_betainc_types[5] = <char>NPY_DOUBLE
  3945. ufunc_betainc_types[6] = <char>NPY_DOUBLE
  3946. ufunc_betainc_types[7] = <char>NPY_DOUBLE
  3947. ufunc_betainc_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ibeta_float
  3948. ufunc_betainc_ptr[2*0+1] = <void*>(<char*>"betainc")
  3949. ufunc_betainc_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ibeta_double
  3950. ufunc_betainc_ptr[2*1+1] = <void*>(<char*>"betainc")
  3951. ufunc_betainc_data[0] = &ufunc_betainc_ptr[2*0]
  3952. ufunc_betainc_data[1] = &ufunc_betainc_ptr[2*1]
  3953. betainc = np.PyUFunc_FromFuncAndData(ufunc_betainc_loops, ufunc_betainc_data, ufunc_betainc_types, 2, 3, 1, 0, 'betainc', ufunc_betainc_doc, 0)
  3954. cdef np.PyUFuncGenericFunction ufunc_betaincc_loops[2]
  3955. cdef void *ufunc_betaincc_ptr[4]
  3956. cdef void *ufunc_betaincc_data[2]
  3957. cdef char ufunc_betaincc_types[8]
  3958. cdef char *ufunc_betaincc_doc = (
  3959. "betaincc(a, b, x, out=None)\n"
  3960. "\n"
  3961. "Complement of the regularized incomplete beta function.\n"
  3962. "\n"
  3963. "Computes the complement of the regularized incomplete beta function,\n"
  3964. "defined as [1]_:\n"
  3965. "\n"
  3966. ".. math::\n"
  3967. "\n"
  3968. " \\bar{I}_x(a, b) = 1 - I_x(a, b)\n"
  3969. " = 1 - \\frac{\\Gamma(a+b)}{\\Gamma(a)\\Gamma(b)} \\int_0^x\n"
  3970. " t^{a-1}(1-t)^{b-1}dt,\n"
  3971. "\n"
  3972. "for :math:`0 \\leq x \\leq 1`.\n"
  3973. "\n"
  3974. "Parameters\n"
  3975. "----------\n"
  3976. "a, b : array_like\n"
  3977. " Positive, real-valued parameters\n"
  3978. "x : array_like\n"
  3979. " Real-valued such that :math:`0 \\leq x \\leq 1`,\n"
  3980. " the upper limit of integration\n"
  3981. "out : ndarray, optional\n"
  3982. " Optional output array for the function values\n"
  3983. "\n"
  3984. "Returns\n"
  3985. "-------\n"
  3986. "scalar or ndarray\n"
  3987. " Value of the regularized incomplete beta function\n"
  3988. "\n"
  3989. "See Also\n"
  3990. "--------\n"
  3991. "betainc : regularized incomplete beta function\n"
  3992. "betaincinv : inverse of the regularized incomplete beta function\n"
  3993. "betainccinv :\n"
  3994. " inverse of the complement of the regularized incomplete beta function\n"
  3995. "beta : beta function\n"
  3996. "scipy.stats.beta : beta distribution\n"
  3997. "\n"
  3998. "Notes\n"
  3999. "-----\n"
  4000. ".. versionadded:: 1.11.0\n"
  4001. "\n"
  4002. "Like `betainc`, ``betaincc(a, b, x)`` is treated as a two parameter\n"
  4003. "family of functions of a single variable `x`, rather than as a function of\n"
  4004. "three variables. See the `betainc` docstring for more info on how this\n"
  4005. "impacts limiting cases.\n"
  4006. "\n"
  4007. "This function wraps the ``ibetac`` routine from the\n"
  4008. "Boost Math C++ library [2]_.\n"
  4009. "\n"
  4010. "References\n"
  4011. "----------\n"
  4012. ".. [1] NIST Digital Library of Mathematical Functions\n"
  4013. " https://dlmf.nist.gov/8.17\n"
  4014. ".. [2] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  4015. "\n"
  4016. "Examples\n"
  4017. "--------\n"
  4018. ">>> from scipy.special import betaincc, betainc\n"
  4019. "\n"
  4020. "The naive calculation ``1 - betainc(a, b, x)`` loses precision when\n"
  4021. "the values of ``betainc(a, b, x)`` are close to 1:\n"
  4022. "\n"
  4023. ">>> 1 - betainc(0.5, 8, [0.9, 0.99, 0.999])\n"
  4024. "array([2.0574632e-09, 0.0000000e+00, 0.0000000e+00])\n"
  4025. "\n"
  4026. "By using ``betaincc``, we get the correct values:\n"
  4027. "\n"
  4028. ">>> betaincc(0.5, 8, [0.9, 0.99, 0.999])\n"
  4029. "array([2.05746321e-09, 1.97259354e-17, 1.96467954e-25])")
  4030. ufunc_betaincc_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  4031. ufunc_betaincc_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  4032. ufunc_betaincc_types[0] = <char>NPY_FLOAT
  4033. ufunc_betaincc_types[1] = <char>NPY_FLOAT
  4034. ufunc_betaincc_types[2] = <char>NPY_FLOAT
  4035. ufunc_betaincc_types[3] = <char>NPY_FLOAT
  4036. ufunc_betaincc_types[4] = <char>NPY_DOUBLE
  4037. ufunc_betaincc_types[5] = <char>NPY_DOUBLE
  4038. ufunc_betaincc_types[6] = <char>NPY_DOUBLE
  4039. ufunc_betaincc_types[7] = <char>NPY_DOUBLE
  4040. ufunc_betaincc_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ibetac_float
  4041. ufunc_betaincc_ptr[2*0+1] = <void*>(<char*>"betaincc")
  4042. ufunc_betaincc_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ibetac_double
  4043. ufunc_betaincc_ptr[2*1+1] = <void*>(<char*>"betaincc")
  4044. ufunc_betaincc_data[0] = &ufunc_betaincc_ptr[2*0]
  4045. ufunc_betaincc_data[1] = &ufunc_betaincc_ptr[2*1]
  4046. betaincc = np.PyUFunc_FromFuncAndData(ufunc_betaincc_loops, ufunc_betaincc_data, ufunc_betaincc_types, 2, 3, 1, 0, 'betaincc', ufunc_betaincc_doc, 0)
  4047. cdef np.PyUFuncGenericFunction ufunc_betainccinv_loops[2]
  4048. cdef void *ufunc_betainccinv_ptr[4]
  4049. cdef void *ufunc_betainccinv_data[2]
  4050. cdef char ufunc_betainccinv_types[8]
  4051. cdef char *ufunc_betainccinv_doc = (
  4052. "betainccinv(a, b, y, out=None)\n"
  4053. "\n"
  4054. "Inverse of the complemented regularized incomplete beta function.\n"
  4055. "\n"
  4056. "Computes :math:`x` such that:\n"
  4057. "\n"
  4058. ".. math::\n"
  4059. "\n"
  4060. " y = 1 - I_x(a, b) = 1 - \\frac{\\Gamma(a+b)}{\\Gamma(a)\\Gamma(b)}\n"
  4061. " \\int_0^x t^{a-1}(1-t)^{b-1}dt,\n"
  4062. "\n"
  4063. "where :math:`I_x` is the normalized incomplete beta function `betainc`\n"
  4064. "and :math:`\\Gamma` is the `gamma` function [1]_.\n"
  4065. "\n"
  4066. "Parameters\n"
  4067. "----------\n"
  4068. "a, b : array_like\n"
  4069. " Positive, real-valued parameters\n"
  4070. "y : array_like\n"
  4071. " Real-valued input\n"
  4072. "out : ndarray, optional\n"
  4073. " Optional output array for function values\n"
  4074. "\n"
  4075. "Returns\n"
  4076. "-------\n"
  4077. "scalar or ndarray\n"
  4078. " Value of the inverse of the regularized incomplete beta function\n"
  4079. "\n"
  4080. "See Also\n"
  4081. "--------\n"
  4082. "betainc : regularized incomplete beta function\n"
  4083. "betaincc : complement of the regularized incomplete beta function\n"
  4084. "\n"
  4085. "Notes\n"
  4086. "-----\n"
  4087. ".. versionadded:: 1.11.0\n"
  4088. "\n"
  4089. "This function wraps the ``ibetac_inv`` routine from the\n"
  4090. "Boost Math C++ library [2]_.\n"
  4091. "\n"
  4092. "References\n"
  4093. "----------\n"
  4094. ".. [1] NIST Digital Library of Mathematical Functions\n"
  4095. " https://dlmf.nist.gov/8.17\n"
  4096. ".. [2] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  4097. "\n"
  4098. "Examples\n"
  4099. "--------\n"
  4100. ">>> from scipy.special import betainccinv, betaincc\n"
  4101. "\n"
  4102. "This function is the inverse of `betaincc` for fixed\n"
  4103. "values of :math:`a` and :math:`b`.\n"
  4104. "\n"
  4105. ">>> a, b = 1.2, 3.1\n"
  4106. ">>> y = betaincc(a, b, 0.2)\n"
  4107. ">>> betainccinv(a, b, y)\n"
  4108. "0.2\n"
  4109. "\n"
  4110. ">>> a, b = 7, 2.5\n"
  4111. ">>> x = betainccinv(a, b, 0.875)\n"
  4112. ">>> betaincc(a, b, x)\n"
  4113. "0.875")
  4114. ufunc_betainccinv_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  4115. ufunc_betainccinv_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  4116. ufunc_betainccinv_types[0] = <char>NPY_FLOAT
  4117. ufunc_betainccinv_types[1] = <char>NPY_FLOAT
  4118. ufunc_betainccinv_types[2] = <char>NPY_FLOAT
  4119. ufunc_betainccinv_types[3] = <char>NPY_FLOAT
  4120. ufunc_betainccinv_types[4] = <char>NPY_DOUBLE
  4121. ufunc_betainccinv_types[5] = <char>NPY_DOUBLE
  4122. ufunc_betainccinv_types[6] = <char>NPY_DOUBLE
  4123. ufunc_betainccinv_types[7] = <char>NPY_DOUBLE
  4124. ufunc_betainccinv_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ibetac_inv_float
  4125. ufunc_betainccinv_ptr[2*0+1] = <void*>(<char*>"betainccinv")
  4126. ufunc_betainccinv_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ibetac_inv_double
  4127. ufunc_betainccinv_ptr[2*1+1] = <void*>(<char*>"betainccinv")
  4128. ufunc_betainccinv_data[0] = &ufunc_betainccinv_ptr[2*0]
  4129. ufunc_betainccinv_data[1] = &ufunc_betainccinv_ptr[2*1]
  4130. betainccinv = np.PyUFunc_FromFuncAndData(ufunc_betainccinv_loops, ufunc_betainccinv_data, ufunc_betainccinv_types, 2, 3, 1, 0, 'betainccinv', ufunc_betainccinv_doc, 0)
  4131. cdef np.PyUFuncGenericFunction ufunc_betaincinv_loops[2]
  4132. cdef void *ufunc_betaincinv_ptr[4]
  4133. cdef void *ufunc_betaincinv_data[2]
  4134. cdef char ufunc_betaincinv_types[8]
  4135. cdef char *ufunc_betaincinv_doc = (
  4136. "betaincinv(a, b, y, out=None)\n"
  4137. "\n"
  4138. "Inverse of the regularized incomplete beta function.\n"
  4139. "\n"
  4140. "Computes :math:`x` such that:\n"
  4141. "\n"
  4142. ".. math::\n"
  4143. "\n"
  4144. " y = I_x(a, b) = \\frac{\\Gamma(a+b)}{\\Gamma(a)\\Gamma(b)}\n"
  4145. " \\int_0^x t^{a-1}(1-t)^{b-1}dt,\n"
  4146. "\n"
  4147. "where :math:`I_x` is the normalized incomplete beta function `betainc`\n"
  4148. "and :math:`\\Gamma` is the `gamma` function [1]_.\n"
  4149. "\n"
  4150. "Parameters\n"
  4151. "----------\n"
  4152. "a, b : array_like\n"
  4153. " Positive, real-valued parameters\n"
  4154. "y : array_like\n"
  4155. " Real-valued input\n"
  4156. "out : ndarray, optional\n"
  4157. " Optional output array for function values\n"
  4158. "\n"
  4159. "Returns\n"
  4160. "-------\n"
  4161. "scalar or ndarray\n"
  4162. " Value of the inverse of the regularized incomplete beta function\n"
  4163. "\n"
  4164. "See Also\n"
  4165. "--------\n"
  4166. "betainc : regularized incomplete beta function\n"
  4167. "gamma : gamma function\n"
  4168. "\n"
  4169. "Notes\n"
  4170. "-----\n"
  4171. "This function wraps the ``ibeta_inv`` routine from the\n"
  4172. "Boost Math C++ library [2]_.\n"
  4173. "\n"
  4174. "References\n"
  4175. "----------\n"
  4176. ".. [1] NIST Digital Library of Mathematical Functions\n"
  4177. " https://dlmf.nist.gov/8.17\n"
  4178. ".. [2] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  4179. "\n"
  4180. "Examples\n"
  4181. "--------\n"
  4182. ">>> import scipy.special as sc\n"
  4183. "\n"
  4184. "This function is the inverse of `betainc` for fixed\n"
  4185. "values of :math:`a` and :math:`b`.\n"
  4186. "\n"
  4187. ">>> a, b = 1.2, 3.1\n"
  4188. ">>> y = sc.betainc(a, b, 0.2)\n"
  4189. ">>> sc.betaincinv(a, b, y)\n"
  4190. "0.2\n"
  4191. ">>>\n"
  4192. ">>> a, b = 7.5, 0.4\n"
  4193. ">>> x = sc.betaincinv(a, b, 0.5)\n"
  4194. ">>> sc.betainc(a, b, x)\n"
  4195. "0.5")
  4196. ufunc_betaincinv_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  4197. ufunc_betaincinv_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  4198. ufunc_betaincinv_types[0] = <char>NPY_FLOAT
  4199. ufunc_betaincinv_types[1] = <char>NPY_FLOAT
  4200. ufunc_betaincinv_types[2] = <char>NPY_FLOAT
  4201. ufunc_betaincinv_types[3] = <char>NPY_FLOAT
  4202. ufunc_betaincinv_types[4] = <char>NPY_DOUBLE
  4203. ufunc_betaincinv_types[5] = <char>NPY_DOUBLE
  4204. ufunc_betaincinv_types[6] = <char>NPY_DOUBLE
  4205. ufunc_betaincinv_types[7] = <char>NPY_DOUBLE
  4206. ufunc_betaincinv_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ibeta_inv_float
  4207. ufunc_betaincinv_ptr[2*0+1] = <void*>(<char*>"betaincinv")
  4208. ufunc_betaincinv_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ibeta_inv_double
  4209. ufunc_betaincinv_ptr[2*1+1] = <void*>(<char*>"betaincinv")
  4210. ufunc_betaincinv_data[0] = &ufunc_betaincinv_ptr[2*0]
  4211. ufunc_betaincinv_data[1] = &ufunc_betaincinv_ptr[2*1]
  4212. betaincinv = np.PyUFunc_FromFuncAndData(ufunc_betaincinv_loops, ufunc_betaincinv_data, ufunc_betaincinv_types, 2, 3, 1, 0, 'betaincinv', ufunc_betaincinv_doc, 0)
  4213. cdef np.PyUFuncGenericFunction ufunc_boxcox_loops[2]
  4214. cdef void *ufunc_boxcox_ptr[4]
  4215. cdef void *ufunc_boxcox_data[2]
  4216. cdef char ufunc_boxcox_types[6]
  4217. cdef char *ufunc_boxcox_doc = (
  4218. "boxcox(x, lmbda, out=None)\n"
  4219. "\n"
  4220. "Compute the Box-Cox transformation.\n"
  4221. "\n"
  4222. "The Box-Cox transformation is::\n"
  4223. "\n"
  4224. " y = (x**lmbda - 1) / lmbda if lmbda != 0\n"
  4225. " log(x) if lmbda == 0\n"
  4226. "\n"
  4227. "Returns `nan` if ``x < 0``.\n"
  4228. "Returns `-inf` if ``x == 0`` and ``lmbda < 0``.\n"
  4229. "\n"
  4230. "Parameters\n"
  4231. "----------\n"
  4232. "x : array_like\n"
  4233. " Data to be transformed.\n"
  4234. "lmbda : array_like\n"
  4235. " Power parameter of the Box-Cox transform.\n"
  4236. "out : ndarray, optional\n"
  4237. " Optional output array for the function values\n"
  4238. "\n"
  4239. "Returns\n"
  4240. "-------\n"
  4241. "y : scalar or ndarray\n"
  4242. " Transformed data.\n"
  4243. "\n"
  4244. "Notes\n"
  4245. "-----\n"
  4246. "\n"
  4247. ".. versionadded:: 0.14.0\n"
  4248. "\n"
  4249. "Examples\n"
  4250. "--------\n"
  4251. ">>> from scipy.special import boxcox\n"
  4252. ">>> boxcox([1, 4, 10], 2.5)\n"
  4253. "array([ 0. , 12.4 , 126.09110641])\n"
  4254. ">>> boxcox(2, [0, 1, 2])\n"
  4255. "array([ 0.69314718, 1. , 1.5 ])")
  4256. ufunc_boxcox_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  4257. ufunc_boxcox_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  4258. ufunc_boxcox_types[0] = <char>NPY_FLOAT
  4259. ufunc_boxcox_types[1] = <char>NPY_FLOAT
  4260. ufunc_boxcox_types[2] = <char>NPY_FLOAT
  4261. ufunc_boxcox_types[3] = <char>NPY_DOUBLE
  4262. ufunc_boxcox_types[4] = <char>NPY_DOUBLE
  4263. ufunc_boxcox_types[5] = <char>NPY_DOUBLE
  4264. ufunc_boxcox_ptr[2*0] = <void*>_func_boxcox
  4265. ufunc_boxcox_ptr[2*0+1] = <void*>(<char*>"boxcox")
  4266. ufunc_boxcox_ptr[2*1] = <void*>_func_boxcox
  4267. ufunc_boxcox_ptr[2*1+1] = <void*>(<char*>"boxcox")
  4268. ufunc_boxcox_data[0] = &ufunc_boxcox_ptr[2*0]
  4269. ufunc_boxcox_data[1] = &ufunc_boxcox_ptr[2*1]
  4270. boxcox = np.PyUFunc_FromFuncAndData(ufunc_boxcox_loops, ufunc_boxcox_data, ufunc_boxcox_types, 2, 2, 1, 0, 'boxcox', ufunc_boxcox_doc, 0)
  4271. cdef np.PyUFuncGenericFunction ufunc_boxcox1p_loops[2]
  4272. cdef void *ufunc_boxcox1p_ptr[4]
  4273. cdef void *ufunc_boxcox1p_data[2]
  4274. cdef char ufunc_boxcox1p_types[6]
  4275. cdef char *ufunc_boxcox1p_doc = (
  4276. "boxcox1p(x, lmbda, out=None)\n"
  4277. "\n"
  4278. "Compute the Box-Cox transformation of 1 + `x`.\n"
  4279. "\n"
  4280. "The Box-Cox transformation computed by `boxcox1p` is::\n"
  4281. "\n"
  4282. " y = ((1+x)**lmbda - 1) / lmbda if lmbda != 0\n"
  4283. " log(1+x) if lmbda == 0\n"
  4284. "\n"
  4285. "Returns `nan` if ``x < -1``.\n"
  4286. "Returns `-inf` if ``x == -1`` and ``lmbda < 0``.\n"
  4287. "\n"
  4288. "Parameters\n"
  4289. "----------\n"
  4290. "x : array_like\n"
  4291. " Data to be transformed.\n"
  4292. "lmbda : array_like\n"
  4293. " Power parameter of the Box-Cox transform.\n"
  4294. "out : ndarray, optional\n"
  4295. " Optional output array for the function values\n"
  4296. "\n"
  4297. "Returns\n"
  4298. "-------\n"
  4299. "y : scalar or ndarray\n"
  4300. " Transformed data.\n"
  4301. "\n"
  4302. "Notes\n"
  4303. "-----\n"
  4304. "\n"
  4305. ".. versionadded:: 0.14.0\n"
  4306. "\n"
  4307. "Examples\n"
  4308. "--------\n"
  4309. ">>> from scipy.special import boxcox1p\n"
  4310. ">>> boxcox1p(1e-4, [0, 0.5, 1])\n"
  4311. "array([ 9.99950003e-05, 9.99975001e-05, 1.00000000e-04])\n"
  4312. ">>> boxcox1p([0.01, 0.1], 0.25)\n"
  4313. "array([ 0.00996272, 0.09645476])")
  4314. ufunc_boxcox1p_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  4315. ufunc_boxcox1p_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  4316. ufunc_boxcox1p_types[0] = <char>NPY_FLOAT
  4317. ufunc_boxcox1p_types[1] = <char>NPY_FLOAT
  4318. ufunc_boxcox1p_types[2] = <char>NPY_FLOAT
  4319. ufunc_boxcox1p_types[3] = <char>NPY_DOUBLE
  4320. ufunc_boxcox1p_types[4] = <char>NPY_DOUBLE
  4321. ufunc_boxcox1p_types[5] = <char>NPY_DOUBLE
  4322. ufunc_boxcox1p_ptr[2*0] = <void*>_func_boxcox1p
  4323. ufunc_boxcox1p_ptr[2*0+1] = <void*>(<char*>"boxcox1p")
  4324. ufunc_boxcox1p_ptr[2*1] = <void*>_func_boxcox1p
  4325. ufunc_boxcox1p_ptr[2*1+1] = <void*>(<char*>"boxcox1p")
  4326. ufunc_boxcox1p_data[0] = &ufunc_boxcox1p_ptr[2*0]
  4327. ufunc_boxcox1p_data[1] = &ufunc_boxcox1p_ptr[2*1]
  4328. boxcox1p = np.PyUFunc_FromFuncAndData(ufunc_boxcox1p_loops, ufunc_boxcox1p_data, ufunc_boxcox1p_types, 2, 2, 1, 0, 'boxcox1p', ufunc_boxcox1p_doc, 0)
  4329. cdef np.PyUFuncGenericFunction ufunc_btdtria_loops[2]
  4330. cdef void *ufunc_btdtria_ptr[4]
  4331. cdef void *ufunc_btdtria_data[2]
  4332. cdef char ufunc_btdtria_types[8]
  4333. cdef char *ufunc_btdtria_doc = (
  4334. "btdtria(p, b, x, out=None)\n"
  4335. "\n"
  4336. "Inverse of `betainc` with respect to `a`.\n"
  4337. "\n"
  4338. "This is the inverse of the beta cumulative distribution function, `betainc`,\n"
  4339. "considered as a function of `a`, returning the value of `a` for which\n"
  4340. "`betainc(a, b, x) = p`, or\n"
  4341. "\n"
  4342. ".. math::\n"
  4343. " p = \\int_0^x \\frac{\\Gamma(a + b)}{\\Gamma(a)\\Gamma(b)} t^{a-1} (1-t)^{b-1}\\,dt\n"
  4344. "\n"
  4345. "Parameters\n"
  4346. "----------\n"
  4347. "p : array_like\n"
  4348. " Cumulative probability, in [0, 1].\n"
  4349. "b : array_like\n"
  4350. " Shape parameter (`b` > 0).\n"
  4351. "x : array_like\n"
  4352. " The quantile, in [0, 1].\n"
  4353. "out : ndarray, optional\n"
  4354. " Optional output array for the function values\n"
  4355. "\n"
  4356. "Returns\n"
  4357. "-------\n"
  4358. "a : scalar or ndarray\n"
  4359. " The value of the shape parameter `a` such that `betainc(a, b, x) = p`.\n"
  4360. "\n"
  4361. "See Also\n"
  4362. "--------\n"
  4363. "betainc : Regularized incomplete beta function\n"
  4364. "betaincinv : Inverse of the regularized incomplete beta function\n"
  4365. "btdtrib : Inverse of the beta cumulative distribution function, with respect to `b`.\n"
  4366. "\n"
  4367. "Notes\n"
  4368. "-----\n"
  4369. "This function wraps the ``ibeta_inva`` routine from the\n"
  4370. "Boost Math C++ library [1]_.\n"
  4371. "\n"
  4372. "References\n"
  4373. "----------\n"
  4374. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  4375. "\n"
  4376. "Examples\n"
  4377. "--------\n"
  4378. ">>> import scipy.special as sc\n"
  4379. "\n"
  4380. "This function is the inverse of `betainc` for fixed\n"
  4381. "values of :math:`b` and :math:`x`.\n"
  4382. "\n"
  4383. ">>> a, b, x = 1.2, 3.1, 0.2\n"
  4384. ">>> y = sc.betainc(a, b, x)\n"
  4385. ">>> sc.btdtria(y, b, x)\n"
  4386. "1.2")
  4387. ufunc_btdtria_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  4388. ufunc_btdtria_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  4389. ufunc_btdtria_types[0] = <char>NPY_FLOAT
  4390. ufunc_btdtria_types[1] = <char>NPY_FLOAT
  4391. ufunc_btdtria_types[2] = <char>NPY_FLOAT
  4392. ufunc_btdtria_types[3] = <char>NPY_FLOAT
  4393. ufunc_btdtria_types[4] = <char>NPY_DOUBLE
  4394. ufunc_btdtria_types[5] = <char>NPY_DOUBLE
  4395. ufunc_btdtria_types[6] = <char>NPY_DOUBLE
  4396. ufunc_btdtria_types[7] = <char>NPY_DOUBLE
  4397. ufunc_btdtria_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ibeta_inva_float
  4398. ufunc_btdtria_ptr[2*0+1] = <void*>(<char*>"btdtria")
  4399. ufunc_btdtria_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ibeta_inva_double
  4400. ufunc_btdtria_ptr[2*1+1] = <void*>(<char*>"btdtria")
  4401. ufunc_btdtria_data[0] = &ufunc_btdtria_ptr[2*0]
  4402. ufunc_btdtria_data[1] = &ufunc_btdtria_ptr[2*1]
  4403. btdtria = np.PyUFunc_FromFuncAndData(ufunc_btdtria_loops, ufunc_btdtria_data, ufunc_btdtria_types, 2, 3, 1, 0, 'btdtria', ufunc_btdtria_doc, 0)
  4404. cdef np.PyUFuncGenericFunction ufunc_btdtrib_loops[2]
  4405. cdef void *ufunc_btdtrib_ptr[4]
  4406. cdef void *ufunc_btdtrib_data[2]
  4407. cdef char ufunc_btdtrib_types[8]
  4408. cdef char *ufunc_btdtrib_doc = (
  4409. "btdtria(a, p, x, out=None)\n"
  4410. "\n"
  4411. "Inverse of `betainc` with respect to `b`.\n"
  4412. "\n"
  4413. "This is the inverse of the beta cumulative distribution function, `betainc`,\n"
  4414. "considered as a function of `b`, returning the value of `b` for which\n"
  4415. "`betainc(a, b, x) = p`, or\n"
  4416. "\n"
  4417. ".. math::\n"
  4418. " p = \\int_0^x \\frac{\\Gamma(a + b)}{\\Gamma(a)\\Gamma(b)} t^{a-1} (1-t)^{b-1}\\,dt\n"
  4419. "\n"
  4420. "Parameters\n"
  4421. "----------\n"
  4422. "a : array_like\n"
  4423. " Shape parameter (`a` > 0).\n"
  4424. "p : array_like\n"
  4425. " Cumulative probability, in [0, 1].\n"
  4426. "x : array_like\n"
  4427. " The quantile, in [0, 1].\n"
  4428. "out : ndarray, optional\n"
  4429. " Optional output array for the function values\n"
  4430. "\n"
  4431. "Returns\n"
  4432. "-------\n"
  4433. "b : scalar or ndarray\n"
  4434. " The value of the shape parameter `b` such that `betainc(a, b, x) = p`.\n"
  4435. "\n"
  4436. "See Also\n"
  4437. "--------\n"
  4438. "betainc : Regularized incomplete beta function\n"
  4439. "betaincinv : Inverse of the regularized incomplete beta function with\n"
  4440. " respect to `x`.\n"
  4441. "btdtria : Inverse of the beta cumulative distribution function, with respect to `a`.\n"
  4442. "\n"
  4443. "Notes\n"
  4444. "-----\n"
  4445. "Wrapper for the `ibeta_invb` routine from the Boost Math C++ library [1]_.\n"
  4446. "\n"
  4447. "References\n"
  4448. "----------\n"
  4449. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  4450. "\n"
  4451. "Examples\n"
  4452. "--------\n"
  4453. ">>> import scipy.special as sc\n"
  4454. ">>> a, b, x = 1.2, 3.1, 0.2\n"
  4455. ">>> y = sc.betainc(a, b, x)\n"
  4456. "\n"
  4457. "`btdtrib` is the inverse of `betainc` for fixed values of :math:`a` and\n"
  4458. ":math:`x`:\n"
  4459. "\n"
  4460. ">>> sc.btdtrib(a, y, x)\n"
  4461. "3.1")
  4462. ufunc_btdtrib_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  4463. ufunc_btdtrib_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  4464. ufunc_btdtrib_types[0] = <char>NPY_FLOAT
  4465. ufunc_btdtrib_types[1] = <char>NPY_FLOAT
  4466. ufunc_btdtrib_types[2] = <char>NPY_FLOAT
  4467. ufunc_btdtrib_types[3] = <char>NPY_FLOAT
  4468. ufunc_btdtrib_types[4] = <char>NPY_DOUBLE
  4469. ufunc_btdtrib_types[5] = <char>NPY_DOUBLE
  4470. ufunc_btdtrib_types[6] = <char>NPY_DOUBLE
  4471. ufunc_btdtrib_types[7] = <char>NPY_DOUBLE
  4472. ufunc_btdtrib_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ibeta_invb_float
  4473. ufunc_btdtrib_ptr[2*0+1] = <void*>(<char*>"btdtrib")
  4474. ufunc_btdtrib_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ibeta_invb_double
  4475. ufunc_btdtrib_ptr[2*1+1] = <void*>(<char*>"btdtrib")
  4476. ufunc_btdtrib_data[0] = &ufunc_btdtrib_ptr[2*0]
  4477. ufunc_btdtrib_data[1] = &ufunc_btdtrib_ptr[2*1]
  4478. btdtrib = np.PyUFunc_FromFuncAndData(ufunc_btdtrib_loops, ufunc_btdtrib_data, ufunc_btdtrib_types, 2, 3, 1, 0, 'btdtrib', ufunc_btdtrib_doc, 0)
  4479. cdef np.PyUFuncGenericFunction ufunc_chdtr_loops[2]
  4480. cdef void *ufunc_chdtr_ptr[4]
  4481. cdef void *ufunc_chdtr_data[2]
  4482. cdef char ufunc_chdtr_types[6]
  4483. cdef char *ufunc_chdtr_doc = (
  4484. "chdtr(v, x, out=None)\n"
  4485. "\n"
  4486. "Chi square cumulative distribution function.\n"
  4487. "\n"
  4488. "Returns the area under the left tail (from 0 to `x`) of the Chi\n"
  4489. "square probability density function with `v` degrees of freedom:\n"
  4490. "\n"
  4491. ".. math::\n"
  4492. "\n"
  4493. " \\frac{1}{2^{v/2} \\Gamma(v/2)} \\int_0^x t^{v/2 - 1} e^{-t/2} dt\n"
  4494. "\n"
  4495. "Here :math:`\\Gamma` is the Gamma function; see `gamma`. This\n"
  4496. "integral can be expressed in terms of the regularized lower\n"
  4497. "incomplete gamma function `gammainc` as\n"
  4498. "``gammainc(v / 2, x / 2)``. [1]_\n"
  4499. "\n"
  4500. "Parameters\n"
  4501. "----------\n"
  4502. "v : array_like\n"
  4503. " Degrees of freedom.\n"
  4504. "x : array_like\n"
  4505. " Upper bound of the integral.\n"
  4506. "out : ndarray, optional\n"
  4507. " Optional output array for the function results.\n"
  4508. "\n"
  4509. "Returns\n"
  4510. "-------\n"
  4511. "scalar or ndarray\n"
  4512. " Values of the cumulative distribution function.\n"
  4513. "\n"
  4514. "See Also\n"
  4515. "--------\n"
  4516. "chdtrc, chdtri, chdtriv, gammainc\n"
  4517. "\n"
  4518. "References\n"
  4519. "----------\n"
  4520. ".. [1] Chi-Square distribution,\n"
  4521. " https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm\n"
  4522. "\n"
  4523. "Examples\n"
  4524. "--------\n"
  4525. ">>> import numpy as np\n"
  4526. ">>> import scipy.special as sc\n"
  4527. "\n"
  4528. "It can be expressed in terms of the regularized lower incomplete\n"
  4529. "gamma function.\n"
  4530. "\n"
  4531. ">>> v = 1\n"
  4532. ">>> x = np.arange(4)\n"
  4533. ">>> sc.chdtr(v, x)\n"
  4534. "array([0. , 0.68268949, 0.84270079, 0.91673548])\n"
  4535. ">>> sc.gammainc(v / 2, x / 2)\n"
  4536. "array([0. , 0.68268949, 0.84270079, 0.91673548])")
  4537. ufunc_chdtr_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  4538. ufunc_chdtr_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  4539. ufunc_chdtr_types[0] = <char>NPY_FLOAT
  4540. ufunc_chdtr_types[1] = <char>NPY_FLOAT
  4541. ufunc_chdtr_types[2] = <char>NPY_FLOAT
  4542. ufunc_chdtr_types[3] = <char>NPY_DOUBLE
  4543. ufunc_chdtr_types[4] = <char>NPY_DOUBLE
  4544. ufunc_chdtr_types[5] = <char>NPY_DOUBLE
  4545. ufunc_chdtr_ptr[2*0] = <void*>_func_xsf_chdtr
  4546. ufunc_chdtr_ptr[2*0+1] = <void*>(<char*>"chdtr")
  4547. ufunc_chdtr_ptr[2*1] = <void*>_func_xsf_chdtr
  4548. ufunc_chdtr_ptr[2*1+1] = <void*>(<char*>"chdtr")
  4549. ufunc_chdtr_data[0] = &ufunc_chdtr_ptr[2*0]
  4550. ufunc_chdtr_data[1] = &ufunc_chdtr_ptr[2*1]
  4551. chdtr = np.PyUFunc_FromFuncAndData(ufunc_chdtr_loops, ufunc_chdtr_data, ufunc_chdtr_types, 2, 2, 1, 0, 'chdtr', ufunc_chdtr_doc, 0)
  4552. cdef np.PyUFuncGenericFunction ufunc_chdtrc_loops[2]
  4553. cdef void *ufunc_chdtrc_ptr[4]
  4554. cdef void *ufunc_chdtrc_data[2]
  4555. cdef char ufunc_chdtrc_types[6]
  4556. cdef char *ufunc_chdtrc_doc = (
  4557. "chdtrc(v, x, out=None)\n"
  4558. "\n"
  4559. "Chi square survival function.\n"
  4560. "\n"
  4561. "Returns the area under the right hand tail (from `x` to infinity)\n"
  4562. "of the Chi square probability density function with `v` degrees of\n"
  4563. "freedom:\n"
  4564. "\n"
  4565. ".. math::\n"
  4566. "\n"
  4567. " \\frac{1}{2^{v/2} \\Gamma(v/2)} \\int_x^\\infty t^{v/2 - 1} e^{-t/2} dt\n"
  4568. "\n"
  4569. "Here :math:`\\Gamma` is the Gamma function; see `gamma`. This\n"
  4570. "integral can be expressed in terms of the regularized upper\n"
  4571. "incomplete gamma function `gammaincc` as\n"
  4572. "``gammaincc(v / 2, x / 2)``. [1]_\n"
  4573. "\n"
  4574. "Parameters\n"
  4575. "----------\n"
  4576. "v : array_like\n"
  4577. " Degrees of freedom.\n"
  4578. "x : array_like\n"
  4579. " Lower bound of the integral.\n"
  4580. "out : ndarray, optional\n"
  4581. " Optional output array for the function results.\n"
  4582. "\n"
  4583. "Returns\n"
  4584. "-------\n"
  4585. "scalar or ndarray\n"
  4586. " Values of the survival function.\n"
  4587. "\n"
  4588. "See Also\n"
  4589. "--------\n"
  4590. "chdtr, chdtri, chdtriv, gammaincc\n"
  4591. "\n"
  4592. "References\n"
  4593. "----------\n"
  4594. ".. [1] Chi-Square distribution,\n"
  4595. " https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm\n"
  4596. "\n"
  4597. "Examples\n"
  4598. "--------\n"
  4599. ">>> import numpy as np\n"
  4600. ">>> import scipy.special as sc\n"
  4601. "\n"
  4602. "It can be expressed in terms of the regularized upper incomplete\n"
  4603. "gamma function.\n"
  4604. "\n"
  4605. ">>> v = 1\n"
  4606. ">>> x = np.arange(4)\n"
  4607. ">>> sc.chdtrc(v, x)\n"
  4608. "array([1. , 0.31731051, 0.15729921, 0.08326452])\n"
  4609. ">>> sc.gammaincc(v / 2, x / 2)\n"
  4610. "array([1. , 0.31731051, 0.15729921, 0.08326452])")
  4611. ufunc_chdtrc_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  4612. ufunc_chdtrc_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  4613. ufunc_chdtrc_types[0] = <char>NPY_FLOAT
  4614. ufunc_chdtrc_types[1] = <char>NPY_FLOAT
  4615. ufunc_chdtrc_types[2] = <char>NPY_FLOAT
  4616. ufunc_chdtrc_types[3] = <char>NPY_DOUBLE
  4617. ufunc_chdtrc_types[4] = <char>NPY_DOUBLE
  4618. ufunc_chdtrc_types[5] = <char>NPY_DOUBLE
  4619. ufunc_chdtrc_ptr[2*0] = <void*>_func_xsf_chdtrc
  4620. ufunc_chdtrc_ptr[2*0+1] = <void*>(<char*>"chdtrc")
  4621. ufunc_chdtrc_ptr[2*1] = <void*>_func_xsf_chdtrc
  4622. ufunc_chdtrc_ptr[2*1+1] = <void*>(<char*>"chdtrc")
  4623. ufunc_chdtrc_data[0] = &ufunc_chdtrc_ptr[2*0]
  4624. ufunc_chdtrc_data[1] = &ufunc_chdtrc_ptr[2*1]
  4625. chdtrc = np.PyUFunc_FromFuncAndData(ufunc_chdtrc_loops, ufunc_chdtrc_data, ufunc_chdtrc_types, 2, 2, 1, 0, 'chdtrc', ufunc_chdtrc_doc, 0)
  4626. cdef np.PyUFuncGenericFunction ufunc_chdtri_loops[2]
  4627. cdef void *ufunc_chdtri_ptr[4]
  4628. cdef void *ufunc_chdtri_data[2]
  4629. cdef char ufunc_chdtri_types[6]
  4630. cdef char *ufunc_chdtri_doc = (
  4631. "chdtri(v, p, out=None)\n"
  4632. "\n"
  4633. "Inverse to `chdtrc` with respect to `x`.\n"
  4634. "\n"
  4635. "Returns `x` such that ``chdtrc(v, x) == p``.\n"
  4636. "\n"
  4637. "Parameters\n"
  4638. "----------\n"
  4639. "v : array_like\n"
  4640. " Degrees of freedom.\n"
  4641. "p : array_like\n"
  4642. " Probability.\n"
  4643. "out : ndarray, optional\n"
  4644. " Optional output array for the function results.\n"
  4645. "\n"
  4646. "Returns\n"
  4647. "-------\n"
  4648. "x : scalar or ndarray\n"
  4649. " Value so that the probability a Chi square random variable\n"
  4650. " with `v` degrees of freedom is greater than `x` equals `p`.\n"
  4651. "\n"
  4652. "See Also\n"
  4653. "--------\n"
  4654. "chdtrc, chdtr, chdtriv\n"
  4655. "\n"
  4656. "References\n"
  4657. "----------\n"
  4658. ".. [1] Chi-Square distribution,\n"
  4659. " https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm\n"
  4660. "\n"
  4661. "Examples\n"
  4662. "--------\n"
  4663. ">>> import scipy.special as sc\n"
  4664. "\n"
  4665. "It inverts `chdtrc`.\n"
  4666. "\n"
  4667. ">>> v, p = 1, 0.3\n"
  4668. ">>> sc.chdtrc(v, sc.chdtri(v, p))\n"
  4669. "0.3\n"
  4670. ">>> x = 1\n"
  4671. ">>> sc.chdtri(v, sc.chdtrc(v, x))\n"
  4672. "1.0")
  4673. ufunc_chdtri_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  4674. ufunc_chdtri_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  4675. ufunc_chdtri_types[0] = <char>NPY_FLOAT
  4676. ufunc_chdtri_types[1] = <char>NPY_FLOAT
  4677. ufunc_chdtri_types[2] = <char>NPY_FLOAT
  4678. ufunc_chdtri_types[3] = <char>NPY_DOUBLE
  4679. ufunc_chdtri_types[4] = <char>NPY_DOUBLE
  4680. ufunc_chdtri_types[5] = <char>NPY_DOUBLE
  4681. ufunc_chdtri_ptr[2*0] = <void*>_func_xsf_chdtri
  4682. ufunc_chdtri_ptr[2*0+1] = <void*>(<char*>"chdtri")
  4683. ufunc_chdtri_ptr[2*1] = <void*>_func_xsf_chdtri
  4684. ufunc_chdtri_ptr[2*1+1] = <void*>(<char*>"chdtri")
  4685. ufunc_chdtri_data[0] = &ufunc_chdtri_ptr[2*0]
  4686. ufunc_chdtri_data[1] = &ufunc_chdtri_ptr[2*1]
  4687. chdtri = np.PyUFunc_FromFuncAndData(ufunc_chdtri_loops, ufunc_chdtri_data, ufunc_chdtri_types, 2, 2, 1, 0, 'chdtri', ufunc_chdtri_doc, 0)
  4688. cdef np.PyUFuncGenericFunction ufunc_chdtriv_loops[2]
  4689. cdef void *ufunc_chdtriv_ptr[4]
  4690. cdef void *ufunc_chdtriv_data[2]
  4691. cdef char ufunc_chdtriv_types[6]
  4692. cdef char *ufunc_chdtriv_doc = (
  4693. "chdtriv(p, x, out=None)\n"
  4694. "\n"
  4695. "Inverse to `chdtr` with respect to `v`.\n"
  4696. "\n"
  4697. "Returns `v` such that ``chdtr(v, x) == p``.\n"
  4698. "\n"
  4699. "Parameters\n"
  4700. "----------\n"
  4701. "p : array_like\n"
  4702. " Probability that the Chi square random variable is less than\n"
  4703. " or equal to `x`.\n"
  4704. "x : array_like\n"
  4705. " Nonnegative input.\n"
  4706. "out : ndarray, optional\n"
  4707. " Optional output array for the function results.\n"
  4708. "\n"
  4709. "Returns\n"
  4710. "-------\n"
  4711. "scalar or ndarray\n"
  4712. " Degrees of freedom.\n"
  4713. "\n"
  4714. "See Also\n"
  4715. "--------\n"
  4716. "chdtr, chdtrc, chdtri\n"
  4717. "\n"
  4718. "Notes\n"
  4719. "-----\n"
  4720. "This function wraps routines from the Boost Math C++ library [1]_.\n"
  4721. "\n"
  4722. "References\n"
  4723. "----------\n"
  4724. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  4725. ".. [2] Chi-Square distribution,\n"
  4726. " https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm\n"
  4727. "\n"
  4728. "Examples\n"
  4729. "--------\n"
  4730. ">>> import scipy.special as sc\n"
  4731. "\n"
  4732. "It inverts `chdtr`.\n"
  4733. "\n"
  4734. ">>> p, x = 0.5, 1\n"
  4735. ">>> sc.chdtr(sc.chdtriv(p, x), x)\n"
  4736. "0.5000000000000003\n"
  4737. ">>> v = 1\n"
  4738. ">>> sc.chdtriv(sc.chdtr(v, x), v)\n"
  4739. "1.0")
  4740. ufunc_chdtriv_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  4741. ufunc_chdtriv_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  4742. ufunc_chdtriv_types[0] = <char>NPY_FLOAT
  4743. ufunc_chdtriv_types[1] = <char>NPY_FLOAT
  4744. ufunc_chdtriv_types[2] = <char>NPY_FLOAT
  4745. ufunc_chdtriv_types[3] = <char>NPY_DOUBLE
  4746. ufunc_chdtriv_types[4] = <char>NPY_DOUBLE
  4747. ufunc_chdtriv_types[5] = <char>NPY_DOUBLE
  4748. ufunc_chdtriv_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_chdtriv_float
  4749. ufunc_chdtriv_ptr[2*0+1] = <void*>(<char*>"chdtriv")
  4750. ufunc_chdtriv_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_chdtriv_double
  4751. ufunc_chdtriv_ptr[2*1+1] = <void*>(<char*>"chdtriv")
  4752. ufunc_chdtriv_data[0] = &ufunc_chdtriv_ptr[2*0]
  4753. ufunc_chdtriv_data[1] = &ufunc_chdtriv_ptr[2*1]
  4754. chdtriv = np.PyUFunc_FromFuncAndData(ufunc_chdtriv_loops, ufunc_chdtriv_data, ufunc_chdtriv_types, 2, 2, 1, 0, 'chdtriv', ufunc_chdtriv_doc, 0)
  4755. cdef np.PyUFuncGenericFunction ufunc_chndtr_loops[2]
  4756. cdef void *ufunc_chndtr_ptr[4]
  4757. cdef void *ufunc_chndtr_data[2]
  4758. cdef char ufunc_chndtr_types[8]
  4759. cdef char *ufunc_chndtr_doc = (
  4760. "chndtr(x, df, nc, out=None)\n"
  4761. "\n"
  4762. "Non-central chi square cumulative distribution function\n"
  4763. "\n"
  4764. "The cumulative distribution function is given by:\n"
  4765. "\n"
  4766. ".. math::\n"
  4767. "\n"
  4768. " P(\\chi^{\\prime 2} \\vert \\nu, \\lambda) =\\sum_{j=0}^{\\infty}\n"
  4769. " e^{-\\lambda /2}\n"
  4770. " \\frac{(\\lambda /2)^j}{j!} P(\\chi^{\\prime 2} \\vert \\nu + 2j),\n"
  4771. "\n"
  4772. "where :math:`\\nu > 0` is the degrees of freedom (``df``) and\n"
  4773. ":math:`\\lambda \\geq 0` is the non-centrality parameter (``nc``).\n"
  4774. "\n"
  4775. "Parameters\n"
  4776. "----------\n"
  4777. "x : array_like\n"
  4778. " Upper bound of the integral; must satisfy ``x >= 0``\n"
  4779. "df : array_like\n"
  4780. " Degrees of freedom; must satisfy ``df > 0``\n"
  4781. "nc : array_like\n"
  4782. " Non-centrality parameter; must satisfy ``nc >= 0``\n"
  4783. "out : ndarray, optional\n"
  4784. " Optional output array for the function results\n"
  4785. "\n"
  4786. "Returns\n"
  4787. "-------\n"
  4788. "x : scalar or ndarray\n"
  4789. " Value of the non-central chi square cumulative distribution function.\n"
  4790. "\n"
  4791. "See Also\n"
  4792. "--------\n"
  4793. "chndtrix: Noncentral Chi Squared distribution quantile\n"
  4794. "chndtridf: Inverse of `chndtr` with respect to `df`\n"
  4795. "chndtrinc: Inverse of `chndtr` with respect to `nc`\n"
  4796. "scipy.stats.ncx2: Non-central chi-squared distribution\n"
  4797. "\n"
  4798. "Notes\n"
  4799. "-----\n"
  4800. "The noncentral chi squared distribution is also available in\n"
  4801. "`scipy.stats.ncx2`. ``scipy.stats.ncx2.cdf`` is equivalent to `chndtr`.\n"
  4802. "\n"
  4803. "This function wraps routines from the Boost Math C++ library [1]_.\n"
  4804. "\n"
  4805. "References\n"
  4806. "----------\n"
  4807. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  4808. "\n"
  4809. "Examples\n"
  4810. "--------\n"
  4811. ">>> import numpy as np\n"
  4812. ">>> import scipy.special as sc\n"
  4813. "\n"
  4814. "Compute the noncentral chi squared distribution CDF at one point.\n"
  4815. "\n"
  4816. ">>> x = 4.0\n"
  4817. ">>> df = 1.0\n"
  4818. ">>> nc = 5.0\n"
  4819. ">>> sc.chndtr(x, df, nc)\n"
  4820. "0.40667858759710945\n"
  4821. "\n"
  4822. "Plot the noncentral chi squared distribution CDF for different parameters.\n"
  4823. "\n"
  4824. ">>> import matplotlib.pyplot as plt\n"
  4825. ">>> x = np.linspace(0, 40, 1000)\n"
  4826. ">>> plt.plot(x, sc.chndtr(x, 1, 5), label=r\"$df=1,\\ nc=5$\")\n"
  4827. ">>> plt.plot(x, sc.chndtr(x, 5, 10), label=r\"$df=5,\\ nc=10$\")\n"
  4828. ">>> plt.legend()\n"
  4829. ">>> plt.show()")
  4830. ufunc_chndtr_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  4831. ufunc_chndtr_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  4832. ufunc_chndtr_types[0] = <char>NPY_FLOAT
  4833. ufunc_chndtr_types[1] = <char>NPY_FLOAT
  4834. ufunc_chndtr_types[2] = <char>NPY_FLOAT
  4835. ufunc_chndtr_types[3] = <char>NPY_FLOAT
  4836. ufunc_chndtr_types[4] = <char>NPY_DOUBLE
  4837. ufunc_chndtr_types[5] = <char>NPY_DOUBLE
  4838. ufunc_chndtr_types[6] = <char>NPY_DOUBLE
  4839. ufunc_chndtr_types[7] = <char>NPY_DOUBLE
  4840. ufunc_chndtr_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncx2_cdf_float
  4841. ufunc_chndtr_ptr[2*0+1] = <void*>(<char*>"chndtr")
  4842. ufunc_chndtr_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncx2_cdf_double
  4843. ufunc_chndtr_ptr[2*1+1] = <void*>(<char*>"chndtr")
  4844. ufunc_chndtr_data[0] = &ufunc_chndtr_ptr[2*0]
  4845. ufunc_chndtr_data[1] = &ufunc_chndtr_ptr[2*1]
  4846. chndtr = np.PyUFunc_FromFuncAndData(ufunc_chndtr_loops, ufunc_chndtr_data, ufunc_chndtr_types, 2, 3, 1, 0, 'chndtr', ufunc_chndtr_doc, 0)
  4847. cdef np.PyUFuncGenericFunction ufunc_chndtridf_loops[2]
  4848. cdef void *ufunc_chndtridf_ptr[4]
  4849. cdef void *ufunc_chndtridf_data[2]
  4850. cdef char ufunc_chndtridf_types[8]
  4851. cdef char *ufunc_chndtridf_doc = (
  4852. "chndtridf(x, p, nc, out=None)\n"
  4853. "\n"
  4854. "Inverse to `chndtr` vs `df`\n"
  4855. "\n"
  4856. "Calculated using a search to find a value for `df` that produces the\n"
  4857. "desired value of `p`.\n"
  4858. "\n"
  4859. "Parameters\n"
  4860. "----------\n"
  4861. "x : array_like\n"
  4862. " Upper bound of the integral; must satisfy ``x >= 0``\n"
  4863. "p : array_like\n"
  4864. " Probability; must satisfy ``0 <= p < 1``\n"
  4865. "nc : array_like\n"
  4866. " Non-centrality parameter; must satisfy ``nc >= 0``\n"
  4867. "out : ndarray, optional\n"
  4868. " Optional output array for the function results\n"
  4869. "\n"
  4870. "Returns\n"
  4871. "-------\n"
  4872. "df : scalar or ndarray\n"
  4873. " Degrees of freedom\n"
  4874. "\n"
  4875. "See Also\n"
  4876. "--------\n"
  4877. "chndtr : Noncentral chi-squared distribution CDF\n"
  4878. "chndtrix : inverse of `chndtr` with respect to `x`\n"
  4879. "chndtrinc : inverse of `chndtr` with respect to `nc`\n"
  4880. "scipy.stats.ncx2 : Non-central chi-squared distribution\n"
  4881. "\n"
  4882. "Notes\n"
  4883. "-----\n"
  4884. "The noncentral chi squared distribution is also available in\n"
  4885. "`scipy.stats.ncx2`.\n"
  4886. "\n"
  4887. "This function wraps routines from the Boost Math C++ library [1]_.\n"
  4888. "\n"
  4889. "References\n"
  4890. "----------\n"
  4891. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  4892. "\n"
  4893. "Examples\n"
  4894. "--------\n"
  4895. ">>> from scipy.special import chndtridf, chndtr\n"
  4896. "\n"
  4897. "Compute the noncentral chi squared distribution CDF at one point.\n"
  4898. "\n"
  4899. ">>> x, df, nc = 3, 5, 10\n"
  4900. ">>> p = chndtr(x, df, nc)\n"
  4901. "\n"
  4902. "`chndtridf` is the inverse of `chndtr` with respect to `df`:\n"
  4903. "\n"
  4904. ">>> chndtridf(x, p, nc)\n"
  4905. "5.0")
  4906. ufunc_chndtridf_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  4907. ufunc_chndtridf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  4908. ufunc_chndtridf_types[0] = <char>NPY_FLOAT
  4909. ufunc_chndtridf_types[1] = <char>NPY_FLOAT
  4910. ufunc_chndtridf_types[2] = <char>NPY_FLOAT
  4911. ufunc_chndtridf_types[3] = <char>NPY_FLOAT
  4912. ufunc_chndtridf_types[4] = <char>NPY_DOUBLE
  4913. ufunc_chndtridf_types[5] = <char>NPY_DOUBLE
  4914. ufunc_chndtridf_types[6] = <char>NPY_DOUBLE
  4915. ufunc_chndtridf_types[7] = <char>NPY_DOUBLE
  4916. ufunc_chndtridf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncx2_find_degrees_of_freedom_float
  4917. ufunc_chndtridf_ptr[2*0+1] = <void*>(<char*>"chndtridf")
  4918. ufunc_chndtridf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncx2_find_degrees_of_freedom_double
  4919. ufunc_chndtridf_ptr[2*1+1] = <void*>(<char*>"chndtridf")
  4920. ufunc_chndtridf_data[0] = &ufunc_chndtridf_ptr[2*0]
  4921. ufunc_chndtridf_data[1] = &ufunc_chndtridf_ptr[2*1]
  4922. chndtridf = np.PyUFunc_FromFuncAndData(ufunc_chndtridf_loops, ufunc_chndtridf_data, ufunc_chndtridf_types, 2, 3, 1, 0, 'chndtridf', ufunc_chndtridf_doc, 0)
  4923. cdef np.PyUFuncGenericFunction ufunc_chndtrinc_loops[2]
  4924. cdef void *ufunc_chndtrinc_ptr[4]
  4925. cdef void *ufunc_chndtrinc_data[2]
  4926. cdef char ufunc_chndtrinc_types[8]
  4927. cdef char *ufunc_chndtrinc_doc = (
  4928. "chndtrinc(x, df, p, out=None)\n"
  4929. "\n"
  4930. "Inverse to `chndtr` vs `nc`\n"
  4931. "\n"
  4932. "Calculated using a search to find a value for `df` that produces the\n"
  4933. "desired value of `p`.\n"
  4934. "\n"
  4935. "Parameters\n"
  4936. "----------\n"
  4937. "x : array_like\n"
  4938. " Upper bound of the integral; must satisfy ``x >= 0``\n"
  4939. "df : array_like\n"
  4940. " Degrees of freedom; must satisfy ``df > 0``\n"
  4941. "p : array_like\n"
  4942. " Probability; must satisfy ``0 <= p < 1``\n"
  4943. "out : ndarray, optional\n"
  4944. " Optional output array for the function results\n"
  4945. "\n"
  4946. "Returns\n"
  4947. "-------\n"
  4948. "nc : scalar or ndarray\n"
  4949. " Non-centrality\n"
  4950. "\n"
  4951. "See Also\n"
  4952. "--------\n"
  4953. "chndtr : Noncentral chi-squared distribution CDF\n"
  4954. "chndtridf : inverse of `chndtr` with respect to `df`\n"
  4955. "chndtrinc : inverse of `chndtr` with respect to `nc`\n"
  4956. "scipy.stats.ncx2 : Non-central chi-squared distribution\n"
  4957. "\n"
  4958. "Notes\n"
  4959. "-----\n"
  4960. "The noncentral chi squared distribution is also available in\n"
  4961. "`scipy.stats.ncx2`.\n"
  4962. "\n"
  4963. "This function wraps routines from the Boost Math C++ library [1]_.\n"
  4964. "\n"
  4965. "References\n"
  4966. "----------\n"
  4967. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  4968. "\n"
  4969. "Examples\n"
  4970. "--------\n"
  4971. ">>> from scipy.special import chndtrinc, chndtr\n"
  4972. "\n"
  4973. "Compute the noncentral chi squared distribution CDF at one point.\n"
  4974. "\n"
  4975. ">>> x, df, nc = 3, 5, 10\n"
  4976. ">>> p = chndtr(x, df, nc)\n"
  4977. "\n"
  4978. "`chndtrinc` is the inverse of `chndtr` with respect to `nc`:\n"
  4979. "\n"
  4980. ">>> chndtrinc(x, df, p)\n"
  4981. "10.0")
  4982. ufunc_chndtrinc_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  4983. ufunc_chndtrinc_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  4984. ufunc_chndtrinc_types[0] = <char>NPY_FLOAT
  4985. ufunc_chndtrinc_types[1] = <char>NPY_FLOAT
  4986. ufunc_chndtrinc_types[2] = <char>NPY_FLOAT
  4987. ufunc_chndtrinc_types[3] = <char>NPY_FLOAT
  4988. ufunc_chndtrinc_types[4] = <char>NPY_DOUBLE
  4989. ufunc_chndtrinc_types[5] = <char>NPY_DOUBLE
  4990. ufunc_chndtrinc_types[6] = <char>NPY_DOUBLE
  4991. ufunc_chndtrinc_types[7] = <char>NPY_DOUBLE
  4992. ufunc_chndtrinc_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncx2_find_noncentrality_float
  4993. ufunc_chndtrinc_ptr[2*0+1] = <void*>(<char*>"chndtrinc")
  4994. ufunc_chndtrinc_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncx2_find_noncentrality_double
  4995. ufunc_chndtrinc_ptr[2*1+1] = <void*>(<char*>"chndtrinc")
  4996. ufunc_chndtrinc_data[0] = &ufunc_chndtrinc_ptr[2*0]
  4997. ufunc_chndtrinc_data[1] = &ufunc_chndtrinc_ptr[2*1]
  4998. chndtrinc = np.PyUFunc_FromFuncAndData(ufunc_chndtrinc_loops, ufunc_chndtrinc_data, ufunc_chndtrinc_types, 2, 3, 1, 0, 'chndtrinc', ufunc_chndtrinc_doc, 0)
  4999. cdef np.PyUFuncGenericFunction ufunc_chndtrix_loops[2]
  5000. cdef void *ufunc_chndtrix_ptr[4]
  5001. cdef void *ufunc_chndtrix_data[2]
  5002. cdef char ufunc_chndtrix_types[8]
  5003. cdef char *ufunc_chndtrix_doc = (
  5004. "chndtrix(p, df, nc, out=None)\n"
  5005. "\n"
  5006. "Inverse to `chndtr` vs `x`\n"
  5007. "\n"
  5008. "Calculated using a search to find a value for `x` that produces the\n"
  5009. "desired value of `p`.\n"
  5010. "\n"
  5011. "Parameters\n"
  5012. "----------\n"
  5013. "p : array_like\n"
  5014. " Probability; must satisfy ``0 <= p < 1``\n"
  5015. "df : array_like\n"
  5016. " Degrees of freedom; must satisfy ``df > 0``\n"
  5017. "nc : array_like\n"
  5018. " Non-centrality parameter; must satisfy ``nc >= 0``\n"
  5019. "out : ndarray, optional\n"
  5020. " Optional output array for the function results\n"
  5021. "\n"
  5022. "Returns\n"
  5023. "-------\n"
  5024. "x : scalar or ndarray\n"
  5025. " Value so that the probability a non-central Chi square random variable\n"
  5026. " with `df` degrees of freedom and non-centrality, `nc`, is greater than\n"
  5027. " `x` equals `p`.\n"
  5028. "\n"
  5029. "See Also\n"
  5030. "--------\n"
  5031. "chndtr : Noncentral chi-squared distribution CDF\n"
  5032. "chndtridf : inverse of `chndtr` with respect to `cdf`\n"
  5033. "chndtrinc : inverse of `chndtr` with respect to `nc`\n"
  5034. "scipy.stats.ncx2 : Non-central chi-squared distribution\n"
  5035. "\n"
  5036. "Notes\n"
  5037. "-----\n"
  5038. "The noncentral chi squared distribution is also available in\n"
  5039. "`scipy.stats.ncx2`. ``scipy.stats.ncx2.ppf`` is equivalent to `chndtrix`.\n"
  5040. "\n"
  5041. "This function wraps routines from the Boost Math C++ library [1]_.\n"
  5042. "\n"
  5043. "References\n"
  5044. "----------\n"
  5045. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  5046. "\n"
  5047. "Examples\n"
  5048. "--------\n"
  5049. ">>> from scipy.special import chndtrix, chndtr\n"
  5050. "\n"
  5051. "Compute the noncentral chi squared distribution CDF at one point.\n"
  5052. ">>> x, df, nc = 3, 5, 10\n"
  5053. ">>> p = chndtr(x, df, nc)\n"
  5054. "\n"
  5055. "`chndtrix` is the inverse of `chndtr` with respect to `x`:\n"
  5056. "\n"
  5057. ">>> chndtrix(p, df, nc)\n"
  5058. "3.0")
  5059. ufunc_chndtrix_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  5060. ufunc_chndtrix_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  5061. ufunc_chndtrix_types[0] = <char>NPY_FLOAT
  5062. ufunc_chndtrix_types[1] = <char>NPY_FLOAT
  5063. ufunc_chndtrix_types[2] = <char>NPY_FLOAT
  5064. ufunc_chndtrix_types[3] = <char>NPY_FLOAT
  5065. ufunc_chndtrix_types[4] = <char>NPY_DOUBLE
  5066. ufunc_chndtrix_types[5] = <char>NPY_DOUBLE
  5067. ufunc_chndtrix_types[6] = <char>NPY_DOUBLE
  5068. ufunc_chndtrix_types[7] = <char>NPY_DOUBLE
  5069. ufunc_chndtrix_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncx2_ppf_float
  5070. ufunc_chndtrix_ptr[2*0+1] = <void*>(<char*>"chndtrix")
  5071. ufunc_chndtrix_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncx2_ppf_double
  5072. ufunc_chndtrix_ptr[2*1+1] = <void*>(<char*>"chndtrix")
  5073. ufunc_chndtrix_data[0] = &ufunc_chndtrix_ptr[2*0]
  5074. ufunc_chndtrix_data[1] = &ufunc_chndtrix_ptr[2*1]
  5075. chndtrix = np.PyUFunc_FromFuncAndData(ufunc_chndtrix_loops, ufunc_chndtrix_data, ufunc_chndtrix_types, 2, 3, 1, 0, 'chndtrix', ufunc_chndtrix_doc, 0)
  5076. cdef np.PyUFuncGenericFunction ufunc_elliprc_loops[4]
  5077. cdef void *ufunc_elliprc_ptr[8]
  5078. cdef void *ufunc_elliprc_data[4]
  5079. cdef char ufunc_elliprc_types[12]
  5080. cdef char *ufunc_elliprc_doc = (
  5081. "elliprc(x, y, out=None)\n"
  5082. "\n"
  5083. "Degenerate symmetric elliptic integral.\n"
  5084. "\n"
  5085. "The function RC is defined as [1]_\n"
  5086. "\n"
  5087. ".. math::\n"
  5088. "\n"
  5089. " R_{\\mathrm{C}}(x, y) =\n"
  5090. " \\frac{1}{2} \\int_0^{+\\infty} (t + x)^{-1/2} (t + y)^{-1} dt\n"
  5091. " = R_{\\mathrm{F}}(x, y, y)\n"
  5092. "\n"
  5093. "Parameters\n"
  5094. "----------\n"
  5095. "x, y : array_like\n"
  5096. " Real or complex input parameters. `x` can be any number in the\n"
  5097. " complex plane cut along the negative real axis. `y` must be non-zero.\n"
  5098. "out : ndarray, optional\n"
  5099. " Optional output array for the function values\n"
  5100. "\n"
  5101. "Returns\n"
  5102. "-------\n"
  5103. "R : scalar or ndarray\n"
  5104. " Value of the integral. If `y` is real and negative, the Cauchy\n"
  5105. " principal value is returned. If both of `x` and `y` are real, the\n"
  5106. " return value is real. Otherwise, the return value is complex.\n"
  5107. "\n"
  5108. "See Also\n"
  5109. "--------\n"
  5110. "elliprf : Completely-symmetric elliptic integral of the first kind.\n"
  5111. "elliprd : Symmetric elliptic integral of the second kind.\n"
  5112. "elliprg : Completely-symmetric elliptic integral of the second kind.\n"
  5113. "elliprj : Symmetric elliptic integral of the third kind.\n"
  5114. "\n"
  5115. "Notes\n"
  5116. "-----\n"
  5117. "RC is a degenerate case of the symmetric integral RF: ``elliprc(x, y) ==\n"
  5118. "elliprf(x, y, y)``. It is an elementary function rather than an elliptic\n"
  5119. "integral.\n"
  5120. "\n"
  5121. "The code implements Carlson's algorithm based on the duplication theorems\n"
  5122. "and series expansion up to the 7th order. [2]_\n"
  5123. "\n"
  5124. ".. versionadded:: 1.8.0\n"
  5125. "\n"
  5126. "References\n"
  5127. "----------\n"
  5128. ".. [1] B. C. Carlson, ed., Chapter 19 in \"Digital Library of Mathematical\n"
  5129. " Functions,\" NIST, US Dept. of Commerce.\n"
  5130. " https://dlmf.nist.gov/19.16.E6\n"
  5131. ".. [2] B. C. Carlson, \"Numerical computation of real or complex elliptic\n"
  5132. " integrals,\" Numer. Algorithm, vol. 10, no. 1, pp. 13-26, 1995.\n"
  5133. " https://arxiv.org/abs/math/9409227\n"
  5134. " https://doi.org/10.1007/BF02198293\n"
  5135. "\n"
  5136. "Examples\n"
  5137. "--------\n"
  5138. "Basic homogeneity property:\n"
  5139. "\n"
  5140. ">>> import numpy as np\n"
  5141. ">>> from scipy.special import elliprc\n"
  5142. "\n"
  5143. ">>> x = 1.2 + 3.4j\n"
  5144. ">>> y = 5.\n"
  5145. ">>> scale = 0.3 + 0.4j\n"
  5146. ">>> elliprc(scale*x, scale*y)\n"
  5147. "(0.5484493976710874-0.4169557678995833j)\n"
  5148. "\n"
  5149. ">>> elliprc(x, y)/np.sqrt(scale)\n"
  5150. "(0.5484493976710874-0.41695576789958333j)\n"
  5151. "\n"
  5152. "When the two arguments coincide, the integral is particularly\n"
  5153. "simple:\n"
  5154. "\n"
  5155. ">>> x = 1.2 + 3.4j\n"
  5156. ">>> elliprc(x, x)\n"
  5157. "(0.4299173120614631-0.3041729818745595j)\n"
  5158. "\n"
  5159. ">>> 1/np.sqrt(x)\n"
  5160. "(0.4299173120614631-0.30417298187455954j)\n"
  5161. "\n"
  5162. "Another simple case: the first argument vanishes:\n"
  5163. "\n"
  5164. ">>> y = 1.2 + 3.4j\n"
  5165. ">>> elliprc(0, y)\n"
  5166. "(0.6753125346116815-0.47779380263880866j)\n"
  5167. "\n"
  5168. ">>> np.pi/2/np.sqrt(y)\n"
  5169. "(0.6753125346116815-0.4777938026388088j)\n"
  5170. "\n"
  5171. "When `x` and `y` are both positive, we can express\n"
  5172. ":math:`R_C(x,y)` in terms of more elementary functions. For the\n"
  5173. "case :math:`0 \\le x < y`,\n"
  5174. "\n"
  5175. ">>> x = 3.2\n"
  5176. ">>> y = 6.\n"
  5177. ">>> elliprc(x, y)\n"
  5178. "0.44942991498453444\n"
  5179. "\n"
  5180. ">>> np.arctan(np.sqrt((y-x)/x))/np.sqrt(y-x)\n"
  5181. "0.44942991498453433\n"
  5182. "\n"
  5183. "And for the case :math:`0 \\le y < x`,\n"
  5184. "\n"
  5185. ">>> x = 6.\n"
  5186. ">>> y = 3.2\n"
  5187. ">>> elliprc(x,y)\n"
  5188. "0.4989837501576147\n"
  5189. "\n"
  5190. ">>> np.log((np.sqrt(x)+np.sqrt(x-y))/np.sqrt(y))/np.sqrt(x-y)\n"
  5191. "0.49898375015761476")
  5192. ufunc_elliprc_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  5193. ufunc_elliprc_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  5194. ufunc_elliprc_loops[2] = <np.PyUFuncGenericFunction>loop_D_DD__As_FF_F
  5195. ufunc_elliprc_loops[3] = <np.PyUFuncGenericFunction>loop_D_DD__As_DD_D
  5196. ufunc_elliprc_types[0] = <char>NPY_FLOAT
  5197. ufunc_elliprc_types[1] = <char>NPY_FLOAT
  5198. ufunc_elliprc_types[2] = <char>NPY_FLOAT
  5199. ufunc_elliprc_types[3] = <char>NPY_DOUBLE
  5200. ufunc_elliprc_types[4] = <char>NPY_DOUBLE
  5201. ufunc_elliprc_types[5] = <char>NPY_DOUBLE
  5202. ufunc_elliprc_types[6] = <char>NPY_CFLOAT
  5203. ufunc_elliprc_types[7] = <char>NPY_CFLOAT
  5204. ufunc_elliprc_types[8] = <char>NPY_CFLOAT
  5205. ufunc_elliprc_types[9] = <char>NPY_CDOUBLE
  5206. ufunc_elliprc_types[10] = <char>NPY_CDOUBLE
  5207. ufunc_elliprc_types[11] = <char>NPY_CDOUBLE
  5208. ufunc_elliprc_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_fellint_RC
  5209. ufunc_elliprc_ptr[2*0+1] = <void*>(<char*>"elliprc")
  5210. ufunc_elliprc_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_fellint_RC
  5211. ufunc_elliprc_ptr[2*1+1] = <void*>(<char*>"elliprc")
  5212. ufunc_elliprc_ptr[2*2] = <void*>scipy.special._ufuncs_cxx._export_cellint_RC
  5213. ufunc_elliprc_ptr[2*2+1] = <void*>(<char*>"elliprc")
  5214. ufunc_elliprc_ptr[2*3] = <void*>scipy.special._ufuncs_cxx._export_cellint_RC
  5215. ufunc_elliprc_ptr[2*3+1] = <void*>(<char*>"elliprc")
  5216. ufunc_elliprc_data[0] = &ufunc_elliprc_ptr[2*0]
  5217. ufunc_elliprc_data[1] = &ufunc_elliprc_ptr[2*1]
  5218. ufunc_elliprc_data[2] = &ufunc_elliprc_ptr[2*2]
  5219. ufunc_elliprc_data[3] = &ufunc_elliprc_ptr[2*3]
  5220. elliprc = np.PyUFunc_FromFuncAndData(ufunc_elliprc_loops, ufunc_elliprc_data, ufunc_elliprc_types, 4, 2, 1, 0, 'elliprc', ufunc_elliprc_doc, 0)
  5221. cdef np.PyUFuncGenericFunction ufunc_elliprd_loops[4]
  5222. cdef void *ufunc_elliprd_ptr[8]
  5223. cdef void *ufunc_elliprd_data[4]
  5224. cdef char ufunc_elliprd_types[16]
  5225. cdef char *ufunc_elliprd_doc = (
  5226. "elliprd(x, y, z, out=None)\n"
  5227. "\n"
  5228. "Symmetric elliptic integral of the second kind.\n"
  5229. "\n"
  5230. "The function RD is defined as [1]_\n"
  5231. "\n"
  5232. ".. math::\n"
  5233. "\n"
  5234. " R_{\\mathrm{D}}(x, y, z) =\n"
  5235. " \\frac{3}{2} \\int_0^{+\\infty} [(t + x) (t + y)]^{-1/2} (t + z)^{-3/2}\n"
  5236. " dt\n"
  5237. "\n"
  5238. "Parameters\n"
  5239. "----------\n"
  5240. "x, y, z : array_like\n"
  5241. " Real or complex input parameters. `x` or `y` can be any number in the\n"
  5242. " complex plane cut along the negative real axis, but at most one of them\n"
  5243. " can be zero, while `z` must be non-zero.\n"
  5244. "out : ndarray, optional\n"
  5245. " Optional output array for the function values\n"
  5246. "\n"
  5247. "Returns\n"
  5248. "-------\n"
  5249. "R : scalar or ndarray\n"
  5250. " Value of the integral. If all of `x`, `y`, and `z` are real, the\n"
  5251. " return value is real. Otherwise, the return value is complex.\n"
  5252. "\n"
  5253. "See Also\n"
  5254. "--------\n"
  5255. "elliprc : Degenerate symmetric elliptic integral.\n"
  5256. "elliprf : Completely-symmetric elliptic integral of the first kind.\n"
  5257. "elliprg : Completely-symmetric elliptic integral of the second kind.\n"
  5258. "elliprj : Symmetric elliptic integral of the third kind.\n"
  5259. "\n"
  5260. "Notes\n"
  5261. "-----\n"
  5262. "RD is a degenerate case of the elliptic integral RJ: ``elliprd(x, y, z) ==\n"
  5263. "elliprj(x, y, z, z)``.\n"
  5264. "\n"
  5265. "The code implements Carlson's algorithm based on the duplication theorems\n"
  5266. "and series expansion up to the 7th order. [2]_\n"
  5267. "\n"
  5268. ".. versionadded:: 1.8.0\n"
  5269. "\n"
  5270. "References\n"
  5271. "----------\n"
  5272. ".. [1] B. C. Carlson, ed., Chapter 19 in \"Digital Library of Mathematical\n"
  5273. " Functions,\" NIST, US Dept. of Commerce.\n"
  5274. " https://dlmf.nist.gov/19.16.E5\n"
  5275. ".. [2] B. C. Carlson, \"Numerical computation of real or complex elliptic\n"
  5276. " integrals,\" Numer. Algorithm, vol. 10, no. 1, pp. 13-26, 1995.\n"
  5277. " https://arxiv.org/abs/math/9409227\n"
  5278. " https://doi.org/10.1007/BF02198293\n"
  5279. "\n"
  5280. "Examples\n"
  5281. "--------\n"
  5282. "Basic homogeneity property:\n"
  5283. "\n"
  5284. ">>> import numpy as np\n"
  5285. ">>> from scipy.special import elliprd\n"
  5286. "\n"
  5287. ">>> x = 1.2 + 3.4j\n"
  5288. ">>> y = 5.\n"
  5289. ">>> z = 6.\n"
  5290. ">>> scale = 0.3 + 0.4j\n"
  5291. ">>> elliprd(scale*x, scale*y, scale*z)\n"
  5292. "(-0.03703043835680379-0.24500934665683802j)\n"
  5293. "\n"
  5294. ">>> elliprd(x, y, z)*np.power(scale, -1.5)\n"
  5295. "(-0.0370304383568038-0.24500934665683805j)\n"
  5296. "\n"
  5297. "All three arguments coincide:\n"
  5298. "\n"
  5299. ">>> x = 1.2 + 3.4j\n"
  5300. ">>> elliprd(x, x, x)\n"
  5301. "(-0.03986825876151896-0.14051741840449586j)\n"
  5302. "\n"
  5303. ">>> np.power(x, -1.5)\n"
  5304. "(-0.03986825876151894-0.14051741840449583j)\n"
  5305. "\n"
  5306. "The so-called \"second lemniscate constant\":\n"
  5307. "\n"
  5308. ">>> elliprd(0, 2, 1)/3\n"
  5309. "0.5990701173677961\n"
  5310. "\n"
  5311. ">>> from scipy.special import gamma\n"
  5312. ">>> gamma(0.75)**2/np.sqrt(2*np.pi)\n"
  5313. "0.5990701173677959")
  5314. ufunc_elliprd_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  5315. ufunc_elliprd_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  5316. ufunc_elliprd_loops[2] = <np.PyUFuncGenericFunction>loop_D_DDD__As_FFF_F
  5317. ufunc_elliprd_loops[3] = <np.PyUFuncGenericFunction>loop_D_DDD__As_DDD_D
  5318. ufunc_elliprd_types[0] = <char>NPY_FLOAT
  5319. ufunc_elliprd_types[1] = <char>NPY_FLOAT
  5320. ufunc_elliprd_types[2] = <char>NPY_FLOAT
  5321. ufunc_elliprd_types[3] = <char>NPY_FLOAT
  5322. ufunc_elliprd_types[4] = <char>NPY_DOUBLE
  5323. ufunc_elliprd_types[5] = <char>NPY_DOUBLE
  5324. ufunc_elliprd_types[6] = <char>NPY_DOUBLE
  5325. ufunc_elliprd_types[7] = <char>NPY_DOUBLE
  5326. ufunc_elliprd_types[8] = <char>NPY_CFLOAT
  5327. ufunc_elliprd_types[9] = <char>NPY_CFLOAT
  5328. ufunc_elliprd_types[10] = <char>NPY_CFLOAT
  5329. ufunc_elliprd_types[11] = <char>NPY_CFLOAT
  5330. ufunc_elliprd_types[12] = <char>NPY_CDOUBLE
  5331. ufunc_elliprd_types[13] = <char>NPY_CDOUBLE
  5332. ufunc_elliprd_types[14] = <char>NPY_CDOUBLE
  5333. ufunc_elliprd_types[15] = <char>NPY_CDOUBLE
  5334. ufunc_elliprd_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_fellint_RD
  5335. ufunc_elliprd_ptr[2*0+1] = <void*>(<char*>"elliprd")
  5336. ufunc_elliprd_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_fellint_RD
  5337. ufunc_elliprd_ptr[2*1+1] = <void*>(<char*>"elliprd")
  5338. ufunc_elliprd_ptr[2*2] = <void*>scipy.special._ufuncs_cxx._export_cellint_RD
  5339. ufunc_elliprd_ptr[2*2+1] = <void*>(<char*>"elliprd")
  5340. ufunc_elliprd_ptr[2*3] = <void*>scipy.special._ufuncs_cxx._export_cellint_RD
  5341. ufunc_elliprd_ptr[2*3+1] = <void*>(<char*>"elliprd")
  5342. ufunc_elliprd_data[0] = &ufunc_elliprd_ptr[2*0]
  5343. ufunc_elliprd_data[1] = &ufunc_elliprd_ptr[2*1]
  5344. ufunc_elliprd_data[2] = &ufunc_elliprd_ptr[2*2]
  5345. ufunc_elliprd_data[3] = &ufunc_elliprd_ptr[2*3]
  5346. elliprd = np.PyUFunc_FromFuncAndData(ufunc_elliprd_loops, ufunc_elliprd_data, ufunc_elliprd_types, 4, 3, 1, 0, 'elliprd', ufunc_elliprd_doc, 0)
  5347. cdef np.PyUFuncGenericFunction ufunc_elliprf_loops[4]
  5348. cdef void *ufunc_elliprf_ptr[8]
  5349. cdef void *ufunc_elliprf_data[4]
  5350. cdef char ufunc_elliprf_types[16]
  5351. cdef char *ufunc_elliprf_doc = (
  5352. "elliprf(x, y, z, out=None)\n"
  5353. "\n"
  5354. "Completely-symmetric elliptic integral of the first kind.\n"
  5355. "\n"
  5356. "The function RF is defined as [1]_\n"
  5357. "\n"
  5358. ".. math::\n"
  5359. "\n"
  5360. " R_{\\mathrm{F}}(x, y, z) =\n"
  5361. " \\frac{1}{2} \\int_0^{+\\infty} [(t + x) (t + y) (t + z)]^{-1/2} dt\n"
  5362. "\n"
  5363. "Parameters\n"
  5364. "----------\n"
  5365. "x, y, z : array_like\n"
  5366. " Real or complex input parameters. `x`, `y`, or `z` can be any number in\n"
  5367. " the complex plane cut along the negative real axis, but at most one of\n"
  5368. " them can be zero.\n"
  5369. "out : ndarray, optional\n"
  5370. " Optional output array for the function values\n"
  5371. "\n"
  5372. "Returns\n"
  5373. "-------\n"
  5374. "R : scalar or ndarray\n"
  5375. " Value of the integral. If all of `x`, `y`, and `z` are real, the return\n"
  5376. " value is real. Otherwise, the return value is complex.\n"
  5377. "\n"
  5378. "See Also\n"
  5379. "--------\n"
  5380. "elliprc : Degenerate symmetric integral.\n"
  5381. "elliprd : Symmetric elliptic integral of the second kind.\n"
  5382. "elliprg : Completely-symmetric elliptic integral of the second kind.\n"
  5383. "elliprj : Symmetric elliptic integral of the third kind.\n"
  5384. "\n"
  5385. "Notes\n"
  5386. "-----\n"
  5387. "The code implements Carlson's algorithm based on the duplication theorems\n"
  5388. "and series expansion up to the 7th order (cf.:\n"
  5389. "https://dlmf.nist.gov/19.36.i) and the AGM algorithm for the complete\n"
  5390. "integral. [2]_\n"
  5391. "\n"
  5392. ".. versionadded:: 1.8.0\n"
  5393. "\n"
  5394. "References\n"
  5395. "----------\n"
  5396. ".. [1] B. C. Carlson, ed., Chapter 19 in \"Digital Library of Mathematical\n"
  5397. " Functions,\" NIST, US Dept. of Commerce.\n"
  5398. " https://dlmf.nist.gov/19.16.E1\n"
  5399. ".. [2] B. C. Carlson, \"Numerical computation of real or complex elliptic\n"
  5400. " integrals,\" Numer. Algorithm, vol. 10, no. 1, pp. 13-26, 1995.\n"
  5401. " https://arxiv.org/abs/math/9409227\n"
  5402. " https://doi.org/10.1007/BF02198293\n"
  5403. "\n"
  5404. "Examples\n"
  5405. "--------\n"
  5406. "Basic homogeneity property:\n"
  5407. "\n"
  5408. ">>> import numpy as np\n"
  5409. ">>> from scipy.special import elliprf\n"
  5410. "\n"
  5411. ">>> x = 1.2 + 3.4j\n"
  5412. ">>> y = 5.\n"
  5413. ">>> z = 6.\n"
  5414. ">>> scale = 0.3 + 0.4j\n"
  5415. ">>> elliprf(scale*x, scale*y, scale*z)\n"
  5416. "(0.5328051227278146-0.4008623567957094j)\n"
  5417. "\n"
  5418. ">>> elliprf(x, y, z)/np.sqrt(scale)\n"
  5419. "(0.5328051227278147-0.4008623567957095j)\n"
  5420. "\n"
  5421. "All three arguments coincide:\n"
  5422. "\n"
  5423. ">>> x = 1.2 + 3.4j\n"
  5424. ">>> elliprf(x, x, x)\n"
  5425. "(0.42991731206146316-0.30417298187455954j)\n"
  5426. "\n"
  5427. ">>> 1/np.sqrt(x)\n"
  5428. "(0.4299173120614631-0.30417298187455954j)\n"
  5429. "\n"
  5430. "The so-called \"first lemniscate constant\":\n"
  5431. "\n"
  5432. ">>> elliprf(0, 1, 2)\n"
  5433. "1.3110287771460598\n"
  5434. "\n"
  5435. ">>> from scipy.special import gamma\n"
  5436. ">>> gamma(0.25)**2/(4*np.sqrt(2*np.pi))\n"
  5437. "1.3110287771460598")
  5438. ufunc_elliprf_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  5439. ufunc_elliprf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  5440. ufunc_elliprf_loops[2] = <np.PyUFuncGenericFunction>loop_D_DDD__As_FFF_F
  5441. ufunc_elliprf_loops[3] = <np.PyUFuncGenericFunction>loop_D_DDD__As_DDD_D
  5442. ufunc_elliprf_types[0] = <char>NPY_FLOAT
  5443. ufunc_elliprf_types[1] = <char>NPY_FLOAT
  5444. ufunc_elliprf_types[2] = <char>NPY_FLOAT
  5445. ufunc_elliprf_types[3] = <char>NPY_FLOAT
  5446. ufunc_elliprf_types[4] = <char>NPY_DOUBLE
  5447. ufunc_elliprf_types[5] = <char>NPY_DOUBLE
  5448. ufunc_elliprf_types[6] = <char>NPY_DOUBLE
  5449. ufunc_elliprf_types[7] = <char>NPY_DOUBLE
  5450. ufunc_elliprf_types[8] = <char>NPY_CFLOAT
  5451. ufunc_elliprf_types[9] = <char>NPY_CFLOAT
  5452. ufunc_elliprf_types[10] = <char>NPY_CFLOAT
  5453. ufunc_elliprf_types[11] = <char>NPY_CFLOAT
  5454. ufunc_elliprf_types[12] = <char>NPY_CDOUBLE
  5455. ufunc_elliprf_types[13] = <char>NPY_CDOUBLE
  5456. ufunc_elliprf_types[14] = <char>NPY_CDOUBLE
  5457. ufunc_elliprf_types[15] = <char>NPY_CDOUBLE
  5458. ufunc_elliprf_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_fellint_RF
  5459. ufunc_elliprf_ptr[2*0+1] = <void*>(<char*>"elliprf")
  5460. ufunc_elliprf_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_fellint_RF
  5461. ufunc_elliprf_ptr[2*1+1] = <void*>(<char*>"elliprf")
  5462. ufunc_elliprf_ptr[2*2] = <void*>scipy.special._ufuncs_cxx._export_cellint_RF
  5463. ufunc_elliprf_ptr[2*2+1] = <void*>(<char*>"elliprf")
  5464. ufunc_elliprf_ptr[2*3] = <void*>scipy.special._ufuncs_cxx._export_cellint_RF
  5465. ufunc_elliprf_ptr[2*3+1] = <void*>(<char*>"elliprf")
  5466. ufunc_elliprf_data[0] = &ufunc_elliprf_ptr[2*0]
  5467. ufunc_elliprf_data[1] = &ufunc_elliprf_ptr[2*1]
  5468. ufunc_elliprf_data[2] = &ufunc_elliprf_ptr[2*2]
  5469. ufunc_elliprf_data[3] = &ufunc_elliprf_ptr[2*3]
  5470. elliprf = np.PyUFunc_FromFuncAndData(ufunc_elliprf_loops, ufunc_elliprf_data, ufunc_elliprf_types, 4, 3, 1, 0, 'elliprf', ufunc_elliprf_doc, 0)
  5471. cdef np.PyUFuncGenericFunction ufunc_elliprg_loops[4]
  5472. cdef void *ufunc_elliprg_ptr[8]
  5473. cdef void *ufunc_elliprg_data[4]
  5474. cdef char ufunc_elliprg_types[16]
  5475. cdef char *ufunc_elliprg_doc = (
  5476. "elliprg(x, y, z, out=None)\n"
  5477. "\n"
  5478. "Completely-symmetric elliptic integral of the second kind.\n"
  5479. "\n"
  5480. "The function RG is defined as [1]_\n"
  5481. "\n"
  5482. ".. math::\n"
  5483. "\n"
  5484. " R_{\\mathrm{G}}(x, y, z) =\n"
  5485. " \\frac{1}{4} \\int_0^{+\\infty} [(t + x) (t + y) (t + z)]^{-1/2}\n"
  5486. " \\left(\\frac{x}{t + x} + \\frac{y}{t + y} + \\frac{z}{t + z}\\right) t\n"
  5487. " dt\n"
  5488. "\n"
  5489. "Parameters\n"
  5490. "----------\n"
  5491. "x, y, z : array_like\n"
  5492. " Real or complex input parameters. `x`, `y`, or `z` can be any number in\n"
  5493. " the complex plane cut along the negative real axis.\n"
  5494. "out : ndarray, optional\n"
  5495. " Optional output array for the function values\n"
  5496. "\n"
  5497. "Returns\n"
  5498. "-------\n"
  5499. "R : scalar or ndarray\n"
  5500. " Value of the integral. If all of `x`, `y`, and `z` are real, the return\n"
  5501. " value is real. Otherwise, the return value is complex.\n"
  5502. "\n"
  5503. "See Also\n"
  5504. "--------\n"
  5505. "elliprc : Degenerate symmetric integral.\n"
  5506. "elliprd : Symmetric elliptic integral of the second kind.\n"
  5507. "elliprf : Completely-symmetric elliptic integral of the first kind.\n"
  5508. "elliprj : Symmetric elliptic integral of the third kind.\n"
  5509. "\n"
  5510. "Notes\n"
  5511. "-----\n"
  5512. "The implementation uses the relation [1]_\n"
  5513. "\n"
  5514. ".. math::\n"
  5515. "\n"
  5516. " 2 R_{\\mathrm{G}}(x, y, z) =\n"
  5517. " z R_{\\mathrm{F}}(x, y, z) -\n"
  5518. " \\frac{1}{3} (x - z) (y - z) R_{\\mathrm{D}}(x, y, z) +\n"
  5519. " \\sqrt{\\frac{x y}{z}}\n"
  5520. "\n"
  5521. "and the symmetry of `x`, `y`, `z` when at least one non-zero parameter can\n"
  5522. "be chosen as the pivot. When one of the arguments is close to zero, the AGM\n"
  5523. "method is applied instead. Other special cases are computed following Ref.\n"
  5524. "[2]_\n"
  5525. "\n"
  5526. ".. versionadded:: 1.8.0\n"
  5527. "\n"
  5528. "References\n"
  5529. "----------\n"
  5530. ".. [1] B. C. Carlson, \"Numerical computation of real or complex elliptic\n"
  5531. " integrals,\" Numer. Algorithm, vol. 10, no. 1, pp. 13-26, 1995.\n"
  5532. " https://arxiv.org/abs/math/9409227\n"
  5533. " https://doi.org/10.1007/BF02198293\n"
  5534. ".. [2] B. C. Carlson, ed., Chapter 19 in \"Digital Library of Mathematical\n"
  5535. " Functions,\" NIST, US Dept. of Commerce.\n"
  5536. " https://dlmf.nist.gov/19.16.E1\n"
  5537. " https://dlmf.nist.gov/19.20.ii\n"
  5538. "\n"
  5539. "Examples\n"
  5540. "--------\n"
  5541. "Basic homogeneity property:\n"
  5542. "\n"
  5543. ">>> import numpy as np\n"
  5544. ">>> from scipy.special import elliprg\n"
  5545. "\n"
  5546. ">>> x = 1.2 + 3.4j\n"
  5547. ">>> y = 5.\n"
  5548. ">>> z = 6.\n"
  5549. ">>> scale = 0.3 + 0.4j\n"
  5550. ">>> elliprg(scale*x, scale*y, scale*z)\n"
  5551. "(1.195936862005246+0.8470988320464167j)\n"
  5552. "\n"
  5553. ">>> elliprg(x, y, z)*np.sqrt(scale)\n"
  5554. "(1.195936862005246+0.8470988320464165j)\n"
  5555. "\n"
  5556. "Simplifications:\n"
  5557. "\n"
  5558. ">>> elliprg(0, y, y)\n"
  5559. "1.756203682760182\n"
  5560. "\n"
  5561. ">>> 0.25*np.pi*np.sqrt(y)\n"
  5562. "1.7562036827601817\n"
  5563. "\n"
  5564. ">>> elliprg(0, 0, z)\n"
  5565. "1.224744871391589\n"
  5566. "\n"
  5567. ">>> 0.5*np.sqrt(z)\n"
  5568. "1.224744871391589\n"
  5569. "\n"
  5570. "The surface area of a triaxial ellipsoid with semiaxes ``a``, ``b``, and\n"
  5571. "``c`` is given by\n"
  5572. "\n"
  5573. ".. math::\n"
  5574. "\n"
  5575. " S = 4 \\pi a b c R_{\\mathrm{G}}(1 / a^2, 1 / b^2, 1 / c^2).\n"
  5576. "\n"
  5577. ">>> def ellipsoid_area(a, b, c):\n"
  5578. "... r = 4.0 * np.pi * a * b * c\n"
  5579. "... return r * elliprg(1.0 / (a * a), 1.0 / (b * b), 1.0 / (c * c))\n"
  5580. ">>> print(ellipsoid_area(1, 3, 5))\n"
  5581. "108.62688289491807")
  5582. ufunc_elliprg_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  5583. ufunc_elliprg_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  5584. ufunc_elliprg_loops[2] = <np.PyUFuncGenericFunction>loop_D_DDD__As_FFF_F
  5585. ufunc_elliprg_loops[3] = <np.PyUFuncGenericFunction>loop_D_DDD__As_DDD_D
  5586. ufunc_elliprg_types[0] = <char>NPY_FLOAT
  5587. ufunc_elliprg_types[1] = <char>NPY_FLOAT
  5588. ufunc_elliprg_types[2] = <char>NPY_FLOAT
  5589. ufunc_elliprg_types[3] = <char>NPY_FLOAT
  5590. ufunc_elliprg_types[4] = <char>NPY_DOUBLE
  5591. ufunc_elliprg_types[5] = <char>NPY_DOUBLE
  5592. ufunc_elliprg_types[6] = <char>NPY_DOUBLE
  5593. ufunc_elliprg_types[7] = <char>NPY_DOUBLE
  5594. ufunc_elliprg_types[8] = <char>NPY_CFLOAT
  5595. ufunc_elliprg_types[9] = <char>NPY_CFLOAT
  5596. ufunc_elliprg_types[10] = <char>NPY_CFLOAT
  5597. ufunc_elliprg_types[11] = <char>NPY_CFLOAT
  5598. ufunc_elliprg_types[12] = <char>NPY_CDOUBLE
  5599. ufunc_elliprg_types[13] = <char>NPY_CDOUBLE
  5600. ufunc_elliprg_types[14] = <char>NPY_CDOUBLE
  5601. ufunc_elliprg_types[15] = <char>NPY_CDOUBLE
  5602. ufunc_elliprg_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_fellint_RG
  5603. ufunc_elliprg_ptr[2*0+1] = <void*>(<char*>"elliprg")
  5604. ufunc_elliprg_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_fellint_RG
  5605. ufunc_elliprg_ptr[2*1+1] = <void*>(<char*>"elliprg")
  5606. ufunc_elliprg_ptr[2*2] = <void*>scipy.special._ufuncs_cxx._export_cellint_RG
  5607. ufunc_elliprg_ptr[2*2+1] = <void*>(<char*>"elliprg")
  5608. ufunc_elliprg_ptr[2*3] = <void*>scipy.special._ufuncs_cxx._export_cellint_RG
  5609. ufunc_elliprg_ptr[2*3+1] = <void*>(<char*>"elliprg")
  5610. ufunc_elliprg_data[0] = &ufunc_elliprg_ptr[2*0]
  5611. ufunc_elliprg_data[1] = &ufunc_elliprg_ptr[2*1]
  5612. ufunc_elliprg_data[2] = &ufunc_elliprg_ptr[2*2]
  5613. ufunc_elliprg_data[3] = &ufunc_elliprg_ptr[2*3]
  5614. elliprg = np.PyUFunc_FromFuncAndData(ufunc_elliprg_loops, ufunc_elliprg_data, ufunc_elliprg_types, 4, 3, 1, 0, 'elliprg', ufunc_elliprg_doc, 0)
  5615. cdef np.PyUFuncGenericFunction ufunc_elliprj_loops[4]
  5616. cdef void *ufunc_elliprj_ptr[8]
  5617. cdef void *ufunc_elliprj_data[4]
  5618. cdef char ufunc_elliprj_types[20]
  5619. cdef char *ufunc_elliprj_doc = (
  5620. "elliprj(x, y, z, p, out=None)\n"
  5621. "\n"
  5622. "Symmetric elliptic integral of the third kind.\n"
  5623. "\n"
  5624. "The function RJ is defined as [1]_\n"
  5625. "\n"
  5626. ".. math::\n"
  5627. "\n"
  5628. " R_{\\mathrm{J}}(x, y, z, p) =\n"
  5629. " \\frac{3}{2} \\int_0^{+\\infty} [(t + x) (t + y) (t + z)]^{-1/2}\n"
  5630. " (t + p)^{-1} dt\n"
  5631. "\n"
  5632. ".. warning::\n"
  5633. " This function should be considered experimental when the inputs are\n"
  5634. " unbalanced. Check correctness with another independent implementation.\n"
  5635. "\n"
  5636. "Parameters\n"
  5637. "----------\n"
  5638. "x, y, z, p : array_like\n"
  5639. " Real or complex input parameters. `x`, `y`, or `z` are numbers in\n"
  5640. " the complex plane cut along the negative real axis (subject to further\n"
  5641. " constraints, see Notes), and at most one of them can be zero. `p` must\n"
  5642. " be non-zero.\n"
  5643. "out : ndarray, optional\n"
  5644. " Optional output array for the function values\n"
  5645. "\n"
  5646. "Returns\n"
  5647. "-------\n"
  5648. "R : scalar or ndarray\n"
  5649. " Value of the integral. If all of `x`, `y`, `z`, and `p` are real, the\n"
  5650. " return value is real. Otherwise, the return value is complex.\n"
  5651. "\n"
  5652. " If `p` is real and negative, while `x`, `y`, and `z` are real,\n"
  5653. " non-negative, and at most one of them is zero, the Cauchy principal\n"
  5654. " value is returned. [1]_ [2]_\n"
  5655. "\n"
  5656. "See Also\n"
  5657. "--------\n"
  5658. "elliprc : Degenerate symmetric integral.\n"
  5659. "elliprd : Symmetric elliptic integral of the second kind.\n"
  5660. "elliprf : Completely-symmetric elliptic integral of the first kind.\n"
  5661. "elliprg : Completely-symmetric elliptic integral of the second kind.\n"
  5662. "\n"
  5663. "Notes\n"
  5664. "-----\n"
  5665. "The code implements Carlson's algorithm based on the duplication theorems\n"
  5666. "and series expansion up to the 7th order. [3]_ The algorithm is slightly\n"
  5667. "different from its earlier incarnation as it appears in [1]_, in that the\n"
  5668. "call to `elliprc` (or ``atan``/``atanh``, see [4]_) is no longer needed in\n"
  5669. "the inner loop. Asymptotic approximations are used where arguments differ\n"
  5670. "widely in the order of magnitude. [5]_\n"
  5671. "\n"
  5672. "The input values are subject to certain sufficient but not necessary\n"
  5673. "constraints when input arguments are complex. Notably, ``x``, ``y``, and\n"
  5674. "``z`` must have non-negative real parts, unless two of them are\n"
  5675. "non-negative and complex-conjugates to each other while the other is a real\n"
  5676. "non-negative number. [1]_ If the inputs do not satisfy the sufficient\n"
  5677. "condition described in Ref. [1]_ they are rejected outright with the output\n"
  5678. "set to NaN.\n"
  5679. "\n"
  5680. "In the case where one of ``x``, ``y``, and ``z`` is equal to ``p``, the\n"
  5681. "function ``elliprd`` should be preferred because of its less restrictive\n"
  5682. "domain.\n"
  5683. "\n"
  5684. ".. versionadded:: 1.8.0\n"
  5685. "\n"
  5686. "References\n"
  5687. "----------\n"
  5688. ".. [1] B. C. Carlson, \"Numerical computation of real or complex elliptic\n"
  5689. " integrals,\" Numer. Algorithm, vol. 10, no. 1, pp. 13-26, 1995.\n"
  5690. " https://arxiv.org/abs/math/9409227\n"
  5691. " https://doi.org/10.1007/BF02198293\n"
  5692. ".. [2] B. C. Carlson, ed., Chapter 19 in \"Digital Library of Mathematical\n"
  5693. " Functions,\" NIST, US Dept. of Commerce.\n"
  5694. " https://dlmf.nist.gov/19.20.iii\n"
  5695. ".. [3] B. C. Carlson, J. FitzSimmons, \"Reduction Theorems for Elliptic\n"
  5696. " Integrands with the Square Root of Two Quadratic Factors,\" J.\n"
  5697. " Comput. Appl. Math., vol. 118, nos. 1-2, pp. 71-85, 2000.\n"
  5698. " https://doi.org/10.1016/S0377-0427(00)00282-X\n"
  5699. ".. [4] F. Johansson, \"Numerical Evaluation of Elliptic Functions, Elliptic\n"
  5700. " Integrals and Modular Forms,\" in J. Blumlein, C. Schneider, P.\n"
  5701. " Paule, eds., \"Elliptic Integrals, Elliptic Functions and Modular\n"
  5702. " Forms in Quantum Field Theory,\" pp. 269-293, 2019 (Cham,\n"
  5703. " Switzerland: Springer Nature Switzerland)\n"
  5704. " https://arxiv.org/abs/1806.06725\n"
  5705. " https://doi.org/10.1007/978-3-030-04480-0\n"
  5706. ".. [5] B. C. Carlson, J. L. Gustafson, \"Asymptotic Approximations for\n"
  5707. " Symmetric Elliptic Integrals,\" SIAM J. Math. Anls., vol. 25, no. 2,\n"
  5708. " pp. 288-303, 1994.\n"
  5709. " https://arxiv.org/abs/math/9310223\n"
  5710. " https://doi.org/10.1137/S0036141092228477\n"
  5711. "\n"
  5712. "Examples\n"
  5713. "--------\n"
  5714. "Basic homogeneity property:\n"
  5715. "\n"
  5716. ">>> import numpy as np\n"
  5717. ">>> from scipy.special import elliprj\n"
  5718. "\n"
  5719. ">>> x = 1.2 + 3.4j\n"
  5720. ">>> y = 5.\n"
  5721. ">>> z = 6.\n"
  5722. ">>> p = 7.\n"
  5723. ">>> scale = 0.3 - 0.4j\n"
  5724. ">>> elliprj(scale*x, scale*y, scale*z, scale*p)\n"
  5725. "(0.10834905565679157+0.19694950747103812j)\n"
  5726. "\n"
  5727. ">>> elliprj(x, y, z, p)*np.power(scale, -1.5)\n"
  5728. "(0.10834905565679556+0.19694950747103854j)\n"
  5729. "\n"
  5730. "Reduction to simpler elliptic integral:\n"
  5731. "\n"
  5732. ">>> elliprj(x, y, z, z)\n"
  5733. "(0.08288462362195129-0.028376809745123258j)\n"
  5734. "\n"
  5735. ">>> from scipy.special import elliprd\n"
  5736. ">>> elliprd(x, y, z)\n"
  5737. "(0.08288462362195136-0.028376809745123296j)\n"
  5738. "\n"
  5739. "All arguments coincide:\n"
  5740. "\n"
  5741. ">>> elliprj(x, x, x, x)\n"
  5742. "(-0.03986825876151896-0.14051741840449586j)\n"
  5743. "\n"
  5744. ">>> np.power(x, -1.5)\n"
  5745. "(-0.03986825876151894-0.14051741840449583j)")
  5746. ufunc_elliprj_loops[0] = <np.PyUFuncGenericFunction>loop_d_dddd__As_ffff_f
  5747. ufunc_elliprj_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  5748. ufunc_elliprj_loops[2] = <np.PyUFuncGenericFunction>loop_D_DDDD__As_FFFF_F
  5749. ufunc_elliprj_loops[3] = <np.PyUFuncGenericFunction>loop_D_DDDD__As_DDDD_D
  5750. ufunc_elliprj_types[0] = <char>NPY_FLOAT
  5751. ufunc_elliprj_types[1] = <char>NPY_FLOAT
  5752. ufunc_elliprj_types[2] = <char>NPY_FLOAT
  5753. ufunc_elliprj_types[3] = <char>NPY_FLOAT
  5754. ufunc_elliprj_types[4] = <char>NPY_FLOAT
  5755. ufunc_elliprj_types[5] = <char>NPY_DOUBLE
  5756. ufunc_elliprj_types[6] = <char>NPY_DOUBLE
  5757. ufunc_elliprj_types[7] = <char>NPY_DOUBLE
  5758. ufunc_elliprj_types[8] = <char>NPY_DOUBLE
  5759. ufunc_elliprj_types[9] = <char>NPY_DOUBLE
  5760. ufunc_elliprj_types[10] = <char>NPY_CFLOAT
  5761. ufunc_elliprj_types[11] = <char>NPY_CFLOAT
  5762. ufunc_elliprj_types[12] = <char>NPY_CFLOAT
  5763. ufunc_elliprj_types[13] = <char>NPY_CFLOAT
  5764. ufunc_elliprj_types[14] = <char>NPY_CFLOAT
  5765. ufunc_elliprj_types[15] = <char>NPY_CDOUBLE
  5766. ufunc_elliprj_types[16] = <char>NPY_CDOUBLE
  5767. ufunc_elliprj_types[17] = <char>NPY_CDOUBLE
  5768. ufunc_elliprj_types[18] = <char>NPY_CDOUBLE
  5769. ufunc_elliprj_types[19] = <char>NPY_CDOUBLE
  5770. ufunc_elliprj_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_fellint_RJ
  5771. ufunc_elliprj_ptr[2*0+1] = <void*>(<char*>"elliprj")
  5772. ufunc_elliprj_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_fellint_RJ
  5773. ufunc_elliprj_ptr[2*1+1] = <void*>(<char*>"elliprj")
  5774. ufunc_elliprj_ptr[2*2] = <void*>scipy.special._ufuncs_cxx._export_cellint_RJ
  5775. ufunc_elliprj_ptr[2*2+1] = <void*>(<char*>"elliprj")
  5776. ufunc_elliprj_ptr[2*3] = <void*>scipy.special._ufuncs_cxx._export_cellint_RJ
  5777. ufunc_elliprj_ptr[2*3+1] = <void*>(<char*>"elliprj")
  5778. ufunc_elliprj_data[0] = &ufunc_elliprj_ptr[2*0]
  5779. ufunc_elliprj_data[1] = &ufunc_elliprj_ptr[2*1]
  5780. ufunc_elliprj_data[2] = &ufunc_elliprj_ptr[2*2]
  5781. ufunc_elliprj_data[3] = &ufunc_elliprj_ptr[2*3]
  5782. elliprj = np.PyUFunc_FromFuncAndData(ufunc_elliprj_loops, ufunc_elliprj_data, ufunc_elliprj_types, 4, 4, 1, 0, 'elliprj', ufunc_elliprj_doc, 0)
  5783. cdef np.PyUFuncGenericFunction ufunc_entr_loops[2]
  5784. cdef void *ufunc_entr_ptr[4]
  5785. cdef void *ufunc_entr_data[2]
  5786. cdef char ufunc_entr_types[4]
  5787. cdef char *ufunc_entr_doc = (
  5788. "entr(x, out=None)\n"
  5789. "\n"
  5790. "Elementwise function for computing entropy.\n"
  5791. "\n"
  5792. ".. math:: \\text{entr}(x) = \\begin{cases} - x \\log(x) & x > 0 \\\\ 0 & x = 0\n"
  5793. " \\\\ -\\infty & \\text{otherwise} \\end{cases}\n"
  5794. "\n"
  5795. "Parameters\n"
  5796. "----------\n"
  5797. "x : ndarray\n"
  5798. " Input array.\n"
  5799. "out : ndarray, optional\n"
  5800. " Optional output array for the function values\n"
  5801. "\n"
  5802. "Returns\n"
  5803. "-------\n"
  5804. "res : scalar or ndarray\n"
  5805. " The value of the elementwise entropy function at the given points `x`.\n"
  5806. "\n"
  5807. "See Also\n"
  5808. "--------\n"
  5809. "kl_div, rel_entr, scipy.stats.entropy\n"
  5810. "\n"
  5811. "Notes\n"
  5812. "-----\n"
  5813. ".. versionadded:: 0.15.0\n"
  5814. "\n"
  5815. "This function is concave.\n"
  5816. "\n"
  5817. "The origin of this function is in convex programming; see [1]_.\n"
  5818. "Given a probability distribution :math:`p_1, \\ldots, p_n`,\n"
  5819. "the definition of entropy in the context of *information theory* is\n"
  5820. "\n"
  5821. ".. math::\n"
  5822. "\n"
  5823. " \\sum_{i = 1}^n \\mathrm{entr}(p_i).\n"
  5824. "\n"
  5825. "To compute the latter quantity, use `scipy.stats.entropy`.\n"
  5826. "\n"
  5827. "References\n"
  5828. "----------\n"
  5829. ".. [1] Boyd, Stephen and Lieven Vandenberghe. *Convex optimization*.\n"
  5830. " Cambridge University Press, 2004.\n"
  5831. " :doi:`https://doi.org/10.1017/CBO9780511804441`")
  5832. ufunc_entr_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  5833. ufunc_entr_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  5834. ufunc_entr_types[0] = <char>NPY_FLOAT
  5835. ufunc_entr_types[1] = <char>NPY_FLOAT
  5836. ufunc_entr_types[2] = <char>NPY_DOUBLE
  5837. ufunc_entr_types[3] = <char>NPY_DOUBLE
  5838. ufunc_entr_ptr[2*0] = <void*>_func_entr
  5839. ufunc_entr_ptr[2*0+1] = <void*>(<char*>"entr")
  5840. ufunc_entr_ptr[2*1] = <void*>_func_entr
  5841. ufunc_entr_ptr[2*1+1] = <void*>(<char*>"entr")
  5842. ufunc_entr_data[0] = &ufunc_entr_ptr[2*0]
  5843. ufunc_entr_data[1] = &ufunc_entr_ptr[2*1]
  5844. entr = np.PyUFunc_FromFuncAndData(ufunc_entr_loops, ufunc_entr_data, ufunc_entr_types, 2, 1, 1, 0, 'entr', ufunc_entr_doc, 0)
  5845. cdef np.PyUFuncGenericFunction ufunc_erfcinv_loops[2]
  5846. cdef void *ufunc_erfcinv_ptr[4]
  5847. cdef void *ufunc_erfcinv_data[2]
  5848. cdef char ufunc_erfcinv_types[4]
  5849. cdef char *ufunc_erfcinv_doc = (
  5850. "erfcinv(y, out=None)\n"
  5851. "\n"
  5852. "Inverse of the complementary error function.\n"
  5853. "\n"
  5854. "Computes the inverse of the complementary error function.\n"
  5855. "\n"
  5856. "In the complex domain, there is no unique complex number w satisfying\n"
  5857. "erfc(w)=z. This indicates a true inverse function would be multivalued.\n"
  5858. "When the domain restricts to the real, 0 < x < 2, there is a unique real\n"
  5859. "number satisfying erfc(erfcinv(x)) = erfcinv(erfc(x)).\n"
  5860. "\n"
  5861. "It is related to inverse of the error function by erfcinv(1-x) = erfinv(x)\n"
  5862. "\n"
  5863. "Parameters\n"
  5864. "----------\n"
  5865. "y : ndarray\n"
  5866. " Argument at which to evaluate. Domain: [0, 2]\n"
  5867. "out : ndarray, optional\n"
  5868. " Optional output array for the function values\n"
  5869. "\n"
  5870. "Returns\n"
  5871. "-------\n"
  5872. "erfcinv : scalar or ndarray\n"
  5873. " The inverse of erfc of y, element-wise\n"
  5874. "\n"
  5875. "See Also\n"
  5876. "--------\n"
  5877. "erf : Error function of a complex argument\n"
  5878. "erfc : Complementary error function, ``1 - erf(x)``\n"
  5879. "erfinv : Inverse of the error function\n"
  5880. "\n"
  5881. "Examples\n"
  5882. "--------\n"
  5883. ">>> import numpy as np\n"
  5884. ">>> import matplotlib.pyplot as plt\n"
  5885. ">>> from scipy.special import erfcinv\n"
  5886. "\n"
  5887. ">>> erfcinv(0.5)\n"
  5888. "0.4769362762044699\n"
  5889. "\n"
  5890. ">>> y = np.linspace(0.0, 2.0, num=11)\n"
  5891. ">>> erfcinv(y)\n"
  5892. "array([ inf, 0.9061938 , 0.59511608, 0.37080716, 0.17914345,\n"
  5893. " -0. , -0.17914345, -0.37080716, -0.59511608, -0.9061938 ,\n"
  5894. " -inf])\n"
  5895. "\n"
  5896. "Plot the function:\n"
  5897. "\n"
  5898. ">>> y = np.linspace(0, 2, 200)\n"
  5899. ">>> fig, ax = plt.subplots()\n"
  5900. ">>> ax.plot(y, erfcinv(y))\n"
  5901. ">>> ax.grid(True)\n"
  5902. ">>> ax.set_xlabel('y')\n"
  5903. ">>> ax.set_title('erfcinv(y)')\n"
  5904. ">>> plt.show()")
  5905. ufunc_erfcinv_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  5906. ufunc_erfcinv_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  5907. ufunc_erfcinv_types[0] = <char>NPY_FLOAT
  5908. ufunc_erfcinv_types[1] = <char>NPY_FLOAT
  5909. ufunc_erfcinv_types[2] = <char>NPY_DOUBLE
  5910. ufunc_erfcinv_types[3] = <char>NPY_DOUBLE
  5911. ufunc_erfcinv_ptr[2*0] = <void*>_func_cephes_erfcinv
  5912. ufunc_erfcinv_ptr[2*0+1] = <void*>(<char*>"erfcinv")
  5913. ufunc_erfcinv_ptr[2*1] = <void*>_func_cephes_erfcinv
  5914. ufunc_erfcinv_ptr[2*1+1] = <void*>(<char*>"erfcinv")
  5915. ufunc_erfcinv_data[0] = &ufunc_erfcinv_ptr[2*0]
  5916. ufunc_erfcinv_data[1] = &ufunc_erfcinv_ptr[2*1]
  5917. erfcinv = np.PyUFunc_FromFuncAndData(ufunc_erfcinv_loops, ufunc_erfcinv_data, ufunc_erfcinv_types, 2, 1, 1, 0, 'erfcinv', ufunc_erfcinv_doc, 0)
  5918. cdef np.PyUFuncGenericFunction ufunc_erfinv_loops[2]
  5919. cdef void *ufunc_erfinv_ptr[4]
  5920. cdef void *ufunc_erfinv_data[2]
  5921. cdef char ufunc_erfinv_types[4]
  5922. cdef char *ufunc_erfinv_doc = (
  5923. "erfinv(y, out=None)\n"
  5924. "\n"
  5925. "Inverse of the error function.\n"
  5926. "\n"
  5927. "Computes the inverse of the error function.\n"
  5928. "\n"
  5929. "In the complex domain, there is no unique complex number w satisfying\n"
  5930. "erf(w)=z. This indicates a true inverse function would be multivalued.\n"
  5931. "When the domain restricts to the real, -1 < x < 1, there is a unique real\n"
  5932. "number satisfying erf(erfinv(x)) = x.\n"
  5933. "\n"
  5934. "Parameters\n"
  5935. "----------\n"
  5936. "y : ndarray\n"
  5937. " Argument at which to evaluate. Domain: [-1, 1]\n"
  5938. "out : ndarray, optional\n"
  5939. " Optional output array for the function values\n"
  5940. "\n"
  5941. "Returns\n"
  5942. "-------\n"
  5943. "erfinv : scalar or ndarray\n"
  5944. " The inverse of erf of y, element-wise\n"
  5945. "\n"
  5946. "See Also\n"
  5947. "--------\n"
  5948. "erf : Error function of a complex argument\n"
  5949. "erfc : Complementary error function, ``1 - erf(x)``\n"
  5950. "erfcinv : Inverse of the complementary error function\n"
  5951. "\n"
  5952. "Notes\n"
  5953. "-----\n"
  5954. "This function wraps the ``erf_inv`` routine from the\n"
  5955. "Boost Math C++ library [1]_.\n"
  5956. "\n"
  5957. "References\n"
  5958. "----------\n"
  5959. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  5960. "\n"
  5961. "Examples\n"
  5962. "--------\n"
  5963. ">>> import numpy as np\n"
  5964. ">>> import matplotlib.pyplot as plt\n"
  5965. ">>> from scipy.special import erfinv, erf\n"
  5966. "\n"
  5967. ">>> erfinv(0.5)\n"
  5968. "0.4769362762044699\n"
  5969. "\n"
  5970. ">>> y = np.linspace(-1.0, 1.0, num=9)\n"
  5971. ">>> x = erfinv(y)\n"
  5972. ">>> x\n"
  5973. "array([ -inf, -0.81341985, -0.47693628, -0.22531206, 0. ,\n"
  5974. " 0.22531206, 0.47693628, 0.81341985, inf])\n"
  5975. "\n"
  5976. "Verify that ``erf(erfinv(y))`` is ``y``.\n"
  5977. "\n"
  5978. ">>> erf(x)\n"
  5979. "array([-1. , -0.75, -0.5 , -0.25, 0. , 0.25, 0.5 , 0.75, 1. ])\n"
  5980. "\n"
  5981. "Plot the function:\n"
  5982. "\n"
  5983. ">>> y = np.linspace(-1, 1, 200)\n"
  5984. ">>> fig, ax = plt.subplots()\n"
  5985. ">>> ax.plot(y, erfinv(y))\n"
  5986. ">>> ax.grid(True)\n"
  5987. ">>> ax.set_xlabel('y')\n"
  5988. ">>> ax.set_title('erfinv(y)')\n"
  5989. ">>> plt.show()")
  5990. ufunc_erfinv_loops[0] = <np.PyUFuncGenericFunction>loop_f_f__As_f_f
  5991. ufunc_erfinv_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  5992. ufunc_erfinv_types[0] = <char>NPY_FLOAT
  5993. ufunc_erfinv_types[1] = <char>NPY_FLOAT
  5994. ufunc_erfinv_types[2] = <char>NPY_DOUBLE
  5995. ufunc_erfinv_types[3] = <char>NPY_DOUBLE
  5996. ufunc_erfinv_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_erfinv_float
  5997. ufunc_erfinv_ptr[2*0+1] = <void*>(<char*>"erfinv")
  5998. ufunc_erfinv_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_erfinv_double
  5999. ufunc_erfinv_ptr[2*1+1] = <void*>(<char*>"erfinv")
  6000. ufunc_erfinv_data[0] = &ufunc_erfinv_ptr[2*0]
  6001. ufunc_erfinv_data[1] = &ufunc_erfinv_ptr[2*1]
  6002. erfinv = np.PyUFunc_FromFuncAndData(ufunc_erfinv_loops, ufunc_erfinv_data, ufunc_erfinv_types, 2, 1, 1, 0, 'erfinv', ufunc_erfinv_doc, 0)
  6003. cdef np.PyUFuncGenericFunction ufunc_eval_chebyc_loops[5]
  6004. cdef void *ufunc_eval_chebyc_ptr[10]
  6005. cdef void *ufunc_eval_chebyc_data[5]
  6006. cdef char ufunc_eval_chebyc_types[15]
  6007. cdef char *ufunc_eval_chebyc_doc = (
  6008. "eval_chebyc(n, x, out=None)\n"
  6009. "\n"
  6010. "Evaluate Chebyshev polynomial of the first kind on [-2, 2] at a\n"
  6011. "point.\n"
  6012. "\n"
  6013. "These polynomials are defined as\n"
  6014. "\n"
  6015. ".. math::\n"
  6016. "\n"
  6017. " C_n(x) = 2 T_n(x/2)\n"
  6018. "\n"
  6019. "where :math:`T_n` is a Chebyshev polynomial of the first kind. See\n"
  6020. "22.5.11 in [AS]_ (or equivalently [DLMF]_) for details.\n"
  6021. "\n"
  6022. "Parameters\n"
  6023. "----------\n"
  6024. "n : array_like\n"
  6025. " Degree of the polynomial. If not an integer, the result is\n"
  6026. " determined via the relation to `eval_chebyt`.\n"
  6027. "x : array_like\n"
  6028. " Points at which to evaluate the Chebyshev polynomial\n"
  6029. "out : ndarray, optional\n"
  6030. " Optional output array for the function values\n"
  6031. "\n"
  6032. "Returns\n"
  6033. "-------\n"
  6034. "C : scalar or ndarray\n"
  6035. " Values of the Chebyshev polynomial\n"
  6036. "\n"
  6037. "See Also\n"
  6038. "--------\n"
  6039. "roots_chebyc : roots and quadrature weights of Chebyshev\n"
  6040. " polynomials of the first kind on [-2, 2]\n"
  6041. "chebyc : Chebyshev polynomial object\n"
  6042. "numpy.polynomial.chebyshev.Chebyshev : Chebyshev series\n"
  6043. "eval_chebyt : evaluate Chebycshev polynomials of the first kind\n"
  6044. "\n"
  6045. "References\n"
  6046. "----------\n"
  6047. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6048. " Handbook of Mathematical Functions with Formulas,\n"
  6049. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6050. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  6051. " https://dlmf.nist.gov/18.1.E3\n"
  6052. "\n"
  6053. "Examples\n"
  6054. "--------\n"
  6055. ">>> import numpy as np\n"
  6056. ">>> import scipy.special as sc\n"
  6057. "\n"
  6058. "They are a scaled version of the Chebyshev polynomials of the\n"
  6059. "first kind.\n"
  6060. "\n"
  6061. ">>> x = np.linspace(-2, 2, 6)\n"
  6062. ">>> sc.eval_chebyc(3, x)\n"
  6063. "array([-2. , 1.872, 1.136, -1.136, -1.872, 2. ])\n"
  6064. ">>> 2 * sc.eval_chebyt(3, x / 2)\n"
  6065. "array([-2. , 1.872, 1.136, -1.136, -1.872, 2. ])")
  6066. ufunc_eval_chebyc_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  6067. ufunc_eval_chebyc_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  6068. ufunc_eval_chebyc_loops[2] = <np.PyUFuncGenericFunction>loop_D_dD__As_fF_F
  6069. ufunc_eval_chebyc_loops[3] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  6070. ufunc_eval_chebyc_loops[4] = <np.PyUFuncGenericFunction>loop_D_dD__As_dD_D
  6071. ufunc_eval_chebyc_types[0] = <char>NPY_INTP
  6072. ufunc_eval_chebyc_types[1] = <char>NPY_DOUBLE
  6073. ufunc_eval_chebyc_types[2] = <char>NPY_DOUBLE
  6074. ufunc_eval_chebyc_types[3] = <char>NPY_FLOAT
  6075. ufunc_eval_chebyc_types[4] = <char>NPY_FLOAT
  6076. ufunc_eval_chebyc_types[5] = <char>NPY_FLOAT
  6077. ufunc_eval_chebyc_types[6] = <char>NPY_FLOAT
  6078. ufunc_eval_chebyc_types[7] = <char>NPY_CFLOAT
  6079. ufunc_eval_chebyc_types[8] = <char>NPY_CFLOAT
  6080. ufunc_eval_chebyc_types[9] = <char>NPY_DOUBLE
  6081. ufunc_eval_chebyc_types[10] = <char>NPY_DOUBLE
  6082. ufunc_eval_chebyc_types[11] = <char>NPY_DOUBLE
  6083. ufunc_eval_chebyc_types[12] = <char>NPY_DOUBLE
  6084. ufunc_eval_chebyc_types[13] = <char>NPY_CDOUBLE
  6085. ufunc_eval_chebyc_types[14] = <char>NPY_CDOUBLE
  6086. ufunc_eval_chebyc_ptr[2*0] = <void*>_func_eval_chebyc_l
  6087. ufunc_eval_chebyc_ptr[2*0+1] = <void*>(<char*>"eval_chebyc")
  6088. ufunc_eval_chebyc_ptr[2*1] = <void*>_func_eval_chebyc[double]
  6089. ufunc_eval_chebyc_ptr[2*1+1] = <void*>(<char*>"eval_chebyc")
  6090. ufunc_eval_chebyc_ptr[2*2] = <void*>_func_eval_chebyc[double_complex]
  6091. ufunc_eval_chebyc_ptr[2*2+1] = <void*>(<char*>"eval_chebyc")
  6092. ufunc_eval_chebyc_ptr[2*3] = <void*>_func_eval_chebyc[double]
  6093. ufunc_eval_chebyc_ptr[2*3+1] = <void*>(<char*>"eval_chebyc")
  6094. ufunc_eval_chebyc_ptr[2*4] = <void*>_func_eval_chebyc[double_complex]
  6095. ufunc_eval_chebyc_ptr[2*4+1] = <void*>(<char*>"eval_chebyc")
  6096. ufunc_eval_chebyc_data[0] = &ufunc_eval_chebyc_ptr[2*0]
  6097. ufunc_eval_chebyc_data[1] = &ufunc_eval_chebyc_ptr[2*1]
  6098. ufunc_eval_chebyc_data[2] = &ufunc_eval_chebyc_ptr[2*2]
  6099. ufunc_eval_chebyc_data[3] = &ufunc_eval_chebyc_ptr[2*3]
  6100. ufunc_eval_chebyc_data[4] = &ufunc_eval_chebyc_ptr[2*4]
  6101. eval_chebyc = np.PyUFunc_FromFuncAndData(ufunc_eval_chebyc_loops, ufunc_eval_chebyc_data, ufunc_eval_chebyc_types, 5, 2, 1, 0, 'eval_chebyc', ufunc_eval_chebyc_doc, 0)
  6102. cdef np.PyUFuncGenericFunction ufunc_eval_chebys_loops[5]
  6103. cdef void *ufunc_eval_chebys_ptr[10]
  6104. cdef void *ufunc_eval_chebys_data[5]
  6105. cdef char ufunc_eval_chebys_types[15]
  6106. cdef char *ufunc_eval_chebys_doc = (
  6107. "eval_chebys(n, x, out=None)\n"
  6108. "\n"
  6109. "Evaluate Chebyshev polynomial of the second kind on [-2, 2] at a\n"
  6110. "point.\n"
  6111. "\n"
  6112. "These polynomials are defined as\n"
  6113. "\n"
  6114. ".. math::\n"
  6115. "\n"
  6116. " S_n(x) = U_n(x/2)\n"
  6117. "\n"
  6118. "where :math:`U_n` is a Chebyshev polynomial of the second kind.\n"
  6119. "See 22.5.13 in [AS]_ (or equivalently [DLMF]_) for details.\n"
  6120. "\n"
  6121. "Parameters\n"
  6122. "----------\n"
  6123. "n : array_like\n"
  6124. " Degree of the polynomial. If not an integer, the result is\n"
  6125. " determined via the relation to `eval_chebyu`.\n"
  6126. "x : array_like\n"
  6127. " Points at which to evaluate the Chebyshev polynomial\n"
  6128. "out : ndarray, optional\n"
  6129. " Optional output array for the function values\n"
  6130. "\n"
  6131. "Returns\n"
  6132. "-------\n"
  6133. "S : scalar or ndarray\n"
  6134. " Values of the Chebyshev polynomial\n"
  6135. "\n"
  6136. "See Also\n"
  6137. "--------\n"
  6138. "roots_chebys : roots and quadrature weights of Chebyshev\n"
  6139. " polynomials of the second kind on [-2, 2]\n"
  6140. "chebys : Chebyshev polynomial object\n"
  6141. "eval_chebyu : evaluate Chebyshev polynomials of the second kind\n"
  6142. "\n"
  6143. "References\n"
  6144. "----------\n"
  6145. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6146. " Handbook of Mathematical Functions with Formulas,\n"
  6147. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6148. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  6149. " https://dlmf.nist.gov/18.1.E3\n"
  6150. "\n"
  6151. "Examples\n"
  6152. "--------\n"
  6153. ">>> import numpy as np\n"
  6154. ">>> import scipy.special as sc\n"
  6155. "\n"
  6156. "They are a scaled version of the Chebyshev polynomials of the\n"
  6157. "second kind.\n"
  6158. "\n"
  6159. ">>> x = np.linspace(-2, 2, 6)\n"
  6160. ">>> sc.eval_chebys(3, x)\n"
  6161. "array([-4. , 0.672, 0.736, -0.736, -0.672, 4. ])\n"
  6162. ">>> sc.eval_chebyu(3, x / 2)\n"
  6163. "array([-4. , 0.672, 0.736, -0.736, -0.672, 4. ])")
  6164. ufunc_eval_chebys_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  6165. ufunc_eval_chebys_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  6166. ufunc_eval_chebys_loops[2] = <np.PyUFuncGenericFunction>loop_D_dD__As_fF_F
  6167. ufunc_eval_chebys_loops[3] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  6168. ufunc_eval_chebys_loops[4] = <np.PyUFuncGenericFunction>loop_D_dD__As_dD_D
  6169. ufunc_eval_chebys_types[0] = <char>NPY_INTP
  6170. ufunc_eval_chebys_types[1] = <char>NPY_DOUBLE
  6171. ufunc_eval_chebys_types[2] = <char>NPY_DOUBLE
  6172. ufunc_eval_chebys_types[3] = <char>NPY_FLOAT
  6173. ufunc_eval_chebys_types[4] = <char>NPY_FLOAT
  6174. ufunc_eval_chebys_types[5] = <char>NPY_FLOAT
  6175. ufunc_eval_chebys_types[6] = <char>NPY_FLOAT
  6176. ufunc_eval_chebys_types[7] = <char>NPY_CFLOAT
  6177. ufunc_eval_chebys_types[8] = <char>NPY_CFLOAT
  6178. ufunc_eval_chebys_types[9] = <char>NPY_DOUBLE
  6179. ufunc_eval_chebys_types[10] = <char>NPY_DOUBLE
  6180. ufunc_eval_chebys_types[11] = <char>NPY_DOUBLE
  6181. ufunc_eval_chebys_types[12] = <char>NPY_DOUBLE
  6182. ufunc_eval_chebys_types[13] = <char>NPY_CDOUBLE
  6183. ufunc_eval_chebys_types[14] = <char>NPY_CDOUBLE
  6184. ufunc_eval_chebys_ptr[2*0] = <void*>_func_eval_chebys_l
  6185. ufunc_eval_chebys_ptr[2*0+1] = <void*>(<char*>"eval_chebys")
  6186. ufunc_eval_chebys_ptr[2*1] = <void*>_func_eval_chebys[double]
  6187. ufunc_eval_chebys_ptr[2*1+1] = <void*>(<char*>"eval_chebys")
  6188. ufunc_eval_chebys_ptr[2*2] = <void*>_func_eval_chebys[double_complex]
  6189. ufunc_eval_chebys_ptr[2*2+1] = <void*>(<char*>"eval_chebys")
  6190. ufunc_eval_chebys_ptr[2*3] = <void*>_func_eval_chebys[double]
  6191. ufunc_eval_chebys_ptr[2*3+1] = <void*>(<char*>"eval_chebys")
  6192. ufunc_eval_chebys_ptr[2*4] = <void*>_func_eval_chebys[double_complex]
  6193. ufunc_eval_chebys_ptr[2*4+1] = <void*>(<char*>"eval_chebys")
  6194. ufunc_eval_chebys_data[0] = &ufunc_eval_chebys_ptr[2*0]
  6195. ufunc_eval_chebys_data[1] = &ufunc_eval_chebys_ptr[2*1]
  6196. ufunc_eval_chebys_data[2] = &ufunc_eval_chebys_ptr[2*2]
  6197. ufunc_eval_chebys_data[3] = &ufunc_eval_chebys_ptr[2*3]
  6198. ufunc_eval_chebys_data[4] = &ufunc_eval_chebys_ptr[2*4]
  6199. eval_chebys = np.PyUFunc_FromFuncAndData(ufunc_eval_chebys_loops, ufunc_eval_chebys_data, ufunc_eval_chebys_types, 5, 2, 1, 0, 'eval_chebys', ufunc_eval_chebys_doc, 0)
  6200. cdef np.PyUFuncGenericFunction ufunc_eval_chebyt_loops[5]
  6201. cdef void *ufunc_eval_chebyt_ptr[10]
  6202. cdef void *ufunc_eval_chebyt_data[5]
  6203. cdef char ufunc_eval_chebyt_types[15]
  6204. cdef char *ufunc_eval_chebyt_doc = (
  6205. "eval_chebyt(n, x, out=None)\n"
  6206. "\n"
  6207. "Evaluate Chebyshev polynomial of the first kind at a point.\n"
  6208. "\n"
  6209. "The Chebyshev polynomials of the first kind can be defined via the\n"
  6210. "Gauss hypergeometric function :math:`{}_2F_1` as\n"
  6211. "\n"
  6212. ".. math::\n"
  6213. "\n"
  6214. " T_n(x) = {}_2F_1(n, -n; 1/2; (1 - x)/2).\n"
  6215. "\n"
  6216. "When :math:`n` is an integer the result is a polynomial of degree\n"
  6217. ":math:`n`. See 22.5.47 in [AS]_ (or equivalently [DLMF]_) for details.\n"
  6218. "\n"
  6219. "Parameters\n"
  6220. "----------\n"
  6221. "n : array_like\n"
  6222. " Degree of the polynomial. If not an integer, the result is\n"
  6223. " determined via the relation to the Gauss hypergeometric\n"
  6224. " function.\n"
  6225. "x : array_like\n"
  6226. " Points at which to evaluate the Chebyshev polynomial\n"
  6227. "out : ndarray, optional\n"
  6228. " Optional output array for the function values\n"
  6229. "\n"
  6230. "Returns\n"
  6231. "-------\n"
  6232. "T : scalar or ndarray\n"
  6233. " Values of the Chebyshev polynomial\n"
  6234. "\n"
  6235. "See Also\n"
  6236. "--------\n"
  6237. "roots_chebyt : roots and quadrature weights of Chebyshev\n"
  6238. " polynomials of the first kind\n"
  6239. "chebyu : Chebychev polynomial object\n"
  6240. "eval_chebyu : evaluate Chebyshev polynomials of the second kind\n"
  6241. "hyp2f1 : Gauss hypergeometric function\n"
  6242. "numpy.polynomial.chebyshev.Chebyshev : Chebyshev series\n"
  6243. "\n"
  6244. "Notes\n"
  6245. "-----\n"
  6246. "This routine is numerically stable for `x` in ``[-1, 1]`` at least\n"
  6247. "up to order ``10000``.\n"
  6248. "\n"
  6249. "References\n"
  6250. "----------\n"
  6251. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6252. " Handbook of Mathematical Functions with Formulas,\n"
  6253. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6254. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  6255. " https://dlmf.nist.gov/18.5.E11_2")
  6256. ufunc_eval_chebyt_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  6257. ufunc_eval_chebyt_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  6258. ufunc_eval_chebyt_loops[2] = <np.PyUFuncGenericFunction>loop_D_dD__As_fF_F
  6259. ufunc_eval_chebyt_loops[3] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  6260. ufunc_eval_chebyt_loops[4] = <np.PyUFuncGenericFunction>loop_D_dD__As_dD_D
  6261. ufunc_eval_chebyt_types[0] = <char>NPY_INTP
  6262. ufunc_eval_chebyt_types[1] = <char>NPY_DOUBLE
  6263. ufunc_eval_chebyt_types[2] = <char>NPY_DOUBLE
  6264. ufunc_eval_chebyt_types[3] = <char>NPY_FLOAT
  6265. ufunc_eval_chebyt_types[4] = <char>NPY_FLOAT
  6266. ufunc_eval_chebyt_types[5] = <char>NPY_FLOAT
  6267. ufunc_eval_chebyt_types[6] = <char>NPY_FLOAT
  6268. ufunc_eval_chebyt_types[7] = <char>NPY_CFLOAT
  6269. ufunc_eval_chebyt_types[8] = <char>NPY_CFLOAT
  6270. ufunc_eval_chebyt_types[9] = <char>NPY_DOUBLE
  6271. ufunc_eval_chebyt_types[10] = <char>NPY_DOUBLE
  6272. ufunc_eval_chebyt_types[11] = <char>NPY_DOUBLE
  6273. ufunc_eval_chebyt_types[12] = <char>NPY_DOUBLE
  6274. ufunc_eval_chebyt_types[13] = <char>NPY_CDOUBLE
  6275. ufunc_eval_chebyt_types[14] = <char>NPY_CDOUBLE
  6276. ufunc_eval_chebyt_ptr[2*0] = <void*>_func_eval_chebyt_l
  6277. ufunc_eval_chebyt_ptr[2*0+1] = <void*>(<char*>"eval_chebyt")
  6278. ufunc_eval_chebyt_ptr[2*1] = <void*>_func_eval_chebyt[double]
  6279. ufunc_eval_chebyt_ptr[2*1+1] = <void*>(<char*>"eval_chebyt")
  6280. ufunc_eval_chebyt_ptr[2*2] = <void*>_func_eval_chebyt[double_complex]
  6281. ufunc_eval_chebyt_ptr[2*2+1] = <void*>(<char*>"eval_chebyt")
  6282. ufunc_eval_chebyt_ptr[2*3] = <void*>_func_eval_chebyt[double]
  6283. ufunc_eval_chebyt_ptr[2*3+1] = <void*>(<char*>"eval_chebyt")
  6284. ufunc_eval_chebyt_ptr[2*4] = <void*>_func_eval_chebyt[double_complex]
  6285. ufunc_eval_chebyt_ptr[2*4+1] = <void*>(<char*>"eval_chebyt")
  6286. ufunc_eval_chebyt_data[0] = &ufunc_eval_chebyt_ptr[2*0]
  6287. ufunc_eval_chebyt_data[1] = &ufunc_eval_chebyt_ptr[2*1]
  6288. ufunc_eval_chebyt_data[2] = &ufunc_eval_chebyt_ptr[2*2]
  6289. ufunc_eval_chebyt_data[3] = &ufunc_eval_chebyt_ptr[2*3]
  6290. ufunc_eval_chebyt_data[4] = &ufunc_eval_chebyt_ptr[2*4]
  6291. eval_chebyt = np.PyUFunc_FromFuncAndData(ufunc_eval_chebyt_loops, ufunc_eval_chebyt_data, ufunc_eval_chebyt_types, 5, 2, 1, 0, 'eval_chebyt', ufunc_eval_chebyt_doc, 0)
  6292. cdef np.PyUFuncGenericFunction ufunc_eval_chebyu_loops[5]
  6293. cdef void *ufunc_eval_chebyu_ptr[10]
  6294. cdef void *ufunc_eval_chebyu_data[5]
  6295. cdef char ufunc_eval_chebyu_types[15]
  6296. cdef char *ufunc_eval_chebyu_doc = (
  6297. "eval_chebyu(n, x, out=None)\n"
  6298. "\n"
  6299. "Evaluate Chebyshev polynomial of the second kind at a point.\n"
  6300. "\n"
  6301. "The Chebyshev polynomials of the second kind can be defined via\n"
  6302. "the Gauss hypergeometric function :math:`{}_2F_1` as\n"
  6303. "\n"
  6304. ".. math::\n"
  6305. "\n"
  6306. " U_n(x) = (n + 1) {}_2F_1(-n, n + 2; 3/2; (1 - x)/2).\n"
  6307. "\n"
  6308. "When :math:`n` is an integer the result is a polynomial of degree\n"
  6309. ":math:`n`. See 22.5.48 in [AS]_ (or equivalently [DLMF]_) for details.\n"
  6310. "\n"
  6311. "Parameters\n"
  6312. "----------\n"
  6313. "n : array_like\n"
  6314. " Degree of the polynomial. If not an integer, the result is\n"
  6315. " determined via the relation to the Gauss hypergeometric\n"
  6316. " function.\n"
  6317. "x : array_like\n"
  6318. " Points at which to evaluate the Chebyshev polynomial\n"
  6319. "out : ndarray, optional\n"
  6320. " Optional output array for the function values\n"
  6321. "\n"
  6322. "Returns\n"
  6323. "-------\n"
  6324. "U : scalar or ndarray\n"
  6325. " Values of the Chebyshev polynomial\n"
  6326. "\n"
  6327. "See Also\n"
  6328. "--------\n"
  6329. "roots_chebyu : roots and quadrature weights of Chebyshev\n"
  6330. " polynomials of the second kind\n"
  6331. "chebyu : Chebyshev polynomial object\n"
  6332. "eval_chebyt : evaluate Chebyshev polynomials of the first kind\n"
  6333. "hyp2f1 : Gauss hypergeometric function\n"
  6334. "\n"
  6335. "References\n"
  6336. "----------\n"
  6337. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6338. " Handbook of Mathematical Functions with Formulas,\n"
  6339. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6340. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  6341. " https://dlmf.nist.gov/18.5.E11_4")
  6342. ufunc_eval_chebyu_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  6343. ufunc_eval_chebyu_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  6344. ufunc_eval_chebyu_loops[2] = <np.PyUFuncGenericFunction>loop_D_dD__As_fF_F
  6345. ufunc_eval_chebyu_loops[3] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  6346. ufunc_eval_chebyu_loops[4] = <np.PyUFuncGenericFunction>loop_D_dD__As_dD_D
  6347. ufunc_eval_chebyu_types[0] = <char>NPY_INTP
  6348. ufunc_eval_chebyu_types[1] = <char>NPY_DOUBLE
  6349. ufunc_eval_chebyu_types[2] = <char>NPY_DOUBLE
  6350. ufunc_eval_chebyu_types[3] = <char>NPY_FLOAT
  6351. ufunc_eval_chebyu_types[4] = <char>NPY_FLOAT
  6352. ufunc_eval_chebyu_types[5] = <char>NPY_FLOAT
  6353. ufunc_eval_chebyu_types[6] = <char>NPY_FLOAT
  6354. ufunc_eval_chebyu_types[7] = <char>NPY_CFLOAT
  6355. ufunc_eval_chebyu_types[8] = <char>NPY_CFLOAT
  6356. ufunc_eval_chebyu_types[9] = <char>NPY_DOUBLE
  6357. ufunc_eval_chebyu_types[10] = <char>NPY_DOUBLE
  6358. ufunc_eval_chebyu_types[11] = <char>NPY_DOUBLE
  6359. ufunc_eval_chebyu_types[12] = <char>NPY_DOUBLE
  6360. ufunc_eval_chebyu_types[13] = <char>NPY_CDOUBLE
  6361. ufunc_eval_chebyu_types[14] = <char>NPY_CDOUBLE
  6362. ufunc_eval_chebyu_ptr[2*0] = <void*>_func_eval_chebyu_l
  6363. ufunc_eval_chebyu_ptr[2*0+1] = <void*>(<char*>"eval_chebyu")
  6364. ufunc_eval_chebyu_ptr[2*1] = <void*>_func_eval_chebyu[double]
  6365. ufunc_eval_chebyu_ptr[2*1+1] = <void*>(<char*>"eval_chebyu")
  6366. ufunc_eval_chebyu_ptr[2*2] = <void*>_func_eval_chebyu[double_complex]
  6367. ufunc_eval_chebyu_ptr[2*2+1] = <void*>(<char*>"eval_chebyu")
  6368. ufunc_eval_chebyu_ptr[2*3] = <void*>_func_eval_chebyu[double]
  6369. ufunc_eval_chebyu_ptr[2*3+1] = <void*>(<char*>"eval_chebyu")
  6370. ufunc_eval_chebyu_ptr[2*4] = <void*>_func_eval_chebyu[double_complex]
  6371. ufunc_eval_chebyu_ptr[2*4+1] = <void*>(<char*>"eval_chebyu")
  6372. ufunc_eval_chebyu_data[0] = &ufunc_eval_chebyu_ptr[2*0]
  6373. ufunc_eval_chebyu_data[1] = &ufunc_eval_chebyu_ptr[2*1]
  6374. ufunc_eval_chebyu_data[2] = &ufunc_eval_chebyu_ptr[2*2]
  6375. ufunc_eval_chebyu_data[3] = &ufunc_eval_chebyu_ptr[2*3]
  6376. ufunc_eval_chebyu_data[4] = &ufunc_eval_chebyu_ptr[2*4]
  6377. eval_chebyu = np.PyUFunc_FromFuncAndData(ufunc_eval_chebyu_loops, ufunc_eval_chebyu_data, ufunc_eval_chebyu_types, 5, 2, 1, 0, 'eval_chebyu', ufunc_eval_chebyu_doc, 0)
  6378. cdef np.PyUFuncGenericFunction ufunc_eval_gegenbauer_loops[5]
  6379. cdef void *ufunc_eval_gegenbauer_ptr[10]
  6380. cdef void *ufunc_eval_gegenbauer_data[5]
  6381. cdef char ufunc_eval_gegenbauer_types[20]
  6382. cdef char *ufunc_eval_gegenbauer_doc = (
  6383. "eval_gegenbauer(n, alpha, x, out=None)\n"
  6384. "\n"
  6385. "Evaluate Gegenbauer polynomial at a point.\n"
  6386. "\n"
  6387. "The Gegenbauer polynomials can be defined via the Gauss\n"
  6388. "hypergeometric function :math:`{}_2F_1` as\n"
  6389. "\n"
  6390. ".. math::\n"
  6391. "\n"
  6392. " C_n^{(\\alpha)} = \\frac{(2\\alpha)_n}{\\Gamma(n + 1)}\n"
  6393. " {}_2F_1(-n, 2\\alpha + n; \\alpha + 1/2; (1 - z)/2).\n"
  6394. "\n"
  6395. "When :math:`n` is an integer the result is a polynomial of degree\n"
  6396. ":math:`n`. See 22.5.46 in [AS]_ (or equivalently [DLMF]_) for details.\n"
  6397. "\n"
  6398. "Parameters\n"
  6399. "----------\n"
  6400. "n : array_like\n"
  6401. " Degree of the polynomial. If not an integer, the result is\n"
  6402. " determined via the relation to the Gauss hypergeometric\n"
  6403. " function.\n"
  6404. "alpha : array_like\n"
  6405. " Parameter\n"
  6406. "x : array_like\n"
  6407. " Points at which to evaluate the Gegenbauer polynomial\n"
  6408. "out : ndarray, optional\n"
  6409. " Optional output array for the function values\n"
  6410. "\n"
  6411. "Returns\n"
  6412. "-------\n"
  6413. "C : scalar or ndarray\n"
  6414. " Values of the Gegenbauer polynomial\n"
  6415. "\n"
  6416. "See Also\n"
  6417. "--------\n"
  6418. "roots_gegenbauer : roots and quadrature weights of Gegenbauer\n"
  6419. " polynomials\n"
  6420. "gegenbauer : Gegenbauer polynomial object\n"
  6421. "hyp2f1 : Gauss hypergeometric function\n"
  6422. "\n"
  6423. "References\n"
  6424. "----------\n"
  6425. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6426. " Handbook of Mathematical Functions with Formulas,\n"
  6427. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6428. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  6429. " https://dlmf.nist.gov/18.5.E9")
  6430. ufunc_eval_gegenbauer_loops[0] = <np.PyUFuncGenericFunction>loop_d_pdd__As_pdd_d
  6431. ufunc_eval_gegenbauer_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  6432. ufunc_eval_gegenbauer_loops[2] = <np.PyUFuncGenericFunction>loop_D_ddD__As_ffF_F
  6433. ufunc_eval_gegenbauer_loops[3] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  6434. ufunc_eval_gegenbauer_loops[4] = <np.PyUFuncGenericFunction>loop_D_ddD__As_ddD_D
  6435. ufunc_eval_gegenbauer_types[0] = <char>NPY_INTP
  6436. ufunc_eval_gegenbauer_types[1] = <char>NPY_DOUBLE
  6437. ufunc_eval_gegenbauer_types[2] = <char>NPY_DOUBLE
  6438. ufunc_eval_gegenbauer_types[3] = <char>NPY_DOUBLE
  6439. ufunc_eval_gegenbauer_types[4] = <char>NPY_FLOAT
  6440. ufunc_eval_gegenbauer_types[5] = <char>NPY_FLOAT
  6441. ufunc_eval_gegenbauer_types[6] = <char>NPY_FLOAT
  6442. ufunc_eval_gegenbauer_types[7] = <char>NPY_FLOAT
  6443. ufunc_eval_gegenbauer_types[8] = <char>NPY_FLOAT
  6444. ufunc_eval_gegenbauer_types[9] = <char>NPY_FLOAT
  6445. ufunc_eval_gegenbauer_types[10] = <char>NPY_CFLOAT
  6446. ufunc_eval_gegenbauer_types[11] = <char>NPY_CFLOAT
  6447. ufunc_eval_gegenbauer_types[12] = <char>NPY_DOUBLE
  6448. ufunc_eval_gegenbauer_types[13] = <char>NPY_DOUBLE
  6449. ufunc_eval_gegenbauer_types[14] = <char>NPY_DOUBLE
  6450. ufunc_eval_gegenbauer_types[15] = <char>NPY_DOUBLE
  6451. ufunc_eval_gegenbauer_types[16] = <char>NPY_DOUBLE
  6452. ufunc_eval_gegenbauer_types[17] = <char>NPY_DOUBLE
  6453. ufunc_eval_gegenbauer_types[18] = <char>NPY_CDOUBLE
  6454. ufunc_eval_gegenbauer_types[19] = <char>NPY_CDOUBLE
  6455. ufunc_eval_gegenbauer_ptr[2*0] = <void*>_func_eval_gegenbauer_l
  6456. ufunc_eval_gegenbauer_ptr[2*0+1] = <void*>(<char*>"eval_gegenbauer")
  6457. ufunc_eval_gegenbauer_ptr[2*1] = <void*>_func_eval_gegenbauer[double]
  6458. ufunc_eval_gegenbauer_ptr[2*1+1] = <void*>(<char*>"eval_gegenbauer")
  6459. ufunc_eval_gegenbauer_ptr[2*2] = <void*>_func_eval_gegenbauer[double_complex]
  6460. ufunc_eval_gegenbauer_ptr[2*2+1] = <void*>(<char*>"eval_gegenbauer")
  6461. ufunc_eval_gegenbauer_ptr[2*3] = <void*>_func_eval_gegenbauer[double]
  6462. ufunc_eval_gegenbauer_ptr[2*3+1] = <void*>(<char*>"eval_gegenbauer")
  6463. ufunc_eval_gegenbauer_ptr[2*4] = <void*>_func_eval_gegenbauer[double_complex]
  6464. ufunc_eval_gegenbauer_ptr[2*4+1] = <void*>(<char*>"eval_gegenbauer")
  6465. ufunc_eval_gegenbauer_data[0] = &ufunc_eval_gegenbauer_ptr[2*0]
  6466. ufunc_eval_gegenbauer_data[1] = &ufunc_eval_gegenbauer_ptr[2*1]
  6467. ufunc_eval_gegenbauer_data[2] = &ufunc_eval_gegenbauer_ptr[2*2]
  6468. ufunc_eval_gegenbauer_data[3] = &ufunc_eval_gegenbauer_ptr[2*3]
  6469. ufunc_eval_gegenbauer_data[4] = &ufunc_eval_gegenbauer_ptr[2*4]
  6470. eval_gegenbauer = np.PyUFunc_FromFuncAndData(ufunc_eval_gegenbauer_loops, ufunc_eval_gegenbauer_data, ufunc_eval_gegenbauer_types, 5, 3, 1, 0, 'eval_gegenbauer', ufunc_eval_gegenbauer_doc, 0)
  6471. cdef np.PyUFuncGenericFunction ufunc_eval_genlaguerre_loops[5]
  6472. cdef void *ufunc_eval_genlaguerre_ptr[10]
  6473. cdef void *ufunc_eval_genlaguerre_data[5]
  6474. cdef char ufunc_eval_genlaguerre_types[20]
  6475. cdef char *ufunc_eval_genlaguerre_doc = (
  6476. "eval_genlaguerre(n, alpha, x, out=None)\n"
  6477. "\n"
  6478. "Evaluate generalized Laguerre polynomial at a point.\n"
  6479. "\n"
  6480. "The generalized Laguerre polynomials can be defined via the\n"
  6481. "confluent hypergeometric function :math:`{}_1F_1` as\n"
  6482. "\n"
  6483. ".. math::\n"
  6484. "\n"
  6485. " L_n^{(\\alpha)}(x) = \\binom{n + \\alpha}{n}\n"
  6486. " {}_1F_1(-n, \\alpha + 1, x).\n"
  6487. "\n"
  6488. "When :math:`n` is an integer the result is a polynomial of degree\n"
  6489. ":math:`n`. See 22.5.54 in [AS]_ or [DLMF]_ for details. The Laguerre\n"
  6490. "polynomials are the special case where :math:`\\alpha = 0`.\n"
  6491. "\n"
  6492. "Parameters\n"
  6493. "----------\n"
  6494. "n : array_like\n"
  6495. " Degree of the polynomial. If not an integer, the result is\n"
  6496. " determined via the relation to the confluent hypergeometric\n"
  6497. " function.\n"
  6498. "alpha : array_like\n"
  6499. " Parameter; must have ``alpha > -1``\n"
  6500. "x : array_like\n"
  6501. " Points at which to evaluate the generalized Laguerre\n"
  6502. " polynomial\n"
  6503. "out : ndarray, optional\n"
  6504. " Optional output array for the function values\n"
  6505. "\n"
  6506. "Returns\n"
  6507. "-------\n"
  6508. "L : scalar or ndarray\n"
  6509. " Values of the generalized Laguerre polynomial\n"
  6510. "\n"
  6511. "See Also\n"
  6512. "--------\n"
  6513. "roots_genlaguerre : roots and quadrature weights of generalized\n"
  6514. " Laguerre polynomials\n"
  6515. "genlaguerre : generalized Laguerre polynomial object\n"
  6516. "hyp1f1 : confluent hypergeometric function\n"
  6517. "eval_laguerre : evaluate Laguerre polynomials\n"
  6518. "\n"
  6519. "References\n"
  6520. "----------\n"
  6521. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6522. " Handbook of Mathematical Functions with Formulas,\n"
  6523. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6524. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  6525. " https://dlmf.nist.gov/18.5.E12")
  6526. ufunc_eval_genlaguerre_loops[0] = <np.PyUFuncGenericFunction>loop_d_pdd__As_pdd_d
  6527. ufunc_eval_genlaguerre_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  6528. ufunc_eval_genlaguerre_loops[2] = <np.PyUFuncGenericFunction>loop_D_ddD__As_ffF_F
  6529. ufunc_eval_genlaguerre_loops[3] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  6530. ufunc_eval_genlaguerre_loops[4] = <np.PyUFuncGenericFunction>loop_D_ddD__As_ddD_D
  6531. ufunc_eval_genlaguerre_types[0] = <char>NPY_INTP
  6532. ufunc_eval_genlaguerre_types[1] = <char>NPY_DOUBLE
  6533. ufunc_eval_genlaguerre_types[2] = <char>NPY_DOUBLE
  6534. ufunc_eval_genlaguerre_types[3] = <char>NPY_DOUBLE
  6535. ufunc_eval_genlaguerre_types[4] = <char>NPY_FLOAT
  6536. ufunc_eval_genlaguerre_types[5] = <char>NPY_FLOAT
  6537. ufunc_eval_genlaguerre_types[6] = <char>NPY_FLOAT
  6538. ufunc_eval_genlaguerre_types[7] = <char>NPY_FLOAT
  6539. ufunc_eval_genlaguerre_types[8] = <char>NPY_FLOAT
  6540. ufunc_eval_genlaguerre_types[9] = <char>NPY_FLOAT
  6541. ufunc_eval_genlaguerre_types[10] = <char>NPY_CFLOAT
  6542. ufunc_eval_genlaguerre_types[11] = <char>NPY_CFLOAT
  6543. ufunc_eval_genlaguerre_types[12] = <char>NPY_DOUBLE
  6544. ufunc_eval_genlaguerre_types[13] = <char>NPY_DOUBLE
  6545. ufunc_eval_genlaguerre_types[14] = <char>NPY_DOUBLE
  6546. ufunc_eval_genlaguerre_types[15] = <char>NPY_DOUBLE
  6547. ufunc_eval_genlaguerre_types[16] = <char>NPY_DOUBLE
  6548. ufunc_eval_genlaguerre_types[17] = <char>NPY_DOUBLE
  6549. ufunc_eval_genlaguerre_types[18] = <char>NPY_CDOUBLE
  6550. ufunc_eval_genlaguerre_types[19] = <char>NPY_CDOUBLE
  6551. ufunc_eval_genlaguerre_ptr[2*0] = <void*>_func_eval_genlaguerre_l
  6552. ufunc_eval_genlaguerre_ptr[2*0+1] = <void*>(<char*>"eval_genlaguerre")
  6553. ufunc_eval_genlaguerre_ptr[2*1] = <void*>_func_eval_genlaguerre[double]
  6554. ufunc_eval_genlaguerre_ptr[2*1+1] = <void*>(<char*>"eval_genlaguerre")
  6555. ufunc_eval_genlaguerre_ptr[2*2] = <void*>_func_eval_genlaguerre[double_complex]
  6556. ufunc_eval_genlaguerre_ptr[2*2+1] = <void*>(<char*>"eval_genlaguerre")
  6557. ufunc_eval_genlaguerre_ptr[2*3] = <void*>_func_eval_genlaguerre[double]
  6558. ufunc_eval_genlaguerre_ptr[2*3+1] = <void*>(<char*>"eval_genlaguerre")
  6559. ufunc_eval_genlaguerre_ptr[2*4] = <void*>_func_eval_genlaguerre[double_complex]
  6560. ufunc_eval_genlaguerre_ptr[2*4+1] = <void*>(<char*>"eval_genlaguerre")
  6561. ufunc_eval_genlaguerre_data[0] = &ufunc_eval_genlaguerre_ptr[2*0]
  6562. ufunc_eval_genlaguerre_data[1] = &ufunc_eval_genlaguerre_ptr[2*1]
  6563. ufunc_eval_genlaguerre_data[2] = &ufunc_eval_genlaguerre_ptr[2*2]
  6564. ufunc_eval_genlaguerre_data[3] = &ufunc_eval_genlaguerre_ptr[2*3]
  6565. ufunc_eval_genlaguerre_data[4] = &ufunc_eval_genlaguerre_ptr[2*4]
  6566. eval_genlaguerre = np.PyUFunc_FromFuncAndData(ufunc_eval_genlaguerre_loops, ufunc_eval_genlaguerre_data, ufunc_eval_genlaguerre_types, 5, 3, 1, 0, 'eval_genlaguerre', ufunc_eval_genlaguerre_doc, 0)
  6567. cdef np.PyUFuncGenericFunction ufunc_eval_hermite_loops[1]
  6568. cdef void *ufunc_eval_hermite_ptr[2]
  6569. cdef void *ufunc_eval_hermite_data[1]
  6570. cdef char ufunc_eval_hermite_types[3]
  6571. cdef char *ufunc_eval_hermite_doc = (
  6572. "eval_hermite(n, x, out=None)\n"
  6573. "\n"
  6574. "Evaluate physicist's Hermite polynomial at a point.\n"
  6575. "\n"
  6576. "Defined by\n"
  6577. "\n"
  6578. ".. math::\n"
  6579. "\n"
  6580. " H_n(x) = (-1)^n e^{x^2} \\frac{d^n}{dx^n} e^{-x^2};\n"
  6581. "\n"
  6582. ":math:`H_n` is a polynomial of degree :math:`n`. See 22.11.7 in\n"
  6583. "[AS]_ or [DLMF]_ for details.\n"
  6584. "\n"
  6585. "Parameters\n"
  6586. "----------\n"
  6587. "n : array_like\n"
  6588. " Degree of the polynomial\n"
  6589. "x : array_like\n"
  6590. " Points at which to evaluate the Hermite polynomial\n"
  6591. "out : ndarray, optional\n"
  6592. " Optional output array for the function values\n"
  6593. "\n"
  6594. "Returns\n"
  6595. "-------\n"
  6596. "H : scalar or ndarray\n"
  6597. " Values of the Hermite polynomial\n"
  6598. "\n"
  6599. "See Also\n"
  6600. "--------\n"
  6601. "roots_hermite : roots and quadrature weights of physicist's\n"
  6602. " Hermite polynomials\n"
  6603. "hermite : physicist's Hermite polynomial object\n"
  6604. "numpy.polynomial.hermite.Hermite : Physicist's Hermite series\n"
  6605. "eval_hermitenorm : evaluate Probabilist's Hermite polynomials\n"
  6606. "\n"
  6607. "References\n"
  6608. "----------\n"
  6609. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6610. " Handbook of Mathematical Functions with Formulas,\n"
  6611. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6612. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  6613. " https://dlmf.nist.gov/18.5.T1")
  6614. ufunc_eval_hermite_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  6615. ufunc_eval_hermite_types[0] = <char>NPY_INTP
  6616. ufunc_eval_hermite_types[1] = <char>NPY_DOUBLE
  6617. ufunc_eval_hermite_types[2] = <char>NPY_DOUBLE
  6618. ufunc_eval_hermite_ptr[2*0] = <void*>_func_eval_hermite
  6619. ufunc_eval_hermite_ptr[2*0+1] = <void*>(<char*>"eval_hermite")
  6620. ufunc_eval_hermite_data[0] = &ufunc_eval_hermite_ptr[2*0]
  6621. eval_hermite = np.PyUFunc_FromFuncAndData(ufunc_eval_hermite_loops, ufunc_eval_hermite_data, ufunc_eval_hermite_types, 1, 2, 1, 0, 'eval_hermite', ufunc_eval_hermite_doc, 0)
  6622. cdef np.PyUFuncGenericFunction ufunc_eval_hermitenorm_loops[1]
  6623. cdef void *ufunc_eval_hermitenorm_ptr[2]
  6624. cdef void *ufunc_eval_hermitenorm_data[1]
  6625. cdef char ufunc_eval_hermitenorm_types[3]
  6626. cdef char *ufunc_eval_hermitenorm_doc = (
  6627. "eval_hermitenorm(n, x, out=None)\n"
  6628. "\n"
  6629. "Evaluate probabilist's (normalized) Hermite polynomial at a\n"
  6630. "point.\n"
  6631. "\n"
  6632. "Defined by\n"
  6633. "\n"
  6634. ".. math::\n"
  6635. "\n"
  6636. " He_n(x) = (-1)^n e^{x^2/2} \\frac{d^n}{dx^n} e^{-x^2/2};\n"
  6637. "\n"
  6638. ":math:`He_n` is a polynomial of degree :math:`n`. See 22.11.8 in\n"
  6639. "[AS]_ or [DLMF]_ for details.\n"
  6640. "\n"
  6641. "Parameters\n"
  6642. "----------\n"
  6643. "n : array_like\n"
  6644. " Degree of the polynomial\n"
  6645. "x : array_like\n"
  6646. " Points at which to evaluate the Hermite polynomial\n"
  6647. "out : ndarray, optional\n"
  6648. " Optional output array for the function values\n"
  6649. "\n"
  6650. "Returns\n"
  6651. "-------\n"
  6652. "He : scalar or ndarray\n"
  6653. " Values of the Hermite polynomial\n"
  6654. "\n"
  6655. "See Also\n"
  6656. "--------\n"
  6657. "roots_hermitenorm : roots and quadrature weights of probabilist's\n"
  6658. " Hermite polynomials\n"
  6659. "hermitenorm : probabilist's Hermite polynomial object\n"
  6660. "numpy.polynomial.hermite_e.HermiteE : Probabilist's Hermite series\n"
  6661. "eval_hermite : evaluate physicist's Hermite polynomials\n"
  6662. "\n"
  6663. "References\n"
  6664. "----------\n"
  6665. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6666. " Handbook of Mathematical Functions with Formulas,\n"
  6667. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6668. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  6669. " https://dlmf.nist.gov/18.5.T1")
  6670. ufunc_eval_hermitenorm_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  6671. ufunc_eval_hermitenorm_types[0] = <char>NPY_INTP
  6672. ufunc_eval_hermitenorm_types[1] = <char>NPY_DOUBLE
  6673. ufunc_eval_hermitenorm_types[2] = <char>NPY_DOUBLE
  6674. ufunc_eval_hermitenorm_ptr[2*0] = <void*>_func_eval_hermitenorm
  6675. ufunc_eval_hermitenorm_ptr[2*0+1] = <void*>(<char*>"eval_hermitenorm")
  6676. ufunc_eval_hermitenorm_data[0] = &ufunc_eval_hermitenorm_ptr[2*0]
  6677. eval_hermitenorm = np.PyUFunc_FromFuncAndData(ufunc_eval_hermitenorm_loops, ufunc_eval_hermitenorm_data, ufunc_eval_hermitenorm_types, 1, 2, 1, 0, 'eval_hermitenorm', ufunc_eval_hermitenorm_doc, 0)
  6678. cdef np.PyUFuncGenericFunction ufunc_eval_jacobi_loops[5]
  6679. cdef void *ufunc_eval_jacobi_ptr[10]
  6680. cdef void *ufunc_eval_jacobi_data[5]
  6681. cdef char ufunc_eval_jacobi_types[25]
  6682. cdef char *ufunc_eval_jacobi_doc = (
  6683. "eval_jacobi(n, alpha, beta, x, out=None)\n"
  6684. "\n"
  6685. "Evaluate Jacobi polynomial at a point.\n"
  6686. "\n"
  6687. "The Jacobi polynomials can be defined via the Gauss hypergeometric\n"
  6688. "function :math:`{}_2F_1` as\n"
  6689. "\n"
  6690. ".. math::\n"
  6691. "\n"
  6692. " P_n^{(\\alpha, \\beta)}(x) = \\frac{(\\alpha + 1)_n}{\\Gamma(n + 1)}\n"
  6693. " {}_2F_1(-n, 1 + \\alpha + \\beta + n; \\alpha + 1; (1 - z)/2)\n"
  6694. "\n"
  6695. "where :math:`(\\cdot)_n` is the Pochhammer symbol; see `poch`. When\n"
  6696. ":math:`n` is an integer the result is a polynomial of degree\n"
  6697. ":math:`n`. See 22.5.42 in [AS]_ or [DLMF]_ for details.\n"
  6698. "\n"
  6699. "Parameters\n"
  6700. "----------\n"
  6701. "n : array_like\n"
  6702. " Degree of the polynomial. If not an integer the result is\n"
  6703. " determined via the relation to the Gauss hypergeometric\n"
  6704. " function.\n"
  6705. "alpha : array_like\n"
  6706. " Parameter\n"
  6707. "beta : array_like\n"
  6708. " Parameter\n"
  6709. "x : array_like\n"
  6710. " Points at which to evaluate the polynomial\n"
  6711. "out : ndarray, optional\n"
  6712. " Optional output array for the function values\n"
  6713. "\n"
  6714. "Returns\n"
  6715. "-------\n"
  6716. "P : scalar or ndarray\n"
  6717. " Values of the Jacobi polynomial\n"
  6718. "\n"
  6719. "See Also\n"
  6720. "--------\n"
  6721. "roots_jacobi : roots and quadrature weights of Jacobi polynomials\n"
  6722. "jacobi : Jacobi polynomial object\n"
  6723. "hyp2f1 : Gauss hypergeometric function\n"
  6724. "\n"
  6725. "References\n"
  6726. "----------\n"
  6727. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6728. " Handbook of Mathematical Functions with Formulas,\n"
  6729. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6730. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  6731. " https://dlmf.nist.gov/18.5.E7")
  6732. ufunc_eval_jacobi_loops[0] = <np.PyUFuncGenericFunction>loop_d_pddd__As_pddd_d
  6733. ufunc_eval_jacobi_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_ffff_f
  6734. ufunc_eval_jacobi_loops[2] = <np.PyUFuncGenericFunction>loop_D_dddD__As_fffF_F
  6735. ufunc_eval_jacobi_loops[3] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  6736. ufunc_eval_jacobi_loops[4] = <np.PyUFuncGenericFunction>loop_D_dddD__As_dddD_D
  6737. ufunc_eval_jacobi_types[0] = <char>NPY_INTP
  6738. ufunc_eval_jacobi_types[1] = <char>NPY_DOUBLE
  6739. ufunc_eval_jacobi_types[2] = <char>NPY_DOUBLE
  6740. ufunc_eval_jacobi_types[3] = <char>NPY_DOUBLE
  6741. ufunc_eval_jacobi_types[4] = <char>NPY_DOUBLE
  6742. ufunc_eval_jacobi_types[5] = <char>NPY_FLOAT
  6743. ufunc_eval_jacobi_types[6] = <char>NPY_FLOAT
  6744. ufunc_eval_jacobi_types[7] = <char>NPY_FLOAT
  6745. ufunc_eval_jacobi_types[8] = <char>NPY_FLOAT
  6746. ufunc_eval_jacobi_types[9] = <char>NPY_FLOAT
  6747. ufunc_eval_jacobi_types[10] = <char>NPY_FLOAT
  6748. ufunc_eval_jacobi_types[11] = <char>NPY_FLOAT
  6749. ufunc_eval_jacobi_types[12] = <char>NPY_FLOAT
  6750. ufunc_eval_jacobi_types[13] = <char>NPY_CFLOAT
  6751. ufunc_eval_jacobi_types[14] = <char>NPY_CFLOAT
  6752. ufunc_eval_jacobi_types[15] = <char>NPY_DOUBLE
  6753. ufunc_eval_jacobi_types[16] = <char>NPY_DOUBLE
  6754. ufunc_eval_jacobi_types[17] = <char>NPY_DOUBLE
  6755. ufunc_eval_jacobi_types[18] = <char>NPY_DOUBLE
  6756. ufunc_eval_jacobi_types[19] = <char>NPY_DOUBLE
  6757. ufunc_eval_jacobi_types[20] = <char>NPY_DOUBLE
  6758. ufunc_eval_jacobi_types[21] = <char>NPY_DOUBLE
  6759. ufunc_eval_jacobi_types[22] = <char>NPY_DOUBLE
  6760. ufunc_eval_jacobi_types[23] = <char>NPY_CDOUBLE
  6761. ufunc_eval_jacobi_types[24] = <char>NPY_CDOUBLE
  6762. ufunc_eval_jacobi_ptr[2*0] = <void*>_func_eval_jacobi_l
  6763. ufunc_eval_jacobi_ptr[2*0+1] = <void*>(<char*>"eval_jacobi")
  6764. ufunc_eval_jacobi_ptr[2*1] = <void*>_func_eval_jacobi[double]
  6765. ufunc_eval_jacobi_ptr[2*1+1] = <void*>(<char*>"eval_jacobi")
  6766. ufunc_eval_jacobi_ptr[2*2] = <void*>_func_eval_jacobi[double_complex]
  6767. ufunc_eval_jacobi_ptr[2*2+1] = <void*>(<char*>"eval_jacobi")
  6768. ufunc_eval_jacobi_ptr[2*3] = <void*>_func_eval_jacobi[double]
  6769. ufunc_eval_jacobi_ptr[2*3+1] = <void*>(<char*>"eval_jacobi")
  6770. ufunc_eval_jacobi_ptr[2*4] = <void*>_func_eval_jacobi[double_complex]
  6771. ufunc_eval_jacobi_ptr[2*4+1] = <void*>(<char*>"eval_jacobi")
  6772. ufunc_eval_jacobi_data[0] = &ufunc_eval_jacobi_ptr[2*0]
  6773. ufunc_eval_jacobi_data[1] = &ufunc_eval_jacobi_ptr[2*1]
  6774. ufunc_eval_jacobi_data[2] = &ufunc_eval_jacobi_ptr[2*2]
  6775. ufunc_eval_jacobi_data[3] = &ufunc_eval_jacobi_ptr[2*3]
  6776. ufunc_eval_jacobi_data[4] = &ufunc_eval_jacobi_ptr[2*4]
  6777. eval_jacobi = np.PyUFunc_FromFuncAndData(ufunc_eval_jacobi_loops, ufunc_eval_jacobi_data, ufunc_eval_jacobi_types, 5, 4, 1, 0, 'eval_jacobi', ufunc_eval_jacobi_doc, 0)
  6778. cdef np.PyUFuncGenericFunction ufunc_eval_laguerre_loops[5]
  6779. cdef void *ufunc_eval_laguerre_ptr[10]
  6780. cdef void *ufunc_eval_laguerre_data[5]
  6781. cdef char ufunc_eval_laguerre_types[15]
  6782. cdef char *ufunc_eval_laguerre_doc = (
  6783. "eval_laguerre(n, x, out=None)\n"
  6784. "\n"
  6785. "Evaluate Laguerre polynomial at a point.\n"
  6786. "\n"
  6787. "The Laguerre polynomials can be defined via the confluent\n"
  6788. "hypergeometric function :math:`{}_1F_1` as\n"
  6789. "\n"
  6790. ".. math::\n"
  6791. "\n"
  6792. " L_n(x) = {}_1F_1(-n, 1, x).\n"
  6793. "\n"
  6794. "See 22.5.16 and 22.5.54 in [AS]_ (or equivalently [DLMF1]_ and [DLMF2]_)\n"
  6795. "for details. When :math:`n` is an integer the result is a polynomial\n"
  6796. "of degree :math:`n`.\n"
  6797. "\n"
  6798. "Parameters\n"
  6799. "----------\n"
  6800. "n : array_like\n"
  6801. " Degree of the polynomial. If not an integer the result is\n"
  6802. " determined via the relation to the confluent hypergeometric\n"
  6803. " function.\n"
  6804. "x : array_like\n"
  6805. " Points at which to evaluate the Laguerre polynomial\n"
  6806. "out : ndarray, optional\n"
  6807. " Optional output array for the function values\n"
  6808. "\n"
  6809. "Returns\n"
  6810. "-------\n"
  6811. "L : scalar or ndarray\n"
  6812. " Values of the Laguerre polynomial\n"
  6813. "\n"
  6814. "See Also\n"
  6815. "--------\n"
  6816. "roots_laguerre : roots and quadrature weights of Laguerre\n"
  6817. " polynomials\n"
  6818. "laguerre : Laguerre polynomial object\n"
  6819. "numpy.polynomial.laguerre.Laguerre : Laguerre series\n"
  6820. "eval_genlaguerre : evaluate generalized Laguerre polynomials\n"
  6821. "\n"
  6822. "References\n"
  6823. "----------\n"
  6824. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6825. " Handbook of Mathematical Functions with Formulas,\n"
  6826. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6827. ".. [DLMF1] NIST Digital Library of Mathematical Functions,\n"
  6828. " https://dlmf.nist.gov/18.1#I1.ix7.p1\n"
  6829. ".. [DLMF2] NIST Digital Library of Mathematical Functions,\n"
  6830. " https://dlmf.nist.gov/18.5.E12")
  6831. ufunc_eval_laguerre_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  6832. ufunc_eval_laguerre_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  6833. ufunc_eval_laguerre_loops[2] = <np.PyUFuncGenericFunction>loop_D_dD__As_fF_F
  6834. ufunc_eval_laguerre_loops[3] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  6835. ufunc_eval_laguerre_loops[4] = <np.PyUFuncGenericFunction>loop_D_dD__As_dD_D
  6836. ufunc_eval_laguerre_types[0] = <char>NPY_INTP
  6837. ufunc_eval_laguerre_types[1] = <char>NPY_DOUBLE
  6838. ufunc_eval_laguerre_types[2] = <char>NPY_DOUBLE
  6839. ufunc_eval_laguerre_types[3] = <char>NPY_FLOAT
  6840. ufunc_eval_laguerre_types[4] = <char>NPY_FLOAT
  6841. ufunc_eval_laguerre_types[5] = <char>NPY_FLOAT
  6842. ufunc_eval_laguerre_types[6] = <char>NPY_FLOAT
  6843. ufunc_eval_laguerre_types[7] = <char>NPY_CFLOAT
  6844. ufunc_eval_laguerre_types[8] = <char>NPY_CFLOAT
  6845. ufunc_eval_laguerre_types[9] = <char>NPY_DOUBLE
  6846. ufunc_eval_laguerre_types[10] = <char>NPY_DOUBLE
  6847. ufunc_eval_laguerre_types[11] = <char>NPY_DOUBLE
  6848. ufunc_eval_laguerre_types[12] = <char>NPY_DOUBLE
  6849. ufunc_eval_laguerre_types[13] = <char>NPY_CDOUBLE
  6850. ufunc_eval_laguerre_types[14] = <char>NPY_CDOUBLE
  6851. ufunc_eval_laguerre_ptr[2*0] = <void*>_func_eval_laguerre_l
  6852. ufunc_eval_laguerre_ptr[2*0+1] = <void*>(<char*>"eval_laguerre")
  6853. ufunc_eval_laguerre_ptr[2*1] = <void*>_func_eval_laguerre[double]
  6854. ufunc_eval_laguerre_ptr[2*1+1] = <void*>(<char*>"eval_laguerre")
  6855. ufunc_eval_laguerre_ptr[2*2] = <void*>_func_eval_laguerre[double_complex]
  6856. ufunc_eval_laguerre_ptr[2*2+1] = <void*>(<char*>"eval_laguerre")
  6857. ufunc_eval_laguerre_ptr[2*3] = <void*>_func_eval_laguerre[double]
  6858. ufunc_eval_laguerre_ptr[2*3+1] = <void*>(<char*>"eval_laguerre")
  6859. ufunc_eval_laguerre_ptr[2*4] = <void*>_func_eval_laguerre[double_complex]
  6860. ufunc_eval_laguerre_ptr[2*4+1] = <void*>(<char*>"eval_laguerre")
  6861. ufunc_eval_laguerre_data[0] = &ufunc_eval_laguerre_ptr[2*0]
  6862. ufunc_eval_laguerre_data[1] = &ufunc_eval_laguerre_ptr[2*1]
  6863. ufunc_eval_laguerre_data[2] = &ufunc_eval_laguerre_ptr[2*2]
  6864. ufunc_eval_laguerre_data[3] = &ufunc_eval_laguerre_ptr[2*3]
  6865. ufunc_eval_laguerre_data[4] = &ufunc_eval_laguerre_ptr[2*4]
  6866. eval_laguerre = np.PyUFunc_FromFuncAndData(ufunc_eval_laguerre_loops, ufunc_eval_laguerre_data, ufunc_eval_laguerre_types, 5, 2, 1, 0, 'eval_laguerre', ufunc_eval_laguerre_doc, 0)
  6867. cdef np.PyUFuncGenericFunction ufunc_eval_legendre_loops[5]
  6868. cdef void *ufunc_eval_legendre_ptr[10]
  6869. cdef void *ufunc_eval_legendre_data[5]
  6870. cdef char ufunc_eval_legendre_types[15]
  6871. cdef char *ufunc_eval_legendre_doc = (
  6872. "eval_legendre(n, x, out=None)\n"
  6873. "\n"
  6874. "Evaluate Legendre polynomial at a point.\n"
  6875. "\n"
  6876. "The Legendre polynomials can be defined via the Gauss\n"
  6877. "hypergeometric function :math:`{}_2F_1` as\n"
  6878. "\n"
  6879. ".. math::\n"
  6880. "\n"
  6881. " P_n(x) = {}_2F_1(-n, n + 1; 1; (1 - x)/2).\n"
  6882. "\n"
  6883. "When :math:`n` is an integer the result is a polynomial of degree\n"
  6884. ":math:`n`. See 22.5.49 in [AS]_ (or equivalently [DLMF]_) for details.\n"
  6885. "\n"
  6886. "Parameters\n"
  6887. "----------\n"
  6888. "n : array_like\n"
  6889. " Degree of the polynomial. If not an integer, the result is\n"
  6890. " determined via the relation to the Gauss hypergeometric\n"
  6891. " function.\n"
  6892. "x : array_like\n"
  6893. " Points at which to evaluate the Legendre polynomial\n"
  6894. "out : ndarray, optional\n"
  6895. " Optional output array for the function values\n"
  6896. "\n"
  6897. "Returns\n"
  6898. "-------\n"
  6899. "P : scalar or ndarray\n"
  6900. " Values of the Legendre polynomial\n"
  6901. "\n"
  6902. "See Also\n"
  6903. "--------\n"
  6904. "roots_legendre : roots and quadrature weights of Legendre\n"
  6905. " polynomials\n"
  6906. "legendre : Legendre polynomial object\n"
  6907. "hyp2f1 : Gauss hypergeometric function\n"
  6908. "numpy.polynomial.legendre.Legendre : Legendre series\n"
  6909. "\n"
  6910. "References\n"
  6911. "----------\n"
  6912. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  6913. " Handbook of Mathematical Functions with Formulas,\n"
  6914. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  6915. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  6916. " https://dlmf.nist.gov/15.9.E7\n"
  6917. "\n"
  6918. "Examples\n"
  6919. "--------\n"
  6920. ">>> import numpy as np\n"
  6921. ">>> from scipy.special import eval_legendre\n"
  6922. "\n"
  6923. "Evaluate the zero-order Legendre polynomial at x = 0\n"
  6924. "\n"
  6925. ">>> eval_legendre(0, 0)\n"
  6926. "1.0\n"
  6927. "\n"
  6928. "Evaluate the first-order Legendre polynomial between -1 and 1\n"
  6929. "\n"
  6930. ">>> X = np.linspace(-1, 1, 5) # Domain of Legendre polynomials\n"
  6931. ">>> eval_legendre(1, X)\n"
  6932. "array([-1. , -0.5, 0. , 0.5, 1. ])\n"
  6933. "\n"
  6934. "Evaluate Legendre polynomials of order 0 through 4 at x = 0\n"
  6935. "\n"
  6936. ">>> N = range(0, 5)\n"
  6937. ">>> eval_legendre(N, 0)\n"
  6938. "array([ 1. , 0. , -0.5 , 0. , 0.375])\n"
  6939. "\n"
  6940. "Plot Legendre polynomials of order 0 through 4\n"
  6941. "\n"
  6942. ">>> X = np.linspace(-1, 1)\n"
  6943. "\n"
  6944. ">>> import matplotlib.pyplot as plt\n"
  6945. ">>> for n in range(0, 5):\n"
  6946. "... y = eval_legendre(n, X)\n"
  6947. "... plt.plot(X, y, label=r'$P_{}(x)$'.format(n))\n"
  6948. "\n"
  6949. ">>> plt.title(\"Legendre Polynomials\")\n"
  6950. ">>> plt.xlabel(\"x\")\n"
  6951. ">>> plt.ylabel(r'$P_n(x)$')\n"
  6952. ">>> plt.legend(loc='lower right')\n"
  6953. ">>> plt.show()")
  6954. ufunc_eval_legendre_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  6955. ufunc_eval_legendre_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  6956. ufunc_eval_legendre_loops[2] = <np.PyUFuncGenericFunction>loop_D_dD__As_fF_F
  6957. ufunc_eval_legendre_loops[3] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  6958. ufunc_eval_legendre_loops[4] = <np.PyUFuncGenericFunction>loop_D_dD__As_dD_D
  6959. ufunc_eval_legendre_types[0] = <char>NPY_INTP
  6960. ufunc_eval_legendre_types[1] = <char>NPY_DOUBLE
  6961. ufunc_eval_legendre_types[2] = <char>NPY_DOUBLE
  6962. ufunc_eval_legendre_types[3] = <char>NPY_FLOAT
  6963. ufunc_eval_legendre_types[4] = <char>NPY_FLOAT
  6964. ufunc_eval_legendre_types[5] = <char>NPY_FLOAT
  6965. ufunc_eval_legendre_types[6] = <char>NPY_FLOAT
  6966. ufunc_eval_legendre_types[7] = <char>NPY_CFLOAT
  6967. ufunc_eval_legendre_types[8] = <char>NPY_CFLOAT
  6968. ufunc_eval_legendre_types[9] = <char>NPY_DOUBLE
  6969. ufunc_eval_legendre_types[10] = <char>NPY_DOUBLE
  6970. ufunc_eval_legendre_types[11] = <char>NPY_DOUBLE
  6971. ufunc_eval_legendre_types[12] = <char>NPY_DOUBLE
  6972. ufunc_eval_legendre_types[13] = <char>NPY_CDOUBLE
  6973. ufunc_eval_legendre_types[14] = <char>NPY_CDOUBLE
  6974. ufunc_eval_legendre_ptr[2*0] = <void*>_func_eval_legendre_l
  6975. ufunc_eval_legendre_ptr[2*0+1] = <void*>(<char*>"eval_legendre")
  6976. ufunc_eval_legendre_ptr[2*1] = <void*>_func_eval_legendre[double]
  6977. ufunc_eval_legendre_ptr[2*1+1] = <void*>(<char*>"eval_legendre")
  6978. ufunc_eval_legendre_ptr[2*2] = <void*>_func_eval_legendre[double_complex]
  6979. ufunc_eval_legendre_ptr[2*2+1] = <void*>(<char*>"eval_legendre")
  6980. ufunc_eval_legendre_ptr[2*3] = <void*>_func_eval_legendre[double]
  6981. ufunc_eval_legendre_ptr[2*3+1] = <void*>(<char*>"eval_legendre")
  6982. ufunc_eval_legendre_ptr[2*4] = <void*>_func_eval_legendre[double_complex]
  6983. ufunc_eval_legendre_ptr[2*4+1] = <void*>(<char*>"eval_legendre")
  6984. ufunc_eval_legendre_data[0] = &ufunc_eval_legendre_ptr[2*0]
  6985. ufunc_eval_legendre_data[1] = &ufunc_eval_legendre_ptr[2*1]
  6986. ufunc_eval_legendre_data[2] = &ufunc_eval_legendre_ptr[2*2]
  6987. ufunc_eval_legendre_data[3] = &ufunc_eval_legendre_ptr[2*3]
  6988. ufunc_eval_legendre_data[4] = &ufunc_eval_legendre_ptr[2*4]
  6989. eval_legendre = np.PyUFunc_FromFuncAndData(ufunc_eval_legendre_loops, ufunc_eval_legendre_data, ufunc_eval_legendre_types, 5, 2, 1, 0, 'eval_legendre', ufunc_eval_legendre_doc, 0)
  6990. cdef np.PyUFuncGenericFunction ufunc_eval_sh_chebyt_loops[5]
  6991. cdef void *ufunc_eval_sh_chebyt_ptr[10]
  6992. cdef void *ufunc_eval_sh_chebyt_data[5]
  6993. cdef char ufunc_eval_sh_chebyt_types[15]
  6994. cdef char *ufunc_eval_sh_chebyt_doc = (
  6995. "eval_sh_chebyt(n, x, out=None)\n"
  6996. "\n"
  6997. "Evaluate shifted Chebyshev polynomial of the first kind at a\n"
  6998. "point.\n"
  6999. "\n"
  7000. "These polynomials are defined as\n"
  7001. "\n"
  7002. ".. math::\n"
  7003. "\n"
  7004. " T_n^*(x) = T_n(2x - 1)\n"
  7005. "\n"
  7006. "where :math:`T_n` is a Chebyshev polynomial of the first kind. See\n"
  7007. "22.5.14 in [AS]_ (or equivalently [DLMF]_) for details.\n"
  7008. "\n"
  7009. "Parameters\n"
  7010. "----------\n"
  7011. "n : array_like\n"
  7012. " Degree of the polynomial. If not an integer, the result is\n"
  7013. " determined via the relation to `eval_chebyt`.\n"
  7014. "x : array_like\n"
  7015. " Points at which to evaluate the shifted Chebyshev polynomial\n"
  7016. "out : ndarray, optional\n"
  7017. " Optional output array for the function values\n"
  7018. "\n"
  7019. "Returns\n"
  7020. "-------\n"
  7021. "T : scalar or ndarray\n"
  7022. " Values of the shifted Chebyshev polynomial\n"
  7023. "\n"
  7024. "See Also\n"
  7025. "--------\n"
  7026. "roots_sh_chebyt : roots and quadrature weights of shifted\n"
  7027. " Chebyshev polynomials of the first kind\n"
  7028. "sh_chebyt : shifted Chebyshev polynomial object\n"
  7029. "eval_chebyt : evaluate Chebyshev polynomials of the first kind\n"
  7030. "numpy.polynomial.chebyshev.Chebyshev : Chebyshev series\n"
  7031. "\n"
  7032. "References\n"
  7033. "----------\n"
  7034. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  7035. " Handbook of Mathematical Functions with Formulas,\n"
  7036. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  7037. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  7038. " https://dlmf.nist.gov/18.7.E7")
  7039. ufunc_eval_sh_chebyt_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  7040. ufunc_eval_sh_chebyt_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  7041. ufunc_eval_sh_chebyt_loops[2] = <np.PyUFuncGenericFunction>loop_D_dD__As_fF_F
  7042. ufunc_eval_sh_chebyt_loops[3] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  7043. ufunc_eval_sh_chebyt_loops[4] = <np.PyUFuncGenericFunction>loop_D_dD__As_dD_D
  7044. ufunc_eval_sh_chebyt_types[0] = <char>NPY_INTP
  7045. ufunc_eval_sh_chebyt_types[1] = <char>NPY_DOUBLE
  7046. ufunc_eval_sh_chebyt_types[2] = <char>NPY_DOUBLE
  7047. ufunc_eval_sh_chebyt_types[3] = <char>NPY_FLOAT
  7048. ufunc_eval_sh_chebyt_types[4] = <char>NPY_FLOAT
  7049. ufunc_eval_sh_chebyt_types[5] = <char>NPY_FLOAT
  7050. ufunc_eval_sh_chebyt_types[6] = <char>NPY_FLOAT
  7051. ufunc_eval_sh_chebyt_types[7] = <char>NPY_CFLOAT
  7052. ufunc_eval_sh_chebyt_types[8] = <char>NPY_CFLOAT
  7053. ufunc_eval_sh_chebyt_types[9] = <char>NPY_DOUBLE
  7054. ufunc_eval_sh_chebyt_types[10] = <char>NPY_DOUBLE
  7055. ufunc_eval_sh_chebyt_types[11] = <char>NPY_DOUBLE
  7056. ufunc_eval_sh_chebyt_types[12] = <char>NPY_DOUBLE
  7057. ufunc_eval_sh_chebyt_types[13] = <char>NPY_CDOUBLE
  7058. ufunc_eval_sh_chebyt_types[14] = <char>NPY_CDOUBLE
  7059. ufunc_eval_sh_chebyt_ptr[2*0] = <void*>_func_eval_sh_chebyt_l
  7060. ufunc_eval_sh_chebyt_ptr[2*0+1] = <void*>(<char*>"eval_sh_chebyt")
  7061. ufunc_eval_sh_chebyt_ptr[2*1] = <void*>_func_eval_sh_chebyt[double]
  7062. ufunc_eval_sh_chebyt_ptr[2*1+1] = <void*>(<char*>"eval_sh_chebyt")
  7063. ufunc_eval_sh_chebyt_ptr[2*2] = <void*>_func_eval_sh_chebyt[double_complex]
  7064. ufunc_eval_sh_chebyt_ptr[2*2+1] = <void*>(<char*>"eval_sh_chebyt")
  7065. ufunc_eval_sh_chebyt_ptr[2*3] = <void*>_func_eval_sh_chebyt[double]
  7066. ufunc_eval_sh_chebyt_ptr[2*3+1] = <void*>(<char*>"eval_sh_chebyt")
  7067. ufunc_eval_sh_chebyt_ptr[2*4] = <void*>_func_eval_sh_chebyt[double_complex]
  7068. ufunc_eval_sh_chebyt_ptr[2*4+1] = <void*>(<char*>"eval_sh_chebyt")
  7069. ufunc_eval_sh_chebyt_data[0] = &ufunc_eval_sh_chebyt_ptr[2*0]
  7070. ufunc_eval_sh_chebyt_data[1] = &ufunc_eval_sh_chebyt_ptr[2*1]
  7071. ufunc_eval_sh_chebyt_data[2] = &ufunc_eval_sh_chebyt_ptr[2*2]
  7072. ufunc_eval_sh_chebyt_data[3] = &ufunc_eval_sh_chebyt_ptr[2*3]
  7073. ufunc_eval_sh_chebyt_data[4] = &ufunc_eval_sh_chebyt_ptr[2*4]
  7074. eval_sh_chebyt = np.PyUFunc_FromFuncAndData(ufunc_eval_sh_chebyt_loops, ufunc_eval_sh_chebyt_data, ufunc_eval_sh_chebyt_types, 5, 2, 1, 0, 'eval_sh_chebyt', ufunc_eval_sh_chebyt_doc, 0)
  7075. cdef np.PyUFuncGenericFunction ufunc_eval_sh_chebyu_loops[5]
  7076. cdef void *ufunc_eval_sh_chebyu_ptr[10]
  7077. cdef void *ufunc_eval_sh_chebyu_data[5]
  7078. cdef char ufunc_eval_sh_chebyu_types[15]
  7079. cdef char *ufunc_eval_sh_chebyu_doc = (
  7080. "eval_sh_chebyu(n, x, out=None)\n"
  7081. "\n"
  7082. "Evaluate shifted Chebyshev polynomial of the second kind at a\n"
  7083. "point.\n"
  7084. "\n"
  7085. "These polynomials are defined as\n"
  7086. "\n"
  7087. ".. math::\n"
  7088. "\n"
  7089. " U_n^*(x) = U_n(2x - 1)\n"
  7090. "\n"
  7091. "where :math:`U_n` is a Chebyshev polynomial of the first kind. See\n"
  7092. "22.5.15 in [AS]_ (or equivalently [DLMF]_) for details.\n"
  7093. "\n"
  7094. "Parameters\n"
  7095. "----------\n"
  7096. "n : array_like\n"
  7097. " Degree of the polynomial. If not an integer, the result is\n"
  7098. " determined via the relation to `eval_chebyu`.\n"
  7099. "x : array_like\n"
  7100. " Points at which to evaluate the shifted Chebyshev polynomial\n"
  7101. "out : ndarray, optional\n"
  7102. " Optional output array for the function values\n"
  7103. "\n"
  7104. "Returns\n"
  7105. "-------\n"
  7106. "U : scalar or ndarray\n"
  7107. " Values of the shifted Chebyshev polynomial\n"
  7108. "\n"
  7109. "See Also\n"
  7110. "--------\n"
  7111. "roots_sh_chebyu : roots and quadrature weights of shifted\n"
  7112. " Chebychev polynomials of the second kind\n"
  7113. "sh_chebyu : shifted Chebyshev polynomial object\n"
  7114. "eval_chebyu : evaluate Chebyshev polynomials of the second kind\n"
  7115. "\n"
  7116. "References\n"
  7117. "----------\n"
  7118. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  7119. " Handbook of Mathematical Functions with Formulas,\n"
  7120. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  7121. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  7122. " https://dlmf.nist.gov/18.7.E8")
  7123. ufunc_eval_sh_chebyu_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  7124. ufunc_eval_sh_chebyu_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  7125. ufunc_eval_sh_chebyu_loops[2] = <np.PyUFuncGenericFunction>loop_D_dD__As_fF_F
  7126. ufunc_eval_sh_chebyu_loops[3] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  7127. ufunc_eval_sh_chebyu_loops[4] = <np.PyUFuncGenericFunction>loop_D_dD__As_dD_D
  7128. ufunc_eval_sh_chebyu_types[0] = <char>NPY_INTP
  7129. ufunc_eval_sh_chebyu_types[1] = <char>NPY_DOUBLE
  7130. ufunc_eval_sh_chebyu_types[2] = <char>NPY_DOUBLE
  7131. ufunc_eval_sh_chebyu_types[3] = <char>NPY_FLOAT
  7132. ufunc_eval_sh_chebyu_types[4] = <char>NPY_FLOAT
  7133. ufunc_eval_sh_chebyu_types[5] = <char>NPY_FLOAT
  7134. ufunc_eval_sh_chebyu_types[6] = <char>NPY_FLOAT
  7135. ufunc_eval_sh_chebyu_types[7] = <char>NPY_CFLOAT
  7136. ufunc_eval_sh_chebyu_types[8] = <char>NPY_CFLOAT
  7137. ufunc_eval_sh_chebyu_types[9] = <char>NPY_DOUBLE
  7138. ufunc_eval_sh_chebyu_types[10] = <char>NPY_DOUBLE
  7139. ufunc_eval_sh_chebyu_types[11] = <char>NPY_DOUBLE
  7140. ufunc_eval_sh_chebyu_types[12] = <char>NPY_DOUBLE
  7141. ufunc_eval_sh_chebyu_types[13] = <char>NPY_CDOUBLE
  7142. ufunc_eval_sh_chebyu_types[14] = <char>NPY_CDOUBLE
  7143. ufunc_eval_sh_chebyu_ptr[2*0] = <void*>_func_eval_sh_chebyu_l
  7144. ufunc_eval_sh_chebyu_ptr[2*0+1] = <void*>(<char*>"eval_sh_chebyu")
  7145. ufunc_eval_sh_chebyu_ptr[2*1] = <void*>_func_eval_sh_chebyu[double]
  7146. ufunc_eval_sh_chebyu_ptr[2*1+1] = <void*>(<char*>"eval_sh_chebyu")
  7147. ufunc_eval_sh_chebyu_ptr[2*2] = <void*>_func_eval_sh_chebyu[double_complex]
  7148. ufunc_eval_sh_chebyu_ptr[2*2+1] = <void*>(<char*>"eval_sh_chebyu")
  7149. ufunc_eval_sh_chebyu_ptr[2*3] = <void*>_func_eval_sh_chebyu[double]
  7150. ufunc_eval_sh_chebyu_ptr[2*3+1] = <void*>(<char*>"eval_sh_chebyu")
  7151. ufunc_eval_sh_chebyu_ptr[2*4] = <void*>_func_eval_sh_chebyu[double_complex]
  7152. ufunc_eval_sh_chebyu_ptr[2*4+1] = <void*>(<char*>"eval_sh_chebyu")
  7153. ufunc_eval_sh_chebyu_data[0] = &ufunc_eval_sh_chebyu_ptr[2*0]
  7154. ufunc_eval_sh_chebyu_data[1] = &ufunc_eval_sh_chebyu_ptr[2*1]
  7155. ufunc_eval_sh_chebyu_data[2] = &ufunc_eval_sh_chebyu_ptr[2*2]
  7156. ufunc_eval_sh_chebyu_data[3] = &ufunc_eval_sh_chebyu_ptr[2*3]
  7157. ufunc_eval_sh_chebyu_data[4] = &ufunc_eval_sh_chebyu_ptr[2*4]
  7158. eval_sh_chebyu = np.PyUFunc_FromFuncAndData(ufunc_eval_sh_chebyu_loops, ufunc_eval_sh_chebyu_data, ufunc_eval_sh_chebyu_types, 5, 2, 1, 0, 'eval_sh_chebyu', ufunc_eval_sh_chebyu_doc, 0)
  7159. cdef np.PyUFuncGenericFunction ufunc_eval_sh_jacobi_loops[5]
  7160. cdef void *ufunc_eval_sh_jacobi_ptr[10]
  7161. cdef void *ufunc_eval_sh_jacobi_data[5]
  7162. cdef char ufunc_eval_sh_jacobi_types[25]
  7163. cdef char *ufunc_eval_sh_jacobi_doc = (
  7164. "eval_sh_jacobi(n, p, q, x, out=None)\n"
  7165. "\n"
  7166. "Evaluate shifted Jacobi polynomial at a point.\n"
  7167. "\n"
  7168. "Defined by\n"
  7169. "\n"
  7170. ".. math::\n"
  7171. "\n"
  7172. " G_n^{(p, q)}(x)\n"
  7173. " = \\binom{2n + p - 1}{n}^{-1} P_n^{(p - q, q - 1)}(2x - 1),\n"
  7174. "\n"
  7175. "where :math:`P_n^{(\\cdot, \\cdot)}` is the n-th Jacobi polynomial.\n"
  7176. "See 22.5.2 in [AS]_ (or equivalently [DLMF]_) for details.\n"
  7177. "\n"
  7178. "Parameters\n"
  7179. "----------\n"
  7180. "n : int\n"
  7181. " Degree of the polynomial. If not an integer, the result is\n"
  7182. " determined via the relation to `binom` and `eval_jacobi`.\n"
  7183. "p : float\n"
  7184. " Parameter\n"
  7185. "q : float\n"
  7186. " Parameter\n"
  7187. "out : ndarray, optional\n"
  7188. " Optional output array for the function values\n"
  7189. "\n"
  7190. "Returns\n"
  7191. "-------\n"
  7192. "G : scalar or ndarray\n"
  7193. " Values of the shifted Jacobi polynomial.\n"
  7194. "\n"
  7195. "See Also\n"
  7196. "--------\n"
  7197. "roots_sh_jacobi : roots and quadrature weights of shifted Jacobi\n"
  7198. " polynomials\n"
  7199. "sh_jacobi : shifted Jacobi polynomial object\n"
  7200. "eval_jacobi : evaluate Jacobi polynomials\n"
  7201. "\n"
  7202. "References\n"
  7203. "----------\n"
  7204. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  7205. " Handbook of Mathematical Functions with Formulas,\n"
  7206. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  7207. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  7208. " https://dlmf.nist.gov/18.1.E2")
  7209. ufunc_eval_sh_jacobi_loops[0] = <np.PyUFuncGenericFunction>loop_d_pddd__As_pddd_d
  7210. ufunc_eval_sh_jacobi_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_ffff_f
  7211. ufunc_eval_sh_jacobi_loops[2] = <np.PyUFuncGenericFunction>loop_D_dddD__As_fffF_F
  7212. ufunc_eval_sh_jacobi_loops[3] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  7213. ufunc_eval_sh_jacobi_loops[4] = <np.PyUFuncGenericFunction>loop_D_dddD__As_dddD_D
  7214. ufunc_eval_sh_jacobi_types[0] = <char>NPY_INTP
  7215. ufunc_eval_sh_jacobi_types[1] = <char>NPY_DOUBLE
  7216. ufunc_eval_sh_jacobi_types[2] = <char>NPY_DOUBLE
  7217. ufunc_eval_sh_jacobi_types[3] = <char>NPY_DOUBLE
  7218. ufunc_eval_sh_jacobi_types[4] = <char>NPY_DOUBLE
  7219. ufunc_eval_sh_jacobi_types[5] = <char>NPY_FLOAT
  7220. ufunc_eval_sh_jacobi_types[6] = <char>NPY_FLOAT
  7221. ufunc_eval_sh_jacobi_types[7] = <char>NPY_FLOAT
  7222. ufunc_eval_sh_jacobi_types[8] = <char>NPY_FLOAT
  7223. ufunc_eval_sh_jacobi_types[9] = <char>NPY_FLOAT
  7224. ufunc_eval_sh_jacobi_types[10] = <char>NPY_FLOAT
  7225. ufunc_eval_sh_jacobi_types[11] = <char>NPY_FLOAT
  7226. ufunc_eval_sh_jacobi_types[12] = <char>NPY_FLOAT
  7227. ufunc_eval_sh_jacobi_types[13] = <char>NPY_CFLOAT
  7228. ufunc_eval_sh_jacobi_types[14] = <char>NPY_CFLOAT
  7229. ufunc_eval_sh_jacobi_types[15] = <char>NPY_DOUBLE
  7230. ufunc_eval_sh_jacobi_types[16] = <char>NPY_DOUBLE
  7231. ufunc_eval_sh_jacobi_types[17] = <char>NPY_DOUBLE
  7232. ufunc_eval_sh_jacobi_types[18] = <char>NPY_DOUBLE
  7233. ufunc_eval_sh_jacobi_types[19] = <char>NPY_DOUBLE
  7234. ufunc_eval_sh_jacobi_types[20] = <char>NPY_DOUBLE
  7235. ufunc_eval_sh_jacobi_types[21] = <char>NPY_DOUBLE
  7236. ufunc_eval_sh_jacobi_types[22] = <char>NPY_DOUBLE
  7237. ufunc_eval_sh_jacobi_types[23] = <char>NPY_CDOUBLE
  7238. ufunc_eval_sh_jacobi_types[24] = <char>NPY_CDOUBLE
  7239. ufunc_eval_sh_jacobi_ptr[2*0] = <void*>_func_eval_sh_jacobi_l
  7240. ufunc_eval_sh_jacobi_ptr[2*0+1] = <void*>(<char*>"eval_sh_jacobi")
  7241. ufunc_eval_sh_jacobi_ptr[2*1] = <void*>_func_eval_sh_jacobi[double]
  7242. ufunc_eval_sh_jacobi_ptr[2*1+1] = <void*>(<char*>"eval_sh_jacobi")
  7243. ufunc_eval_sh_jacobi_ptr[2*2] = <void*>_func_eval_sh_jacobi[double_complex]
  7244. ufunc_eval_sh_jacobi_ptr[2*2+1] = <void*>(<char*>"eval_sh_jacobi")
  7245. ufunc_eval_sh_jacobi_ptr[2*3] = <void*>_func_eval_sh_jacobi[double]
  7246. ufunc_eval_sh_jacobi_ptr[2*3+1] = <void*>(<char*>"eval_sh_jacobi")
  7247. ufunc_eval_sh_jacobi_ptr[2*4] = <void*>_func_eval_sh_jacobi[double_complex]
  7248. ufunc_eval_sh_jacobi_ptr[2*4+1] = <void*>(<char*>"eval_sh_jacobi")
  7249. ufunc_eval_sh_jacobi_data[0] = &ufunc_eval_sh_jacobi_ptr[2*0]
  7250. ufunc_eval_sh_jacobi_data[1] = &ufunc_eval_sh_jacobi_ptr[2*1]
  7251. ufunc_eval_sh_jacobi_data[2] = &ufunc_eval_sh_jacobi_ptr[2*2]
  7252. ufunc_eval_sh_jacobi_data[3] = &ufunc_eval_sh_jacobi_ptr[2*3]
  7253. ufunc_eval_sh_jacobi_data[4] = &ufunc_eval_sh_jacobi_ptr[2*4]
  7254. eval_sh_jacobi = np.PyUFunc_FromFuncAndData(ufunc_eval_sh_jacobi_loops, ufunc_eval_sh_jacobi_data, ufunc_eval_sh_jacobi_types, 5, 4, 1, 0, 'eval_sh_jacobi', ufunc_eval_sh_jacobi_doc, 0)
  7255. cdef np.PyUFuncGenericFunction ufunc_eval_sh_legendre_loops[5]
  7256. cdef void *ufunc_eval_sh_legendre_ptr[10]
  7257. cdef void *ufunc_eval_sh_legendre_data[5]
  7258. cdef char ufunc_eval_sh_legendre_types[15]
  7259. cdef char *ufunc_eval_sh_legendre_doc = (
  7260. "eval_sh_legendre(n, x, out=None)\n"
  7261. "\n"
  7262. "Evaluate shifted Legendre polynomial at a point.\n"
  7263. "\n"
  7264. "These polynomials are defined as\n"
  7265. "\n"
  7266. ".. math::\n"
  7267. "\n"
  7268. " P_n^*(x) = P_n(2x - 1)\n"
  7269. "\n"
  7270. "where :math:`P_n` is a Legendre polynomial. See 2.2.11 in [AS]_\n"
  7271. "or [DLMF]_ for details.\n"
  7272. "\n"
  7273. "Parameters\n"
  7274. "----------\n"
  7275. "n : array_like\n"
  7276. " Degree of the polynomial. If not an integer, the value is\n"
  7277. " determined via the relation to `eval_legendre`.\n"
  7278. "x : array_like\n"
  7279. " Points at which to evaluate the shifted Legendre polynomial\n"
  7280. "out : ndarray, optional\n"
  7281. " Optional output array for the function values\n"
  7282. "\n"
  7283. "Returns\n"
  7284. "-------\n"
  7285. "P : scalar or ndarray\n"
  7286. " Values of the shifted Legendre polynomial\n"
  7287. "\n"
  7288. "See Also\n"
  7289. "--------\n"
  7290. "roots_sh_legendre : roots and quadrature weights of shifted\n"
  7291. " Legendre polynomials\n"
  7292. "sh_legendre : shifted Legendre polynomial object\n"
  7293. "eval_legendre : evaluate Legendre polynomials\n"
  7294. "numpy.polynomial.legendre.Legendre : Legendre series\n"
  7295. "\n"
  7296. "References\n"
  7297. "----------\n"
  7298. ".. [AS] Milton Abramowitz and Irene A. Stegun, eds.\n"
  7299. " Handbook of Mathematical Functions with Formulas,\n"
  7300. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  7301. ".. [DLMF] NIST Digital Library of Mathematical Functions,\n"
  7302. " https://dlmf.nist.gov/18.7.E10")
  7303. ufunc_eval_sh_legendre_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  7304. ufunc_eval_sh_legendre_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  7305. ufunc_eval_sh_legendre_loops[2] = <np.PyUFuncGenericFunction>loop_D_dD__As_fF_F
  7306. ufunc_eval_sh_legendre_loops[3] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  7307. ufunc_eval_sh_legendre_loops[4] = <np.PyUFuncGenericFunction>loop_D_dD__As_dD_D
  7308. ufunc_eval_sh_legendre_types[0] = <char>NPY_INTP
  7309. ufunc_eval_sh_legendre_types[1] = <char>NPY_DOUBLE
  7310. ufunc_eval_sh_legendre_types[2] = <char>NPY_DOUBLE
  7311. ufunc_eval_sh_legendre_types[3] = <char>NPY_FLOAT
  7312. ufunc_eval_sh_legendre_types[4] = <char>NPY_FLOAT
  7313. ufunc_eval_sh_legendre_types[5] = <char>NPY_FLOAT
  7314. ufunc_eval_sh_legendre_types[6] = <char>NPY_FLOAT
  7315. ufunc_eval_sh_legendre_types[7] = <char>NPY_CFLOAT
  7316. ufunc_eval_sh_legendre_types[8] = <char>NPY_CFLOAT
  7317. ufunc_eval_sh_legendre_types[9] = <char>NPY_DOUBLE
  7318. ufunc_eval_sh_legendre_types[10] = <char>NPY_DOUBLE
  7319. ufunc_eval_sh_legendre_types[11] = <char>NPY_DOUBLE
  7320. ufunc_eval_sh_legendre_types[12] = <char>NPY_DOUBLE
  7321. ufunc_eval_sh_legendre_types[13] = <char>NPY_CDOUBLE
  7322. ufunc_eval_sh_legendre_types[14] = <char>NPY_CDOUBLE
  7323. ufunc_eval_sh_legendre_ptr[2*0] = <void*>_func_eval_sh_legendre_l
  7324. ufunc_eval_sh_legendre_ptr[2*0+1] = <void*>(<char*>"eval_sh_legendre")
  7325. ufunc_eval_sh_legendre_ptr[2*1] = <void*>_func_eval_sh_legendre[double]
  7326. ufunc_eval_sh_legendre_ptr[2*1+1] = <void*>(<char*>"eval_sh_legendre")
  7327. ufunc_eval_sh_legendre_ptr[2*2] = <void*>_func_eval_sh_legendre[double_complex]
  7328. ufunc_eval_sh_legendre_ptr[2*2+1] = <void*>(<char*>"eval_sh_legendre")
  7329. ufunc_eval_sh_legendre_ptr[2*3] = <void*>_func_eval_sh_legendre[double]
  7330. ufunc_eval_sh_legendre_ptr[2*3+1] = <void*>(<char*>"eval_sh_legendre")
  7331. ufunc_eval_sh_legendre_ptr[2*4] = <void*>_func_eval_sh_legendre[double_complex]
  7332. ufunc_eval_sh_legendre_ptr[2*4+1] = <void*>(<char*>"eval_sh_legendre")
  7333. ufunc_eval_sh_legendre_data[0] = &ufunc_eval_sh_legendre_ptr[2*0]
  7334. ufunc_eval_sh_legendre_data[1] = &ufunc_eval_sh_legendre_ptr[2*1]
  7335. ufunc_eval_sh_legendre_data[2] = &ufunc_eval_sh_legendre_ptr[2*2]
  7336. ufunc_eval_sh_legendre_data[3] = &ufunc_eval_sh_legendre_ptr[2*3]
  7337. ufunc_eval_sh_legendre_data[4] = &ufunc_eval_sh_legendre_ptr[2*4]
  7338. eval_sh_legendre = np.PyUFunc_FromFuncAndData(ufunc_eval_sh_legendre_loops, ufunc_eval_sh_legendre_data, ufunc_eval_sh_legendre_types, 5, 2, 1, 0, 'eval_sh_legendre', ufunc_eval_sh_legendre_doc, 0)
  7339. cdef np.PyUFuncGenericFunction ufunc_expn_loops[3]
  7340. cdef void *ufunc_expn_ptr[6]
  7341. cdef void *ufunc_expn_data[3]
  7342. cdef char ufunc_expn_types[9]
  7343. cdef char *ufunc_expn_doc = (
  7344. "expn(n, x, out=None)\n"
  7345. "\n"
  7346. "Generalized exponential integral En.\n"
  7347. "\n"
  7348. "For integer :math:`n \\geq 0` and real :math:`x \\geq 0` the\n"
  7349. "generalized exponential integral is defined as [DLMF]_\n"
  7350. "\n"
  7351. ".. math::\n"
  7352. "\n"
  7353. " E_n(x) = x^{n - 1} \\int_x^\\infty \\frac{e^{-t}}{t^n} dt.\n"
  7354. "\n"
  7355. "Parameters\n"
  7356. "----------\n"
  7357. "n : array_like\n"
  7358. " Non-negative integers\n"
  7359. "x : array_like\n"
  7360. " Real argument\n"
  7361. "out : ndarray, optional\n"
  7362. " Optional output array for the function results\n"
  7363. "\n"
  7364. "Returns\n"
  7365. "-------\n"
  7366. "scalar or ndarray\n"
  7367. " Values of the generalized exponential integral\n"
  7368. "\n"
  7369. "See Also\n"
  7370. "--------\n"
  7371. "exp1 : special case of :math:`E_n` for :math:`n = 1`\n"
  7372. "expi : related to :math:`E_n` when :math:`n = 1`\n"
  7373. "\n"
  7374. "References\n"
  7375. "----------\n"
  7376. ".. [DLMF] Digital Library of Mathematical Functions, 8.19.2\n"
  7377. " https://dlmf.nist.gov/8.19#E2\n"
  7378. "\n"
  7379. "Examples\n"
  7380. "--------\n"
  7381. ">>> import numpy as np\n"
  7382. ">>> import scipy.special as sc\n"
  7383. "\n"
  7384. "Its domain is nonnegative n and x.\n"
  7385. "\n"
  7386. ">>> sc.expn(-1, 1.0), sc.expn(1, -1.0)\n"
  7387. "(nan, nan)\n"
  7388. "\n"
  7389. "It has a pole at ``x = 0`` for ``n = 1, 2``; for larger ``n`` it\n"
  7390. "is equal to ``1 / (n - 1)``.\n"
  7391. "\n"
  7392. ">>> sc.expn([0, 1, 2, 3, 4], 0)\n"
  7393. "array([ inf, inf, 1. , 0.5 , 0.33333333])\n"
  7394. "\n"
  7395. "For n equal to 0 it reduces to ``exp(-x) / x``.\n"
  7396. "\n"
  7397. ">>> x = np.array([1, 2, 3, 4])\n"
  7398. ">>> sc.expn(0, x)\n"
  7399. "array([0.36787944, 0.06766764, 0.01659569, 0.00457891])\n"
  7400. ">>> np.exp(-x) / x\n"
  7401. "array([0.36787944, 0.06766764, 0.01659569, 0.00457891])\n"
  7402. "\n"
  7403. "For n equal to 1 it reduces to `exp1`.\n"
  7404. "\n"
  7405. ">>> sc.expn(1, x)\n"
  7406. "array([0.21938393, 0.04890051, 0.01304838, 0.00377935])\n"
  7407. ">>> sc.exp1(x)\n"
  7408. "array([0.21938393, 0.04890051, 0.01304838, 0.00377935])")
  7409. ufunc_expn_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  7410. ufunc_expn_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  7411. ufunc_expn_loops[2] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  7412. ufunc_expn_types[0] = <char>NPY_INTP
  7413. ufunc_expn_types[1] = <char>NPY_DOUBLE
  7414. ufunc_expn_types[2] = <char>NPY_DOUBLE
  7415. ufunc_expn_types[3] = <char>NPY_FLOAT
  7416. ufunc_expn_types[4] = <char>NPY_FLOAT
  7417. ufunc_expn_types[5] = <char>NPY_FLOAT
  7418. ufunc_expn_types[6] = <char>NPY_DOUBLE
  7419. ufunc_expn_types[7] = <char>NPY_DOUBLE
  7420. ufunc_expn_types[8] = <char>NPY_DOUBLE
  7421. ufunc_expn_ptr[2*0] = <void*>_func_cephes_expn_wrap
  7422. ufunc_expn_ptr[2*0+1] = <void*>(<char*>"expn")
  7423. ufunc_expn_ptr[2*1] = <void*>_func_expn_unsafe
  7424. ufunc_expn_ptr[2*1+1] = <void*>(<char*>"expn")
  7425. ufunc_expn_ptr[2*2] = <void*>_func_expn_unsafe
  7426. ufunc_expn_ptr[2*2+1] = <void*>(<char*>"expn")
  7427. ufunc_expn_data[0] = &ufunc_expn_ptr[2*0]
  7428. ufunc_expn_data[1] = &ufunc_expn_ptr[2*1]
  7429. ufunc_expn_data[2] = &ufunc_expn_ptr[2*2]
  7430. expn = np.PyUFunc_FromFuncAndData(ufunc_expn_loops, ufunc_expn_data, ufunc_expn_types, 3, 2, 1, 0, 'expn', ufunc_expn_doc, 0)
  7431. cdef np.PyUFuncGenericFunction ufunc_fdtr_loops[2]
  7432. cdef void *ufunc_fdtr_ptr[4]
  7433. cdef void *ufunc_fdtr_data[2]
  7434. cdef char ufunc_fdtr_types[8]
  7435. cdef char *ufunc_fdtr_doc = (
  7436. "fdtr(dfn, dfd, x, out=None)\n"
  7437. "\n"
  7438. "F cumulative distribution function.\n"
  7439. "\n"
  7440. "Returns the value of the cumulative distribution function of the\n"
  7441. "F-distribution, also known as Snedecor's F-distribution or the\n"
  7442. "Fisher-Snedecor distribution.\n"
  7443. "\n"
  7444. "The F-distribution with parameters :math:`d_n` and :math:`d_d` is the\n"
  7445. "distribution of the random variable,\n"
  7446. "\n"
  7447. ".. math::\n"
  7448. " X = \\frac{U_n/d_n}{U_d/d_d},\n"
  7449. "\n"
  7450. "where :math:`U_n` and :math:`U_d` are random variables distributed\n"
  7451. ":math:`\\chi^2`, with :math:`d_n` and :math:`d_d` degrees of freedom,\n"
  7452. "respectively.\n"
  7453. "\n"
  7454. "Parameters\n"
  7455. "----------\n"
  7456. "dfn : array_like\n"
  7457. " First parameter (positive float).\n"
  7458. "dfd : array_like\n"
  7459. " Second parameter (positive float).\n"
  7460. "x : array_like\n"
  7461. " Argument (nonnegative float).\n"
  7462. "out : ndarray, optional\n"
  7463. " Optional output array for the function values\n"
  7464. "\n"
  7465. "Returns\n"
  7466. "-------\n"
  7467. "y : scalar or ndarray\n"
  7468. " The CDF of the F-distribution with parameters `dfn` and `dfd` at `x`.\n"
  7469. "\n"
  7470. "See Also\n"
  7471. "--------\n"
  7472. "fdtrc : F distribution survival function\n"
  7473. "fdtri : F distribution inverse cumulative distribution\n"
  7474. "scipy.stats.f : F distribution\n"
  7475. "\n"
  7476. "Notes\n"
  7477. "-----\n"
  7478. "The regularized incomplete beta function is used, according to the\n"
  7479. "formula,\n"
  7480. "\n"
  7481. ".. math::\n"
  7482. " F(d_n, d_d; x) = I_{xd_n/(d_d + xd_n)}(d_n/2, d_d/2).\n"
  7483. "\n"
  7484. "Wrapper for a routine from the Boost Math C++ library [1]_. The\n"
  7485. "F distribution is also available as `scipy.stats.f`. Calling\n"
  7486. "`fdtr` directly can improve performance compared to the ``cdf``\n"
  7487. "method of `scipy.stats.f` (see last example below).\n"
  7488. "\n"
  7489. "References\n"
  7490. "----------\n"
  7491. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  7492. "\n"
  7493. "\n"
  7494. "Examples\n"
  7495. "--------\n"
  7496. "Calculate the function for ``dfn=1`` and ``dfd=2`` at ``x=1``.\n"
  7497. "\n"
  7498. ">>> import numpy as np\n"
  7499. ">>> from scipy.special import fdtr\n"
  7500. ">>> fdtr(1, 2, 1)\n"
  7501. "0.5773502691896258\n"
  7502. "\n"
  7503. "Calculate the function at several points by providing a NumPy array for\n"
  7504. "`x`.\n"
  7505. "\n"
  7506. ">>> x = np.array([0.5, 2., 3.])\n"
  7507. ">>> fdtr(1, 2, x)\n"
  7508. "array([0.4472136 , 0.70710678, 0.77459667])\n"
  7509. "\n"
  7510. "Plot the function for several parameter sets.\n"
  7511. "\n"
  7512. ">>> import matplotlib.pyplot as plt\n"
  7513. ">>> dfn_parameters = [1, 5, 10, 50]\n"
  7514. ">>> dfd_parameters = [1, 1, 2, 3]\n"
  7515. ">>> linestyles = ['solid', 'dashed', 'dotted', 'dashdot']\n"
  7516. ">>> parameters_list = list(zip(dfn_parameters, dfd_parameters,\n"
  7517. "... linestyles))\n"
  7518. ">>> x = np.linspace(0, 30, 1000)\n"
  7519. ">>> fig, ax = plt.subplots()\n"
  7520. ">>> for parameter_set in parameters_list:\n"
  7521. "... dfn, dfd, style = parameter_set\n"
  7522. "... fdtr_vals = fdtr(dfn, dfd, x)\n"
  7523. "... ax.plot(x, fdtr_vals, label=rf\"$d_n={dfn},\\, d_d={dfd}$\",\n"
  7524. "... ls=style)\n"
  7525. ">>> ax.legend()\n"
  7526. ">>> ax.set_xlabel(\"$x$\")\n"
  7527. ">>> ax.set_title(\"F distribution cumulative distribution function\")\n"
  7528. ">>> plt.show()\n"
  7529. "\n"
  7530. "The F distribution is also available as `scipy.stats.f`. Using `fdtr`\n"
  7531. "directly can be much faster than calling the ``cdf`` method of\n"
  7532. "`scipy.stats.f`, especially for small arrays or individual values.\n"
  7533. "To get the same results one must use the following parametrization:\n"
  7534. "``stats.f(dfn, dfd).cdf(x)=fdtr(dfn, dfd, x)``.\n"
  7535. "\n"
  7536. ">>> from scipy.stats import f\n"
  7537. ">>> dfn, dfd = 1, 2\n"
  7538. ">>> x = 1\n"
  7539. ">>> fdtr_res = fdtr(dfn, dfd, x) # this will often be faster than below\n"
  7540. ">>> f_dist_res = f(dfn, dfd).cdf(x)\n"
  7541. ">>> fdtr_res == f_dist_res # test that results are equal\n"
  7542. "True")
  7543. ufunc_fdtr_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  7544. ufunc_fdtr_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  7545. ufunc_fdtr_types[0] = <char>NPY_FLOAT
  7546. ufunc_fdtr_types[1] = <char>NPY_FLOAT
  7547. ufunc_fdtr_types[2] = <char>NPY_FLOAT
  7548. ufunc_fdtr_types[3] = <char>NPY_FLOAT
  7549. ufunc_fdtr_types[4] = <char>NPY_DOUBLE
  7550. ufunc_fdtr_types[5] = <char>NPY_DOUBLE
  7551. ufunc_fdtr_types[6] = <char>NPY_DOUBLE
  7552. ufunc_fdtr_types[7] = <char>NPY_DOUBLE
  7553. ufunc_fdtr_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_f_cdf_float
  7554. ufunc_fdtr_ptr[2*0+1] = <void*>(<char*>"fdtr")
  7555. ufunc_fdtr_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_f_cdf_double
  7556. ufunc_fdtr_ptr[2*1+1] = <void*>(<char*>"fdtr")
  7557. ufunc_fdtr_data[0] = &ufunc_fdtr_ptr[2*0]
  7558. ufunc_fdtr_data[1] = &ufunc_fdtr_ptr[2*1]
  7559. fdtr = np.PyUFunc_FromFuncAndData(ufunc_fdtr_loops, ufunc_fdtr_data, ufunc_fdtr_types, 2, 3, 1, 0, 'fdtr', ufunc_fdtr_doc, 0)
  7560. cdef np.PyUFuncGenericFunction ufunc_fdtrc_loops[2]
  7561. cdef void *ufunc_fdtrc_ptr[4]
  7562. cdef void *ufunc_fdtrc_data[2]
  7563. cdef char ufunc_fdtrc_types[8]
  7564. cdef char *ufunc_fdtrc_doc = (
  7565. "fdtrc(dfn, dfd, x, out=None)\n"
  7566. "\n"
  7567. "F survival function.\n"
  7568. "\n"
  7569. "Returns the complemented F-distribution function (the integral of the\n"
  7570. "density from `x` to infinity).\n"
  7571. "\n"
  7572. "Parameters\n"
  7573. "----------\n"
  7574. "dfn : array_like\n"
  7575. " First parameter (positive float).\n"
  7576. "dfd : array_like\n"
  7577. " Second parameter (positive float).\n"
  7578. "x : array_like\n"
  7579. " Argument (nonnegative float).\n"
  7580. "out : ndarray, optional\n"
  7581. " Optional output array for the function values\n"
  7582. "\n"
  7583. "Returns\n"
  7584. "-------\n"
  7585. "y : scalar or ndarray\n"
  7586. " The complemented F-distribution function with parameters `dfn` and\n"
  7587. " `dfd` at `x`.\n"
  7588. "\n"
  7589. "See Also\n"
  7590. "--------\n"
  7591. "fdtr : F distribution cumulative distribution function\n"
  7592. "fdtri : F distribution inverse cumulative distribution function\n"
  7593. "scipy.stats.f : F distribution\n"
  7594. "\n"
  7595. "Notes\n"
  7596. "-----\n"
  7597. "The regularized incomplete beta function is used, according to the\n"
  7598. "formula,\n"
  7599. "\n"
  7600. ".. math::\n"
  7601. " F(d_n, d_d; x) = I_{d_d/(d_d + xd_n)}(d_d/2, d_n/2).\n"
  7602. "\n"
  7603. "Wrapper for a routine from the Boost Math C++ library [1]_. The\n"
  7604. "F distribution is also available as `scipy.stats.f`. Calling\n"
  7605. "`fdtrc` directly can improve performance compared to the ``sf``\n"
  7606. "method of `scipy.stats.f` (see last example below).\n"
  7607. "\n"
  7608. "References\n"
  7609. "----------\n"
  7610. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  7611. "\n"
  7612. "Examples\n"
  7613. "--------\n"
  7614. "Calculate the function for ``dfn=1`` and ``dfd=2`` at ``x=1``.\n"
  7615. "\n"
  7616. ">>> import numpy as np\n"
  7617. ">>> from scipy.special import fdtrc\n"
  7618. ">>> fdtrc(1, 2, 1)\n"
  7619. "0.42264973081037427\n"
  7620. "\n"
  7621. "Calculate the function at several points by providing a NumPy array for\n"
  7622. "`x`.\n"
  7623. "\n"
  7624. ">>> x = np.array([0.5, 2., 3.])\n"
  7625. ">>> fdtrc(1, 2, x)\n"
  7626. "array([0.5527864 , 0.29289322, 0.22540333])\n"
  7627. "\n"
  7628. "Plot the function for several parameter sets.\n"
  7629. "\n"
  7630. ">>> import matplotlib.pyplot as plt\n"
  7631. ">>> dfn_parameters = [1, 5, 10, 50]\n"
  7632. ">>> dfd_parameters = [1, 1, 2, 3]\n"
  7633. ">>> linestyles = ['solid', 'dashed', 'dotted', 'dashdot']\n"
  7634. ">>> parameters_list = list(zip(dfn_parameters, dfd_parameters,\n"
  7635. "... linestyles))\n"
  7636. ">>> x = np.linspace(0, 30, 1000)\n"
  7637. ">>> fig, ax = plt.subplots()\n"
  7638. ">>> for parameter_set in parameters_list:\n"
  7639. "... dfn, dfd, style = parameter_set\n"
  7640. "... fdtrc_vals = fdtrc(dfn, dfd, x)\n"
  7641. "... ax.plot(x, fdtrc_vals, label=rf\"$d_n={dfn},\\, d_d={dfd}$\",\n"
  7642. "... ls=style)\n"
  7643. ">>> ax.legend()\n"
  7644. ">>> ax.set_xlabel(\"$x$\")\n"
  7645. ">>> ax.set_title(\"F distribution survival function\")\n"
  7646. ">>> plt.show()\n"
  7647. "\n"
  7648. "The F distribution is also available as `scipy.stats.f`. Using `fdtrc`\n"
  7649. "directly can be much faster than calling the ``sf`` method of\n"
  7650. "`scipy.stats.f`, especially for small arrays or individual values.\n"
  7651. "To get the same results one must use the following parametrization:\n"
  7652. "``stats.f(dfn, dfd).sf(x)=fdtrc(dfn, dfd, x)``.\n"
  7653. "\n"
  7654. ">>> from scipy.stats import f\n"
  7655. ">>> dfn, dfd = 1, 2\n"
  7656. ">>> x = 1\n"
  7657. ">>> fdtrc_res = fdtrc(dfn, dfd, x) # this will often be faster than below\n"
  7658. ">>> f_dist_res = f(dfn, dfd).sf(x)\n"
  7659. ">>> f_dist_res == fdtrc_res # test that results are equal\n"
  7660. "True")
  7661. ufunc_fdtrc_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  7662. ufunc_fdtrc_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  7663. ufunc_fdtrc_types[0] = <char>NPY_FLOAT
  7664. ufunc_fdtrc_types[1] = <char>NPY_FLOAT
  7665. ufunc_fdtrc_types[2] = <char>NPY_FLOAT
  7666. ufunc_fdtrc_types[3] = <char>NPY_FLOAT
  7667. ufunc_fdtrc_types[4] = <char>NPY_DOUBLE
  7668. ufunc_fdtrc_types[5] = <char>NPY_DOUBLE
  7669. ufunc_fdtrc_types[6] = <char>NPY_DOUBLE
  7670. ufunc_fdtrc_types[7] = <char>NPY_DOUBLE
  7671. ufunc_fdtrc_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_f_sf_float
  7672. ufunc_fdtrc_ptr[2*0+1] = <void*>(<char*>"fdtrc")
  7673. ufunc_fdtrc_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_f_sf_double
  7674. ufunc_fdtrc_ptr[2*1+1] = <void*>(<char*>"fdtrc")
  7675. ufunc_fdtrc_data[0] = &ufunc_fdtrc_ptr[2*0]
  7676. ufunc_fdtrc_data[1] = &ufunc_fdtrc_ptr[2*1]
  7677. fdtrc = np.PyUFunc_FromFuncAndData(ufunc_fdtrc_loops, ufunc_fdtrc_data, ufunc_fdtrc_types, 2, 3, 1, 0, 'fdtrc', ufunc_fdtrc_doc, 0)
  7678. cdef np.PyUFuncGenericFunction ufunc_fdtri_loops[2]
  7679. cdef void *ufunc_fdtri_ptr[4]
  7680. cdef void *ufunc_fdtri_data[2]
  7681. cdef char ufunc_fdtri_types[8]
  7682. cdef char *ufunc_fdtri_doc = (
  7683. "fdtri(dfn, dfd, p, out=None)\n"
  7684. "\n"
  7685. "The `p`-th quantile of the F-distribution.\n"
  7686. "\n"
  7687. "This function is the inverse of the F-distribution CDF, `fdtr`, returning\n"
  7688. "the `x` such that `fdtr(dfn, dfd, x) = p`.\n"
  7689. "\n"
  7690. "Parameters\n"
  7691. "----------\n"
  7692. "dfn : array_like\n"
  7693. " First parameter (positive float).\n"
  7694. "dfd : array_like\n"
  7695. " Second parameter (positive float).\n"
  7696. "p : array_like\n"
  7697. " Cumulative probability, in [0, 1].\n"
  7698. "out : ndarray, optional\n"
  7699. " Optional output array for the function values\n"
  7700. "\n"
  7701. "Returns\n"
  7702. "-------\n"
  7703. "x : scalar or ndarray\n"
  7704. " The quantile corresponding to `p`.\n"
  7705. "\n"
  7706. "See Also\n"
  7707. "--------\n"
  7708. "fdtr : F distribution cumulative distribution function\n"
  7709. "fdtrc : F distribution survival function\n"
  7710. "scipy.stats.f : F distribution\n"
  7711. "\n"
  7712. "Notes\n"
  7713. "-----\n"
  7714. "Wrapper for a routine from the Boost Math C++ library [1]_. The\n"
  7715. "F distribution is also available as `scipy.stats.f`. Calling\n"
  7716. "`fdtri` directly can improve performance compared to the ``ppf``\n"
  7717. "method of `scipy.stats.f` (see last example below).\n"
  7718. "\n"
  7719. "References\n"
  7720. "----------\n"
  7721. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  7722. "\n"
  7723. "Examples\n"
  7724. "--------\n"
  7725. "`fdtri` represents the inverse of the F distribution CDF which is\n"
  7726. "available as `fdtr`. Here, we calculate the CDF for ``df1=1``, ``df2=2``\n"
  7727. "at ``x=3``. `fdtri` then returns ``3`` given the same values for `df1`,\n"
  7728. "`df2` and the computed CDF value.\n"
  7729. "\n"
  7730. ">>> import numpy as np\n"
  7731. ">>> from scipy.special import fdtri, fdtr\n"
  7732. ">>> df1, df2 = 1, 2\n"
  7733. ">>> x = 3\n"
  7734. ">>> cdf_value = fdtr(df1, df2, x)\n"
  7735. ">>> fdtri(df1, df2, cdf_value)\n"
  7736. "3.000000000000006\n"
  7737. "\n"
  7738. "Calculate the function at several points by providing a NumPy array for\n"
  7739. "`x`.\n"
  7740. "\n"
  7741. ">>> x = np.array([0.1, 0.4, 0.7])\n"
  7742. ">>> fdtri(1, 2, x)\n"
  7743. "array([0.02020202, 0.38095238, 1.92156863])\n"
  7744. "\n"
  7745. "Plot the function for several parameter sets.\n"
  7746. "\n"
  7747. ">>> import matplotlib.pyplot as plt\n"
  7748. ">>> dfn_parameters = [50, 10, 1, 50]\n"
  7749. ">>> dfd_parameters = [0.5, 1, 1, 5]\n"
  7750. ">>> linestyles = ['solid', 'dashed', 'dotted', 'dashdot']\n"
  7751. ">>> parameters_list = list(zip(dfn_parameters, dfd_parameters,\n"
  7752. "... linestyles))\n"
  7753. ">>> x = np.linspace(0, 1, 1000)\n"
  7754. ">>> fig, ax = plt.subplots()\n"
  7755. ">>> for parameter_set in parameters_list:\n"
  7756. "... dfn, dfd, style = parameter_set\n"
  7757. "... fdtri_vals = fdtri(dfn, dfd, x)\n"
  7758. "... ax.plot(x, fdtri_vals, label=rf\"$d_n={dfn},\\, d_d={dfd}$\",\n"
  7759. "... ls=style)\n"
  7760. ">>> ax.legend()\n"
  7761. ">>> ax.set_xlabel(\"$x$\")\n"
  7762. ">>> title = \"F distribution inverse cumulative distribution function\"\n"
  7763. ">>> ax.set_title(title)\n"
  7764. ">>> ax.set_ylim(0, 30)\n"
  7765. ">>> plt.show()\n"
  7766. "\n"
  7767. "The F distribution is also available as `scipy.stats.f`. Using `fdtri`\n"
  7768. "directly can be much faster than calling the ``ppf`` method of\n"
  7769. "`scipy.stats.f`, especially for small arrays or individual values.\n"
  7770. "To get the same results one must use the following parametrization:\n"
  7771. "``stats.f(dfn, dfd).ppf(x)=fdtri(dfn, dfd, x)``.\n"
  7772. "\n"
  7773. ">>> from scipy.stats import f\n"
  7774. ">>> dfn, dfd = 1, 2\n"
  7775. ">>> x = 0.7\n"
  7776. ">>> fdtri_res = fdtri(dfn, dfd, x) # this will often be faster than below\n"
  7777. ">>> f_dist_res = f(dfn, dfd).ppf(x)\n"
  7778. ">>> f_dist_res == fdtri_res # test that results are equal\n"
  7779. "True")
  7780. ufunc_fdtri_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  7781. ufunc_fdtri_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  7782. ufunc_fdtri_types[0] = <char>NPY_FLOAT
  7783. ufunc_fdtri_types[1] = <char>NPY_FLOAT
  7784. ufunc_fdtri_types[2] = <char>NPY_FLOAT
  7785. ufunc_fdtri_types[3] = <char>NPY_FLOAT
  7786. ufunc_fdtri_types[4] = <char>NPY_DOUBLE
  7787. ufunc_fdtri_types[5] = <char>NPY_DOUBLE
  7788. ufunc_fdtri_types[6] = <char>NPY_DOUBLE
  7789. ufunc_fdtri_types[7] = <char>NPY_DOUBLE
  7790. ufunc_fdtri_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_f_ppf_float
  7791. ufunc_fdtri_ptr[2*0+1] = <void*>(<char*>"fdtri")
  7792. ufunc_fdtri_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_f_ppf_double
  7793. ufunc_fdtri_ptr[2*1+1] = <void*>(<char*>"fdtri")
  7794. ufunc_fdtri_data[0] = &ufunc_fdtri_ptr[2*0]
  7795. ufunc_fdtri_data[1] = &ufunc_fdtri_ptr[2*1]
  7796. fdtri = np.PyUFunc_FromFuncAndData(ufunc_fdtri_loops, ufunc_fdtri_data, ufunc_fdtri_types, 2, 3, 1, 0, 'fdtri', ufunc_fdtri_doc, 0)
  7797. cdef np.PyUFuncGenericFunction ufunc_fdtridfd_loops[2]
  7798. cdef void *ufunc_fdtridfd_ptr[4]
  7799. cdef void *ufunc_fdtridfd_data[2]
  7800. cdef char ufunc_fdtridfd_types[8]
  7801. cdef char *ufunc_fdtridfd_doc = (
  7802. "fdtridfd(dfn, p, x, out=None)\n"
  7803. "\n"
  7804. "Inverse to `fdtr` vs dfd\n"
  7805. "\n"
  7806. "Finds the F density argument dfd such that ``fdtr(dfn, dfd, x) == p``.\n"
  7807. "\n"
  7808. "Parameters\n"
  7809. "----------\n"
  7810. "dfn : array_like\n"
  7811. " First parameter (positive float).\n"
  7812. "p : array_like\n"
  7813. " Cumulative probability, in [0, 1].\n"
  7814. "x : array_like\n"
  7815. " Argument (nonnegative float).\n"
  7816. "out : ndarray, optional\n"
  7817. " Optional output array for the function values\n"
  7818. "\n"
  7819. "Returns\n"
  7820. "-------\n"
  7821. "dfd : scalar or ndarray\n"
  7822. " `dfd` such that ``fdtr(dfn, dfd, x) == p``.\n"
  7823. "\n"
  7824. "See Also\n"
  7825. "--------\n"
  7826. "fdtr : F distribution cumulative distribution function\n"
  7827. "fdtrc : F distribution survival function\n"
  7828. "fdtri : F distribution quantile function\n"
  7829. "scipy.stats.f : F distribution\n"
  7830. "\n"
  7831. "Examples\n"
  7832. "--------\n"
  7833. "Compute the F distribution cumulative distribution function for one\n"
  7834. "parameter set.\n"
  7835. "\n"
  7836. ">>> from scipy.special import fdtridfd, fdtr\n"
  7837. ">>> dfn, dfd, x = 10, 5, 2\n"
  7838. ">>> cdf_value = fdtr(dfn, dfd, x)\n"
  7839. ">>> cdf_value\n"
  7840. "0.7700248806501017\n"
  7841. "\n"
  7842. "Verify that `fdtridfd` recovers the original value for `dfd`:\n"
  7843. "\n"
  7844. ">>> fdtridfd(dfn, cdf_value, x)\n"
  7845. "5.0")
  7846. ufunc_fdtridfd_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  7847. ufunc_fdtridfd_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  7848. ufunc_fdtridfd_types[0] = <char>NPY_FLOAT
  7849. ufunc_fdtridfd_types[1] = <char>NPY_FLOAT
  7850. ufunc_fdtridfd_types[2] = <char>NPY_FLOAT
  7851. ufunc_fdtridfd_types[3] = <char>NPY_FLOAT
  7852. ufunc_fdtridfd_types[4] = <char>NPY_DOUBLE
  7853. ufunc_fdtridfd_types[5] = <char>NPY_DOUBLE
  7854. ufunc_fdtridfd_types[6] = <char>NPY_DOUBLE
  7855. ufunc_fdtridfd_types[7] = <char>NPY_DOUBLE
  7856. ufunc_fdtridfd_ptr[2*0] = <void*>_func_fdtridfd
  7857. ufunc_fdtridfd_ptr[2*0+1] = <void*>(<char*>"fdtridfd")
  7858. ufunc_fdtridfd_ptr[2*1] = <void*>_func_fdtridfd
  7859. ufunc_fdtridfd_ptr[2*1+1] = <void*>(<char*>"fdtridfd")
  7860. ufunc_fdtridfd_data[0] = &ufunc_fdtridfd_ptr[2*0]
  7861. ufunc_fdtridfd_data[1] = &ufunc_fdtridfd_ptr[2*1]
  7862. fdtridfd = np.PyUFunc_FromFuncAndData(ufunc_fdtridfd_loops, ufunc_fdtridfd_data, ufunc_fdtridfd_types, 2, 3, 1, 0, 'fdtridfd', ufunc_fdtridfd_doc, 0)
  7863. cdef np.PyUFuncGenericFunction ufunc_gdtr_loops[2]
  7864. cdef void *ufunc_gdtr_ptr[4]
  7865. cdef void *ufunc_gdtr_data[2]
  7866. cdef char ufunc_gdtr_types[8]
  7867. cdef char *ufunc_gdtr_doc = (
  7868. "gdtr(a, b, x, out=None)\n"
  7869. "\n"
  7870. "Gamma distribution cumulative distribution function.\n"
  7871. "\n"
  7872. "Returns the integral from zero to `x` of the gamma probability density\n"
  7873. "function,\n"
  7874. "\n"
  7875. ".. math::\n"
  7876. "\n"
  7877. " F = \\int_0^x \\frac{a^b}{\\Gamma(b)} t^{b-1} e^{-at}\\,dt,\n"
  7878. "\n"
  7879. "where :math:`\\Gamma` is the gamma function.\n"
  7880. "\n"
  7881. "Parameters\n"
  7882. "----------\n"
  7883. "a : array_like\n"
  7884. " The rate parameter of the gamma distribution, sometimes denoted\n"
  7885. " :math:`\\beta` (float). It is also the reciprocal of the scale\n"
  7886. " parameter :math:`\\theta`.\n"
  7887. "b : array_like\n"
  7888. " The shape parameter of the gamma distribution, sometimes denoted\n"
  7889. " :math:`\\alpha` (float).\n"
  7890. "x : array_like\n"
  7891. " The quantile (upper limit of integration; float).\n"
  7892. "out : ndarray, optional\n"
  7893. " Optional output array for the function values\n"
  7894. "\n"
  7895. "Returns\n"
  7896. "-------\n"
  7897. "F : scalar or ndarray\n"
  7898. " The CDF of the gamma distribution with parameters `a` and `b`\n"
  7899. " evaluated at `x`.\n"
  7900. "\n"
  7901. "See Also\n"
  7902. "--------\n"
  7903. "gdtrc : 1 - CDF of the gamma distribution.\n"
  7904. "scipy.stats.gamma: Gamma distribution\n"
  7905. "\n"
  7906. "Notes\n"
  7907. "-----\n"
  7908. "The evaluation is carried out using the relation to the incomplete gamma\n"
  7909. "integral (regularized gamma function).\n"
  7910. "\n"
  7911. "Wrapper for the Cephes [1]_ routine `gdtr`. Calling `gdtr` directly can\n"
  7912. "improve performance compared to the ``cdf`` method of `scipy.stats.gamma`\n"
  7913. "(see last example below).\n"
  7914. "\n"
  7915. "References\n"
  7916. "----------\n"
  7917. ".. [1] Cephes Mathematical Functions Library,\n"
  7918. " http://www.netlib.org/cephes/\n"
  7919. "\n"
  7920. "Examples\n"
  7921. "--------\n"
  7922. "Compute the function for ``a=1``, ``b=2`` at ``x=5``.\n"
  7923. "\n"
  7924. ">>> import numpy as np\n"
  7925. ">>> from scipy.special import gdtr\n"
  7926. ">>> import matplotlib.pyplot as plt\n"
  7927. ">>> gdtr(1., 2., 5.)\n"
  7928. "0.9595723180054873\n"
  7929. "\n"
  7930. "Compute the function for ``a=1`` and ``b=2`` at several points by\n"
  7931. "providing a NumPy array for `x`.\n"
  7932. "\n"
  7933. ">>> xvalues = np.array([1., 2., 3., 4])\n"
  7934. ">>> gdtr(1., 1., xvalues)\n"
  7935. "array([0.63212056, 0.86466472, 0.95021293, 0.98168436])\n"
  7936. "\n"
  7937. "`gdtr` can evaluate different parameter sets by providing arrays with\n"
  7938. "broadcasting compatible shapes for `a`, `b` and `x`. Here we compute the\n"
  7939. "function for three different `a` at four positions `x` and ``b=3``,\n"
  7940. "resulting in a 3x4 array.\n"
  7941. "\n"
  7942. ">>> a = np.array([[0.5], [1.5], [2.5]])\n"
  7943. ">>> x = np.array([1., 2., 3., 4])\n"
  7944. ">>> a.shape, x.shape\n"
  7945. "((3, 1), (4,))\n"
  7946. "\n"
  7947. ">>> gdtr(a, 3., x)\n"
  7948. "array([[0.01438768, 0.0803014 , 0.19115317, 0.32332358],\n"
  7949. " [0.19115317, 0.57680992, 0.82642193, 0.9380312 ],\n"
  7950. " [0.45618688, 0.87534798, 0.97974328, 0.9972306 ]])\n"
  7951. "\n"
  7952. "Plot the function for four different parameter sets.\n"
  7953. "\n"
  7954. ">>> a_parameters = [0.3, 1, 2, 6]\n"
  7955. ">>> b_parameters = [2, 10, 15, 20]\n"
  7956. ">>> linestyles = ['solid', 'dashed', 'dotted', 'dashdot']\n"
  7957. ">>> parameters_list = list(zip(a_parameters, b_parameters, linestyles))\n"
  7958. ">>> x = np.linspace(0, 30, 1000)\n"
  7959. ">>> fig, ax = plt.subplots()\n"
  7960. ">>> for parameter_set in parameters_list:\n"
  7961. "... a, b, style = parameter_set\n"
  7962. "... gdtr_vals = gdtr(a, b, x)\n"
  7963. "... ax.plot(x, gdtr_vals, label=fr\"$a= {a},\\, b={b}$\", ls=style)\n"
  7964. ">>> ax.legend()\n"
  7965. ">>> ax.set_xlabel(\"$x$\")\n"
  7966. ">>> ax.set_title(\"Gamma distribution cumulative distribution function\")\n"
  7967. ">>> plt.show()\n"
  7968. "\n"
  7969. "The gamma distribution is also available as `scipy.stats.gamma`. Using\n"
  7970. "`gdtr` directly can be much faster than calling the ``cdf`` method of\n"
  7971. "`scipy.stats.gamma`, especially for small arrays or individual values.\n"
  7972. "To get the same results one must use the following parametrization:\n"
  7973. "``stats.gamma(b, scale=1/a).cdf(x)=gdtr(a, b, x)``.\n"
  7974. "\n"
  7975. ">>> from scipy.stats import gamma\n"
  7976. ">>> a = 2.\n"
  7977. ">>> b = 3\n"
  7978. ">>> x = 1.\n"
  7979. ">>> gdtr_result = gdtr(a, b, x) # this will often be faster than below\n"
  7980. ">>> gamma_dist_result = gamma(b, scale=1/a).cdf(x)\n"
  7981. ">>> gdtr_result == gamma_dist_result # test that results are equal\n"
  7982. "True")
  7983. ufunc_gdtr_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  7984. ufunc_gdtr_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  7985. ufunc_gdtr_types[0] = <char>NPY_FLOAT
  7986. ufunc_gdtr_types[1] = <char>NPY_FLOAT
  7987. ufunc_gdtr_types[2] = <char>NPY_FLOAT
  7988. ufunc_gdtr_types[3] = <char>NPY_FLOAT
  7989. ufunc_gdtr_types[4] = <char>NPY_DOUBLE
  7990. ufunc_gdtr_types[5] = <char>NPY_DOUBLE
  7991. ufunc_gdtr_types[6] = <char>NPY_DOUBLE
  7992. ufunc_gdtr_types[7] = <char>NPY_DOUBLE
  7993. ufunc_gdtr_ptr[2*0] = <void*>_func_xsf_gdtr
  7994. ufunc_gdtr_ptr[2*0+1] = <void*>(<char*>"gdtr")
  7995. ufunc_gdtr_ptr[2*1] = <void*>_func_xsf_gdtr
  7996. ufunc_gdtr_ptr[2*1+1] = <void*>(<char*>"gdtr")
  7997. ufunc_gdtr_data[0] = &ufunc_gdtr_ptr[2*0]
  7998. ufunc_gdtr_data[1] = &ufunc_gdtr_ptr[2*1]
  7999. gdtr = np.PyUFunc_FromFuncAndData(ufunc_gdtr_loops, ufunc_gdtr_data, ufunc_gdtr_types, 2, 3, 1, 0, 'gdtr', ufunc_gdtr_doc, 0)
  8000. cdef np.PyUFuncGenericFunction ufunc_gdtrc_loops[2]
  8001. cdef void *ufunc_gdtrc_ptr[4]
  8002. cdef void *ufunc_gdtrc_data[2]
  8003. cdef char ufunc_gdtrc_types[8]
  8004. cdef char *ufunc_gdtrc_doc = (
  8005. "gdtrc(a, b, x, out=None)\n"
  8006. "\n"
  8007. "Gamma distribution survival function.\n"
  8008. "\n"
  8009. "Integral from `x` to infinity of the gamma probability density function,\n"
  8010. "\n"
  8011. ".. math::\n"
  8012. "\n"
  8013. " F = \\int_x^\\infty \\frac{a^b}{\\Gamma(b)} t^{b-1} e^{-at}\\,dt,\n"
  8014. "\n"
  8015. "where :math:`\\Gamma` is the gamma function.\n"
  8016. "\n"
  8017. "Parameters\n"
  8018. "----------\n"
  8019. "a : array_like\n"
  8020. " The rate parameter of the gamma distribution, sometimes denoted\n"
  8021. " :math:`\\beta` (float). It is also the reciprocal of the scale\n"
  8022. " parameter :math:`\\theta`.\n"
  8023. "b : array_like\n"
  8024. " The shape parameter of the gamma distribution, sometimes denoted\n"
  8025. " :math:`\\alpha` (float).\n"
  8026. "x : array_like\n"
  8027. " The quantile (lower limit of integration; float).\n"
  8028. "out : ndarray, optional\n"
  8029. " Optional output array for the function values\n"
  8030. "\n"
  8031. "Returns\n"
  8032. "-------\n"
  8033. "F : scalar or ndarray\n"
  8034. " The survival function of the gamma distribution with parameters `a`\n"
  8035. " and `b` evaluated at `x`.\n"
  8036. "\n"
  8037. "See Also\n"
  8038. "--------\n"
  8039. "gdtr: Gamma distribution cumulative distribution function\n"
  8040. "scipy.stats.gamma: Gamma distribution\n"
  8041. "gdtrix\n"
  8042. "\n"
  8043. "Notes\n"
  8044. "-----\n"
  8045. "The evaluation is carried out using the relation to the incomplete gamma\n"
  8046. "integral (regularized gamma function).\n"
  8047. "\n"
  8048. "Wrapper for the Cephes [1]_ routine `gdtrc`. Calling `gdtrc` directly can\n"
  8049. "improve performance compared to the ``sf`` method of `scipy.stats.gamma`\n"
  8050. "(see last example below).\n"
  8051. "\n"
  8052. "References\n"
  8053. "----------\n"
  8054. ".. [1] Cephes Mathematical Functions Library,\n"
  8055. " http://www.netlib.org/cephes/\n"
  8056. "\n"
  8057. "Examples\n"
  8058. "--------\n"
  8059. "Compute the function for ``a=1`` and ``b=2`` at ``x=5``.\n"
  8060. "\n"
  8061. ">>> import numpy as np\n"
  8062. ">>> from scipy.special import gdtrc\n"
  8063. ">>> import matplotlib.pyplot as plt\n"
  8064. ">>> gdtrc(1., 2., 5.)\n"
  8065. "0.04042768199451279\n"
  8066. "\n"
  8067. "Compute the function for ``a=1``, ``b=2`` at several points by providing\n"
  8068. "a NumPy array for `x`.\n"
  8069. "\n"
  8070. ">>> xvalues = np.array([1., 2., 3., 4])\n"
  8071. ">>> gdtrc(1., 1., xvalues)\n"
  8072. "array([0.36787944, 0.13533528, 0.04978707, 0.01831564])\n"
  8073. "\n"
  8074. "`gdtrc` can evaluate different parameter sets by providing arrays with\n"
  8075. "broadcasting compatible shapes for `a`, `b` and `x`. Here we compute the\n"
  8076. "function for three different `a` at four positions `x` and ``b=3``,\n"
  8077. "resulting in a 3x4 array.\n"
  8078. "\n"
  8079. ">>> a = np.array([[0.5], [1.5], [2.5]])\n"
  8080. ">>> x = np.array([1., 2., 3., 4])\n"
  8081. ">>> a.shape, x.shape\n"
  8082. "((3, 1), (4,))\n"
  8083. "\n"
  8084. ">>> gdtrc(a, 3., x)\n"
  8085. "array([[0.98561232, 0.9196986 , 0.80884683, 0.67667642],\n"
  8086. " [0.80884683, 0.42319008, 0.17357807, 0.0619688 ],\n"
  8087. " [0.54381312, 0.12465202, 0.02025672, 0.0027694 ]])\n"
  8088. "\n"
  8089. "Plot the function for four different parameter sets.\n"
  8090. "\n"
  8091. ">>> a_parameters = [0.3, 1, 2, 6]\n"
  8092. ">>> b_parameters = [2, 10, 15, 20]\n"
  8093. ">>> linestyles = ['solid', 'dashed', 'dotted', 'dashdot']\n"
  8094. ">>> parameters_list = list(zip(a_parameters, b_parameters, linestyles))\n"
  8095. ">>> x = np.linspace(0, 30, 1000)\n"
  8096. ">>> fig, ax = plt.subplots()\n"
  8097. ">>> for parameter_set in parameters_list:\n"
  8098. "... a, b, style = parameter_set\n"
  8099. "... gdtrc_vals = gdtrc(a, b, x)\n"
  8100. "... ax.plot(x, gdtrc_vals, label=fr\"$a= {a},\\, b={b}$\", ls=style)\n"
  8101. ">>> ax.legend()\n"
  8102. ">>> ax.set_xlabel(\"$x$\")\n"
  8103. ">>> ax.set_title(\"Gamma distribution survival function\")\n"
  8104. ">>> plt.show()\n"
  8105. "\n"
  8106. "The gamma distribution is also available as `scipy.stats.gamma`.\n"
  8107. "Using `gdtrc` directly can be much faster than calling the ``sf`` method\n"
  8108. "of `scipy.stats.gamma`, especially for small arrays or individual\n"
  8109. "values. To get the same results one must use the following parametrization:\n"
  8110. "``stats.gamma(b, scale=1/a).sf(x)=gdtrc(a, b, x)``.\n"
  8111. "\n"
  8112. ">>> from scipy.stats import gamma\n"
  8113. ">>> a = 2\n"
  8114. ">>> b = 3\n"
  8115. ">>> x = 1.\n"
  8116. ">>> gdtrc_result = gdtrc(a, b, x) # this will often be faster than below\n"
  8117. ">>> gamma_dist_result = gamma(b, scale=1/a).sf(x)\n"
  8118. ">>> gdtrc_result == gamma_dist_result # test that results are equal\n"
  8119. "True")
  8120. ufunc_gdtrc_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  8121. ufunc_gdtrc_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  8122. ufunc_gdtrc_types[0] = <char>NPY_FLOAT
  8123. ufunc_gdtrc_types[1] = <char>NPY_FLOAT
  8124. ufunc_gdtrc_types[2] = <char>NPY_FLOAT
  8125. ufunc_gdtrc_types[3] = <char>NPY_FLOAT
  8126. ufunc_gdtrc_types[4] = <char>NPY_DOUBLE
  8127. ufunc_gdtrc_types[5] = <char>NPY_DOUBLE
  8128. ufunc_gdtrc_types[6] = <char>NPY_DOUBLE
  8129. ufunc_gdtrc_types[7] = <char>NPY_DOUBLE
  8130. ufunc_gdtrc_ptr[2*0] = <void*>_func_xsf_gdtrc
  8131. ufunc_gdtrc_ptr[2*0+1] = <void*>(<char*>"gdtrc")
  8132. ufunc_gdtrc_ptr[2*1] = <void*>_func_xsf_gdtrc
  8133. ufunc_gdtrc_ptr[2*1+1] = <void*>(<char*>"gdtrc")
  8134. ufunc_gdtrc_data[0] = &ufunc_gdtrc_ptr[2*0]
  8135. ufunc_gdtrc_data[1] = &ufunc_gdtrc_ptr[2*1]
  8136. gdtrc = np.PyUFunc_FromFuncAndData(ufunc_gdtrc_loops, ufunc_gdtrc_data, ufunc_gdtrc_types, 2, 3, 1, 0, 'gdtrc', ufunc_gdtrc_doc, 0)
  8137. cdef np.PyUFuncGenericFunction ufunc_gdtria_loops[2]
  8138. cdef void *ufunc_gdtria_ptr[4]
  8139. cdef void *ufunc_gdtria_data[2]
  8140. cdef char ufunc_gdtria_types[8]
  8141. cdef char *ufunc_gdtria_doc = (
  8142. "gdtria(p, b, x, out=None)\n"
  8143. "\n"
  8144. "Inverse of `gdtr` vs a.\n"
  8145. "\n"
  8146. "Returns the inverse with respect to the parameter `a` of ``p =\n"
  8147. "gdtr(a, b, x)``, the cumulative distribution function of the gamma\n"
  8148. "distribution.\n"
  8149. "\n"
  8150. "Parameters\n"
  8151. "----------\n"
  8152. "p : array_like\n"
  8153. " Probability values.\n"
  8154. "b : array_like\n"
  8155. " `b` parameter values of `gdtr(a, b, x)`. `b` is the \"shape\" parameter\n"
  8156. " of the gamma distribution.\n"
  8157. "x : array_like\n"
  8158. " Nonnegative real values, from the domain of the gamma distribution.\n"
  8159. "out : ndarray, optional\n"
  8160. " If a fourth argument is given, it must be a numpy.ndarray whose size\n"
  8161. " matches the broadcast result of `a`, `b` and `x`. `out` is then the\n"
  8162. " array returned by the function.\n"
  8163. "\n"
  8164. "Returns\n"
  8165. "-------\n"
  8166. "a : scalar or ndarray\n"
  8167. " Values of the `a` parameter such that ``p = gdtr(a, b, x)`. ``1/a``\n"
  8168. " is the \"scale\" parameter of the gamma distribution.\n"
  8169. "\n"
  8170. "See Also\n"
  8171. "--------\n"
  8172. "gdtr : CDF of the gamma distribution.\n"
  8173. "gdtrib : Inverse with respect to `b` of `gdtr(a, b, x)`.\n"
  8174. "gdtrix : Inverse with respect to `x` of `gdtr(a, b, x)`.\n"
  8175. "\n"
  8176. "Notes\n"
  8177. "-----\n"
  8178. "Wrapper for the CDFLIB [1]_ Fortran routine `cdfgam`.\n"
  8179. "\n"
  8180. "The cumulative distribution function `p` is computed using a routine by\n"
  8181. "DiDinato and Morris [2]_. Computation of `a` involves a search for a value\n"
  8182. "that produces the desired value of `p`. The search relies on the\n"
  8183. "monotonicity of `p` with `a`.\n"
  8184. "\n"
  8185. "References\n"
  8186. "----------\n"
  8187. ".. [1] Barry Brown, James Lovato, and Kathy Russell,\n"
  8188. " CDFLIB: Library of Fortran Routines for Cumulative Distribution\n"
  8189. " Functions, Inverses, and Other Parameters.\n"
  8190. ".. [2] DiDinato, A. R. and Morris, A. H.,\n"
  8191. " Computation of the incomplete gamma function ratios and their\n"
  8192. " inverse. ACM Trans. Math. Softw. 12 (1986), 377-393.\n"
  8193. "\n"
  8194. "Examples\n"
  8195. "--------\n"
  8196. "First evaluate `gdtr`.\n"
  8197. "\n"
  8198. ">>> from scipy.special import gdtr, gdtria\n"
  8199. ">>> p = gdtr(1.2, 3.4, 5.6)\n"
  8200. ">>> print(p)\n"
  8201. "0.94378087442\n"
  8202. "\n"
  8203. "Verify the inverse.\n"
  8204. "\n"
  8205. ">>> gdtria(p, 3.4, 5.6)\n"
  8206. "1.2")
  8207. ufunc_gdtria_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  8208. ufunc_gdtria_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  8209. ufunc_gdtria_types[0] = <char>NPY_FLOAT
  8210. ufunc_gdtria_types[1] = <char>NPY_FLOAT
  8211. ufunc_gdtria_types[2] = <char>NPY_FLOAT
  8212. ufunc_gdtria_types[3] = <char>NPY_FLOAT
  8213. ufunc_gdtria_types[4] = <char>NPY_DOUBLE
  8214. ufunc_gdtria_types[5] = <char>NPY_DOUBLE
  8215. ufunc_gdtria_types[6] = <char>NPY_DOUBLE
  8216. ufunc_gdtria_types[7] = <char>NPY_DOUBLE
  8217. ufunc_gdtria_ptr[2*0] = <void*>_func_special_gdtria
  8218. ufunc_gdtria_ptr[2*0+1] = <void*>(<char*>"gdtria")
  8219. ufunc_gdtria_ptr[2*1] = <void*>_func_special_gdtria
  8220. ufunc_gdtria_ptr[2*1+1] = <void*>(<char*>"gdtria")
  8221. ufunc_gdtria_data[0] = &ufunc_gdtria_ptr[2*0]
  8222. ufunc_gdtria_data[1] = &ufunc_gdtria_ptr[2*1]
  8223. gdtria = np.PyUFunc_FromFuncAndData(ufunc_gdtria_loops, ufunc_gdtria_data, ufunc_gdtria_types, 2, 3, 1, 0, 'gdtria', ufunc_gdtria_doc, 0)
  8224. cdef np.PyUFuncGenericFunction ufunc_gdtrib_loops[2]
  8225. cdef void *ufunc_gdtrib_ptr[4]
  8226. cdef void *ufunc_gdtrib_data[2]
  8227. cdef char ufunc_gdtrib_types[8]
  8228. cdef char *ufunc_gdtrib_doc = (
  8229. "gdtrib(a, p, x, out=None)\n"
  8230. "\n"
  8231. "Inverse of `gdtr` vs b.\n"
  8232. "\n"
  8233. "Returns the inverse with respect to the parameter `b` of ``p =\n"
  8234. "gdtr(a, b, x)``, the cumulative distribution function of the gamma\n"
  8235. "distribution.\n"
  8236. "\n"
  8237. "Parameters\n"
  8238. "----------\n"
  8239. "a : array_like\n"
  8240. " `a` parameter values of ``gdtr(a, b, x)`. ``1/a`` is the \"scale\"\n"
  8241. " parameter of the gamma distribution.\n"
  8242. "p : array_like\n"
  8243. " Probability values.\n"
  8244. "x : array_like\n"
  8245. " Nonnegative real values, from the domain of the gamma distribution.\n"
  8246. "out : ndarray, optional\n"
  8247. " If a fourth argument is given, it must be a numpy.ndarray whose size\n"
  8248. " matches the broadcast result of `a`, `b` and `x`. `out` is then the\n"
  8249. " array returned by the function.\n"
  8250. "\n"
  8251. "Returns\n"
  8252. "-------\n"
  8253. "b : scalar or ndarray\n"
  8254. " Values of the `b` parameter such that `p = gdtr(a, b, x)`. `b` is\n"
  8255. " the \"shape\" parameter of the gamma distribution.\n"
  8256. "\n"
  8257. "See Also\n"
  8258. "--------\n"
  8259. "gdtr : CDF of the gamma distribution.\n"
  8260. "gdtria : Inverse with respect to `a` of `gdtr(a, b, x)`.\n"
  8261. "gdtrix : Inverse with respect to `x` of `gdtr(a, b, x)`.\n"
  8262. "\n"
  8263. "Notes\n"
  8264. "-----\n"
  8265. "\n"
  8266. "The cumulative distribution function `p` is computed using the Cephes [1]_\n"
  8267. "routines `igam` and `igamc`. Computation of `b` involves a search for a value\n"
  8268. "that produces the desired value of `p` using Chandrupatla's bracketing\n"
  8269. "root finding algorithm [2]_.\n"
  8270. "\n"
  8271. "Note that there are some edge cases where `gdtrib` is extended by taking\n"
  8272. "limits where they are uniquely defined. In particular\n"
  8273. "``x == 0`` with ``p > 0`` and ``p == 0`` with ``x > 0``.\n"
  8274. "For these edge cases, a numerical result will be returned for\n"
  8275. "``gdtrib(a, p, x)`` even though ``gdtr(a, gdtrib(a, p, x), x)`` is\n"
  8276. "undefined.\n"
  8277. "\n"
  8278. "References\n"
  8279. "----------\n"
  8280. ".. [1] Cephes Mathematical Functions Library,\n"
  8281. " http://www.netlib.org/cephes/\n"
  8282. ".. [2] Chandrupatla, Tirupathi R.\n"
  8283. " \"A new hybrid quadratic/bisection algorithm for finding the zero of a\n"
  8284. " nonlinear function without using derivatives\".\n"
  8285. " Advances in Engineering Software, 28(3), 145-149.\n"
  8286. " https://doi.org/10.1016/s0965-9978(96)00051-8\n"
  8287. "\n"
  8288. "Examples\n"
  8289. "--------\n"
  8290. "First evaluate `gdtr`.\n"
  8291. "\n"
  8292. ">>> from scipy.special import gdtr, gdtrib\n"
  8293. ">>> p = gdtr(1.2, 3.4, 5.6)\n"
  8294. ">>> print(p)\n"
  8295. "0.94378087442\n"
  8296. "\n"
  8297. "Verify the inverse.\n"
  8298. "\n"
  8299. ">>> gdtrib(1.2, p, 5.6)\n"
  8300. "3.3999999999999995")
  8301. ufunc_gdtrib_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  8302. ufunc_gdtrib_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  8303. ufunc_gdtrib_types[0] = <char>NPY_FLOAT
  8304. ufunc_gdtrib_types[1] = <char>NPY_FLOAT
  8305. ufunc_gdtrib_types[2] = <char>NPY_FLOAT
  8306. ufunc_gdtrib_types[3] = <char>NPY_FLOAT
  8307. ufunc_gdtrib_types[4] = <char>NPY_DOUBLE
  8308. ufunc_gdtrib_types[5] = <char>NPY_DOUBLE
  8309. ufunc_gdtrib_types[6] = <char>NPY_DOUBLE
  8310. ufunc_gdtrib_types[7] = <char>NPY_DOUBLE
  8311. ufunc_gdtrib_ptr[2*0] = <void*>_func_xsf_gdtrib
  8312. ufunc_gdtrib_ptr[2*0+1] = <void*>(<char*>"gdtrib")
  8313. ufunc_gdtrib_ptr[2*1] = <void*>_func_xsf_gdtrib
  8314. ufunc_gdtrib_ptr[2*1+1] = <void*>(<char*>"gdtrib")
  8315. ufunc_gdtrib_data[0] = &ufunc_gdtrib_ptr[2*0]
  8316. ufunc_gdtrib_data[1] = &ufunc_gdtrib_ptr[2*1]
  8317. gdtrib = np.PyUFunc_FromFuncAndData(ufunc_gdtrib_loops, ufunc_gdtrib_data, ufunc_gdtrib_types, 2, 3, 1, 0, 'gdtrib', ufunc_gdtrib_doc, 0)
  8318. cdef np.PyUFuncGenericFunction ufunc_gdtrix_loops[2]
  8319. cdef void *ufunc_gdtrix_ptr[4]
  8320. cdef void *ufunc_gdtrix_data[2]
  8321. cdef char ufunc_gdtrix_types[8]
  8322. cdef char *ufunc_gdtrix_doc = (
  8323. "gdtrix(a, b, p, out=None)\n"
  8324. "\n"
  8325. "Inverse of `gdtr` vs x.\n"
  8326. "\n"
  8327. "Returns the inverse with respect to the parameter `x` of ``p =\n"
  8328. "gdtr(a, b, x)``, the cumulative distribution function of the gamma\n"
  8329. "distribution. This is also known as the pth quantile of the\n"
  8330. "distribution.\n"
  8331. "\n"
  8332. "Parameters\n"
  8333. "----------\n"
  8334. "a : array_like\n"
  8335. " `a` parameter values of ``gdtr(a, b, x)``. ``1/a`` is the \"scale\"\n"
  8336. " parameter of the gamma distribution.\n"
  8337. "b : array_like\n"
  8338. " `b` parameter values of ``gdtr(a, b, x)``. `b` is the \"shape\" parameter\n"
  8339. " of the gamma distribution.\n"
  8340. "p : array_like\n"
  8341. " Probability values.\n"
  8342. "out : ndarray, optional\n"
  8343. " If a fourth argument is given, it must be a numpy.ndarray whose size\n"
  8344. " matches the broadcast result of `a`, `b` and `x`. `out` is then the\n"
  8345. " array returned by the function.\n"
  8346. "\n"
  8347. "Returns\n"
  8348. "-------\n"
  8349. "x : scalar or ndarray\n"
  8350. " Values of the `x` parameter such that `p = gdtr(a, b, x)`.\n"
  8351. "\n"
  8352. "See Also\n"
  8353. "--------\n"
  8354. "gdtr : CDF of the gamma distribution.\n"
  8355. "gdtria : Inverse with respect to `a` of ``gdtr(a, b, x)``.\n"
  8356. "gdtrib : Inverse with respect to `b` of ``gdtr(a, b, x)``.\n"
  8357. "\n"
  8358. "Notes\n"
  8359. "-----\n"
  8360. "Wrapper for the CDFLIB [1]_ Fortran routine `cdfgam`.\n"
  8361. "\n"
  8362. "The cumulative distribution function `p` is computed using a routine by\n"
  8363. "DiDinato and Morris [2]_. Computation of `x` involves a search for a value\n"
  8364. "that produces the desired value of `p`. The search relies on the\n"
  8365. "monotonicity of `p` with `x`.\n"
  8366. "\n"
  8367. "References\n"
  8368. "----------\n"
  8369. ".. [1] Barry Brown, James Lovato, and Kathy Russell,\n"
  8370. " CDFLIB: Library of Fortran Routines for Cumulative Distribution\n"
  8371. " Functions, Inverses, and Other Parameters.\n"
  8372. ".. [2] DiDinato, A. R. and Morris, A. H.,\n"
  8373. " Computation of the incomplete gamma function ratios and their\n"
  8374. " inverse. ACM Trans. Math. Softw. 12 (1986), 377-393.\n"
  8375. "\n"
  8376. "Examples\n"
  8377. "--------\n"
  8378. "First evaluate `gdtr`.\n"
  8379. "\n"
  8380. ">>> from scipy.special import gdtr, gdtrix\n"
  8381. ">>> p = gdtr(1.2, 3.4, 5.6)\n"
  8382. ">>> print(p)\n"
  8383. "0.94378087442\n"
  8384. "\n"
  8385. "Verify the inverse.\n"
  8386. "\n"
  8387. ">>> gdtrix(1.2, 3.4, p)\n"
  8388. "5.5999999999999996")
  8389. ufunc_gdtrix_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  8390. ufunc_gdtrix_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  8391. ufunc_gdtrix_types[0] = <char>NPY_FLOAT
  8392. ufunc_gdtrix_types[1] = <char>NPY_FLOAT
  8393. ufunc_gdtrix_types[2] = <char>NPY_FLOAT
  8394. ufunc_gdtrix_types[3] = <char>NPY_FLOAT
  8395. ufunc_gdtrix_types[4] = <char>NPY_DOUBLE
  8396. ufunc_gdtrix_types[5] = <char>NPY_DOUBLE
  8397. ufunc_gdtrix_types[6] = <char>NPY_DOUBLE
  8398. ufunc_gdtrix_types[7] = <char>NPY_DOUBLE
  8399. ufunc_gdtrix_ptr[2*0] = <void*>_func_special_gdtrix
  8400. ufunc_gdtrix_ptr[2*0+1] = <void*>(<char*>"gdtrix")
  8401. ufunc_gdtrix_ptr[2*1] = <void*>_func_special_gdtrix
  8402. ufunc_gdtrix_ptr[2*1+1] = <void*>(<char*>"gdtrix")
  8403. ufunc_gdtrix_data[0] = &ufunc_gdtrix_ptr[2*0]
  8404. ufunc_gdtrix_data[1] = &ufunc_gdtrix_ptr[2*1]
  8405. gdtrix = np.PyUFunc_FromFuncAndData(ufunc_gdtrix_loops, ufunc_gdtrix_data, ufunc_gdtrix_types, 2, 3, 1, 0, 'gdtrix', ufunc_gdtrix_doc, 0)
  8406. cdef np.PyUFuncGenericFunction ufunc_huber_loops[2]
  8407. cdef void *ufunc_huber_ptr[4]
  8408. cdef void *ufunc_huber_data[2]
  8409. cdef char ufunc_huber_types[6]
  8410. cdef char *ufunc_huber_doc = (
  8411. "huber(delta, r, out=None)\n"
  8412. "\n"
  8413. "Huber loss function.\n"
  8414. "\n"
  8415. ".. math:: \\text{huber}(\\delta, r) = \\begin{cases} \\infty & \\delta < 0 \\\\\n"
  8416. " \\frac{1}{2}r^2 & 0 \\le \\delta, | r | \\le \\delta \\\\\n"
  8417. " \\delta ( |r| - \\frac{1}{2}\\delta ) & \\text{otherwise} \\end{cases}\n"
  8418. "\n"
  8419. "Parameters\n"
  8420. "----------\n"
  8421. "delta : ndarray\n"
  8422. " Input array, indicating the quadratic vs. linear loss changepoint.\n"
  8423. "r : ndarray\n"
  8424. " Input array, possibly representing residuals.\n"
  8425. "out : ndarray, optional\n"
  8426. " Optional output array for the function values\n"
  8427. "\n"
  8428. "Returns\n"
  8429. "-------\n"
  8430. "scalar or ndarray\n"
  8431. " The computed Huber loss function values.\n"
  8432. "\n"
  8433. "See Also\n"
  8434. "--------\n"
  8435. "pseudo_huber : smooth approximation of this function\n"
  8436. "\n"
  8437. "Notes\n"
  8438. "-----\n"
  8439. "`huber` is useful as a loss function in robust statistics or machine\n"
  8440. "learning to reduce the influence of outliers as compared to the common\n"
  8441. "squared error loss, residuals with a magnitude higher than `delta` are\n"
  8442. "not squared [1]_.\n"
  8443. "\n"
  8444. "Typically, `r` represents residuals, the difference\n"
  8445. "between a model prediction and data. Then, for :math:`|r|\\leq\\delta`,\n"
  8446. "`huber` resembles the squared error and for :math:`|r|>\\delta` the\n"
  8447. "absolute error. This way, the Huber loss often achieves\n"
  8448. "a fast convergence in model fitting for small residuals like the squared\n"
  8449. "error loss function and still reduces the influence of outliers\n"
  8450. "(:math:`|r|>\\delta`) like the absolute error loss. As :math:`\\delta` is\n"
  8451. "the cutoff between squared and absolute error regimes, it has\n"
  8452. "to be tuned carefully for each problem. `huber` is also\n"
  8453. "convex, making it suitable for gradient based optimization.\n"
  8454. "\n"
  8455. ".. versionadded:: 0.15.0\n"
  8456. "\n"
  8457. "References\n"
  8458. "----------\n"
  8459. ".. [1] Peter Huber. \"Robust Estimation of a Location Parameter\",\n"
  8460. " 1964. Annals of Statistics. 53 (1): 73 - 101.\n"
  8461. "\n"
  8462. "Examples\n"
  8463. "--------\n"
  8464. "Import all necessary modules.\n"
  8465. "\n"
  8466. ">>> import numpy as np\n"
  8467. ">>> from scipy.special import huber\n"
  8468. ">>> import matplotlib.pyplot as plt\n"
  8469. "\n"
  8470. "Compute the function for ``delta=1`` at ``r=2``\n"
  8471. "\n"
  8472. ">>> huber(1., 2.)\n"
  8473. "1.5\n"
  8474. "\n"
  8475. "Compute the function for different `delta` by providing a NumPy array or\n"
  8476. "list for `delta`.\n"
  8477. "\n"
  8478. ">>> huber([1., 3., 5.], 4.)\n"
  8479. "array([3.5, 7.5, 8. ])\n"
  8480. "\n"
  8481. "Compute the function at different points by providing a NumPy array or\n"
  8482. "list for `r`.\n"
  8483. "\n"
  8484. ">>> huber(2., np.array([1., 1.5, 3.]))\n"
  8485. "array([0.5 , 1.125, 4. ])\n"
  8486. "\n"
  8487. "The function can be calculated for different `delta` and `r` by\n"
  8488. "providing arrays for both with compatible shapes for broadcasting.\n"
  8489. "\n"
  8490. ">>> r = np.array([1., 2.5, 8., 10.])\n"
  8491. ">>> deltas = np.array([[1.], [5.], [9.]])\n"
  8492. ">>> print(r.shape, deltas.shape)\n"
  8493. "(4,) (3, 1)\n"
  8494. "\n"
  8495. ">>> huber(deltas, r)\n"
  8496. "array([[ 0.5 , 2. , 7.5 , 9.5 ],\n"
  8497. " [ 0.5 , 3.125, 27.5 , 37.5 ],\n"
  8498. " [ 0.5 , 3.125, 32. , 49.5 ]])\n"
  8499. "\n"
  8500. "Plot the function for different `delta`.\n"
  8501. "\n"
  8502. ">>> x = np.linspace(-4, 4, 500)\n"
  8503. ">>> deltas = [1, 2, 3]\n"
  8504. ">>> linestyles = [\"dashed\", \"dotted\", \"dashdot\"]\n"
  8505. ">>> fig, ax = plt.subplots()\n"
  8506. ">>> combined_plot_parameters = list(zip(deltas, linestyles))\n"
  8507. ">>> for delta, style in combined_plot_parameters:\n"
  8508. "... ax.plot(x, huber(delta, x), label=fr\"$\\delta={delta}$\", ls=style)\n"
  8509. ">>> ax.legend(loc=\"upper center\")\n"
  8510. ">>> ax.set_xlabel(\"$x$\")\n"
  8511. ">>> ax.set_title(r\"Huber loss function $h_{\\delta}(x)$\")\n"
  8512. ">>> ax.set_xlim(-4, 4)\n"
  8513. ">>> ax.set_ylim(0, 8)\n"
  8514. ">>> plt.show()")
  8515. ufunc_huber_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  8516. ufunc_huber_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  8517. ufunc_huber_types[0] = <char>NPY_FLOAT
  8518. ufunc_huber_types[1] = <char>NPY_FLOAT
  8519. ufunc_huber_types[2] = <char>NPY_FLOAT
  8520. ufunc_huber_types[3] = <char>NPY_DOUBLE
  8521. ufunc_huber_types[4] = <char>NPY_DOUBLE
  8522. ufunc_huber_types[5] = <char>NPY_DOUBLE
  8523. ufunc_huber_ptr[2*0] = <void*>_func_huber
  8524. ufunc_huber_ptr[2*0+1] = <void*>(<char*>"huber")
  8525. ufunc_huber_ptr[2*1] = <void*>_func_huber
  8526. ufunc_huber_ptr[2*1+1] = <void*>(<char*>"huber")
  8527. ufunc_huber_data[0] = &ufunc_huber_ptr[2*0]
  8528. ufunc_huber_data[1] = &ufunc_huber_ptr[2*1]
  8529. huber = np.PyUFunc_FromFuncAndData(ufunc_huber_loops, ufunc_huber_data, ufunc_huber_types, 2, 2, 1, 0, 'huber', ufunc_huber_doc, 0)
  8530. cdef np.PyUFuncGenericFunction ufunc_hyp0f1_loops[4]
  8531. cdef void *ufunc_hyp0f1_ptr[8]
  8532. cdef void *ufunc_hyp0f1_data[4]
  8533. cdef char ufunc_hyp0f1_types[12]
  8534. cdef char *ufunc_hyp0f1_doc = (
  8535. "hyp0f1(v, z, out=None)\n"
  8536. "\n"
  8537. "Confluent hypergeometric limit function 0F1.\n"
  8538. "\n"
  8539. "Parameters\n"
  8540. "----------\n"
  8541. "v : array_like\n"
  8542. " Real-valued parameter\n"
  8543. "z : array_like\n"
  8544. " Real- or complex-valued argument\n"
  8545. "out : ndarray, optional\n"
  8546. " Optional output array for the function results\n"
  8547. "\n"
  8548. "Returns\n"
  8549. "-------\n"
  8550. "scalar or ndarray\n"
  8551. " The confluent hypergeometric limit function\n"
  8552. "\n"
  8553. "Notes\n"
  8554. "-----\n"
  8555. "This function is defined as:\n"
  8556. "\n"
  8557. ".. math:: _0F_1(v, z) = \\sum_{k=0}^{\\infty}\\frac{z^k}{(v)_k k!}.\n"
  8558. "\n"
  8559. "It's also the limit as :math:`q \\to \\infty` of :math:`_1F_1(q; v; z/q)`,\n"
  8560. "and satisfies the differential equation :math:`f''(z) + vf'(z) =\n"
  8561. "f(z)`. See [1]_ for more information.\n"
  8562. "\n"
  8563. "References\n"
  8564. "----------\n"
  8565. ".. [1] Wolfram MathWorld, \"Confluent Hypergeometric Limit Function\",\n"
  8566. " http://mathworld.wolfram.com/ConfluentHypergeometricLimitFunction.html\n"
  8567. "\n"
  8568. "Examples\n"
  8569. "--------\n"
  8570. ">>> import numpy as np\n"
  8571. ">>> import scipy.special as sc\n"
  8572. "\n"
  8573. "It is one when `z` is zero.\n"
  8574. "\n"
  8575. ">>> sc.hyp0f1(1, 0)\n"
  8576. "1.0\n"
  8577. "\n"
  8578. "It is the limit of the confluent hypergeometric function as `q`\n"
  8579. "goes to infinity.\n"
  8580. "\n"
  8581. ">>> q = np.array([1, 10, 100, 1000])\n"
  8582. ">>> v = 1\n"
  8583. ">>> z = 1\n"
  8584. ">>> sc.hyp1f1(q, v, z / q)\n"
  8585. "array([2.71828183, 2.31481985, 2.28303778, 2.27992985])\n"
  8586. ">>> sc.hyp0f1(v, z)\n"
  8587. "2.2795853023360673\n"
  8588. "\n"
  8589. "It is related to Bessel functions.\n"
  8590. "\n"
  8591. ">>> n = 1\n"
  8592. ">>> x = np.linspace(0, 1, 5)\n"
  8593. ">>> sc.jv(n, x)\n"
  8594. "array([0. , 0.12402598, 0.24226846, 0.3492436 , 0.44005059])\n"
  8595. ">>> (0.5 * x)**n / sc.factorial(n) * sc.hyp0f1(n + 1, -0.25 * x**2)\n"
  8596. "array([0. , 0.12402598, 0.24226846, 0.3492436 , 0.44005059])")
  8597. ufunc_hyp0f1_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  8598. ufunc_hyp0f1_loops[1] = <np.PyUFuncGenericFunction>loop_D_dD__As_fF_F
  8599. ufunc_hyp0f1_loops[2] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  8600. ufunc_hyp0f1_loops[3] = <np.PyUFuncGenericFunction>loop_D_dD__As_dD_D
  8601. ufunc_hyp0f1_types[0] = <char>NPY_FLOAT
  8602. ufunc_hyp0f1_types[1] = <char>NPY_FLOAT
  8603. ufunc_hyp0f1_types[2] = <char>NPY_FLOAT
  8604. ufunc_hyp0f1_types[3] = <char>NPY_FLOAT
  8605. ufunc_hyp0f1_types[4] = <char>NPY_CFLOAT
  8606. ufunc_hyp0f1_types[5] = <char>NPY_CFLOAT
  8607. ufunc_hyp0f1_types[6] = <char>NPY_DOUBLE
  8608. ufunc_hyp0f1_types[7] = <char>NPY_DOUBLE
  8609. ufunc_hyp0f1_types[8] = <char>NPY_DOUBLE
  8610. ufunc_hyp0f1_types[9] = <char>NPY_DOUBLE
  8611. ufunc_hyp0f1_types[10] = <char>NPY_CDOUBLE
  8612. ufunc_hyp0f1_types[11] = <char>NPY_CDOUBLE
  8613. ufunc_hyp0f1_ptr[2*0] = <void*>_func__hyp0f1_real
  8614. ufunc_hyp0f1_ptr[2*0+1] = <void*>(<char*>"hyp0f1")
  8615. ufunc_hyp0f1_ptr[2*1] = <void*>_func__hyp0f1_cmplx
  8616. ufunc_hyp0f1_ptr[2*1+1] = <void*>(<char*>"hyp0f1")
  8617. ufunc_hyp0f1_ptr[2*2] = <void*>_func__hyp0f1_real
  8618. ufunc_hyp0f1_ptr[2*2+1] = <void*>(<char*>"hyp0f1")
  8619. ufunc_hyp0f1_ptr[2*3] = <void*>_func__hyp0f1_cmplx
  8620. ufunc_hyp0f1_ptr[2*3+1] = <void*>(<char*>"hyp0f1")
  8621. ufunc_hyp0f1_data[0] = &ufunc_hyp0f1_ptr[2*0]
  8622. ufunc_hyp0f1_data[1] = &ufunc_hyp0f1_ptr[2*1]
  8623. ufunc_hyp0f1_data[2] = &ufunc_hyp0f1_ptr[2*2]
  8624. ufunc_hyp0f1_data[3] = &ufunc_hyp0f1_ptr[2*3]
  8625. hyp0f1 = np.PyUFunc_FromFuncAndData(ufunc_hyp0f1_loops, ufunc_hyp0f1_data, ufunc_hyp0f1_types, 4, 2, 1, 0, 'hyp0f1', ufunc_hyp0f1_doc, 0)
  8626. cdef np.PyUFuncGenericFunction ufunc_hyp1f1_loops[4]
  8627. cdef void *ufunc_hyp1f1_ptr[8]
  8628. cdef void *ufunc_hyp1f1_data[4]
  8629. cdef char ufunc_hyp1f1_types[16]
  8630. cdef char *ufunc_hyp1f1_doc = (
  8631. "hyp1f1(a, b, x, out=None)\n"
  8632. "\n"
  8633. "Confluent hypergeometric function 1F1.\n"
  8634. "\n"
  8635. "The confluent hypergeometric function is defined by the series\n"
  8636. "\n"
  8637. ".. math::\n"
  8638. "\n"
  8639. " {}_1F_1(a; b; x) = \\sum_{k = 0}^\\infty \\frac{(a)_k}{(b)_k k!} x^k.\n"
  8640. "\n"
  8641. "See [DLMF]_ for more details. Here :math:`(\\cdot)_k` is the\n"
  8642. "Pochhammer symbol; see `poch`.\n"
  8643. "\n"
  8644. "Parameters\n"
  8645. "----------\n"
  8646. "a, b : array_like\n"
  8647. " Real parameters\n"
  8648. "x : array_like\n"
  8649. " Real or complex argument\n"
  8650. "out : ndarray, optional\n"
  8651. " Optional output array for the function results\n"
  8652. "\n"
  8653. "Returns\n"
  8654. "-------\n"
  8655. "scalar or ndarray\n"
  8656. " Values of the confluent hypergeometric function\n"
  8657. "\n"
  8658. "See Also\n"
  8659. "--------\n"
  8660. "hyperu : another confluent hypergeometric function\n"
  8661. "hyp0f1 : confluent hypergeometric limit function\n"
  8662. "hyp2f1 : Gaussian hypergeometric function\n"
  8663. "\n"
  8664. "Notes\n"
  8665. "-----\n"
  8666. "For real values, this function uses the ``hyp1f1`` routine from the C++ Boost\n"
  8667. "library [2]_, for complex values a C translation of the specfun\n"
  8668. "Fortran library [3]_.\n"
  8669. "\n"
  8670. "References\n"
  8671. "----------\n"
  8672. ".. [DLMF] NIST Digital Library of Mathematical Functions\n"
  8673. " https://dlmf.nist.gov/13.2#E2\n"
  8674. ".. [2] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  8675. ".. [3] Zhang, Jin, \"Computation of Special Functions\", John Wiley\n"
  8676. " and Sons, Inc, 1996.\n"
  8677. "\n"
  8678. "Examples\n"
  8679. "--------\n"
  8680. ">>> import numpy as np\n"
  8681. ">>> import scipy.special as sc\n"
  8682. "\n"
  8683. "It is one when `x` is zero:\n"
  8684. "\n"
  8685. ">>> sc.hyp1f1(0.5, 0.5, 0)\n"
  8686. "1.0\n"
  8687. "\n"
  8688. "It is singular when `b` is a nonpositive integer.\n"
  8689. "\n"
  8690. ">>> sc.hyp1f1(0.5, -1, 0)\n"
  8691. "inf\n"
  8692. "\n"
  8693. "It is a polynomial when `a` is a nonpositive integer.\n"
  8694. "\n"
  8695. ">>> a, b, x = -1, 0.5, np.array([1.0, 2.0, 3.0, 4.0])\n"
  8696. ">>> sc.hyp1f1(a, b, x)\n"
  8697. "array([-1., -3., -5., -7.])\n"
  8698. ">>> 1 + (a / b) * x\n"
  8699. "array([-1., -3., -5., -7.])\n"
  8700. "\n"
  8701. "It reduces to the exponential function when ``a = b``.\n"
  8702. "\n"
  8703. ">>> sc.hyp1f1(2, 2, [1, 2, 3, 4])\n"
  8704. "array([ 2.71828183, 7.3890561 , 20.08553692, 54.59815003])\n"
  8705. ">>> np.exp([1, 2, 3, 4])\n"
  8706. "array([ 2.71828183, 7.3890561 , 20.08553692, 54.59815003])")
  8707. ufunc_hyp1f1_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  8708. ufunc_hyp1f1_loops[1] = <np.PyUFuncGenericFunction>loop_D_ddD__As_ffF_F
  8709. ufunc_hyp1f1_loops[2] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  8710. ufunc_hyp1f1_loops[3] = <np.PyUFuncGenericFunction>loop_D_ddD__As_ddD_D
  8711. ufunc_hyp1f1_types[0] = <char>NPY_FLOAT
  8712. ufunc_hyp1f1_types[1] = <char>NPY_FLOAT
  8713. ufunc_hyp1f1_types[2] = <char>NPY_FLOAT
  8714. ufunc_hyp1f1_types[3] = <char>NPY_FLOAT
  8715. ufunc_hyp1f1_types[4] = <char>NPY_FLOAT
  8716. ufunc_hyp1f1_types[5] = <char>NPY_FLOAT
  8717. ufunc_hyp1f1_types[6] = <char>NPY_CFLOAT
  8718. ufunc_hyp1f1_types[7] = <char>NPY_CFLOAT
  8719. ufunc_hyp1f1_types[8] = <char>NPY_DOUBLE
  8720. ufunc_hyp1f1_types[9] = <char>NPY_DOUBLE
  8721. ufunc_hyp1f1_types[10] = <char>NPY_DOUBLE
  8722. ufunc_hyp1f1_types[11] = <char>NPY_DOUBLE
  8723. ufunc_hyp1f1_types[12] = <char>NPY_DOUBLE
  8724. ufunc_hyp1f1_types[13] = <char>NPY_DOUBLE
  8725. ufunc_hyp1f1_types[14] = <char>NPY_CDOUBLE
  8726. ufunc_hyp1f1_types[15] = <char>NPY_CDOUBLE
  8727. ufunc_hyp1f1_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_hyp1f1_double
  8728. ufunc_hyp1f1_ptr[2*0+1] = <void*>(<char*>"hyp1f1")
  8729. ufunc_hyp1f1_ptr[2*1] = <void*>_func_chyp1f1_wrap
  8730. ufunc_hyp1f1_ptr[2*1+1] = <void*>(<char*>"hyp1f1")
  8731. ufunc_hyp1f1_ptr[2*2] = <void*>scipy.special._ufuncs_cxx._export_hyp1f1_double
  8732. ufunc_hyp1f1_ptr[2*2+1] = <void*>(<char*>"hyp1f1")
  8733. ufunc_hyp1f1_ptr[2*3] = <void*>_func_chyp1f1_wrap
  8734. ufunc_hyp1f1_ptr[2*3+1] = <void*>(<char*>"hyp1f1")
  8735. ufunc_hyp1f1_data[0] = &ufunc_hyp1f1_ptr[2*0]
  8736. ufunc_hyp1f1_data[1] = &ufunc_hyp1f1_ptr[2*1]
  8737. ufunc_hyp1f1_data[2] = &ufunc_hyp1f1_ptr[2*2]
  8738. ufunc_hyp1f1_data[3] = &ufunc_hyp1f1_ptr[2*3]
  8739. hyp1f1 = np.PyUFunc_FromFuncAndData(ufunc_hyp1f1_loops, ufunc_hyp1f1_data, ufunc_hyp1f1_types, 4, 3, 1, 0, 'hyp1f1', ufunc_hyp1f1_doc, 0)
  8740. cdef np.PyUFuncGenericFunction ufunc_hyperu_loops[2]
  8741. cdef void *ufunc_hyperu_ptr[4]
  8742. cdef void *ufunc_hyperu_data[2]
  8743. cdef char ufunc_hyperu_types[8]
  8744. cdef char *ufunc_hyperu_doc = (
  8745. "hyperu(a, b, x, out=None)\n"
  8746. "\n"
  8747. "Confluent hypergeometric function U\n"
  8748. "\n"
  8749. "It is defined as the solution to the equation\n"
  8750. "\n"
  8751. ".. math::\n"
  8752. "\n"
  8753. " x \\frac{d^2w}{dx^2} + (b - x) \\frac{dw}{dx} - aw = 0\n"
  8754. "\n"
  8755. "which satisfies the property\n"
  8756. "\n"
  8757. ".. math::\n"
  8758. "\n"
  8759. " U(a, b, x) \\sim x^{-a}\n"
  8760. "\n"
  8761. "as :math:`x \\to \\infty`. See [DLMF]_ for more details.\n"
  8762. "\n"
  8763. "Parameters\n"
  8764. "----------\n"
  8765. "a, b : array_like\n"
  8766. " Real-valued parameters\n"
  8767. "x : array_like\n"
  8768. " Real-valued argument\n"
  8769. "out : ndarray, optional\n"
  8770. " Optional output array for the function values\n"
  8771. "\n"
  8772. "Returns\n"
  8773. "-------\n"
  8774. "scalar or ndarray\n"
  8775. " Values of `U`\n"
  8776. "\n"
  8777. "References\n"
  8778. "----------\n"
  8779. ".. [DLMF] NIST Digital Library of Mathematics Functions\n"
  8780. " https://dlmf.nist.gov/13.2#E6\n"
  8781. "\n"
  8782. "Examples\n"
  8783. "--------\n"
  8784. ">>> import numpy as np\n"
  8785. ">>> import scipy.special as sc\n"
  8786. "\n"
  8787. "It has a branch cut along the negative `x` axis.\n"
  8788. "\n"
  8789. ">>> x = np.linspace(-0.1, -10, 5)\n"
  8790. ">>> sc.hyperu(1, 1, x)\n"
  8791. "array([nan, nan, nan, nan, nan])\n"
  8792. "\n"
  8793. "It approaches zero as `x` goes to infinity.\n"
  8794. "\n"
  8795. ">>> x = np.array([1, 10, 100])\n"
  8796. ">>> sc.hyperu(1, 1, x)\n"
  8797. "array([0.59634736, 0.09156333, 0.00990194])\n"
  8798. "\n"
  8799. "It satisfies Kummer's transformation.\n"
  8800. "\n"
  8801. ">>> a, b, x = 2, 1, 1\n"
  8802. ">>> sc.hyperu(a, b, x)\n"
  8803. "0.1926947246463881\n"
  8804. ">>> x**(1 - b) * sc.hyperu(a - b + 1, 2 - b, x)\n"
  8805. "0.1926947246463881")
  8806. ufunc_hyperu_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  8807. ufunc_hyperu_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  8808. ufunc_hyperu_types[0] = <char>NPY_FLOAT
  8809. ufunc_hyperu_types[1] = <char>NPY_FLOAT
  8810. ufunc_hyperu_types[2] = <char>NPY_FLOAT
  8811. ufunc_hyperu_types[3] = <char>NPY_FLOAT
  8812. ufunc_hyperu_types[4] = <char>NPY_DOUBLE
  8813. ufunc_hyperu_types[5] = <char>NPY_DOUBLE
  8814. ufunc_hyperu_types[6] = <char>NPY_DOUBLE
  8815. ufunc_hyperu_types[7] = <char>NPY_DOUBLE
  8816. ufunc_hyperu_ptr[2*0] = <void*>_func_hyperu
  8817. ufunc_hyperu_ptr[2*0+1] = <void*>(<char*>"hyperu")
  8818. ufunc_hyperu_ptr[2*1] = <void*>_func_hyperu
  8819. ufunc_hyperu_ptr[2*1+1] = <void*>(<char*>"hyperu")
  8820. ufunc_hyperu_data[0] = &ufunc_hyperu_ptr[2*0]
  8821. ufunc_hyperu_data[1] = &ufunc_hyperu_ptr[2*1]
  8822. hyperu = np.PyUFunc_FromFuncAndData(ufunc_hyperu_loops, ufunc_hyperu_data, ufunc_hyperu_types, 2, 3, 1, 0, 'hyperu', ufunc_hyperu_doc, 0)
  8823. cdef np.PyUFuncGenericFunction ufunc_inv_boxcox_loops[2]
  8824. cdef void *ufunc_inv_boxcox_ptr[4]
  8825. cdef void *ufunc_inv_boxcox_data[2]
  8826. cdef char ufunc_inv_boxcox_types[6]
  8827. cdef char *ufunc_inv_boxcox_doc = (
  8828. "inv_boxcox(y, lmbda, out=None)\n"
  8829. "\n"
  8830. "Compute the inverse of the Box-Cox transformation.\n"
  8831. "\n"
  8832. "Find ``x`` such that::\n"
  8833. "\n"
  8834. " y = (x**lmbda - 1) / lmbda if lmbda != 0\n"
  8835. " log(x) if lmbda == 0\n"
  8836. "\n"
  8837. "Parameters\n"
  8838. "----------\n"
  8839. "y : array_like\n"
  8840. " Data to be transformed.\n"
  8841. "lmbda : array_like\n"
  8842. " Power parameter of the Box-Cox transform.\n"
  8843. "out : ndarray, optional\n"
  8844. " Optional output array for the function values\n"
  8845. "\n"
  8846. "Returns\n"
  8847. "-------\n"
  8848. "x : scalar or ndarray\n"
  8849. " Transformed data.\n"
  8850. "\n"
  8851. "Notes\n"
  8852. "-----\n"
  8853. "\n"
  8854. ".. versionadded:: 0.16.0\n"
  8855. "\n"
  8856. "Examples\n"
  8857. "--------\n"
  8858. ">>> from scipy.special import boxcox, inv_boxcox\n"
  8859. ">>> y = boxcox([1, 4, 10], 2.5)\n"
  8860. ">>> inv_boxcox(y, 2.5)\n"
  8861. "array([1., 4., 10.])")
  8862. ufunc_inv_boxcox_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  8863. ufunc_inv_boxcox_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  8864. ufunc_inv_boxcox_types[0] = <char>NPY_FLOAT
  8865. ufunc_inv_boxcox_types[1] = <char>NPY_FLOAT
  8866. ufunc_inv_boxcox_types[2] = <char>NPY_FLOAT
  8867. ufunc_inv_boxcox_types[3] = <char>NPY_DOUBLE
  8868. ufunc_inv_boxcox_types[4] = <char>NPY_DOUBLE
  8869. ufunc_inv_boxcox_types[5] = <char>NPY_DOUBLE
  8870. ufunc_inv_boxcox_ptr[2*0] = <void*>_func_inv_boxcox
  8871. ufunc_inv_boxcox_ptr[2*0+1] = <void*>(<char*>"inv_boxcox")
  8872. ufunc_inv_boxcox_ptr[2*1] = <void*>_func_inv_boxcox
  8873. ufunc_inv_boxcox_ptr[2*1+1] = <void*>(<char*>"inv_boxcox")
  8874. ufunc_inv_boxcox_data[0] = &ufunc_inv_boxcox_ptr[2*0]
  8875. ufunc_inv_boxcox_data[1] = &ufunc_inv_boxcox_ptr[2*1]
  8876. inv_boxcox = np.PyUFunc_FromFuncAndData(ufunc_inv_boxcox_loops, ufunc_inv_boxcox_data, ufunc_inv_boxcox_types, 2, 2, 1, 0, 'inv_boxcox', ufunc_inv_boxcox_doc, 0)
  8877. cdef np.PyUFuncGenericFunction ufunc_inv_boxcox1p_loops[2]
  8878. cdef void *ufunc_inv_boxcox1p_ptr[4]
  8879. cdef void *ufunc_inv_boxcox1p_data[2]
  8880. cdef char ufunc_inv_boxcox1p_types[6]
  8881. cdef char *ufunc_inv_boxcox1p_doc = (
  8882. "inv_boxcox1p(y, lmbda, out=None)\n"
  8883. "\n"
  8884. "Compute the inverse of the Box-Cox transformation.\n"
  8885. "\n"
  8886. "Find ``x`` such that::\n"
  8887. "\n"
  8888. " y = ((1+x)**lmbda - 1) / lmbda if lmbda != 0\n"
  8889. " log(1+x) if lmbda == 0\n"
  8890. "\n"
  8891. "Parameters\n"
  8892. "----------\n"
  8893. "y : array_like\n"
  8894. " Data to be transformed.\n"
  8895. "lmbda : array_like\n"
  8896. " Power parameter of the Box-Cox transform.\n"
  8897. "out : ndarray, optional\n"
  8898. " Optional output array for the function values\n"
  8899. "\n"
  8900. "Returns\n"
  8901. "-------\n"
  8902. "x : scalar or ndarray\n"
  8903. " Transformed data.\n"
  8904. "\n"
  8905. "Notes\n"
  8906. "-----\n"
  8907. "\n"
  8908. ".. versionadded:: 0.16.0\n"
  8909. "\n"
  8910. "Examples\n"
  8911. "--------\n"
  8912. ">>> from scipy.special import boxcox1p, inv_boxcox1p\n"
  8913. ">>> y = boxcox1p([1, 4, 10], 2.5)\n"
  8914. ">>> inv_boxcox1p(y, 2.5)\n"
  8915. "array([1., 4., 10.])")
  8916. ufunc_inv_boxcox1p_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  8917. ufunc_inv_boxcox1p_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  8918. ufunc_inv_boxcox1p_types[0] = <char>NPY_FLOAT
  8919. ufunc_inv_boxcox1p_types[1] = <char>NPY_FLOAT
  8920. ufunc_inv_boxcox1p_types[2] = <char>NPY_FLOAT
  8921. ufunc_inv_boxcox1p_types[3] = <char>NPY_DOUBLE
  8922. ufunc_inv_boxcox1p_types[4] = <char>NPY_DOUBLE
  8923. ufunc_inv_boxcox1p_types[5] = <char>NPY_DOUBLE
  8924. ufunc_inv_boxcox1p_ptr[2*0] = <void*>_func_inv_boxcox1p
  8925. ufunc_inv_boxcox1p_ptr[2*0+1] = <void*>(<char*>"inv_boxcox1p")
  8926. ufunc_inv_boxcox1p_ptr[2*1] = <void*>_func_inv_boxcox1p
  8927. ufunc_inv_boxcox1p_ptr[2*1+1] = <void*>(<char*>"inv_boxcox1p")
  8928. ufunc_inv_boxcox1p_data[0] = &ufunc_inv_boxcox1p_ptr[2*0]
  8929. ufunc_inv_boxcox1p_data[1] = &ufunc_inv_boxcox1p_ptr[2*1]
  8930. inv_boxcox1p = np.PyUFunc_FromFuncAndData(ufunc_inv_boxcox1p_loops, ufunc_inv_boxcox1p_data, ufunc_inv_boxcox1p_types, 2, 2, 1, 0, 'inv_boxcox1p', ufunc_inv_boxcox1p_doc, 0)
  8931. cdef np.PyUFuncGenericFunction ufunc_kl_div_loops[2]
  8932. cdef void *ufunc_kl_div_ptr[4]
  8933. cdef void *ufunc_kl_div_data[2]
  8934. cdef char ufunc_kl_div_types[6]
  8935. cdef char *ufunc_kl_div_doc = (
  8936. "kl_div(x, y, out=None)\n"
  8937. "\n"
  8938. "Elementwise function for computing Kullback-Leibler divergence.\n"
  8939. "\n"
  8940. ".. math::\n"
  8941. "\n"
  8942. " \\mathrm{kl\\_div}(x, y) =\n"
  8943. " \\begin{cases}\n"
  8944. " x \\log(x / y) - x + y & x > 0, y > 0 \\\\\n"
  8945. " y & x = 0, y \\ge 0 \\\\\n"
  8946. " \\infty & \\text{otherwise}\n"
  8947. " \\end{cases}\n"
  8948. "\n"
  8949. "Parameters\n"
  8950. "----------\n"
  8951. "x, y : array_like\n"
  8952. " Real arguments\n"
  8953. "out : ndarray, optional\n"
  8954. " Optional output array for the function results\n"
  8955. "\n"
  8956. "Returns\n"
  8957. "-------\n"
  8958. "scalar or ndarray\n"
  8959. " Values of the Kullback-Liebler divergence.\n"
  8960. "\n"
  8961. "See Also\n"
  8962. "--------\n"
  8963. "entr, rel_entr, scipy.stats.entropy\n"
  8964. "\n"
  8965. "Notes\n"
  8966. "-----\n"
  8967. ".. versionadded:: 0.15.0\n"
  8968. "\n"
  8969. "This function is non-negative and is jointly convex in `x` and `y`.\n"
  8970. "\n"
  8971. "The origin of this function is in convex programming; see [1]_ for\n"
  8972. "details. This is why the function contains the extra :math:`-x\n"
  8973. "+ y` terms over what might be expected from the Kullback-Leibler\n"
  8974. "divergence. For a version of the function without the extra terms,\n"
  8975. "see `rel_entr`.\n"
  8976. "\n"
  8977. "References\n"
  8978. "----------\n"
  8979. ".. [1] Boyd, Stephen and Lieven Vandenberghe. *Convex optimization*.\n"
  8980. " Cambridge University Press, 2004.\n"
  8981. " :doi:`https://doi.org/10.1017/CBO9780511804441`")
  8982. ufunc_kl_div_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  8983. ufunc_kl_div_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  8984. ufunc_kl_div_types[0] = <char>NPY_FLOAT
  8985. ufunc_kl_div_types[1] = <char>NPY_FLOAT
  8986. ufunc_kl_div_types[2] = <char>NPY_FLOAT
  8987. ufunc_kl_div_types[3] = <char>NPY_DOUBLE
  8988. ufunc_kl_div_types[4] = <char>NPY_DOUBLE
  8989. ufunc_kl_div_types[5] = <char>NPY_DOUBLE
  8990. ufunc_kl_div_ptr[2*0] = <void*>_func_kl_div
  8991. ufunc_kl_div_ptr[2*0+1] = <void*>(<char*>"kl_div")
  8992. ufunc_kl_div_ptr[2*1] = <void*>_func_kl_div
  8993. ufunc_kl_div_ptr[2*1+1] = <void*>(<char*>"kl_div")
  8994. ufunc_kl_div_data[0] = &ufunc_kl_div_ptr[2*0]
  8995. ufunc_kl_div_data[1] = &ufunc_kl_div_ptr[2*1]
  8996. kl_div = np.PyUFunc_FromFuncAndData(ufunc_kl_div_loops, ufunc_kl_div_data, ufunc_kl_div_types, 2, 2, 1, 0, 'kl_div', ufunc_kl_div_doc, 0)
  8997. cdef np.PyUFuncGenericFunction ufunc_kn_loops[3]
  8998. cdef void *ufunc_kn_ptr[6]
  8999. cdef void *ufunc_kn_data[3]
  9000. cdef char ufunc_kn_types[9]
  9001. cdef char *ufunc_kn_doc = (
  9002. "kn(n, x, out=None)\n"
  9003. "\n"
  9004. "Modified Bessel function of the second kind of integer order `n`\n"
  9005. "\n"
  9006. "Returns the modified Bessel function of the second kind for integer order\n"
  9007. "`n` at real `z`.\n"
  9008. "\n"
  9009. "These are also sometimes called functions of the third kind, Basset\n"
  9010. "functions, or Macdonald functions.\n"
  9011. "\n"
  9012. "Parameters\n"
  9013. "----------\n"
  9014. "n : array_like of int\n"
  9015. " Order of Bessel functions (floats will truncate with a warning)\n"
  9016. "x : array_like of float\n"
  9017. " Argument at which to evaluate the Bessel functions\n"
  9018. "out : ndarray, optional\n"
  9019. " Optional output array for the function results.\n"
  9020. "\n"
  9021. "Returns\n"
  9022. "-------\n"
  9023. "scalar or ndarray\n"
  9024. " Value of the Modified Bessel function of the second kind,\n"
  9025. " :math:`K_n(x)`.\n"
  9026. "\n"
  9027. "See Also\n"
  9028. "--------\n"
  9029. "kv : Same function, but accepts real order and complex argument\n"
  9030. "kvp : Derivative of this function\n"
  9031. "\n"
  9032. "Notes\n"
  9033. "-----\n"
  9034. "Wrapper for AMOS [1]_ routine `zbesk`. For a discussion of the\n"
  9035. "algorithm used, see [2]_ and the references therein.\n"
  9036. "\n"
  9037. "References\n"
  9038. "----------\n"
  9039. ".. [1] Donald E. Amos, \"AMOS, A Portable Package for Bessel Functions\n"
  9040. " of a Complex Argument and Nonnegative Order\",\n"
  9041. " http://netlib.org/amos/\n"
  9042. ".. [2] Donald E. Amos, \"Algorithm 644: A portable package for Bessel\n"
  9043. " functions of a complex argument and nonnegative order\", ACM\n"
  9044. " TOMS Vol. 12 Issue 3, Sept. 1986, p. 265\n"
  9045. "\n"
  9046. "Examples\n"
  9047. "--------\n"
  9048. "Plot the function of several orders for real input:\n"
  9049. "\n"
  9050. ">>> import numpy as np\n"
  9051. ">>> from scipy.special import kn\n"
  9052. ">>> import matplotlib.pyplot as plt\n"
  9053. ">>> x = np.linspace(0, 5, 1000)\n"
  9054. ">>> for N in range(6):\n"
  9055. "... plt.plot(x, kn(N, x), label='$K_{}(x)$'.format(N))\n"
  9056. ">>> plt.ylim(0, 10)\n"
  9057. ">>> plt.legend()\n"
  9058. ">>> plt.title(r'Modified Bessel function of the second kind $K_n(x)$')\n"
  9059. ">>> plt.show()\n"
  9060. "\n"
  9061. "Calculate for a single value at multiple orders:\n"
  9062. "\n"
  9063. ">>> kn([4, 5, 6], 1)\n"
  9064. "array([ 44.23241585, 360.9605896 , 3653.83831186])")
  9065. ufunc_kn_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  9066. ufunc_kn_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  9067. ufunc_kn_loops[2] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  9068. ufunc_kn_types[0] = <char>NPY_INTP
  9069. ufunc_kn_types[1] = <char>NPY_DOUBLE
  9070. ufunc_kn_types[2] = <char>NPY_DOUBLE
  9071. ufunc_kn_types[3] = <char>NPY_FLOAT
  9072. ufunc_kn_types[4] = <char>NPY_FLOAT
  9073. ufunc_kn_types[5] = <char>NPY_FLOAT
  9074. ufunc_kn_types[6] = <char>NPY_DOUBLE
  9075. ufunc_kn_types[7] = <char>NPY_DOUBLE
  9076. ufunc_kn_types[8] = <char>NPY_DOUBLE
  9077. ufunc_kn_ptr[2*0] = <void*>_func_special_cyl_bessel_k_int
  9078. ufunc_kn_ptr[2*0+1] = <void*>(<char*>"kn")
  9079. ufunc_kn_ptr[2*1] = <void*>_func_kn_unsafe
  9080. ufunc_kn_ptr[2*1+1] = <void*>(<char*>"kn")
  9081. ufunc_kn_ptr[2*2] = <void*>_func_kn_unsafe
  9082. ufunc_kn_ptr[2*2+1] = <void*>(<char*>"kn")
  9083. ufunc_kn_data[0] = &ufunc_kn_ptr[2*0]
  9084. ufunc_kn_data[1] = &ufunc_kn_ptr[2*1]
  9085. ufunc_kn_data[2] = &ufunc_kn_ptr[2*2]
  9086. kn = np.PyUFunc_FromFuncAndData(ufunc_kn_loops, ufunc_kn_data, ufunc_kn_types, 3, 2, 1, 0, 'kn', ufunc_kn_doc, 0)
  9087. cdef np.PyUFuncGenericFunction ufunc_kolmogi_loops[2]
  9088. cdef void *ufunc_kolmogi_ptr[4]
  9089. cdef void *ufunc_kolmogi_data[2]
  9090. cdef char ufunc_kolmogi_types[4]
  9091. cdef char *ufunc_kolmogi_doc = (
  9092. "kolmogi(p, out=None)\n"
  9093. "\n"
  9094. "Inverse Survival Function of Kolmogorov distribution\n"
  9095. "\n"
  9096. "It is the inverse function to `kolmogorov`.\n"
  9097. "Returns y such that ``kolmogorov(y) == p``.\n"
  9098. "\n"
  9099. "Parameters\n"
  9100. "----------\n"
  9101. "p : float array_like\n"
  9102. " Probability\n"
  9103. "out : ndarray, optional\n"
  9104. " Optional output array for the function results\n"
  9105. "\n"
  9106. "Returns\n"
  9107. "-------\n"
  9108. "scalar or ndarray\n"
  9109. " The value(s) of kolmogi(p)\n"
  9110. "\n"
  9111. "See Also\n"
  9112. "--------\n"
  9113. "kolmogorov : The Survival Function for the distribution\n"
  9114. "scipy.stats.kstwobign : Provides the functionality as a continuous distribution\n"
  9115. "smirnov, smirnovi : Functions for the one-sided distribution\n"
  9116. "\n"
  9117. "Notes\n"
  9118. "-----\n"
  9119. "`kolmogorov` is used by `stats.kstest` in the application of the\n"
  9120. "Kolmogorov-Smirnov Goodness of Fit test. For historical reasons this\n"
  9121. "function is exposed in `scpy.special`, but the recommended way to achieve\n"
  9122. "the most accurate CDF/SF/PDF/PPF/ISF computations is to use the\n"
  9123. "`stats.kstwobign` distribution.\n"
  9124. "\n"
  9125. "Examples\n"
  9126. "--------\n"
  9127. ">>> from scipy.special import kolmogi\n"
  9128. ">>> kolmogi([0, 0.1, 0.25, 0.5, 0.75, 0.9, 1.0])\n"
  9129. "array([ inf, 1.22384787, 1.01918472, 0.82757356, 0.67644769,\n"
  9130. " 0.57117327, 0. ])")
  9131. ufunc_kolmogi_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  9132. ufunc_kolmogi_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  9133. ufunc_kolmogi_types[0] = <char>NPY_FLOAT
  9134. ufunc_kolmogi_types[1] = <char>NPY_FLOAT
  9135. ufunc_kolmogi_types[2] = <char>NPY_DOUBLE
  9136. ufunc_kolmogi_types[3] = <char>NPY_DOUBLE
  9137. ufunc_kolmogi_ptr[2*0] = <void*>_func_xsf_kolmogi
  9138. ufunc_kolmogi_ptr[2*0+1] = <void*>(<char*>"kolmogi")
  9139. ufunc_kolmogi_ptr[2*1] = <void*>_func_xsf_kolmogi
  9140. ufunc_kolmogi_ptr[2*1+1] = <void*>(<char*>"kolmogi")
  9141. ufunc_kolmogi_data[0] = &ufunc_kolmogi_ptr[2*0]
  9142. ufunc_kolmogi_data[1] = &ufunc_kolmogi_ptr[2*1]
  9143. kolmogi = np.PyUFunc_FromFuncAndData(ufunc_kolmogi_loops, ufunc_kolmogi_data, ufunc_kolmogi_types, 2, 1, 1, 0, 'kolmogi', ufunc_kolmogi_doc, 0)
  9144. cdef np.PyUFuncGenericFunction ufunc_kolmogorov_loops[2]
  9145. cdef void *ufunc_kolmogorov_ptr[4]
  9146. cdef void *ufunc_kolmogorov_data[2]
  9147. cdef char ufunc_kolmogorov_types[4]
  9148. cdef char *ufunc_kolmogorov_doc = (
  9149. "kolmogorov(y, out=None)\n"
  9150. "\n"
  9151. "Complementary cumulative distribution (Survival Function) function of\n"
  9152. "Kolmogorov distribution.\n"
  9153. "\n"
  9154. "Returns the complementary cumulative distribution function of\n"
  9155. "Kolmogorov's limiting distribution (``D_n*\\sqrt(n)`` as n goes to infinity)\n"
  9156. "of a two-sided test for equality between an empirical and a theoretical\n"
  9157. "distribution. It is equal to the (limit as n->infinity of the)\n"
  9158. "probability that ``sqrt(n) * max absolute deviation > y``.\n"
  9159. "\n"
  9160. "Parameters\n"
  9161. "----------\n"
  9162. "y : float array_like\n"
  9163. " Absolute deviation between the Empirical CDF (ECDF) and the target CDF,\n"
  9164. " multiplied by sqrt(n).\n"
  9165. "out : ndarray, optional\n"
  9166. " Optional output array for the function results\n"
  9167. "\n"
  9168. "Returns\n"
  9169. "-------\n"
  9170. "scalar or ndarray\n"
  9171. " The value(s) of kolmogorov(y)\n"
  9172. "\n"
  9173. "See Also\n"
  9174. "--------\n"
  9175. "kolmogi : The Inverse Survival Function for the distribution\n"
  9176. "scipy.stats.kstwobign : Provides the functionality as a continuous distribution\n"
  9177. "smirnov, smirnovi : Functions for the one-sided distribution\n"
  9178. "\n"
  9179. "Notes\n"
  9180. "-----\n"
  9181. "`kolmogorov` is used by `stats.kstest` in the application of the\n"
  9182. "Kolmogorov-Smirnov Goodness of Fit test. For historical reasons this\n"
  9183. "function is exposed in `scpy.special`, but the recommended way to achieve\n"
  9184. "the most accurate CDF/SF/PDF/PPF/ISF computations is to use the\n"
  9185. "`stats.kstwobign` distribution.\n"
  9186. "\n"
  9187. "Examples\n"
  9188. "--------\n"
  9189. "Show the probability of a gap at least as big as 0, 0.5 and 1.0.\n"
  9190. "\n"
  9191. ">>> import numpy as np\n"
  9192. ">>> from scipy.special import kolmogorov\n"
  9193. ">>> from scipy.stats import kstwobign\n"
  9194. ">>> kolmogorov([0, 0.5, 1.0])\n"
  9195. "array([ 1. , 0.96394524, 0.26999967])\n"
  9196. "\n"
  9197. "Compare a sample of size 1000 drawn from a Laplace(0, 1) distribution against\n"
  9198. "the target distribution, a Normal(0, 1) distribution.\n"
  9199. "\n"
  9200. ">>> from scipy.stats import norm, laplace\n"
  9201. ">>> rng = np.random.default_rng()\n"
  9202. ">>> n = 1000\n"
  9203. ">>> lap01 = laplace(0, 1)\n"
  9204. ">>> x = np.sort(lap01.rvs(n, random_state=rng))\n"
  9205. ">>> np.mean(x), np.std(x)\n"
  9206. "(-0.05841730131499543, 1.3968109101997568)\n"
  9207. "\n"
  9208. "Construct the Empirical CDF and the K-S statistic Dn.\n"
  9209. "\n"
  9210. ">>> target = norm(0,1) # Normal mean 0, stddev 1\n"
  9211. ">>> cdfs = target.cdf(x)\n"
  9212. ">>> ecdfs = np.arange(n+1, dtype=float)/n\n"
  9213. ">>> gaps = np.column_stack([cdfs - ecdfs[:n], ecdfs[1:] - cdfs])\n"
  9214. ">>> Dn = np.max(gaps)\n"
  9215. ">>> Kn = np.sqrt(n) * Dn\n"
  9216. ">>> print('Dn=%f, sqrt(n)*Dn=%f' % (Dn, Kn))\n"
  9217. "Dn=0.043363, sqrt(n)*Dn=1.371265\n"
  9218. ">>> print(chr(10).join(['For a sample of size n drawn from a N(0, 1) distribution:',\n"
  9219. "... ' the approximate Kolmogorov probability that sqrt(n)*Dn>=%f is %f' %\n"
  9220. "... (Kn, kolmogorov(Kn)),\n"
  9221. "... ' the approximate Kolmogorov probability that sqrt(n)*Dn<=%f is %f' %\n"
  9222. "... (Kn, kstwobign.cdf(Kn))]))\n"
  9223. "For a sample of size n drawn from a N(0, 1) distribution:\n"
  9224. " the approximate Kolmogorov probability that sqrt(n)*Dn>=1.371265 is 0.046533\n"
  9225. " the approximate Kolmogorov probability that sqrt(n)*Dn<=1.371265 is 0.953467\n"
  9226. "\n"
  9227. "Plot the Empirical CDF against the target N(0, 1) CDF.\n"
  9228. "\n"
  9229. ">>> import matplotlib.pyplot as plt\n"
  9230. ">>> plt.step(np.concatenate([[-3], x]), ecdfs, where='post', label='Empirical CDF')\n"
  9231. ">>> x3 = np.linspace(-3, 3, 100)\n"
  9232. ">>> plt.plot(x3, target.cdf(x3), label='CDF for N(0, 1)')\n"
  9233. ">>> plt.ylim([0, 1]); plt.grid(True); plt.legend();\n"
  9234. ">>> # Add vertical lines marking Dn+ and Dn-\n"
  9235. ">>> iminus, iplus = np.argmax(gaps, axis=0)\n"
  9236. ">>> plt.vlines([x[iminus]], ecdfs[iminus], cdfs[iminus],\n"
  9237. "... color='r', linestyle='dashed', lw=4)\n"
  9238. ">>> plt.vlines([x[iplus]], cdfs[iplus], ecdfs[iplus+1],\n"
  9239. "... color='r', linestyle='dashed', lw=4)\n"
  9240. ">>> plt.show()")
  9241. ufunc_kolmogorov_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  9242. ufunc_kolmogorov_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  9243. ufunc_kolmogorov_types[0] = <char>NPY_FLOAT
  9244. ufunc_kolmogorov_types[1] = <char>NPY_FLOAT
  9245. ufunc_kolmogorov_types[2] = <char>NPY_DOUBLE
  9246. ufunc_kolmogorov_types[3] = <char>NPY_DOUBLE
  9247. ufunc_kolmogorov_ptr[2*0] = <void*>_func_xsf_kolmogorov
  9248. ufunc_kolmogorov_ptr[2*0+1] = <void*>(<char*>"kolmogorov")
  9249. ufunc_kolmogorov_ptr[2*1] = <void*>_func_xsf_kolmogorov
  9250. ufunc_kolmogorov_ptr[2*1+1] = <void*>(<char*>"kolmogorov")
  9251. ufunc_kolmogorov_data[0] = &ufunc_kolmogorov_ptr[2*0]
  9252. ufunc_kolmogorov_data[1] = &ufunc_kolmogorov_ptr[2*1]
  9253. kolmogorov = np.PyUFunc_FromFuncAndData(ufunc_kolmogorov_loops, ufunc_kolmogorov_data, ufunc_kolmogorov_types, 2, 1, 1, 0, 'kolmogorov', ufunc_kolmogorov_doc, 0)
  9254. cdef np.PyUFuncGenericFunction ufunc_lpmv_loops[2]
  9255. cdef void *ufunc_lpmv_ptr[4]
  9256. cdef void *ufunc_lpmv_data[2]
  9257. cdef char ufunc_lpmv_types[8]
  9258. cdef char *ufunc_lpmv_doc = (
  9259. "lpmv(m, v, x, out=None)\n"
  9260. "\n"
  9261. "Associated Legendre function of integer order and real degree.\n"
  9262. "\n"
  9263. "Defined as\n"
  9264. "\n"
  9265. ".. math::\n"
  9266. "\n"
  9267. " P_v^m = (-1)^m (1 - x^2)^{m/2} \\frac{d^m}{dx^m} P_v(x)\n"
  9268. "\n"
  9269. "where\n"
  9270. "\n"
  9271. ".. math::\n"
  9272. "\n"
  9273. " P_v = \\sum_{k = 0}^\\infty \\frac{(-v)_k (v + 1)_k}{(k!)^2}\n"
  9274. " \\left(\\frac{1 - x}{2}\\right)^k\n"
  9275. "\n"
  9276. "is the Legendre function of the first kind. Here :math:`(\\cdot)_k`\n"
  9277. "is the Pochhammer symbol; see `poch`.\n"
  9278. "\n"
  9279. "Parameters\n"
  9280. "----------\n"
  9281. "m : array_like\n"
  9282. " Order (int or float). If passed a float not equal to an\n"
  9283. " integer the function returns NaN.\n"
  9284. "v : array_like\n"
  9285. " Degree (float).\n"
  9286. "x : array_like\n"
  9287. " Argument (float). Must have ``|x| <= 1``.\n"
  9288. "out : ndarray, optional\n"
  9289. " Optional output array for the function results\n"
  9290. "\n"
  9291. "Returns\n"
  9292. "-------\n"
  9293. "pmv : scalar or ndarray\n"
  9294. " Value of the associated Legendre function.\n"
  9295. "\n"
  9296. "Notes\n"
  9297. "-----\n"
  9298. "Note that this implementation includes the Condon-Shortley phase.\n"
  9299. "\n"
  9300. "References\n"
  9301. "----------\n"
  9302. ".. [1] Zhang, Jin, \"Computation of Special Functions\", John Wiley\n"
  9303. " and Sons, Inc, 1996.")
  9304. ufunc_lpmv_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  9305. ufunc_lpmv_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  9306. ufunc_lpmv_types[0] = <char>NPY_FLOAT
  9307. ufunc_lpmv_types[1] = <char>NPY_FLOAT
  9308. ufunc_lpmv_types[2] = <char>NPY_FLOAT
  9309. ufunc_lpmv_types[3] = <char>NPY_FLOAT
  9310. ufunc_lpmv_types[4] = <char>NPY_DOUBLE
  9311. ufunc_lpmv_types[5] = <char>NPY_DOUBLE
  9312. ufunc_lpmv_types[6] = <char>NPY_DOUBLE
  9313. ufunc_lpmv_types[7] = <char>NPY_DOUBLE
  9314. ufunc_lpmv_ptr[2*0] = <void*>_func_pmv_wrap
  9315. ufunc_lpmv_ptr[2*0+1] = <void*>(<char*>"lpmv")
  9316. ufunc_lpmv_ptr[2*1] = <void*>_func_pmv_wrap
  9317. ufunc_lpmv_ptr[2*1+1] = <void*>(<char*>"lpmv")
  9318. ufunc_lpmv_data[0] = &ufunc_lpmv_ptr[2*0]
  9319. ufunc_lpmv_data[1] = &ufunc_lpmv_ptr[2*1]
  9320. lpmv = np.PyUFunc_FromFuncAndData(ufunc_lpmv_loops, ufunc_lpmv_data, ufunc_lpmv_types, 2, 3, 1, 0, 'lpmv', ufunc_lpmv_doc, 0)
  9321. cdef np.PyUFuncGenericFunction ufunc_nbdtr_loops[3]
  9322. cdef void *ufunc_nbdtr_ptr[6]
  9323. cdef void *ufunc_nbdtr_data[3]
  9324. cdef char ufunc_nbdtr_types[12]
  9325. cdef char *ufunc_nbdtr_doc = (
  9326. "nbdtr(k, n, p, out=None)\n"
  9327. "\n"
  9328. "Negative binomial cumulative distribution function.\n"
  9329. "\n"
  9330. "Returns the sum of the terms 0 through `k` of the negative binomial\n"
  9331. "distribution probability mass function,\n"
  9332. "\n"
  9333. ".. math::\n"
  9334. "\n"
  9335. " F = \\sum_{j=0}^k {{n + j - 1}\\choose{j}} p^n (1 - p)^j.\n"
  9336. "\n"
  9337. "In a sequence of Bernoulli trials with individual success probabilities\n"
  9338. "`p`, this is the probability that `k` or fewer failures precede the nth\n"
  9339. "success.\n"
  9340. "\n"
  9341. "Parameters\n"
  9342. "----------\n"
  9343. "k : array_like\n"
  9344. " The maximum number of allowed failures (nonnegative int).\n"
  9345. "n : array_like\n"
  9346. " The target number of successes (positive int).\n"
  9347. "p : array_like\n"
  9348. " Probability of success in a single event (float).\n"
  9349. "out : ndarray, optional\n"
  9350. " Optional output array for the function results\n"
  9351. "\n"
  9352. "Returns\n"
  9353. "-------\n"
  9354. "F : scalar or ndarray\n"
  9355. " The probability of `k` or fewer failures before `n` successes in a\n"
  9356. " sequence of events with individual success probability `p`.\n"
  9357. "\n"
  9358. "See Also\n"
  9359. "--------\n"
  9360. "nbdtrc : Negative binomial survival function\n"
  9361. "nbdtrik : Negative binomial quantile function\n"
  9362. "scipy.stats.nbinom : Negative binomial distribution\n"
  9363. "\n"
  9364. "Notes\n"
  9365. "-----\n"
  9366. "If floating point values are passed for `k` or `n`, they will be truncated\n"
  9367. "to integers.\n"
  9368. "\n"
  9369. "The terms are not summed directly; instead the regularized incomplete beta\n"
  9370. "function is employed, according to the formula,\n"
  9371. "\n"
  9372. ".. math::\n"
  9373. " \\mathrm{nbdtr}(k, n, p) = I_{p}(n, k + 1).\n"
  9374. "\n"
  9375. "Wrapper for the Cephes [1]_ routine `nbdtr`.\n"
  9376. "\n"
  9377. "The negative binomial distribution is also available as\n"
  9378. "`scipy.stats.nbinom`. Using `nbdtr` directly can improve performance\n"
  9379. "compared to the ``cdf`` method of `scipy.stats.nbinom` (see last example).\n"
  9380. "\n"
  9381. "References\n"
  9382. "----------\n"
  9383. ".. [1] Cephes Mathematical Functions Library,\n"
  9384. " http://www.netlib.org/cephes/\n"
  9385. "\n"
  9386. "Examples\n"
  9387. "--------\n"
  9388. "Compute the function for ``k=10`` and ``n=5`` at ``p=0.5``.\n"
  9389. "\n"
  9390. ">>> import numpy as np\n"
  9391. ">>> from scipy.special import nbdtr\n"
  9392. ">>> nbdtr(10, 5, 0.5)\n"
  9393. "0.940765380859375\n"
  9394. "\n"
  9395. "Compute the function for ``n=10`` and ``p=0.5`` at several points by\n"
  9396. "providing a NumPy array or list for `k`.\n"
  9397. "\n"
  9398. ">>> nbdtr([5, 10, 15], 10, 0.5)\n"
  9399. "array([0.15087891, 0.58809853, 0.88523853])\n"
  9400. "\n"
  9401. "Plot the function for four different parameter sets.\n"
  9402. "\n"
  9403. ">>> import matplotlib.pyplot as plt\n"
  9404. ">>> k = np.arange(130)\n"
  9405. ">>> n_parameters = [20, 20, 20, 80]\n"
  9406. ">>> p_parameters = [0.2, 0.5, 0.8, 0.5]\n"
  9407. ">>> linestyles = ['solid', 'dashed', 'dotted', 'dashdot']\n"
  9408. ">>> parameters_list = list(zip(p_parameters, n_parameters,\n"
  9409. "... linestyles))\n"
  9410. ">>> fig, ax = plt.subplots(figsize=(8, 8))\n"
  9411. ">>> for parameter_set in parameters_list:\n"
  9412. "... p, n, style = parameter_set\n"
  9413. "... nbdtr_vals = nbdtr(k, n, p)\n"
  9414. "... ax.plot(k, nbdtr_vals, label=rf\"$n={n},\\, p={p}$\",\n"
  9415. "... ls=style)\n"
  9416. ">>> ax.legend()\n"
  9417. ">>> ax.set_xlabel(\"$k$\")\n"
  9418. ">>> ax.set_title(\"Negative binomial cumulative distribution function\")\n"
  9419. ">>> plt.show()\n"
  9420. "\n"
  9421. "The negative binomial distribution is also available as\n"
  9422. "`scipy.stats.nbinom`. Using `nbdtr` directly can be much faster than\n"
  9423. "calling the ``cdf`` method of `scipy.stats.nbinom`, especially for small\n"
  9424. "arrays or individual values. To get the same results one must use the\n"
  9425. "following parametrization: ``nbinom(n, p).cdf(k)=nbdtr(k, n, p)``.\n"
  9426. "\n"
  9427. ">>> from scipy.stats import nbinom\n"
  9428. ">>> k, n, p = 5, 3, 0.5\n"
  9429. ">>> nbdtr_res = nbdtr(k, n, p) # this will often be faster than below\n"
  9430. ">>> stats_res = nbinom(n, p).cdf(k)\n"
  9431. ">>> stats_res, nbdtr_res # test that results are equal\n"
  9432. "(0.85546875, 0.85546875)\n"
  9433. "\n"
  9434. "`nbdtr` can evaluate different parameter sets by providing arrays with\n"
  9435. "shapes compatible for broadcasting for `k`, `n` and `p`. Here we compute\n"
  9436. "the function for three different `k` at four locations `p`, resulting in\n"
  9437. "a 3x4 array.\n"
  9438. "\n"
  9439. ">>> k = np.array([[5], [10], [15]])\n"
  9440. ">>> p = np.array([0.3, 0.5, 0.7, 0.9])\n"
  9441. ">>> k.shape, p.shape\n"
  9442. "((3, 1), (4,))\n"
  9443. "\n"
  9444. ">>> nbdtr(k, 5, p)\n"
  9445. "array([[0.15026833, 0.62304687, 0.95265101, 0.9998531 ],\n"
  9446. " [0.48450894, 0.94076538, 0.99932777, 0.99999999],\n"
  9447. " [0.76249222, 0.99409103, 0.99999445, 1. ]])")
  9448. ufunc_nbdtr_loops[0] = <np.PyUFuncGenericFunction>loop_d_ppd__As_ppd_d
  9449. ufunc_nbdtr_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  9450. ufunc_nbdtr_loops[2] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  9451. ufunc_nbdtr_types[0] = <char>NPY_INTP
  9452. ufunc_nbdtr_types[1] = <char>NPY_INTP
  9453. ufunc_nbdtr_types[2] = <char>NPY_DOUBLE
  9454. ufunc_nbdtr_types[3] = <char>NPY_DOUBLE
  9455. ufunc_nbdtr_types[4] = <char>NPY_FLOAT
  9456. ufunc_nbdtr_types[5] = <char>NPY_FLOAT
  9457. ufunc_nbdtr_types[6] = <char>NPY_FLOAT
  9458. ufunc_nbdtr_types[7] = <char>NPY_FLOAT
  9459. ufunc_nbdtr_types[8] = <char>NPY_DOUBLE
  9460. ufunc_nbdtr_types[9] = <char>NPY_DOUBLE
  9461. ufunc_nbdtr_types[10] = <char>NPY_DOUBLE
  9462. ufunc_nbdtr_types[11] = <char>NPY_DOUBLE
  9463. ufunc_nbdtr_ptr[2*0] = <void*>_func_cephes_nbdtr_wrap
  9464. ufunc_nbdtr_ptr[2*0+1] = <void*>(<char*>"nbdtr")
  9465. ufunc_nbdtr_ptr[2*1] = <void*>_func_nbdtr_unsafe
  9466. ufunc_nbdtr_ptr[2*1+1] = <void*>(<char*>"nbdtr")
  9467. ufunc_nbdtr_ptr[2*2] = <void*>_func_nbdtr_unsafe
  9468. ufunc_nbdtr_ptr[2*2+1] = <void*>(<char*>"nbdtr")
  9469. ufunc_nbdtr_data[0] = &ufunc_nbdtr_ptr[2*0]
  9470. ufunc_nbdtr_data[1] = &ufunc_nbdtr_ptr[2*1]
  9471. ufunc_nbdtr_data[2] = &ufunc_nbdtr_ptr[2*2]
  9472. nbdtr = np.PyUFunc_FromFuncAndData(ufunc_nbdtr_loops, ufunc_nbdtr_data, ufunc_nbdtr_types, 3, 3, 1, 0, 'nbdtr', ufunc_nbdtr_doc, 0)
  9473. cdef np.PyUFuncGenericFunction ufunc_nbdtrc_loops[3]
  9474. cdef void *ufunc_nbdtrc_ptr[6]
  9475. cdef void *ufunc_nbdtrc_data[3]
  9476. cdef char ufunc_nbdtrc_types[12]
  9477. cdef char *ufunc_nbdtrc_doc = (
  9478. "nbdtrc(k, n, p, out=None)\n"
  9479. "\n"
  9480. "Negative binomial survival function.\n"
  9481. "\n"
  9482. "Returns the sum of the terms `k + 1` to infinity of the negative binomial\n"
  9483. "distribution probability mass function,\n"
  9484. "\n"
  9485. ".. math::\n"
  9486. "\n"
  9487. " F = \\sum_{j=k + 1}^\\infty {{n + j - 1}\\choose{j}} p^n (1 - p)^j.\n"
  9488. "\n"
  9489. "In a sequence of Bernoulli trials with individual success probabilities\n"
  9490. "`p`, this is the probability that more than `k` failures precede the nth\n"
  9491. "success.\n"
  9492. "\n"
  9493. "Parameters\n"
  9494. "----------\n"
  9495. "k : array_like\n"
  9496. " The maximum number of allowed failures (nonnegative int).\n"
  9497. "n : array_like\n"
  9498. " The target number of successes (positive int).\n"
  9499. "p : array_like\n"
  9500. " Probability of success in a single event (float).\n"
  9501. "out : ndarray, optional\n"
  9502. " Optional output array for the function results\n"
  9503. "\n"
  9504. "Returns\n"
  9505. "-------\n"
  9506. "F : scalar or ndarray\n"
  9507. " The probability of `k + 1` or more failures before `n` successes in a\n"
  9508. " sequence of events with individual success probability `p`.\n"
  9509. "\n"
  9510. "See Also\n"
  9511. "--------\n"
  9512. "nbdtr : Negative binomial cumulative distribution function\n"
  9513. "nbdtrik : Negative binomial percentile function\n"
  9514. "scipy.stats.nbinom : Negative binomial distribution\n"
  9515. "\n"
  9516. "Notes\n"
  9517. "-----\n"
  9518. "If floating point values are passed for `k` or `n`, they will be truncated\n"
  9519. "to integers.\n"
  9520. "\n"
  9521. "The terms are not summed directly; instead the regularized incomplete beta\n"
  9522. "function is employed, according to the formula,\n"
  9523. "\n"
  9524. ".. math::\n"
  9525. " \\mathrm{nbdtrc}(k, n, p) = I_{1 - p}(k + 1, n).\n"
  9526. "\n"
  9527. "Wrapper for the Cephes [1]_ routine `nbdtrc`.\n"
  9528. "\n"
  9529. "The negative binomial distribution is also available as\n"
  9530. "`scipy.stats.nbinom`. Using `nbdtrc` directly can improve performance\n"
  9531. "compared to the ``sf`` method of `scipy.stats.nbinom` (see last example).\n"
  9532. "\n"
  9533. "References\n"
  9534. "----------\n"
  9535. ".. [1] Cephes Mathematical Functions Library,\n"
  9536. " http://www.netlib.org/cephes/\n"
  9537. "\n"
  9538. "Examples\n"
  9539. "--------\n"
  9540. "Compute the function for ``k=10`` and ``n=5`` at ``p=0.5``.\n"
  9541. "\n"
  9542. ">>> import numpy as np\n"
  9543. ">>> from scipy.special import nbdtrc\n"
  9544. ">>> nbdtrc(10, 5, 0.5)\n"
  9545. "0.059234619140624986\n"
  9546. "\n"
  9547. "Compute the function for ``n=10`` and ``p=0.5`` at several points by\n"
  9548. "providing a NumPy array or list for `k`.\n"
  9549. "\n"
  9550. ">>> nbdtrc([5, 10, 15], 10, 0.5)\n"
  9551. "array([0.84912109, 0.41190147, 0.11476147])\n"
  9552. "\n"
  9553. "Plot the function for four different parameter sets.\n"
  9554. "\n"
  9555. ">>> import matplotlib.pyplot as plt\n"
  9556. ">>> k = np.arange(130)\n"
  9557. ">>> n_parameters = [20, 20, 20, 80]\n"
  9558. ">>> p_parameters = [0.2, 0.5, 0.8, 0.5]\n"
  9559. ">>> linestyles = ['solid', 'dashed', 'dotted', 'dashdot']\n"
  9560. ">>> parameters_list = list(zip(p_parameters, n_parameters,\n"
  9561. "... linestyles))\n"
  9562. ">>> fig, ax = plt.subplots(figsize=(8, 8))\n"
  9563. ">>> for parameter_set in parameters_list:\n"
  9564. "... p, n, style = parameter_set\n"
  9565. "... nbdtrc_vals = nbdtrc(k, n, p)\n"
  9566. "... ax.plot(k, nbdtrc_vals, label=rf\"$n={n},\\, p={p}$\",\n"
  9567. "... ls=style)\n"
  9568. ">>> ax.legend()\n"
  9569. ">>> ax.set_xlabel(\"$k$\")\n"
  9570. ">>> ax.set_title(\"Negative binomial distribution survival function\")\n"
  9571. ">>> plt.show()\n"
  9572. "\n"
  9573. "The negative binomial distribution is also available as\n"
  9574. "`scipy.stats.nbinom`. Using `nbdtrc` directly can be much faster than\n"
  9575. "calling the ``sf`` method of `scipy.stats.nbinom`, especially for small\n"
  9576. "arrays or individual values. To get the same results one must use the\n"
  9577. "following parametrization: ``nbinom(n, p).sf(k)=nbdtrc(k, n, p)``.\n"
  9578. "\n"
  9579. ">>> from scipy.stats import nbinom\n"
  9580. ">>> k, n, p = 3, 5, 0.5\n"
  9581. ">>> nbdtr_res = nbdtrc(k, n, p) # this will often be faster than below\n"
  9582. ">>> stats_res = nbinom(n, p).sf(k)\n"
  9583. ">>> stats_res, nbdtr_res # test that results are equal\n"
  9584. "(0.6367187499999999, 0.6367187499999999)\n"
  9585. "\n"
  9586. "`nbdtrc` can evaluate different parameter sets by providing arrays with\n"
  9587. "shapes compatible for broadcasting for `k`, `n` and `p`. Here we compute\n"
  9588. "the function for three different `k` at four locations `p`, resulting in\n"
  9589. "a 3x4 array.\n"
  9590. "\n"
  9591. ">>> k = np.array([[5], [10], [15]])\n"
  9592. ">>> p = np.array([0.3, 0.5, 0.7, 0.9])\n"
  9593. ">>> k.shape, p.shape\n"
  9594. "((3, 1), (4,))\n"
  9595. "\n"
  9596. ">>> nbdtrc(k, 5, p)\n"
  9597. "array([[8.49731667e-01, 3.76953125e-01, 4.73489874e-02, 1.46902600e-04],\n"
  9598. " [5.15491059e-01, 5.92346191e-02, 6.72234070e-04, 9.29610100e-09],\n"
  9599. " [2.37507779e-01, 5.90896606e-03, 5.55025308e-06, 3.26346760e-13]])")
  9600. ufunc_nbdtrc_loops[0] = <np.PyUFuncGenericFunction>loop_d_ppd__As_ppd_d
  9601. ufunc_nbdtrc_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  9602. ufunc_nbdtrc_loops[2] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  9603. ufunc_nbdtrc_types[0] = <char>NPY_INTP
  9604. ufunc_nbdtrc_types[1] = <char>NPY_INTP
  9605. ufunc_nbdtrc_types[2] = <char>NPY_DOUBLE
  9606. ufunc_nbdtrc_types[3] = <char>NPY_DOUBLE
  9607. ufunc_nbdtrc_types[4] = <char>NPY_FLOAT
  9608. ufunc_nbdtrc_types[5] = <char>NPY_FLOAT
  9609. ufunc_nbdtrc_types[6] = <char>NPY_FLOAT
  9610. ufunc_nbdtrc_types[7] = <char>NPY_FLOAT
  9611. ufunc_nbdtrc_types[8] = <char>NPY_DOUBLE
  9612. ufunc_nbdtrc_types[9] = <char>NPY_DOUBLE
  9613. ufunc_nbdtrc_types[10] = <char>NPY_DOUBLE
  9614. ufunc_nbdtrc_types[11] = <char>NPY_DOUBLE
  9615. ufunc_nbdtrc_ptr[2*0] = <void*>_func_cephes_nbdtrc_wrap
  9616. ufunc_nbdtrc_ptr[2*0+1] = <void*>(<char*>"nbdtrc")
  9617. ufunc_nbdtrc_ptr[2*1] = <void*>_func_nbdtrc_unsafe
  9618. ufunc_nbdtrc_ptr[2*1+1] = <void*>(<char*>"nbdtrc")
  9619. ufunc_nbdtrc_ptr[2*2] = <void*>_func_nbdtrc_unsafe
  9620. ufunc_nbdtrc_ptr[2*2+1] = <void*>(<char*>"nbdtrc")
  9621. ufunc_nbdtrc_data[0] = &ufunc_nbdtrc_ptr[2*0]
  9622. ufunc_nbdtrc_data[1] = &ufunc_nbdtrc_ptr[2*1]
  9623. ufunc_nbdtrc_data[2] = &ufunc_nbdtrc_ptr[2*2]
  9624. nbdtrc = np.PyUFunc_FromFuncAndData(ufunc_nbdtrc_loops, ufunc_nbdtrc_data, ufunc_nbdtrc_types, 3, 3, 1, 0, 'nbdtrc', ufunc_nbdtrc_doc, 0)
  9625. cdef np.PyUFuncGenericFunction ufunc_nbdtri_loops[3]
  9626. cdef void *ufunc_nbdtri_ptr[6]
  9627. cdef void *ufunc_nbdtri_data[3]
  9628. cdef char ufunc_nbdtri_types[12]
  9629. cdef char *ufunc_nbdtri_doc = (
  9630. "nbdtri(k, n, y, out=None)\n"
  9631. "\n"
  9632. "Returns the inverse with respect to the parameter `p` of\n"
  9633. "``y = nbdtr(k, n, p)``, the negative binomial cumulative distribution\n"
  9634. "function.\n"
  9635. "\n"
  9636. "Parameters\n"
  9637. "----------\n"
  9638. "k : array_like\n"
  9639. " The maximum number of allowed failures (nonnegative int).\n"
  9640. "n : array_like\n"
  9641. " The target number of successes (positive int).\n"
  9642. "y : array_like\n"
  9643. " The probability of `k` or fewer failures before `n` successes (float).\n"
  9644. "out : ndarray, optional\n"
  9645. " Optional output array for the function results\n"
  9646. "\n"
  9647. "Returns\n"
  9648. "-------\n"
  9649. "p : scalar or ndarray\n"
  9650. " Probability of success in a single event (float) such that\n"
  9651. " `nbdtr(k, n, p) = y`.\n"
  9652. "\n"
  9653. "See Also\n"
  9654. "--------\n"
  9655. "nbdtr : Cumulative distribution function of the negative binomial.\n"
  9656. "nbdtrc : Negative binomial survival function.\n"
  9657. "scipy.stats.nbinom : negative binomial distribution.\n"
  9658. "nbdtrik : Inverse with respect to `k` of `nbdtr(k, n, p)`.\n"
  9659. "nbdtrin : Inverse with respect to `n` of `nbdtr(k, n, p)`.\n"
  9660. "scipy.stats.nbinom : Negative binomial distribution\n"
  9661. "\n"
  9662. "Notes\n"
  9663. "-----\n"
  9664. "Wrapper for the Cephes [1]_ routine `nbdtri`.\n"
  9665. "\n"
  9666. "The negative binomial distribution is also available as\n"
  9667. "`scipy.stats.nbinom`. Using `nbdtri` directly can improve performance\n"
  9668. "compared to the ``ppf`` method of `scipy.stats.nbinom`.\n"
  9669. "\n"
  9670. "References\n"
  9671. "----------\n"
  9672. ".. [1] Cephes Mathematical Functions Library,\n"
  9673. " http://www.netlib.org/cephes/\n"
  9674. "\n"
  9675. "Examples\n"
  9676. "--------\n"
  9677. "`nbdtri` is the inverse of `nbdtr` with respect to `p`.\n"
  9678. "Up to floating point errors the following holds:\n"
  9679. "``nbdtri(k, n, nbdtr(k, n, p))=p``.\n"
  9680. "\n"
  9681. ">>> import numpy as np\n"
  9682. ">>> from scipy.special import nbdtri, nbdtr\n"
  9683. ">>> k, n, y = 5, 10, 0.2\n"
  9684. ">>> cdf_val = nbdtr(k, n, y)\n"
  9685. ">>> nbdtri(k, n, cdf_val)\n"
  9686. "0.20000000000000004\n"
  9687. "\n"
  9688. "Compute the function for ``k=10`` and ``n=5`` at several points by\n"
  9689. "providing a NumPy array or list for `y`.\n"
  9690. "\n"
  9691. ">>> y = np.array([0.1, 0.4, 0.8])\n"
  9692. ">>> nbdtri(3, 5, y)\n"
  9693. "array([0.34462319, 0.51653095, 0.69677416])\n"
  9694. "\n"
  9695. "Plot the function for three different parameter sets.\n"
  9696. "\n"
  9697. ">>> import matplotlib.pyplot as plt\n"
  9698. ">>> n_parameters = [5, 20, 30, 30]\n"
  9699. ">>> k_parameters = [20, 20, 60, 80]\n"
  9700. ">>> linestyles = ['solid', 'dashed', 'dotted', 'dashdot']\n"
  9701. ">>> parameters_list = list(zip(n_parameters, k_parameters, linestyles))\n"
  9702. ">>> cdf_vals = np.linspace(0, 1, 1000)\n"
  9703. ">>> fig, ax = plt.subplots(figsize=(8, 8))\n"
  9704. ">>> for parameter_set in parameters_list:\n"
  9705. "... n, k, style = parameter_set\n"
  9706. "... nbdtri_vals = nbdtri(k, n, cdf_vals)\n"
  9707. "... ax.plot(cdf_vals, nbdtri_vals, label=rf\"$k={k},\\ n={n}$\",\n"
  9708. "... ls=style)\n"
  9709. ">>> ax.legend()\n"
  9710. ">>> ax.set_ylabel(\"$p$\")\n"
  9711. ">>> ax.set_xlabel(\"$CDF$\")\n"
  9712. ">>> title = \"nbdtri: inverse of negative binomial CDF with respect to $p$\"\n"
  9713. ">>> ax.set_title(title)\n"
  9714. ">>> plt.show()\n"
  9715. "\n"
  9716. "`nbdtri` can evaluate different parameter sets by providing arrays with\n"
  9717. "shapes compatible for broadcasting for `k`, `n` and `p`. Here we compute\n"
  9718. "the function for three different `k` at four locations `p`, resulting in\n"
  9719. "a 3x4 array.\n"
  9720. "\n"
  9721. ">>> k = np.array([[5], [10], [15]])\n"
  9722. ">>> y = np.array([0.3, 0.5, 0.7, 0.9])\n"
  9723. ">>> k.shape, y.shape\n"
  9724. "((3, 1), (4,))\n"
  9725. "\n"
  9726. ">>> nbdtri(k, 5, y)\n"
  9727. "array([[0.37258157, 0.45169416, 0.53249956, 0.64578407],\n"
  9728. " [0.24588501, 0.30451981, 0.36778453, 0.46397088],\n"
  9729. " [0.18362101, 0.22966758, 0.28054743, 0.36066188]])")
  9730. ufunc_nbdtri_loops[0] = <np.PyUFuncGenericFunction>loop_d_ppd__As_ppd_d
  9731. ufunc_nbdtri_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  9732. ufunc_nbdtri_loops[2] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  9733. ufunc_nbdtri_types[0] = <char>NPY_INTP
  9734. ufunc_nbdtri_types[1] = <char>NPY_INTP
  9735. ufunc_nbdtri_types[2] = <char>NPY_DOUBLE
  9736. ufunc_nbdtri_types[3] = <char>NPY_DOUBLE
  9737. ufunc_nbdtri_types[4] = <char>NPY_FLOAT
  9738. ufunc_nbdtri_types[5] = <char>NPY_FLOAT
  9739. ufunc_nbdtri_types[6] = <char>NPY_FLOAT
  9740. ufunc_nbdtri_types[7] = <char>NPY_FLOAT
  9741. ufunc_nbdtri_types[8] = <char>NPY_DOUBLE
  9742. ufunc_nbdtri_types[9] = <char>NPY_DOUBLE
  9743. ufunc_nbdtri_types[10] = <char>NPY_DOUBLE
  9744. ufunc_nbdtri_types[11] = <char>NPY_DOUBLE
  9745. ufunc_nbdtri_ptr[2*0] = <void*>_func_cephes_nbdtri_wrap
  9746. ufunc_nbdtri_ptr[2*0+1] = <void*>(<char*>"nbdtri")
  9747. ufunc_nbdtri_ptr[2*1] = <void*>_func_nbdtri_unsafe
  9748. ufunc_nbdtri_ptr[2*1+1] = <void*>(<char*>"nbdtri")
  9749. ufunc_nbdtri_ptr[2*2] = <void*>_func_nbdtri_unsafe
  9750. ufunc_nbdtri_ptr[2*2+1] = <void*>(<char*>"nbdtri")
  9751. ufunc_nbdtri_data[0] = &ufunc_nbdtri_ptr[2*0]
  9752. ufunc_nbdtri_data[1] = &ufunc_nbdtri_ptr[2*1]
  9753. ufunc_nbdtri_data[2] = &ufunc_nbdtri_ptr[2*2]
  9754. nbdtri = np.PyUFunc_FromFuncAndData(ufunc_nbdtri_loops, ufunc_nbdtri_data, ufunc_nbdtri_types, 3, 3, 1, 0, 'nbdtri', ufunc_nbdtri_doc, 0)
  9755. cdef np.PyUFuncGenericFunction ufunc_nbdtrik_loops[2]
  9756. cdef void *ufunc_nbdtrik_ptr[4]
  9757. cdef void *ufunc_nbdtrik_data[2]
  9758. cdef char ufunc_nbdtrik_types[8]
  9759. cdef char *ufunc_nbdtrik_doc = (
  9760. "nbdtrik(y, n, p, out=None)\n"
  9761. "\n"
  9762. "Negative binomial percentile function.\n"
  9763. "\n"
  9764. "Returns the inverse with respect to the parameter `k` of\n"
  9765. "``y = nbdtr(k, n, p)``, the negative binomial cumulative distribution\n"
  9766. "function.\n"
  9767. "\n"
  9768. "Parameters\n"
  9769. "----------\n"
  9770. "y : array_like\n"
  9771. " The probability of `k` or fewer failures before `n` successes (float).\n"
  9772. "n : array_like\n"
  9773. " The target number of successes (positive int).\n"
  9774. "p : array_like\n"
  9775. " Probability of success in a single event (float).\n"
  9776. "out : ndarray, optional\n"
  9777. " Optional output array for the function results\n"
  9778. "\n"
  9779. "Returns\n"
  9780. "-------\n"
  9781. "k : scalar or ndarray\n"
  9782. " The maximum number of allowed failures such that `nbdtr(k, n, p) = y`.\n"
  9783. "\n"
  9784. "See Also\n"
  9785. "--------\n"
  9786. "nbdtr : Cumulative distribution function of the negative binomial.\n"
  9787. "nbdtrc : Survival function of the negative binomial.\n"
  9788. "nbdtri : Inverse with respect to `p` of `nbdtr(k, n, p)`.\n"
  9789. "nbdtrin : Inverse with respect to `n` of `nbdtr(k, n, p)`.\n"
  9790. "scipy.stats.nbinom : Negative binomial distribution\n"
  9791. "\n"
  9792. "Notes\n"
  9793. "-----\n"
  9794. "Wrapper for the CDFLIB [1]_ Fortran routine `cdfnbn`.\n"
  9795. "\n"
  9796. "Formula 26.5.26 of [2]_ or [3]_,\n"
  9797. "\n"
  9798. ".. math::\n"
  9799. " \\sum_{j=k + 1}^\\infty {{n + j - 1}\n"
  9800. " \\choose{j}} p^n (1 - p)^j = I_{1 - p}(k + 1, n),\n"
  9801. "\n"
  9802. "is used to reduce calculation of the cumulative distribution function to\n"
  9803. "that of a regularized incomplete beta :math:`I`.\n"
  9804. "\n"
  9805. "Computation of `k` involves a search for a value that produces the desired\n"
  9806. "value of `y`. The search relies on the monotonicity of `y` with `k`.\n"
  9807. "\n"
  9808. "References\n"
  9809. "----------\n"
  9810. ".. [1] Barry Brown, James Lovato, and Kathy Russell,\n"
  9811. " CDFLIB: Library of Fortran Routines for Cumulative Distribution\n"
  9812. " Functions, Inverses, and Other Parameters.\n"
  9813. ".. [2] Milton Abramowitz and Irene A. Stegun, eds.\n"
  9814. " Handbook of Mathematical Functions with Formulas,\n"
  9815. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  9816. ".. [3] NIST Digital Library of Mathematical Functions\n"
  9817. " https://dlmf.nist.gov/8.17.E24\n"
  9818. "\n"
  9819. "Examples\n"
  9820. "--------\n"
  9821. "Compute the negative binomial cumulative distribution function for an\n"
  9822. "exemplary parameter set.\n"
  9823. "\n"
  9824. ">>> import numpy as np\n"
  9825. ">>> from scipy.special import nbdtr, nbdtrik\n"
  9826. ">>> k, n, p = 5, 2, 0.5\n"
  9827. ">>> cdf_value = nbdtr(k, n, p)\n"
  9828. ">>> cdf_value\n"
  9829. "0.9375\n"
  9830. "\n"
  9831. "Verify that `nbdtrik` recovers the original value for `k`.\n"
  9832. "\n"
  9833. ">>> nbdtrik(cdf_value, n, p)\n"
  9834. "5.0\n"
  9835. "\n"
  9836. "Plot the function for different parameter sets.\n"
  9837. "\n"
  9838. ">>> import matplotlib.pyplot as plt\n"
  9839. ">>> p_parameters = [0.2, 0.5, 0.7, 0.5]\n"
  9840. ">>> n_parameters = [30, 30, 30, 80]\n"
  9841. ">>> linestyles = ['solid', 'dashed', 'dotted', 'dashdot']\n"
  9842. ">>> parameters_list = list(zip(p_parameters, n_parameters, linestyles))\n"
  9843. ">>> cdf_vals = np.linspace(0, 1, 1000)\n"
  9844. ">>> fig, ax = plt.subplots(figsize=(8, 8))\n"
  9845. ">>> for parameter_set in parameters_list:\n"
  9846. "... p, n, style = parameter_set\n"
  9847. "... nbdtrik_vals = nbdtrik(cdf_vals, n, p)\n"
  9848. "... ax.plot(cdf_vals, nbdtrik_vals, label=rf\"$n={n},\\ p={p}$\",\n"
  9849. "... ls=style)\n"
  9850. ">>> ax.legend()\n"
  9851. ">>> ax.set_ylabel(\"$k$\")\n"
  9852. ">>> ax.set_xlabel(\"$CDF$\")\n"
  9853. ">>> ax.set_title(\"Negative binomial percentile function\")\n"
  9854. ">>> plt.show()\n"
  9855. "\n"
  9856. "The negative binomial distribution is also available as\n"
  9857. "`scipy.stats.nbinom`. The percentile function method ``ppf``\n"
  9858. "returns the result of `nbdtrik` rounded up to integers:\n"
  9859. "\n"
  9860. ">>> from scipy.stats import nbinom\n"
  9861. ">>> q, n, p = 0.6, 5, 0.5\n"
  9862. ">>> nbinom.ppf(q, n, p), nbdtrik(q, n, p)\n"
  9863. "(5.0, 4.800428460273882)")
  9864. ufunc_nbdtrik_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  9865. ufunc_nbdtrik_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  9866. ufunc_nbdtrik_types[0] = <char>NPY_FLOAT
  9867. ufunc_nbdtrik_types[1] = <char>NPY_FLOAT
  9868. ufunc_nbdtrik_types[2] = <char>NPY_FLOAT
  9869. ufunc_nbdtrik_types[3] = <char>NPY_FLOAT
  9870. ufunc_nbdtrik_types[4] = <char>NPY_DOUBLE
  9871. ufunc_nbdtrik_types[5] = <char>NPY_DOUBLE
  9872. ufunc_nbdtrik_types[6] = <char>NPY_DOUBLE
  9873. ufunc_nbdtrik_types[7] = <char>NPY_DOUBLE
  9874. ufunc_nbdtrik_ptr[2*0] = <void*>_func_nbdtrik
  9875. ufunc_nbdtrik_ptr[2*0+1] = <void*>(<char*>"nbdtrik")
  9876. ufunc_nbdtrik_ptr[2*1] = <void*>_func_nbdtrik
  9877. ufunc_nbdtrik_ptr[2*1+1] = <void*>(<char*>"nbdtrik")
  9878. ufunc_nbdtrik_data[0] = &ufunc_nbdtrik_ptr[2*0]
  9879. ufunc_nbdtrik_data[1] = &ufunc_nbdtrik_ptr[2*1]
  9880. nbdtrik = np.PyUFunc_FromFuncAndData(ufunc_nbdtrik_loops, ufunc_nbdtrik_data, ufunc_nbdtrik_types, 2, 3, 1, 0, 'nbdtrik', ufunc_nbdtrik_doc, 0)
  9881. cdef np.PyUFuncGenericFunction ufunc_nbdtrin_loops[2]
  9882. cdef void *ufunc_nbdtrin_ptr[4]
  9883. cdef void *ufunc_nbdtrin_data[2]
  9884. cdef char ufunc_nbdtrin_types[8]
  9885. cdef char *ufunc_nbdtrin_doc = (
  9886. "nbdtrin(k, y, p, out=None)\n"
  9887. "\n"
  9888. "Inverse of `nbdtr` vs `n`.\n"
  9889. "\n"
  9890. "Returns the inverse with respect to the parameter `n` of\n"
  9891. "``y = nbdtr(k, n, p)``, the negative binomial cumulative distribution\n"
  9892. "function.\n"
  9893. "\n"
  9894. "Parameters\n"
  9895. "----------\n"
  9896. "k : array_like\n"
  9897. " The maximum number of allowed failures (nonnegative int).\n"
  9898. "y : array_like\n"
  9899. " The probability of `k` or fewer failures before `n` successes (float).\n"
  9900. "p : array_like\n"
  9901. " Probability of success in a single event (float).\n"
  9902. "out : ndarray, optional\n"
  9903. " Optional output array for the function results\n"
  9904. "\n"
  9905. "Returns\n"
  9906. "-------\n"
  9907. "n : scalar or ndarray\n"
  9908. " The number of successes `n` such that `nbdtr(k, n, p) = y`.\n"
  9909. "\n"
  9910. "See Also\n"
  9911. "--------\n"
  9912. "nbdtr : Cumulative distribution function of the negative binomial.\n"
  9913. "nbdtri : Inverse with respect to `p` of `nbdtr(k, n, p)`.\n"
  9914. "nbdtrik : Inverse with respect to `k` of `nbdtr(k, n, p)`.\n"
  9915. "\n"
  9916. "Notes\n"
  9917. "-----\n"
  9918. "Wrapper for the CDFLIB [1]_ Fortran routine `cdfnbn`.\n"
  9919. "\n"
  9920. "Formula 26.5.26 of [2]_ or [3]_,\n"
  9921. "\n"
  9922. ".. math::\n"
  9923. " \\sum_{j=k + 1}^\\infty {{n + j - 1}\n"
  9924. " \\choose{j}} p^n (1 - p)^j = I_{1 - p}(k + 1, n),\n"
  9925. "\n"
  9926. "is used to reduce calculation of the cumulative distribution function to\n"
  9927. "that of a regularized incomplete beta :math:`I`.\n"
  9928. "\n"
  9929. "Computation of `n` involves a search for a value that produces the desired\n"
  9930. "value of `y`. The search relies on the monotonicity of `y` with `n`.\n"
  9931. "\n"
  9932. "References\n"
  9933. "----------\n"
  9934. ".. [1] Barry Brown, James Lovato, and Kathy Russell,\n"
  9935. " CDFLIB: Library of Fortran Routines for Cumulative Distribution\n"
  9936. " Functions, Inverses, and Other Parameters.\n"
  9937. ".. [2] Milton Abramowitz and Irene A. Stegun, eds.\n"
  9938. " Handbook of Mathematical Functions with Formulas,\n"
  9939. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  9940. ".. [3] NIST Digital Library of Mathematical Functions\n"
  9941. " https://dlmf.nist.gov/8.17.E24\n"
  9942. "\n"
  9943. "Examples\n"
  9944. "--------\n"
  9945. "Compute the negative binomial cumulative distribution function for an\n"
  9946. "exemplary parameter set.\n"
  9947. "\n"
  9948. ">>> from scipy.special import nbdtr, nbdtrin\n"
  9949. ">>> k, n, p = 5, 2, 0.5\n"
  9950. ">>> cdf_value = nbdtr(k, n, p)\n"
  9951. ">>> cdf_value\n"
  9952. "0.9375\n"
  9953. "\n"
  9954. "Verify that `nbdtrin` recovers the original value for `n` up to floating\n"
  9955. "point accuracy.\n"
  9956. "\n"
  9957. ">>> nbdtrin(k, cdf_value, p)\n"
  9958. "1.999999999998137")
  9959. ufunc_nbdtrin_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  9960. ufunc_nbdtrin_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  9961. ufunc_nbdtrin_types[0] = <char>NPY_FLOAT
  9962. ufunc_nbdtrin_types[1] = <char>NPY_FLOAT
  9963. ufunc_nbdtrin_types[2] = <char>NPY_FLOAT
  9964. ufunc_nbdtrin_types[3] = <char>NPY_FLOAT
  9965. ufunc_nbdtrin_types[4] = <char>NPY_DOUBLE
  9966. ufunc_nbdtrin_types[5] = <char>NPY_DOUBLE
  9967. ufunc_nbdtrin_types[6] = <char>NPY_DOUBLE
  9968. ufunc_nbdtrin_types[7] = <char>NPY_DOUBLE
  9969. ufunc_nbdtrin_ptr[2*0] = <void*>_func_nbdtrin
  9970. ufunc_nbdtrin_ptr[2*0+1] = <void*>(<char*>"nbdtrin")
  9971. ufunc_nbdtrin_ptr[2*1] = <void*>_func_nbdtrin
  9972. ufunc_nbdtrin_ptr[2*1+1] = <void*>(<char*>"nbdtrin")
  9973. ufunc_nbdtrin_data[0] = &ufunc_nbdtrin_ptr[2*0]
  9974. ufunc_nbdtrin_data[1] = &ufunc_nbdtrin_ptr[2*1]
  9975. nbdtrin = np.PyUFunc_FromFuncAndData(ufunc_nbdtrin_loops, ufunc_nbdtrin_data, ufunc_nbdtrin_types, 2, 3, 1, 0, 'nbdtrin', ufunc_nbdtrin_doc, 0)
  9976. cdef np.PyUFuncGenericFunction ufunc_ncfdtr_loops[2]
  9977. cdef void *ufunc_ncfdtr_ptr[4]
  9978. cdef void *ufunc_ncfdtr_data[2]
  9979. cdef char ufunc_ncfdtr_types[10]
  9980. cdef char *ufunc_ncfdtr_doc = (
  9981. "ncfdtr(dfn, dfd, nc, f, out=None)\n"
  9982. "\n"
  9983. "Cumulative distribution function of the non-central F distribution.\n"
  9984. "\n"
  9985. "The non-central F describes the distribution of,\n"
  9986. "\n"
  9987. ".. math::\n"
  9988. " Z = \\frac{X/d_n}{Y/d_d}\n"
  9989. "\n"
  9990. "where :math:`X` and :math:`Y` are independently distributed, with\n"
  9991. ":math:`X` distributed non-central :math:`\\chi^2` with noncentrality\n"
  9992. "parameter `nc` and :math:`d_n` degrees of freedom, and :math:`Y`\n"
  9993. "distributed :math:`\\chi^2` with :math:`d_d` degrees of freedom.\n"
  9994. "\n"
  9995. "Parameters\n"
  9996. "----------\n"
  9997. "dfn : array_like\n"
  9998. " Degrees of freedom of the numerator sum of squares. Range (0, inf).\n"
  9999. "dfd : array_like\n"
  10000. " Degrees of freedom of the denominator sum of squares. Range (0, inf).\n"
  10001. "nc : array_like\n"
  10002. " Noncentrality parameter. Range [0, inf).\n"
  10003. "f : array_like\n"
  10004. " Quantiles, i.e. the upper limit of integration.\n"
  10005. "out : ndarray, optional\n"
  10006. " Optional output array for the function results\n"
  10007. "\n"
  10008. "Returns\n"
  10009. "-------\n"
  10010. "cdf : scalar or ndarray\n"
  10011. " The calculated CDF. If all inputs are scalar, the return will be a\n"
  10012. " float. Otherwise it will be an array.\n"
  10013. "\n"
  10014. "See Also\n"
  10015. "--------\n"
  10016. "ncfdtri : Quantile function; inverse of `ncfdtr` with respect to `f`.\n"
  10017. "ncfdtridfd : Inverse of `ncfdtr` with respect to `dfd`.\n"
  10018. "ncfdtridfn : Inverse of `ncfdtr` with respect to `dfn`.\n"
  10019. "ncfdtrinc : Inverse of `ncfdtr` with respect to `nc`.\n"
  10020. "scipy.stats.ncf : Non-central F distribution.\n"
  10021. "\n"
  10022. "Notes\n"
  10023. "-----\n"
  10024. "This function calculates the CDF of the non-central f distribution using\n"
  10025. "the Boost Math C++ library [1]_.\n"
  10026. "\n"
  10027. "The cumulative distribution function is computed using Formula 26.6.20 of\n"
  10028. "[2]_:\n"
  10029. "\n"
  10030. ".. math::\n"
  10031. " F(d_n, d_d, n_c, f) = \\sum_{j=0}^\\infty e^{-n_c/2}\n"
  10032. " \\frac{(n_c/2)^j}{j!} I_{x}(\\frac{d_n}{2} + j, \\frac{d_d}{2}),\n"
  10033. "\n"
  10034. "where :math:`I` is the regularized incomplete beta function, and\n"
  10035. ":math:`x = f d_n/(f d_n + d_d)`.\n"
  10036. "\n"
  10037. "Note that argument order of `ncfdtr` is different from that of the\n"
  10038. "similar ``cdf`` method of `scipy.stats.ncf`: `f` is the last\n"
  10039. "parameter of `ncfdtr` but the first parameter of ``scipy.stats.ncf.cdf``.\n"
  10040. "\n"
  10041. "References\n"
  10042. "----------\n"
  10043. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  10044. ".. [2] Milton Abramowitz and Irene A. Stegun, eds.\n"
  10045. " Handbook of Mathematical Functions with Formulas,\n"
  10046. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  10047. "\n"
  10048. "Examples\n"
  10049. "--------\n"
  10050. ">>> import numpy as np\n"
  10051. ">>> from scipy import special\n"
  10052. ">>> from scipy import stats\n"
  10053. ">>> import matplotlib.pyplot as plt\n"
  10054. "\n"
  10055. "Plot the CDF of the non-central F distribution, for nc=0. Compare with the\n"
  10056. "F-distribution from scipy.stats:\n"
  10057. "\n"
  10058. ">>> x = np.linspace(-1, 8, num=500)\n"
  10059. ">>> dfn = 3\n"
  10060. ">>> dfd = 2\n"
  10061. ">>> ncf_stats = stats.f.cdf(x, dfn, dfd)\n"
  10062. ">>> ncf_special = special.ncfdtr(dfn, dfd, 0, x)\n"
  10063. "\n"
  10064. ">>> fig = plt.figure()\n"
  10065. ">>> ax = fig.add_subplot(111)\n"
  10066. ">>> ax.plot(x, ncf_stats, 'b-', lw=3)\n"
  10067. ">>> ax.plot(x, ncf_special, 'r-')\n"
  10068. ">>> plt.show()")
  10069. ufunc_ncfdtr_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  10070. ufunc_ncfdtr_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  10071. ufunc_ncfdtr_types[0] = <char>NPY_FLOAT
  10072. ufunc_ncfdtr_types[1] = <char>NPY_FLOAT
  10073. ufunc_ncfdtr_types[2] = <char>NPY_FLOAT
  10074. ufunc_ncfdtr_types[3] = <char>NPY_FLOAT
  10075. ufunc_ncfdtr_types[4] = <char>NPY_FLOAT
  10076. ufunc_ncfdtr_types[5] = <char>NPY_DOUBLE
  10077. ufunc_ncfdtr_types[6] = <char>NPY_DOUBLE
  10078. ufunc_ncfdtr_types[7] = <char>NPY_DOUBLE
  10079. ufunc_ncfdtr_types[8] = <char>NPY_DOUBLE
  10080. ufunc_ncfdtr_types[9] = <char>NPY_DOUBLE
  10081. ufunc_ncfdtr_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncf_cdf_float
  10082. ufunc_ncfdtr_ptr[2*0+1] = <void*>(<char*>"ncfdtr")
  10083. ufunc_ncfdtr_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncf_cdf_double
  10084. ufunc_ncfdtr_ptr[2*1+1] = <void*>(<char*>"ncfdtr")
  10085. ufunc_ncfdtr_data[0] = &ufunc_ncfdtr_ptr[2*0]
  10086. ufunc_ncfdtr_data[1] = &ufunc_ncfdtr_ptr[2*1]
  10087. ncfdtr = np.PyUFunc_FromFuncAndData(ufunc_ncfdtr_loops, ufunc_ncfdtr_data, ufunc_ncfdtr_types, 2, 4, 1, 0, 'ncfdtr', ufunc_ncfdtr_doc, 0)
  10088. cdef np.PyUFuncGenericFunction ufunc_ncfdtri_loops[2]
  10089. cdef void *ufunc_ncfdtri_ptr[4]
  10090. cdef void *ufunc_ncfdtri_data[2]
  10091. cdef char ufunc_ncfdtri_types[10]
  10092. cdef char *ufunc_ncfdtri_doc = (
  10093. "ncfdtri(dfn, dfd, nc, p, out=None)\n"
  10094. "\n"
  10095. "Inverse with respect to `f` of the CDF of the non-central F distribution.\n"
  10096. "\n"
  10097. "See `ncfdtr` for more details.\n"
  10098. "\n"
  10099. "Parameters\n"
  10100. "----------\n"
  10101. "dfn : array_like\n"
  10102. " Degrees of freedom of the numerator sum of squares. Range (0, inf).\n"
  10103. "dfd : array_like\n"
  10104. " Degrees of freedom of the denominator sum of squares. Range (0, inf).\n"
  10105. "nc : array_like\n"
  10106. " Noncentrality parameter. Range [0, inf).\n"
  10107. "p : array_like\n"
  10108. " Value of the cumulative distribution function. Must be in the\n"
  10109. " range [0, 1].\n"
  10110. "out : ndarray, optional\n"
  10111. " Optional output array for the function results\n"
  10112. "\n"
  10113. "Returns\n"
  10114. "-------\n"
  10115. "f : scalar or ndarray\n"
  10116. " Quantiles, i.e., the upper limit of integration.\n"
  10117. "\n"
  10118. "See Also\n"
  10119. "--------\n"
  10120. "ncfdtr : CDF of the non-central F distribution.\n"
  10121. "ncfdtridfd : Inverse of `ncfdtr` with respect to `dfd`.\n"
  10122. "ncfdtridfn : Inverse of `ncfdtr` with respect to `dfn`.\n"
  10123. "ncfdtrinc : Inverse of `ncfdtr` with respect to `nc`.\n"
  10124. "scipy.stats.ncf : Non-central F distribution.\n"
  10125. "\n"
  10126. "Notes\n"
  10127. "-----\n"
  10128. "This function calculates the Quantile of the non-central f distribution\n"
  10129. "using the Boost Math C++ library [1]_.\n"
  10130. "\n"
  10131. "Note that argument order of `ncfdtri` is different from that of the\n"
  10132. "similar ``ppf`` method of `scipy.stats.ncf`. `p` is the last parameter\n"
  10133. "of `ncfdtri` but the first parameter of ``scipy.stats.ncf.ppf``.\n"
  10134. "\n"
  10135. "References\n"
  10136. "----------\n"
  10137. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  10138. "\n"
  10139. "Examples\n"
  10140. "--------\n"
  10141. ">>> from scipy.special import ncfdtr, ncfdtri\n"
  10142. "\n"
  10143. "Compute the CDF for several values of `f`:\n"
  10144. "\n"
  10145. ">>> f = [0.5, 1, 1.5]\n"
  10146. ">>> p = ncfdtr(2, 3, 1.5, f)\n"
  10147. ">>> p\n"
  10148. "array([ 0.20782291, 0.36107392, 0.47345752])\n"
  10149. "\n"
  10150. "Compute the inverse. We recover the values of `f`, as expected:\n"
  10151. "\n"
  10152. ">>> ncfdtri(2, 3, 1.5, p)\n"
  10153. "array([ 0.5, 1. , 1.5])")
  10154. ufunc_ncfdtri_loops[0] = <np.PyUFuncGenericFunction>loop_f_ffff__As_ffff_f
  10155. ufunc_ncfdtri_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  10156. ufunc_ncfdtri_types[0] = <char>NPY_FLOAT
  10157. ufunc_ncfdtri_types[1] = <char>NPY_FLOAT
  10158. ufunc_ncfdtri_types[2] = <char>NPY_FLOAT
  10159. ufunc_ncfdtri_types[3] = <char>NPY_FLOAT
  10160. ufunc_ncfdtri_types[4] = <char>NPY_FLOAT
  10161. ufunc_ncfdtri_types[5] = <char>NPY_DOUBLE
  10162. ufunc_ncfdtri_types[6] = <char>NPY_DOUBLE
  10163. ufunc_ncfdtri_types[7] = <char>NPY_DOUBLE
  10164. ufunc_ncfdtri_types[8] = <char>NPY_DOUBLE
  10165. ufunc_ncfdtri_types[9] = <char>NPY_DOUBLE
  10166. ufunc_ncfdtri_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_ncf_ppf_float
  10167. ufunc_ncfdtri_ptr[2*0+1] = <void*>(<char*>"ncfdtri")
  10168. ufunc_ncfdtri_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_ncf_ppf_double
  10169. ufunc_ncfdtri_ptr[2*1+1] = <void*>(<char*>"ncfdtri")
  10170. ufunc_ncfdtri_data[0] = &ufunc_ncfdtri_ptr[2*0]
  10171. ufunc_ncfdtri_data[1] = &ufunc_ncfdtri_ptr[2*1]
  10172. ncfdtri = np.PyUFunc_FromFuncAndData(ufunc_ncfdtri_loops, ufunc_ncfdtri_data, ufunc_ncfdtri_types, 2, 4, 1, 0, 'ncfdtri', ufunc_ncfdtri_doc, 0)
  10173. cdef np.PyUFuncGenericFunction ufunc_ncfdtridfd_loops[2]
  10174. cdef void *ufunc_ncfdtridfd_ptr[4]
  10175. cdef void *ufunc_ncfdtridfd_data[2]
  10176. cdef char ufunc_ncfdtridfd_types[10]
  10177. cdef char *ufunc_ncfdtridfd_doc = (
  10178. "ncfdtridfd(dfn, p, nc, f, out=None)\n"
  10179. "\n"
  10180. "Calculate degrees of freedom (denominator) for the noncentral F-distribution.\n"
  10181. "\n"
  10182. "This is the inverse with respect to `dfd` of `ncfdtr`.\n"
  10183. "See `ncfdtr` for more details.\n"
  10184. "\n"
  10185. "Parameters\n"
  10186. "----------\n"
  10187. "dfn : array_like\n"
  10188. " Degrees of freedom of the numerator sum of squares. Range (0, inf).\n"
  10189. "p : array_like\n"
  10190. " Value of the cumulative distribution function. Must be in the\n"
  10191. " range [0, 1].\n"
  10192. "nc : array_like\n"
  10193. " Noncentrality parameter. Should be in range (0, 1e4).\n"
  10194. "f : array_like\n"
  10195. " Quantiles, i.e., the upper limit of integration.\n"
  10196. "out : ndarray, optional\n"
  10197. " Optional output array for the function results\n"
  10198. "\n"
  10199. "Returns\n"
  10200. "-------\n"
  10201. "dfd : scalar or ndarray\n"
  10202. " Degrees of freedom of the denominator sum of squares.\n"
  10203. "\n"
  10204. "See Also\n"
  10205. "--------\n"
  10206. "ncfdtr : CDF of the non-central F distribution.\n"
  10207. "ncfdtri : Quantile function; inverse of `ncfdtr` with respect to `f`.\n"
  10208. "ncfdtridfn : Inverse of `ncfdtr` with respect to `dfn`.\n"
  10209. "ncfdtrinc : Inverse of `ncfdtr` with respect to `nc`.\n"
  10210. "\n"
  10211. "Notes\n"
  10212. "-----\n"
  10213. "The value of the cumulative noncentral F distribution is not necessarily\n"
  10214. "monotone in either degrees of freedom. There thus may be two values that\n"
  10215. "provide a given CDF value. This routine assumes monotonicity and will\n"
  10216. "find an arbitrary one of the two values.\n"
  10217. "\n"
  10218. "Examples\n"
  10219. "--------\n"
  10220. ">>> from scipy.special import ncfdtr, ncfdtridfd\n"
  10221. "\n"
  10222. "Compute the CDF for several values of `dfd`:\n"
  10223. "\n"
  10224. ">>> dfd = [1, 2, 3]\n"
  10225. ">>> p = ncfdtr(2, dfd, 0.25, 15)\n"
  10226. ">>> p\n"
  10227. "array([ 0.8097138 , 0.93020416, 0.96787852])\n"
  10228. "\n"
  10229. "Compute the inverse. We recover the values of `dfd`, as expected:\n"
  10230. "\n"
  10231. ">>> ncfdtridfd(2, p, 0.25, 15)\n"
  10232. "array([ 1., 2., 3.])")
  10233. ufunc_ncfdtridfd_loops[0] = <np.PyUFuncGenericFunction>loop_d_dddd__As_ffff_f
  10234. ufunc_ncfdtridfd_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  10235. ufunc_ncfdtridfd_types[0] = <char>NPY_FLOAT
  10236. ufunc_ncfdtridfd_types[1] = <char>NPY_FLOAT
  10237. ufunc_ncfdtridfd_types[2] = <char>NPY_FLOAT
  10238. ufunc_ncfdtridfd_types[3] = <char>NPY_FLOAT
  10239. ufunc_ncfdtridfd_types[4] = <char>NPY_FLOAT
  10240. ufunc_ncfdtridfd_types[5] = <char>NPY_DOUBLE
  10241. ufunc_ncfdtridfd_types[6] = <char>NPY_DOUBLE
  10242. ufunc_ncfdtridfd_types[7] = <char>NPY_DOUBLE
  10243. ufunc_ncfdtridfd_types[8] = <char>NPY_DOUBLE
  10244. ufunc_ncfdtridfd_types[9] = <char>NPY_DOUBLE
  10245. ufunc_ncfdtridfd_ptr[2*0] = <void*>_func_ncfdtridfd
  10246. ufunc_ncfdtridfd_ptr[2*0+1] = <void*>(<char*>"ncfdtridfd")
  10247. ufunc_ncfdtridfd_ptr[2*1] = <void*>_func_ncfdtridfd
  10248. ufunc_ncfdtridfd_ptr[2*1+1] = <void*>(<char*>"ncfdtridfd")
  10249. ufunc_ncfdtridfd_data[0] = &ufunc_ncfdtridfd_ptr[2*0]
  10250. ufunc_ncfdtridfd_data[1] = &ufunc_ncfdtridfd_ptr[2*1]
  10251. ncfdtridfd = np.PyUFunc_FromFuncAndData(ufunc_ncfdtridfd_loops, ufunc_ncfdtridfd_data, ufunc_ncfdtridfd_types, 2, 4, 1, 0, 'ncfdtridfd', ufunc_ncfdtridfd_doc, 0)
  10252. cdef np.PyUFuncGenericFunction ufunc_ncfdtridfn_loops[2]
  10253. cdef void *ufunc_ncfdtridfn_ptr[4]
  10254. cdef void *ufunc_ncfdtridfn_data[2]
  10255. cdef char ufunc_ncfdtridfn_types[10]
  10256. cdef char *ufunc_ncfdtridfn_doc = (
  10257. "ncfdtridfn(p, dfd, nc, f, out=None)\n"
  10258. "\n"
  10259. "Calculate degrees of freedom (numerator) for the noncentral F-distribution.\n"
  10260. "\n"
  10261. "This is the inverse with respect to `dfn` of `ncfdtr`.\n"
  10262. "See `ncfdtr` for more details.\n"
  10263. "\n"
  10264. "Parameters\n"
  10265. "----------\n"
  10266. "p : array_like\n"
  10267. " Value of the cumulative distribution function. Must be in the\n"
  10268. " range [0, 1].\n"
  10269. "dfd : array_like\n"
  10270. " Degrees of freedom of the denominator sum of squares. Range (0, inf).\n"
  10271. "nc : array_like\n"
  10272. " Noncentrality parameter. Should be in range (0, 1e4).\n"
  10273. "f : float\n"
  10274. " Quantiles, i.e., the upper limit of integration.\n"
  10275. "out : ndarray, optional\n"
  10276. " Optional output array for the function results\n"
  10277. "\n"
  10278. "Returns\n"
  10279. "-------\n"
  10280. "dfn : scalar or ndarray\n"
  10281. " Degrees of freedom of the numerator sum of squares.\n"
  10282. "\n"
  10283. "See Also\n"
  10284. "--------\n"
  10285. "ncfdtr : CDF of the non-central F distribution.\n"
  10286. "ncfdtri : Quantile function; inverse of `ncfdtr` with respect to `f`.\n"
  10287. "ncfdtridfd : Inverse of `ncfdtr` with respect to `dfd`.\n"
  10288. "ncfdtrinc : Inverse of `ncfdtr` with respect to `nc`.\n"
  10289. "\n"
  10290. "Notes\n"
  10291. "-----\n"
  10292. "The value of the cumulative noncentral F distribution is not necessarily\n"
  10293. "monotone in either degrees of freedom. There thus may be two values that\n"
  10294. "provide a given CDF value. This routine assumes monotonicity and will\n"
  10295. "find an arbitrary one of the two values.\n"
  10296. "\n"
  10297. "Examples\n"
  10298. "--------\n"
  10299. ">>> from scipy.special import ncfdtr, ncfdtridfn\n"
  10300. "\n"
  10301. "Compute the CDF for several values of `dfn`:\n"
  10302. "\n"
  10303. ">>> dfn = [1, 2, 3]\n"
  10304. ">>> p = ncfdtr(dfn, 2, 0.25, 15)\n"
  10305. ">>> p\n"
  10306. "array([ 0.92562363, 0.93020416, 0.93188394])\n"
  10307. "\n"
  10308. "Compute the inverse. We recover the values of `dfn`, as expected:\n"
  10309. "\n"
  10310. ">>> ncfdtridfn(p, 2, 0.25, 15)\n"
  10311. "array([ 1., 2., 3.])")
  10312. ufunc_ncfdtridfn_loops[0] = <np.PyUFuncGenericFunction>loop_d_dddd__As_ffff_f
  10313. ufunc_ncfdtridfn_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  10314. ufunc_ncfdtridfn_types[0] = <char>NPY_FLOAT
  10315. ufunc_ncfdtridfn_types[1] = <char>NPY_FLOAT
  10316. ufunc_ncfdtridfn_types[2] = <char>NPY_FLOAT
  10317. ufunc_ncfdtridfn_types[3] = <char>NPY_FLOAT
  10318. ufunc_ncfdtridfn_types[4] = <char>NPY_FLOAT
  10319. ufunc_ncfdtridfn_types[5] = <char>NPY_DOUBLE
  10320. ufunc_ncfdtridfn_types[6] = <char>NPY_DOUBLE
  10321. ufunc_ncfdtridfn_types[7] = <char>NPY_DOUBLE
  10322. ufunc_ncfdtridfn_types[8] = <char>NPY_DOUBLE
  10323. ufunc_ncfdtridfn_types[9] = <char>NPY_DOUBLE
  10324. ufunc_ncfdtridfn_ptr[2*0] = <void*>_func_ncfdtridfn
  10325. ufunc_ncfdtridfn_ptr[2*0+1] = <void*>(<char*>"ncfdtridfn")
  10326. ufunc_ncfdtridfn_ptr[2*1] = <void*>_func_ncfdtridfn
  10327. ufunc_ncfdtridfn_ptr[2*1+1] = <void*>(<char*>"ncfdtridfn")
  10328. ufunc_ncfdtridfn_data[0] = &ufunc_ncfdtridfn_ptr[2*0]
  10329. ufunc_ncfdtridfn_data[1] = &ufunc_ncfdtridfn_ptr[2*1]
  10330. ncfdtridfn = np.PyUFunc_FromFuncAndData(ufunc_ncfdtridfn_loops, ufunc_ncfdtridfn_data, ufunc_ncfdtridfn_types, 2, 4, 1, 0, 'ncfdtridfn', ufunc_ncfdtridfn_doc, 0)
  10331. cdef np.PyUFuncGenericFunction ufunc_ncfdtrinc_loops[2]
  10332. cdef void *ufunc_ncfdtrinc_ptr[4]
  10333. cdef void *ufunc_ncfdtrinc_data[2]
  10334. cdef char ufunc_ncfdtrinc_types[10]
  10335. cdef char *ufunc_ncfdtrinc_doc = (
  10336. "ncfdtrinc(dfn, dfd, p, f, out=None)\n"
  10337. "\n"
  10338. "Calculate non-centrality parameter for non-central F distribution.\n"
  10339. "\n"
  10340. "This is the inverse with respect to `nc` of `ncfdtr`.\n"
  10341. "See `ncfdtr` for more details.\n"
  10342. "\n"
  10343. "Parameters\n"
  10344. "----------\n"
  10345. "dfn : array_like\n"
  10346. " Degrees of freedom of the numerator sum of squares. Range (0, inf).\n"
  10347. "dfd : array_like\n"
  10348. " Degrees of freedom of the denominator sum of squares. Range (0, inf).\n"
  10349. "p : array_like\n"
  10350. " Value of the cumulative distribution function. Must be in the\n"
  10351. " range [0, 1].\n"
  10352. "f : array_like\n"
  10353. " Quantiles, i.e., the upper limit of integration.\n"
  10354. "out : ndarray, optional\n"
  10355. " Optional output array for the function results\n"
  10356. "\n"
  10357. "Returns\n"
  10358. "-------\n"
  10359. "nc : scalar or ndarray\n"
  10360. " Noncentrality parameter.\n"
  10361. "\n"
  10362. "See Also\n"
  10363. "--------\n"
  10364. "ncfdtr : CDF of the non-central F distribution.\n"
  10365. "ncfdtri : Quantile function; inverse of `ncfdtr` with respect to `f`.\n"
  10366. "ncfdtridfd : Inverse of `ncfdtr` with respect to `dfd`.\n"
  10367. "ncfdtridfn : Inverse of `ncfdtr` with respect to `dfn`.\n"
  10368. "\n"
  10369. "Examples\n"
  10370. "--------\n"
  10371. ">>> from scipy.special import ncfdtr, ncfdtrinc\n"
  10372. "\n"
  10373. "Compute the CDF for several values of `nc`:\n"
  10374. "\n"
  10375. ">>> nc = [0.5, 1.5, 2.0]\n"
  10376. ">>> p = ncfdtr(2, 3, nc, 15)\n"
  10377. ">>> p\n"
  10378. "array([ 0.96309246, 0.94327955, 0.93304098])\n"
  10379. "\n"
  10380. "Compute the inverse. We recover the values of `nc`, as expected:\n"
  10381. "\n"
  10382. ">>> ncfdtrinc(2, 3, p, 15)\n"
  10383. "array([ 0.5, 1.5, 2. ])")
  10384. ufunc_ncfdtrinc_loops[0] = <np.PyUFuncGenericFunction>loop_d_dddd__As_ffff_f
  10385. ufunc_ncfdtrinc_loops[1] = <np.PyUFuncGenericFunction>loop_d_dddd__As_dddd_d
  10386. ufunc_ncfdtrinc_types[0] = <char>NPY_FLOAT
  10387. ufunc_ncfdtrinc_types[1] = <char>NPY_FLOAT
  10388. ufunc_ncfdtrinc_types[2] = <char>NPY_FLOAT
  10389. ufunc_ncfdtrinc_types[3] = <char>NPY_FLOAT
  10390. ufunc_ncfdtrinc_types[4] = <char>NPY_FLOAT
  10391. ufunc_ncfdtrinc_types[5] = <char>NPY_DOUBLE
  10392. ufunc_ncfdtrinc_types[6] = <char>NPY_DOUBLE
  10393. ufunc_ncfdtrinc_types[7] = <char>NPY_DOUBLE
  10394. ufunc_ncfdtrinc_types[8] = <char>NPY_DOUBLE
  10395. ufunc_ncfdtrinc_types[9] = <char>NPY_DOUBLE
  10396. ufunc_ncfdtrinc_ptr[2*0] = <void*>_func_ncfdtrinc
  10397. ufunc_ncfdtrinc_ptr[2*0+1] = <void*>(<char*>"ncfdtrinc")
  10398. ufunc_ncfdtrinc_ptr[2*1] = <void*>_func_ncfdtrinc
  10399. ufunc_ncfdtrinc_ptr[2*1+1] = <void*>(<char*>"ncfdtrinc")
  10400. ufunc_ncfdtrinc_data[0] = &ufunc_ncfdtrinc_ptr[2*0]
  10401. ufunc_ncfdtrinc_data[1] = &ufunc_ncfdtrinc_ptr[2*1]
  10402. ncfdtrinc = np.PyUFunc_FromFuncAndData(ufunc_ncfdtrinc_loops, ufunc_ncfdtrinc_data, ufunc_ncfdtrinc_types, 2, 4, 1, 0, 'ncfdtrinc', ufunc_ncfdtrinc_doc, 0)
  10403. cdef np.PyUFuncGenericFunction ufunc_nctdtr_loops[2]
  10404. cdef void *ufunc_nctdtr_ptr[4]
  10405. cdef void *ufunc_nctdtr_data[2]
  10406. cdef char ufunc_nctdtr_types[8]
  10407. cdef char *ufunc_nctdtr_doc = (
  10408. "nctdtr(df, nc, t, out=None)\n"
  10409. "\n"
  10410. "Cumulative distribution function of the non-central `t` distribution.\n"
  10411. "\n"
  10412. "Parameters\n"
  10413. "----------\n"
  10414. "df : array_like\n"
  10415. " Degrees of freedom of the distribution. Should be in range (0, inf).\n"
  10416. "nc : array_like\n"
  10417. " Noncentrality parameter.\n"
  10418. "t : array_like\n"
  10419. " Quantiles, i.e., the upper limit of integration.\n"
  10420. "out : ndarray, optional\n"
  10421. " Optional output array for the function results\n"
  10422. "\n"
  10423. "Returns\n"
  10424. "-------\n"
  10425. "cdf : scalar or ndarray\n"
  10426. " The calculated CDF. If all inputs are scalar, the return will be a\n"
  10427. " float. Otherwise, it will be an array.\n"
  10428. "\n"
  10429. "See Also\n"
  10430. "--------\n"
  10431. "nctdtrit : Inverse CDF (iCDF) of the non-central t distribution.\n"
  10432. "nctdtridf : Calculate degrees of freedom, given CDF and iCDF values.\n"
  10433. "nctdtrinc : Calculate non-centrality parameter, given CDF iCDF values.\n"
  10434. "\n"
  10435. "Notes\n"
  10436. "-----\n"
  10437. "This function calculates the CDF of the non-central t distribution using\n"
  10438. "the Boost Math C++ library [1]_.\n"
  10439. "\n"
  10440. "Note that the argument order of `nctdtr` is different from that of the\n"
  10441. "similar ``cdf`` method of `scipy.stats.nct`: `t` is the last\n"
  10442. "parameter of `nctdtr` but the first parameter of ``scipy.stats.nct.cdf``.\n"
  10443. "\n"
  10444. "References\n"
  10445. "----------\n"
  10446. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  10447. "\n"
  10448. "Examples\n"
  10449. "--------\n"
  10450. ">>> import numpy as np\n"
  10451. ">>> from scipy import special\n"
  10452. ">>> from scipy import stats\n"
  10453. ">>> import matplotlib.pyplot as plt\n"
  10454. "\n"
  10455. "Plot the CDF of the non-central t distribution, for nc=0. Compare with the\n"
  10456. "t-distribution from scipy.stats:\n"
  10457. "\n"
  10458. ">>> x = np.linspace(-5, 5, num=500)\n"
  10459. ">>> df = 3\n"
  10460. ">>> nct_stats = stats.t.cdf(x, df)\n"
  10461. ">>> nct_special = special.nctdtr(df, 0, x)\n"
  10462. "\n"
  10463. ">>> fig = plt.figure()\n"
  10464. ">>> ax = fig.add_subplot(111)\n"
  10465. ">>> ax.plot(x, nct_stats, 'b-', lw=3)\n"
  10466. ">>> ax.plot(x, nct_special, 'r-')\n"
  10467. ">>> plt.show()")
  10468. ufunc_nctdtr_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  10469. ufunc_nctdtr_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  10470. ufunc_nctdtr_types[0] = <char>NPY_FLOAT
  10471. ufunc_nctdtr_types[1] = <char>NPY_FLOAT
  10472. ufunc_nctdtr_types[2] = <char>NPY_FLOAT
  10473. ufunc_nctdtr_types[3] = <char>NPY_FLOAT
  10474. ufunc_nctdtr_types[4] = <char>NPY_DOUBLE
  10475. ufunc_nctdtr_types[5] = <char>NPY_DOUBLE
  10476. ufunc_nctdtr_types[6] = <char>NPY_DOUBLE
  10477. ufunc_nctdtr_types[7] = <char>NPY_DOUBLE
  10478. ufunc_nctdtr_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nct_cdf_float
  10479. ufunc_nctdtr_ptr[2*0+1] = <void*>(<char*>"nctdtr")
  10480. ufunc_nctdtr_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nct_cdf_double
  10481. ufunc_nctdtr_ptr[2*1+1] = <void*>(<char*>"nctdtr")
  10482. ufunc_nctdtr_data[0] = &ufunc_nctdtr_ptr[2*0]
  10483. ufunc_nctdtr_data[1] = &ufunc_nctdtr_ptr[2*1]
  10484. nctdtr = np.PyUFunc_FromFuncAndData(ufunc_nctdtr_loops, ufunc_nctdtr_data, ufunc_nctdtr_types, 2, 3, 1, 0, 'nctdtr', ufunc_nctdtr_doc, 0)
  10485. cdef np.PyUFuncGenericFunction ufunc_nctdtridf_loops[2]
  10486. cdef void *ufunc_nctdtridf_ptr[4]
  10487. cdef void *ufunc_nctdtridf_data[2]
  10488. cdef char ufunc_nctdtridf_types[8]
  10489. cdef char *ufunc_nctdtridf_doc = (
  10490. "nctdtridf(p, nc, t, out=None)\n"
  10491. "\n"
  10492. "Calculate degrees of freedom for non-central t distribution.\n"
  10493. "\n"
  10494. "See `nctdtr` for more details.\n"
  10495. "\n"
  10496. "Parameters\n"
  10497. "----------\n"
  10498. "p : array_like\n"
  10499. " CDF values, in range (0, 1].\n"
  10500. "nc : array_like\n"
  10501. " Noncentrality parameter. Should be in range (-1e6, 1e6).\n"
  10502. "t : array_like\n"
  10503. " Quantiles, i.e., the upper limit of integration.\n"
  10504. "out : ndarray, optional\n"
  10505. " Optional output array for the function results\n"
  10506. "\n"
  10507. "Returns\n"
  10508. "-------\n"
  10509. "df : scalar or ndarray\n"
  10510. " The degrees of freedom. If all inputs are scalar, the return will be a\n"
  10511. " float. Otherwise, it will be an array.\n"
  10512. "\n"
  10513. "See Also\n"
  10514. "--------\n"
  10515. "nctdtr : CDF of the non-central `t` distribution.\n"
  10516. "nctdtrit : Inverse CDF (iCDF) of the non-central t distribution.\n"
  10517. "nctdtrinc : Calculate non-centrality parameter, given CDF iCDF values.\n"
  10518. "\n"
  10519. "Examples\n"
  10520. "--------\n"
  10521. ">>> from scipy.special import nctdtr, nctdtridf\n"
  10522. "\n"
  10523. "Compute the CDF for several values of `df`:\n"
  10524. "\n"
  10525. ">>> df = [1, 2, 3]\n"
  10526. ">>> p = nctdtr(df, 0.25, 1)\n"
  10527. ">>> p\n"
  10528. "array([0.67491974, 0.716464 , 0.73349456])\n"
  10529. "\n"
  10530. "Compute the inverse. We recover the values of `df`, as expected:\n"
  10531. "\n"
  10532. ">>> nctdtridf(p, 0.25, 1)\n"
  10533. "array([1., 2., 3.])")
  10534. ufunc_nctdtridf_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  10535. ufunc_nctdtridf_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  10536. ufunc_nctdtridf_types[0] = <char>NPY_FLOAT
  10537. ufunc_nctdtridf_types[1] = <char>NPY_FLOAT
  10538. ufunc_nctdtridf_types[2] = <char>NPY_FLOAT
  10539. ufunc_nctdtridf_types[3] = <char>NPY_FLOAT
  10540. ufunc_nctdtridf_types[4] = <char>NPY_DOUBLE
  10541. ufunc_nctdtridf_types[5] = <char>NPY_DOUBLE
  10542. ufunc_nctdtridf_types[6] = <char>NPY_DOUBLE
  10543. ufunc_nctdtridf_types[7] = <char>NPY_DOUBLE
  10544. ufunc_nctdtridf_ptr[2*0] = <void*>_func_nctdtridf
  10545. ufunc_nctdtridf_ptr[2*0+1] = <void*>(<char*>"nctdtridf")
  10546. ufunc_nctdtridf_ptr[2*1] = <void*>_func_nctdtridf
  10547. ufunc_nctdtridf_ptr[2*1+1] = <void*>(<char*>"nctdtridf")
  10548. ufunc_nctdtridf_data[0] = &ufunc_nctdtridf_ptr[2*0]
  10549. ufunc_nctdtridf_data[1] = &ufunc_nctdtridf_ptr[2*1]
  10550. nctdtridf = np.PyUFunc_FromFuncAndData(ufunc_nctdtridf_loops, ufunc_nctdtridf_data, ufunc_nctdtridf_types, 2, 3, 1, 0, 'nctdtridf', ufunc_nctdtridf_doc, 0)
  10551. cdef np.PyUFuncGenericFunction ufunc_nctdtrinc_loops[2]
  10552. cdef void *ufunc_nctdtrinc_ptr[4]
  10553. cdef void *ufunc_nctdtrinc_data[2]
  10554. cdef char ufunc_nctdtrinc_types[8]
  10555. cdef char *ufunc_nctdtrinc_doc = (
  10556. "nctdtrinc(df, p, t, out=None)\n"
  10557. "\n"
  10558. "Calculate non-centrality parameter for non-central t distribution.\n"
  10559. "\n"
  10560. "See `nctdtr` for more details.\n"
  10561. "\n"
  10562. "Parameters\n"
  10563. "----------\n"
  10564. "df : array_like\n"
  10565. " Degrees of freedom of the distribution. Should be in range (0, inf).\n"
  10566. "p : array_like\n"
  10567. " CDF values, in range (0, 1].\n"
  10568. "t : array_like\n"
  10569. " Quantiles, i.e., the upper limit of integration.\n"
  10570. "out : ndarray, optional\n"
  10571. " Optional output array for the function results\n"
  10572. "\n"
  10573. "Returns\n"
  10574. "-------\n"
  10575. "nc : scalar or ndarray\n"
  10576. " Noncentrality parameter\n"
  10577. "\n"
  10578. "See Also\n"
  10579. "--------\n"
  10580. "nctdtr : CDF of the non-central `t` distribution.\n"
  10581. "nctdtrit : Inverse CDF (iCDF) of the non-central t distribution.\n"
  10582. "nctdtridf : Calculate degrees of freedom, given CDF and iCDF values.\n"
  10583. "\n"
  10584. "Examples\n"
  10585. "--------\n"
  10586. ">>> from scipy.special import nctdtr, nctdtrinc\n"
  10587. "\n"
  10588. "Compute the CDF for several values of `nc`:\n"
  10589. "\n"
  10590. ">>> nc = [0.5, 1.5, 2.5]\n"
  10591. ">>> p = nctdtr(3, nc, 1.5)\n"
  10592. ">>> p\n"
  10593. "array([0.77569497, 0.45524533, 0.1668691 ])\n"
  10594. "\n"
  10595. "Compute the inverse. We recover the values of `nc`, as expected:\n"
  10596. "\n"
  10597. ">>> nctdtrinc(3, p, 1.5)\n"
  10598. "array([0.5, 1.5, 2.5])")
  10599. ufunc_nctdtrinc_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  10600. ufunc_nctdtrinc_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  10601. ufunc_nctdtrinc_types[0] = <char>NPY_FLOAT
  10602. ufunc_nctdtrinc_types[1] = <char>NPY_FLOAT
  10603. ufunc_nctdtrinc_types[2] = <char>NPY_FLOAT
  10604. ufunc_nctdtrinc_types[3] = <char>NPY_FLOAT
  10605. ufunc_nctdtrinc_types[4] = <char>NPY_DOUBLE
  10606. ufunc_nctdtrinc_types[5] = <char>NPY_DOUBLE
  10607. ufunc_nctdtrinc_types[6] = <char>NPY_DOUBLE
  10608. ufunc_nctdtrinc_types[7] = <char>NPY_DOUBLE
  10609. ufunc_nctdtrinc_ptr[2*0] = <void*>_func_nctdtrinc
  10610. ufunc_nctdtrinc_ptr[2*0+1] = <void*>(<char*>"nctdtrinc")
  10611. ufunc_nctdtrinc_ptr[2*1] = <void*>_func_nctdtrinc
  10612. ufunc_nctdtrinc_ptr[2*1+1] = <void*>(<char*>"nctdtrinc")
  10613. ufunc_nctdtrinc_data[0] = &ufunc_nctdtrinc_ptr[2*0]
  10614. ufunc_nctdtrinc_data[1] = &ufunc_nctdtrinc_ptr[2*1]
  10615. nctdtrinc = np.PyUFunc_FromFuncAndData(ufunc_nctdtrinc_loops, ufunc_nctdtrinc_data, ufunc_nctdtrinc_types, 2, 3, 1, 0, 'nctdtrinc', ufunc_nctdtrinc_doc, 0)
  10616. cdef np.PyUFuncGenericFunction ufunc_nctdtrit_loops[2]
  10617. cdef void *ufunc_nctdtrit_ptr[4]
  10618. cdef void *ufunc_nctdtrit_data[2]
  10619. cdef char ufunc_nctdtrit_types[8]
  10620. cdef char *ufunc_nctdtrit_doc = (
  10621. "nctdtrit(df, nc, p, out=None)\n"
  10622. "\n"
  10623. "Inverse cumulative distribution function of the non-central t distribution.\n"
  10624. "\n"
  10625. "See `nctdtr` for more details.\n"
  10626. "\n"
  10627. "Parameters\n"
  10628. "----------\n"
  10629. "df : array_like\n"
  10630. " Degrees of freedom of the distribution. Should be in range (0, inf).\n"
  10631. "nc : array_like\n"
  10632. " Noncentrality parameter.\n"
  10633. "p : array_like\n"
  10634. " CDF values, in range (0, 1].\n"
  10635. "out : ndarray, optional\n"
  10636. " Optional output array for the function results\n"
  10637. "\n"
  10638. "Returns\n"
  10639. "-------\n"
  10640. "t : scalar or ndarray\n"
  10641. " Quantiles\n"
  10642. "\n"
  10643. "See Also\n"
  10644. "--------\n"
  10645. "nctdtr : CDF of the non-central `t` distribution.\n"
  10646. "nctdtridf : Calculate degrees of freedom, given CDF and iCDF values.\n"
  10647. "nctdtrinc : Calculate non-centrality parameter, given CDF iCDF values.\n"
  10648. "\n"
  10649. "Notes\n"
  10650. "-----\n"
  10651. "This function calculates the quantile of the non-central t distribution using\n"
  10652. "the Boost Math C++ library [1]_.\n"
  10653. "\n"
  10654. "Note that the argument order of `nctdtrit` is different from that of the\n"
  10655. "similar ``ppf`` method of `scipy.stats.nct`: `t` is the last\n"
  10656. "parameter of `nctdtrit` but the first parameter of ``scipy.stats.nct.ppf``.\n"
  10657. "\n"
  10658. "References\n"
  10659. "----------\n"
  10660. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  10661. "\n"
  10662. "Examples\n"
  10663. "--------\n"
  10664. ">>> from scipy.special import nctdtr, nctdtrit\n"
  10665. "\n"
  10666. "Compute the CDF for several values of `t`:\n"
  10667. "\n"
  10668. ">>> t = [0.5, 1, 1.5]\n"
  10669. ">>> p = nctdtr(3, 1, t)\n"
  10670. ">>> p\n"
  10671. "array([0.29811049, 0.46922687, 0.6257559 ])\n"
  10672. "\n"
  10673. "Compute the inverse. We recover the values of `t`, as expected:\n"
  10674. "\n"
  10675. ">>> nctdtrit(3, 1, p)\n"
  10676. "array([0.5, 1. , 1.5])")
  10677. ufunc_nctdtrit_loops[0] = <np.PyUFuncGenericFunction>loop_f_fff__As_fff_f
  10678. ufunc_nctdtrit_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  10679. ufunc_nctdtrit_types[0] = <char>NPY_FLOAT
  10680. ufunc_nctdtrit_types[1] = <char>NPY_FLOAT
  10681. ufunc_nctdtrit_types[2] = <char>NPY_FLOAT
  10682. ufunc_nctdtrit_types[3] = <char>NPY_FLOAT
  10683. ufunc_nctdtrit_types[4] = <char>NPY_DOUBLE
  10684. ufunc_nctdtrit_types[5] = <char>NPY_DOUBLE
  10685. ufunc_nctdtrit_types[6] = <char>NPY_DOUBLE
  10686. ufunc_nctdtrit_types[7] = <char>NPY_DOUBLE
  10687. ufunc_nctdtrit_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_nct_ppf_float
  10688. ufunc_nctdtrit_ptr[2*0+1] = <void*>(<char*>"nctdtrit")
  10689. ufunc_nctdtrit_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_nct_ppf_double
  10690. ufunc_nctdtrit_ptr[2*1+1] = <void*>(<char*>"nctdtrit")
  10691. ufunc_nctdtrit_data[0] = &ufunc_nctdtrit_ptr[2*0]
  10692. ufunc_nctdtrit_data[1] = &ufunc_nctdtrit_ptr[2*1]
  10693. nctdtrit = np.PyUFunc_FromFuncAndData(ufunc_nctdtrit_loops, ufunc_nctdtrit_data, ufunc_nctdtrit_types, 2, 3, 1, 0, 'nctdtrit', ufunc_nctdtrit_doc, 0)
  10694. cdef np.PyUFuncGenericFunction ufunc_ndtri_loops[2]
  10695. cdef void *ufunc_ndtri_ptr[4]
  10696. cdef void *ufunc_ndtri_data[2]
  10697. cdef char ufunc_ndtri_types[4]
  10698. cdef char *ufunc_ndtri_doc = (
  10699. "ndtri(y, out=None)\n"
  10700. "\n"
  10701. "Inverse of `ndtr` vs x\n"
  10702. "\n"
  10703. "Returns the argument x for which the area under the standard normal\n"
  10704. "probability density function (integrated from minus infinity to `x`)\n"
  10705. "is equal to y.\n"
  10706. "\n"
  10707. "Parameters\n"
  10708. "----------\n"
  10709. "p : array_like\n"
  10710. " Probability\n"
  10711. "out : ndarray, optional\n"
  10712. " Optional output array for the function results\n"
  10713. "\n"
  10714. "Returns\n"
  10715. "-------\n"
  10716. "x : scalar or ndarray\n"
  10717. " Value of x such that ``ndtr(x) == p``.\n"
  10718. "\n"
  10719. "See Also\n"
  10720. "--------\n"
  10721. "ndtr : Standard normal cumulative probability distribution\n"
  10722. "ndtri_exp : Inverse of log_ndtr\n"
  10723. "\n"
  10724. "Examples\n"
  10725. "--------\n"
  10726. "`ndtri` is the percentile function of the standard normal distribution.\n"
  10727. "This means it returns the inverse of the cumulative density `ndtr`. First,\n"
  10728. "let us compute a cumulative density value.\n"
  10729. "\n"
  10730. ">>> import numpy as np\n"
  10731. ">>> from scipy.special import ndtri, ndtr\n"
  10732. ">>> cdf_val = ndtr(2)\n"
  10733. ">>> cdf_val\n"
  10734. "0.9772498680518208\n"
  10735. "\n"
  10736. "Verify that `ndtri` yields the original value for `x` up to floating point\n"
  10737. "errors.\n"
  10738. "\n"
  10739. ">>> ndtri(cdf_val)\n"
  10740. "2.0000000000000004\n"
  10741. "\n"
  10742. "Plot the function. For that purpose, we provide a NumPy array as argument.\n"
  10743. "\n"
  10744. ">>> import matplotlib.pyplot as plt\n"
  10745. ">>> x = np.linspace(0.01, 1, 200)\n"
  10746. ">>> fig, ax = plt.subplots()\n"
  10747. ">>> ax.plot(x, ndtri(x))\n"
  10748. ">>> ax.set_title(\"Standard normal percentile function\")\n"
  10749. ">>> plt.show()")
  10750. ufunc_ndtri_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  10751. ufunc_ndtri_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  10752. ufunc_ndtri_types[0] = <char>NPY_FLOAT
  10753. ufunc_ndtri_types[1] = <char>NPY_FLOAT
  10754. ufunc_ndtri_types[2] = <char>NPY_DOUBLE
  10755. ufunc_ndtri_types[3] = <char>NPY_DOUBLE
  10756. ufunc_ndtri_ptr[2*0] = <void*>_func_xsf_ndtri
  10757. ufunc_ndtri_ptr[2*0+1] = <void*>(<char*>"ndtri")
  10758. ufunc_ndtri_ptr[2*1] = <void*>_func_xsf_ndtri
  10759. ufunc_ndtri_ptr[2*1+1] = <void*>(<char*>"ndtri")
  10760. ufunc_ndtri_data[0] = &ufunc_ndtri_ptr[2*0]
  10761. ufunc_ndtri_data[1] = &ufunc_ndtri_ptr[2*1]
  10762. ndtri = np.PyUFunc_FromFuncAndData(ufunc_ndtri_loops, ufunc_ndtri_data, ufunc_ndtri_types, 2, 1, 1, 0, 'ndtri', ufunc_ndtri_doc, 0)
  10763. cdef np.PyUFuncGenericFunction ufunc_ndtri_exp_loops[2]
  10764. cdef void *ufunc_ndtri_exp_ptr[4]
  10765. cdef void *ufunc_ndtri_exp_data[2]
  10766. cdef char ufunc_ndtri_exp_types[4]
  10767. cdef char *ufunc_ndtri_exp_doc = (
  10768. "ndtri_exp(y, out=None)\n"
  10769. "\n"
  10770. "Inverse of `log_ndtr` vs x. Allows for greater precision than\n"
  10771. "`ndtri` composed with `numpy.exp` for very small values of y and for\n"
  10772. "y close to 0.\n"
  10773. "\n"
  10774. "Parameters\n"
  10775. "----------\n"
  10776. "y : array_like of float\n"
  10777. " Function argument\n"
  10778. "out : ndarray, optional\n"
  10779. " Optional output array for the function results\n"
  10780. "\n"
  10781. "Returns\n"
  10782. "-------\n"
  10783. "scalar or ndarray\n"
  10784. " Inverse of the log CDF of the standard normal distribution, evaluated\n"
  10785. " at y.\n"
  10786. "\n"
  10787. "See Also\n"
  10788. "--------\n"
  10789. "log_ndtr : log of the standard normal cumulative distribution function\n"
  10790. "ndtr : standard normal cumulative distribution function\n"
  10791. "ndtri : standard normal percentile function\n"
  10792. "\n"
  10793. "Examples\n"
  10794. "--------\n"
  10795. ">>> import numpy as np\n"
  10796. ">>> import scipy.special as sc\n"
  10797. "\n"
  10798. "`ndtri_exp` agrees with the naive implementation when the latter does\n"
  10799. "not suffer from underflow.\n"
  10800. "\n"
  10801. ">>> sc.ndtri_exp(-1)\n"
  10802. "-0.33747496376420244\n"
  10803. ">>> sc.ndtri(np.exp(-1))\n"
  10804. "-0.33747496376420244\n"
  10805. "\n"
  10806. "For extreme values of y, the naive approach fails\n"
  10807. "\n"
  10808. ">>> sc.ndtri(np.exp(-800))\n"
  10809. "-inf\n"
  10810. ">>> sc.ndtri(np.exp(-1e-20))\n"
  10811. "inf\n"
  10812. "\n"
  10813. "whereas `ndtri_exp` is still able to compute the result to high precision.\n"
  10814. "\n"
  10815. ">>> sc.ndtri_exp(-800)\n"
  10816. "-39.88469483825668\n"
  10817. ">>> sc.ndtri_exp(-1e-20)\n"
  10818. "9.262340089798409")
  10819. ufunc_ndtri_exp_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  10820. ufunc_ndtri_exp_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  10821. ufunc_ndtri_exp_types[0] = <char>NPY_FLOAT
  10822. ufunc_ndtri_exp_types[1] = <char>NPY_FLOAT
  10823. ufunc_ndtri_exp_types[2] = <char>NPY_DOUBLE
  10824. ufunc_ndtri_exp_types[3] = <char>NPY_DOUBLE
  10825. ufunc_ndtri_exp_ptr[2*0] = <void*>_func_ndtri_exp
  10826. ufunc_ndtri_exp_ptr[2*0+1] = <void*>(<char*>"ndtri_exp")
  10827. ufunc_ndtri_exp_ptr[2*1] = <void*>_func_ndtri_exp
  10828. ufunc_ndtri_exp_ptr[2*1+1] = <void*>(<char*>"ndtri_exp")
  10829. ufunc_ndtri_exp_data[0] = &ufunc_ndtri_exp_ptr[2*0]
  10830. ufunc_ndtri_exp_data[1] = &ufunc_ndtri_exp_ptr[2*1]
  10831. ndtri_exp = np.PyUFunc_FromFuncAndData(ufunc_ndtri_exp_loops, ufunc_ndtri_exp_data, ufunc_ndtri_exp_types, 2, 1, 1, 0, 'ndtri_exp', ufunc_ndtri_exp_doc, 0)
  10832. cdef np.PyUFuncGenericFunction ufunc_nrdtrimn_loops[2]
  10833. cdef void *ufunc_nrdtrimn_ptr[4]
  10834. cdef void *ufunc_nrdtrimn_data[2]
  10835. cdef char ufunc_nrdtrimn_types[8]
  10836. cdef char *ufunc_nrdtrimn_doc = (
  10837. "nrdtrimn(p, std, x, out=None)\n"
  10838. "\n"
  10839. "Calculate mean of normal distribution given other params.\n"
  10840. "\n"
  10841. "Parameters\n"
  10842. "----------\n"
  10843. "p : array_like\n"
  10844. " CDF values, in range (0, 1].\n"
  10845. "std : array_like\n"
  10846. " Standard deviation.\n"
  10847. "x : array_like\n"
  10848. " Quantiles, i.e. the upper limit of integration.\n"
  10849. "out : ndarray, optional\n"
  10850. " Optional output array for the function results\n"
  10851. "\n"
  10852. "Returns\n"
  10853. "-------\n"
  10854. "mn : scalar or ndarray\n"
  10855. " The mean of the normal distribution.\n"
  10856. "\n"
  10857. "See Also\n"
  10858. "--------\n"
  10859. "scipy.stats.norm : Normal distribution\n"
  10860. "ndtr : Standard normal cumulative probability distribution\n"
  10861. "ndtri : Inverse of standard normal CDF with respect to quantile\n"
  10862. "nrdtrisd : Inverse of normal distribution CDF with respect to\n"
  10863. " standard deviation\n"
  10864. "\n"
  10865. "Examples\n"
  10866. "--------\n"
  10867. "`nrdtrimn` can be used to recover the mean of a normal distribution\n"
  10868. "if we know the CDF value `p` for a given quantile `x` and the\n"
  10869. "standard deviation `std`. First, we calculate\n"
  10870. "the normal distribution CDF for an exemplary parameter set.\n"
  10871. "\n"
  10872. ">>> from scipy.stats import norm\n"
  10873. ">>> mean = 3.\n"
  10874. ">>> std = 2.\n"
  10875. ">>> x = 6.\n"
  10876. ">>> p = norm.cdf(x, loc=mean, scale=std)\n"
  10877. ">>> p\n"
  10878. "0.9331927987311419\n"
  10879. "\n"
  10880. "Verify that `nrdtrimn` returns the original value for `mean`.\n"
  10881. "\n"
  10882. ">>> from scipy.special import nrdtrimn\n"
  10883. ">>> nrdtrimn(p, std, x)\n"
  10884. "3.0000000000000004")
  10885. ufunc_nrdtrimn_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  10886. ufunc_nrdtrimn_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  10887. ufunc_nrdtrimn_types[0] = <char>NPY_FLOAT
  10888. ufunc_nrdtrimn_types[1] = <char>NPY_FLOAT
  10889. ufunc_nrdtrimn_types[2] = <char>NPY_FLOAT
  10890. ufunc_nrdtrimn_types[3] = <char>NPY_FLOAT
  10891. ufunc_nrdtrimn_types[4] = <char>NPY_DOUBLE
  10892. ufunc_nrdtrimn_types[5] = <char>NPY_DOUBLE
  10893. ufunc_nrdtrimn_types[6] = <char>NPY_DOUBLE
  10894. ufunc_nrdtrimn_types[7] = <char>NPY_DOUBLE
  10895. ufunc_nrdtrimn_ptr[2*0] = <void*>_func_nrdtrimn
  10896. ufunc_nrdtrimn_ptr[2*0+1] = <void*>(<char*>"nrdtrimn")
  10897. ufunc_nrdtrimn_ptr[2*1] = <void*>_func_nrdtrimn
  10898. ufunc_nrdtrimn_ptr[2*1+1] = <void*>(<char*>"nrdtrimn")
  10899. ufunc_nrdtrimn_data[0] = &ufunc_nrdtrimn_ptr[2*0]
  10900. ufunc_nrdtrimn_data[1] = &ufunc_nrdtrimn_ptr[2*1]
  10901. nrdtrimn = np.PyUFunc_FromFuncAndData(ufunc_nrdtrimn_loops, ufunc_nrdtrimn_data, ufunc_nrdtrimn_types, 2, 3, 1, 0, 'nrdtrimn', ufunc_nrdtrimn_doc, 0)
  10902. cdef np.PyUFuncGenericFunction ufunc_nrdtrisd_loops[2]
  10903. cdef void *ufunc_nrdtrisd_ptr[4]
  10904. cdef void *ufunc_nrdtrisd_data[2]
  10905. cdef char ufunc_nrdtrisd_types[8]
  10906. cdef char *ufunc_nrdtrisd_doc = (
  10907. "nrdtrisd(mn, p, x, out=None)\n"
  10908. "\n"
  10909. "Calculate standard deviation of normal distribution given other params.\n"
  10910. "\n"
  10911. "Parameters\n"
  10912. "----------\n"
  10913. "mn : scalar or ndarray\n"
  10914. " The mean of the normal distribution.\n"
  10915. "p : array_like\n"
  10916. " CDF values, in range (0, 1].\n"
  10917. "x : array_like\n"
  10918. " Quantiles, i.e. the upper limit of integration.\n"
  10919. "\n"
  10920. "out : ndarray, optional\n"
  10921. " Optional output array for the function results\n"
  10922. "\n"
  10923. "Returns\n"
  10924. "-------\n"
  10925. "std : scalar or ndarray\n"
  10926. " Standard deviation.\n"
  10927. "\n"
  10928. "See Also\n"
  10929. "--------\n"
  10930. "scipy.stats.norm : Normal distribution\n"
  10931. "ndtr : Standard normal cumulative probability distribution\n"
  10932. "ndtri : Inverse of standard normal CDF with respect to quantile\n"
  10933. "nrdtrimn : Inverse of normal distribution CDF with respect to\n"
  10934. " mean\n"
  10935. "\n"
  10936. "Examples\n"
  10937. "--------\n"
  10938. "`nrdtrisd` can be used to recover the standard deviation of a normal\n"
  10939. "distribution if we know the CDF value `p` for a given quantile `x` and\n"
  10940. "the mean `mn`. First, we calculate the normal distribution CDF for an\n"
  10941. "exemplary parameter set.\n"
  10942. "\n"
  10943. ">>> from scipy.stats import norm\n"
  10944. ">>> mean = 3.\n"
  10945. ">>> std = 2.\n"
  10946. ">>> x = 6.\n"
  10947. ">>> p = norm.cdf(x, loc=mean, scale=std)\n"
  10948. ">>> p\n"
  10949. "0.9331927987311419\n"
  10950. "\n"
  10951. "Verify that `nrdtrisd` returns the original value for `std`.\n"
  10952. "\n"
  10953. ">>> from scipy.special import nrdtrisd\n"
  10954. ">>> nrdtrisd(mean, p, x)\n"
  10955. "2.0000000000000004")
  10956. ufunc_nrdtrisd_loops[0] = <np.PyUFuncGenericFunction>loop_d_ddd__As_fff_f
  10957. ufunc_nrdtrisd_loops[1] = <np.PyUFuncGenericFunction>loop_d_ddd__As_ddd_d
  10958. ufunc_nrdtrisd_types[0] = <char>NPY_FLOAT
  10959. ufunc_nrdtrisd_types[1] = <char>NPY_FLOAT
  10960. ufunc_nrdtrisd_types[2] = <char>NPY_FLOAT
  10961. ufunc_nrdtrisd_types[3] = <char>NPY_FLOAT
  10962. ufunc_nrdtrisd_types[4] = <char>NPY_DOUBLE
  10963. ufunc_nrdtrisd_types[5] = <char>NPY_DOUBLE
  10964. ufunc_nrdtrisd_types[6] = <char>NPY_DOUBLE
  10965. ufunc_nrdtrisd_types[7] = <char>NPY_DOUBLE
  10966. ufunc_nrdtrisd_ptr[2*0] = <void*>_func_nrdtrisd
  10967. ufunc_nrdtrisd_ptr[2*0+1] = <void*>(<char*>"nrdtrisd")
  10968. ufunc_nrdtrisd_ptr[2*1] = <void*>_func_nrdtrisd
  10969. ufunc_nrdtrisd_ptr[2*1+1] = <void*>(<char*>"nrdtrisd")
  10970. ufunc_nrdtrisd_data[0] = &ufunc_nrdtrisd_ptr[2*0]
  10971. ufunc_nrdtrisd_data[1] = &ufunc_nrdtrisd_ptr[2*1]
  10972. nrdtrisd = np.PyUFunc_FromFuncAndData(ufunc_nrdtrisd_loops, ufunc_nrdtrisd_data, ufunc_nrdtrisd_types, 2, 3, 1, 0, 'nrdtrisd', ufunc_nrdtrisd_doc, 0)
  10973. cdef np.PyUFuncGenericFunction ufunc_owens_t_loops[2]
  10974. cdef void *ufunc_owens_t_ptr[4]
  10975. cdef void *ufunc_owens_t_data[2]
  10976. cdef char ufunc_owens_t_types[6]
  10977. cdef char *ufunc_owens_t_doc = (
  10978. "owens_t(h, a, out=None)\n"
  10979. "\n"
  10980. "Owen's T Function.\n"
  10981. "\n"
  10982. "The function T(h, a) gives the probability of the event\n"
  10983. "(X > h and 0 < Y < a * X) where X and Y are independent\n"
  10984. "standard normal random variables.\n"
  10985. "\n"
  10986. "Parameters\n"
  10987. "----------\n"
  10988. "h: array_like\n"
  10989. " Input value.\n"
  10990. "a: array_like\n"
  10991. " Input value.\n"
  10992. "out : ndarray, optional\n"
  10993. " Optional output array for the function results\n"
  10994. "\n"
  10995. "Returns\n"
  10996. "-------\n"
  10997. "t: scalar or ndarray\n"
  10998. " Probability of the event (X > h and 0 < Y < a * X),\n"
  10999. " where X and Y are independent standard normal random variables.\n"
  11000. "\n"
  11001. "References\n"
  11002. "----------\n"
  11003. ".. [1] M. Patefield and D. Tandy, \"Fast and accurate calculation of\n"
  11004. " Owen's T Function\", Statistical Software vol. 5, pp. 1-25, 2000.\n"
  11005. "\n"
  11006. "Examples\n"
  11007. "--------\n"
  11008. ">>> from scipy import special\n"
  11009. ">>> a = 3.5\n"
  11010. ">>> h = 0.78\n"
  11011. ">>> special.owens_t(h, a)\n"
  11012. "0.10877216734852274")
  11013. ufunc_owens_t_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  11014. ufunc_owens_t_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  11015. ufunc_owens_t_types[0] = <char>NPY_FLOAT
  11016. ufunc_owens_t_types[1] = <char>NPY_FLOAT
  11017. ufunc_owens_t_types[2] = <char>NPY_FLOAT
  11018. ufunc_owens_t_types[3] = <char>NPY_DOUBLE
  11019. ufunc_owens_t_types[4] = <char>NPY_DOUBLE
  11020. ufunc_owens_t_types[5] = <char>NPY_DOUBLE
  11021. ufunc_owens_t_ptr[2*0] = <void*>_func_xsf_owens_t
  11022. ufunc_owens_t_ptr[2*0+1] = <void*>(<char*>"owens_t")
  11023. ufunc_owens_t_ptr[2*1] = <void*>_func_xsf_owens_t
  11024. ufunc_owens_t_ptr[2*1+1] = <void*>(<char*>"owens_t")
  11025. ufunc_owens_t_data[0] = &ufunc_owens_t_ptr[2*0]
  11026. ufunc_owens_t_data[1] = &ufunc_owens_t_ptr[2*1]
  11027. owens_t = np.PyUFunc_FromFuncAndData(ufunc_owens_t_loops, ufunc_owens_t_data, ufunc_owens_t_types, 2, 2, 1, 0, 'owens_t', ufunc_owens_t_doc, 0)
  11028. cdef np.PyUFuncGenericFunction ufunc_pdtr_loops[2]
  11029. cdef void *ufunc_pdtr_ptr[4]
  11030. cdef void *ufunc_pdtr_data[2]
  11031. cdef char ufunc_pdtr_types[6]
  11032. cdef char *ufunc_pdtr_doc = (
  11033. "pdtr(k, m, out=None)\n"
  11034. "\n"
  11035. "Poisson cumulative distribution function.\n"
  11036. "\n"
  11037. "Defined as the probability that a Poisson-distributed random\n"
  11038. "variable with event rate :math:`m` is less than or equal to\n"
  11039. ":math:`k`. More concretely, this works out to be [1]_\n"
  11040. "\n"
  11041. ".. math::\n"
  11042. "\n"
  11043. " \\exp(-m) \\sum_{j = 0}^{\\lfloor{k}\\rfloor} \\frac{m^j}{j!}.\n"
  11044. "\n"
  11045. "Parameters\n"
  11046. "----------\n"
  11047. "k : array_like\n"
  11048. " Number of occurrences (nonnegative, real)\n"
  11049. "m : array_like\n"
  11050. " Shape parameter (nonnegative, real)\n"
  11051. "out : ndarray, optional\n"
  11052. " Optional output array for the function results\n"
  11053. "\n"
  11054. "Returns\n"
  11055. "-------\n"
  11056. "scalar or ndarray\n"
  11057. " Values of the Poisson cumulative distribution function\n"
  11058. "\n"
  11059. "See Also\n"
  11060. "--------\n"
  11061. "pdtrc : Poisson survival function\n"
  11062. "pdtrik : inverse of `pdtr` with respect to `k`\n"
  11063. "pdtri : inverse of `pdtr` with respect to `m`\n"
  11064. "\n"
  11065. "References\n"
  11066. "----------\n"
  11067. ".. [1] https://en.wikipedia.org/wiki/Poisson_distribution\n"
  11068. "\n"
  11069. "Examples\n"
  11070. "--------\n"
  11071. ">>> import numpy as np\n"
  11072. ">>> import scipy.special as sc\n"
  11073. "\n"
  11074. "It is a cumulative distribution function, so it converges to 1\n"
  11075. "monotonically as `k` goes to infinity.\n"
  11076. "\n"
  11077. ">>> sc.pdtr([1, 10, 100, np.inf], 1)\n"
  11078. "array([0.73575888, 0.99999999, 1. , 1. ])\n"
  11079. "\n"
  11080. "It is discontinuous at integers and constant between integers.\n"
  11081. "\n"
  11082. ">>> sc.pdtr([1, 1.5, 1.9, 2], 1)\n"
  11083. "array([0.73575888, 0.73575888, 0.73575888, 0.9196986 ])")
  11084. ufunc_pdtr_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  11085. ufunc_pdtr_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  11086. ufunc_pdtr_types[0] = <char>NPY_FLOAT
  11087. ufunc_pdtr_types[1] = <char>NPY_FLOAT
  11088. ufunc_pdtr_types[2] = <char>NPY_FLOAT
  11089. ufunc_pdtr_types[3] = <char>NPY_DOUBLE
  11090. ufunc_pdtr_types[4] = <char>NPY_DOUBLE
  11091. ufunc_pdtr_types[5] = <char>NPY_DOUBLE
  11092. ufunc_pdtr_ptr[2*0] = <void*>_func_xsf_pdtr
  11093. ufunc_pdtr_ptr[2*0+1] = <void*>(<char*>"pdtr")
  11094. ufunc_pdtr_ptr[2*1] = <void*>_func_xsf_pdtr
  11095. ufunc_pdtr_ptr[2*1+1] = <void*>(<char*>"pdtr")
  11096. ufunc_pdtr_data[0] = &ufunc_pdtr_ptr[2*0]
  11097. ufunc_pdtr_data[1] = &ufunc_pdtr_ptr[2*1]
  11098. pdtr = np.PyUFunc_FromFuncAndData(ufunc_pdtr_loops, ufunc_pdtr_data, ufunc_pdtr_types, 2, 2, 1, 0, 'pdtr', ufunc_pdtr_doc, 0)
  11099. cdef np.PyUFuncGenericFunction ufunc_pdtrc_loops[2]
  11100. cdef void *ufunc_pdtrc_ptr[4]
  11101. cdef void *ufunc_pdtrc_data[2]
  11102. cdef char ufunc_pdtrc_types[6]
  11103. cdef char *ufunc_pdtrc_doc = (
  11104. "pdtrc(k, m, out=None)\n"
  11105. "\n"
  11106. "Poisson survival function\n"
  11107. "\n"
  11108. "Returns the sum of the terms from k+1 to infinity of the Poisson\n"
  11109. "distribution: sum(exp(-m) * m**j / j!, j=k+1..inf) = gammainc(\n"
  11110. "k+1, m). Arguments must both be non-negative doubles.\n"
  11111. "\n"
  11112. "Parameters\n"
  11113. "----------\n"
  11114. "k : array_like\n"
  11115. " Number of occurrences (nonnegative, real)\n"
  11116. "m : array_like\n"
  11117. " Shape parameter (nonnegative, real)\n"
  11118. "out : ndarray, optional\n"
  11119. " Optional output array for the function results\n"
  11120. "\n"
  11121. "Returns\n"
  11122. "-------\n"
  11123. "scalar or ndarray\n"
  11124. " Values of the Poisson survival function\n"
  11125. "\n"
  11126. "See Also\n"
  11127. "--------\n"
  11128. "pdtr : Poisson cumulative distribution function\n"
  11129. "pdtrik : inverse of `pdtr` with respect to `k`\n"
  11130. "pdtri : inverse of `pdtr` with respect to `m`\n"
  11131. "\n"
  11132. "Examples\n"
  11133. "--------\n"
  11134. ">>> import numpy as np\n"
  11135. ">>> import scipy.special as sc\n"
  11136. "\n"
  11137. "It is a survival function, so it decreases to 0\n"
  11138. "monotonically as `k` goes to infinity.\n"
  11139. "\n"
  11140. ">>> k = np.array([1, 10, 100, np.inf])\n"
  11141. ">>> sc.pdtrc(k, 1)\n"
  11142. "array([2.64241118e-001, 1.00477664e-008, 3.94147589e-161, 0.00000000e+000])\n"
  11143. "\n"
  11144. "It can be expressed in terms of the lower incomplete gamma\n"
  11145. "function `gammainc`.\n"
  11146. "\n"
  11147. ">>> sc.gammainc(k + 1, 1)\n"
  11148. "array([2.64241118e-001, 1.00477664e-008, 3.94147589e-161, 0.00000000e+000])")
  11149. ufunc_pdtrc_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  11150. ufunc_pdtrc_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  11151. ufunc_pdtrc_types[0] = <char>NPY_FLOAT
  11152. ufunc_pdtrc_types[1] = <char>NPY_FLOAT
  11153. ufunc_pdtrc_types[2] = <char>NPY_FLOAT
  11154. ufunc_pdtrc_types[3] = <char>NPY_DOUBLE
  11155. ufunc_pdtrc_types[4] = <char>NPY_DOUBLE
  11156. ufunc_pdtrc_types[5] = <char>NPY_DOUBLE
  11157. ufunc_pdtrc_ptr[2*0] = <void*>_func_xsf_pdtrc
  11158. ufunc_pdtrc_ptr[2*0+1] = <void*>(<char*>"pdtrc")
  11159. ufunc_pdtrc_ptr[2*1] = <void*>_func_xsf_pdtrc
  11160. ufunc_pdtrc_ptr[2*1+1] = <void*>(<char*>"pdtrc")
  11161. ufunc_pdtrc_data[0] = &ufunc_pdtrc_ptr[2*0]
  11162. ufunc_pdtrc_data[1] = &ufunc_pdtrc_ptr[2*1]
  11163. pdtrc = np.PyUFunc_FromFuncAndData(ufunc_pdtrc_loops, ufunc_pdtrc_data, ufunc_pdtrc_types, 2, 2, 1, 0, 'pdtrc', ufunc_pdtrc_doc, 0)
  11164. cdef np.PyUFuncGenericFunction ufunc_pdtri_loops[3]
  11165. cdef void *ufunc_pdtri_ptr[6]
  11166. cdef void *ufunc_pdtri_data[3]
  11167. cdef char ufunc_pdtri_types[9]
  11168. cdef char *ufunc_pdtri_doc = (
  11169. "pdtri(k, y, out=None)\n"
  11170. "\n"
  11171. "Inverse to `pdtr` vs m\n"
  11172. "\n"
  11173. "Returns the Poisson variable `m` such that the sum from 0 to `k` of\n"
  11174. "the Poisson density is equal to the given probability `y`:\n"
  11175. "calculated by ``gammaincinv(k + 1, y)``. `k` must be a nonnegative\n"
  11176. "integer and `y` between 0 and 1.\n"
  11177. "\n"
  11178. "Parameters\n"
  11179. "----------\n"
  11180. "k : array_like\n"
  11181. " Number of occurrences (nonnegative, real)\n"
  11182. "y : array_like\n"
  11183. " Probability\n"
  11184. "out : ndarray, optional\n"
  11185. " Optional output array for the function results\n"
  11186. "\n"
  11187. "Returns\n"
  11188. "-------\n"
  11189. "scalar or ndarray\n"
  11190. " Values of the shape parameter `m` such that ``pdtr(k, m) = p``\n"
  11191. "\n"
  11192. "See Also\n"
  11193. "--------\n"
  11194. "pdtr : Poisson cumulative distribution function\n"
  11195. "pdtrc : Poisson survival function\n"
  11196. "pdtrik : inverse of `pdtr` with respect to `k`\n"
  11197. "\n"
  11198. "Examples\n"
  11199. "--------\n"
  11200. ">>> import scipy.special as sc\n"
  11201. "\n"
  11202. "Compute the CDF for several values of `m`:\n"
  11203. "\n"
  11204. ">>> m = [0.5, 1, 1.5]\n"
  11205. ">>> p = sc.pdtr(1, m)\n"
  11206. ">>> p\n"
  11207. "array([0.90979599, 0.73575888, 0.5578254 ])\n"
  11208. "\n"
  11209. "Compute the inverse. We recover the values of `m`, as expected:\n"
  11210. "\n"
  11211. ">>> sc.pdtri(1, p)\n"
  11212. "array([0.5, 1. , 1.5])")
  11213. ufunc_pdtri_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  11214. ufunc_pdtri_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  11215. ufunc_pdtri_loops[2] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  11216. ufunc_pdtri_types[0] = <char>NPY_INTP
  11217. ufunc_pdtri_types[1] = <char>NPY_DOUBLE
  11218. ufunc_pdtri_types[2] = <char>NPY_DOUBLE
  11219. ufunc_pdtri_types[3] = <char>NPY_FLOAT
  11220. ufunc_pdtri_types[4] = <char>NPY_FLOAT
  11221. ufunc_pdtri_types[5] = <char>NPY_FLOAT
  11222. ufunc_pdtri_types[6] = <char>NPY_DOUBLE
  11223. ufunc_pdtri_types[7] = <char>NPY_DOUBLE
  11224. ufunc_pdtri_types[8] = <char>NPY_DOUBLE
  11225. ufunc_pdtri_ptr[2*0] = <void*>_func_cephes_pdtri_wrap
  11226. ufunc_pdtri_ptr[2*0+1] = <void*>(<char*>"pdtri")
  11227. ufunc_pdtri_ptr[2*1] = <void*>_func_pdtri_unsafe
  11228. ufunc_pdtri_ptr[2*1+1] = <void*>(<char*>"pdtri")
  11229. ufunc_pdtri_ptr[2*2] = <void*>_func_pdtri_unsafe
  11230. ufunc_pdtri_ptr[2*2+1] = <void*>(<char*>"pdtri")
  11231. ufunc_pdtri_data[0] = &ufunc_pdtri_ptr[2*0]
  11232. ufunc_pdtri_data[1] = &ufunc_pdtri_ptr[2*1]
  11233. ufunc_pdtri_data[2] = &ufunc_pdtri_ptr[2*2]
  11234. pdtri = np.PyUFunc_FromFuncAndData(ufunc_pdtri_loops, ufunc_pdtri_data, ufunc_pdtri_types, 3, 2, 1, 0, 'pdtri', ufunc_pdtri_doc, 0)
  11235. cdef np.PyUFuncGenericFunction ufunc_pdtrik_loops[2]
  11236. cdef void *ufunc_pdtrik_ptr[4]
  11237. cdef void *ufunc_pdtrik_data[2]
  11238. cdef char ufunc_pdtrik_types[6]
  11239. cdef char *ufunc_pdtrik_doc = (
  11240. "pdtrik(p, m, out=None)\n"
  11241. "\n"
  11242. "Inverse to `pdtr` vs `k`.\n"
  11243. "\n"
  11244. "Parameters\n"
  11245. "----------\n"
  11246. "p : array_like\n"
  11247. " Probability\n"
  11248. "m : array_like\n"
  11249. " Shape parameter (nonnegative, real)\n"
  11250. "out : ndarray, optional\n"
  11251. " Optional output array for the function results\n"
  11252. "\n"
  11253. "Returns\n"
  11254. "-------\n"
  11255. "scalar or ndarray\n"
  11256. " The number of occurrences `k` such that ``pdtr(k, m) = p``\n"
  11257. "\n"
  11258. "Notes\n"
  11259. "-----\n"
  11260. "This function relies on the ``gamma_q_inva`` function from the Boost\n"
  11261. "Math C++ library [1]_.\n"
  11262. "\n"
  11263. "References\n"
  11264. "----------\n"
  11265. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  11266. "\n"
  11267. "See Also\n"
  11268. "--------\n"
  11269. "pdtr : Poisson cumulative distribution function\n"
  11270. "pdtrc : Poisson survival function\n"
  11271. "pdtri : inverse of `pdtr` with respect to `m`\n"
  11272. "\n"
  11273. "Examples\n"
  11274. "--------\n"
  11275. ">>> import scipy.special as sc\n"
  11276. "\n"
  11277. "Compute the CDF for several values of `k`:\n"
  11278. "\n"
  11279. ">>> k = [1, 2, 3]\n"
  11280. ">>> p = sc.pdtr(k, 2)\n"
  11281. ">>> p\n"
  11282. "array([0.40600585, 0.67667642, 0.85712346])\n"
  11283. "\n"
  11284. "Compute the inverse. We recover the values of `k`, as expected:\n"
  11285. "\n"
  11286. ">>> sc.pdtrik(p, 2)\n"
  11287. "array([1., 2., 3.])")
  11288. ufunc_pdtrik_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  11289. ufunc_pdtrik_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  11290. ufunc_pdtrik_types[0] = <char>NPY_FLOAT
  11291. ufunc_pdtrik_types[1] = <char>NPY_FLOAT
  11292. ufunc_pdtrik_types[2] = <char>NPY_FLOAT
  11293. ufunc_pdtrik_types[3] = <char>NPY_DOUBLE
  11294. ufunc_pdtrik_types[4] = <char>NPY_DOUBLE
  11295. ufunc_pdtrik_types[5] = <char>NPY_DOUBLE
  11296. ufunc_pdtrik_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_pdtrik_float
  11297. ufunc_pdtrik_ptr[2*0+1] = <void*>(<char*>"pdtrik")
  11298. ufunc_pdtrik_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_pdtrik_double
  11299. ufunc_pdtrik_ptr[2*1+1] = <void*>(<char*>"pdtrik")
  11300. ufunc_pdtrik_data[0] = &ufunc_pdtrik_ptr[2*0]
  11301. ufunc_pdtrik_data[1] = &ufunc_pdtrik_ptr[2*1]
  11302. pdtrik = np.PyUFunc_FromFuncAndData(ufunc_pdtrik_loops, ufunc_pdtrik_data, ufunc_pdtrik_types, 2, 2, 1, 0, 'pdtrik', ufunc_pdtrik_doc, 0)
  11303. cdef np.PyUFuncGenericFunction ufunc_poch_loops[2]
  11304. cdef void *ufunc_poch_ptr[4]
  11305. cdef void *ufunc_poch_data[2]
  11306. cdef char ufunc_poch_types[6]
  11307. cdef char *ufunc_poch_doc = (
  11308. "poch(z, m, out=None)\n"
  11309. "\n"
  11310. "Pochhammer symbol.\n"
  11311. "\n"
  11312. "The Pochhammer symbol (rising factorial) is defined as\n"
  11313. "\n"
  11314. ".. math::\n"
  11315. "\n"
  11316. " (z)_m = \\frac{\\Gamma(z + m)}{\\Gamma(z)}\n"
  11317. "\n"
  11318. "For positive integer `m` it reads\n"
  11319. "\n"
  11320. ".. math::\n"
  11321. "\n"
  11322. " (z)_m = z (z + 1) ... (z + m - 1)\n"
  11323. "\n"
  11324. "See [DLMF]_ for more details.\n"
  11325. "\n"
  11326. "Parameters\n"
  11327. "----------\n"
  11328. "z, m : array_like\n"
  11329. " Real-valued arguments.\n"
  11330. "out : ndarray, optional\n"
  11331. " Optional output array for the function results\n"
  11332. "\n"
  11333. "Returns\n"
  11334. "-------\n"
  11335. "scalar or ndarray\n"
  11336. " The value of the function.\n"
  11337. "\n"
  11338. "References\n"
  11339. "----------\n"
  11340. ".. [DLMF] Nist, Digital Library of Mathematical Functions\n"
  11341. " https://dlmf.nist.gov/5.2#iii\n"
  11342. "\n"
  11343. "Examples\n"
  11344. "--------\n"
  11345. ">>> import scipy.special as sc\n"
  11346. "\n"
  11347. "It is 1 when m is 0.\n"
  11348. "\n"
  11349. ">>> sc.poch([1, 2, 3, 4], 0)\n"
  11350. "array([1., 1., 1., 1.])\n"
  11351. "\n"
  11352. "For z equal to 1 it reduces to the factorial function.\n"
  11353. "\n"
  11354. ">>> sc.poch(1, 5)\n"
  11355. "120.0\n"
  11356. ">>> 1 * 2 * 3 * 4 * 5\n"
  11357. "120\n"
  11358. "\n"
  11359. "It can be expressed in terms of the gamma function.\n"
  11360. "\n"
  11361. ">>> z, m = 3.7, 2.1\n"
  11362. ">>> sc.poch(z, m)\n"
  11363. "20.529581933776953\n"
  11364. ">>> sc.gamma(z + m) / sc.gamma(z)\n"
  11365. "20.52958193377696")
  11366. ufunc_poch_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  11367. ufunc_poch_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  11368. ufunc_poch_types[0] = <char>NPY_FLOAT
  11369. ufunc_poch_types[1] = <char>NPY_FLOAT
  11370. ufunc_poch_types[2] = <char>NPY_FLOAT
  11371. ufunc_poch_types[3] = <char>NPY_DOUBLE
  11372. ufunc_poch_types[4] = <char>NPY_DOUBLE
  11373. ufunc_poch_types[5] = <char>NPY_DOUBLE
  11374. ufunc_poch_ptr[2*0] = <void*>_func_cephes_poch
  11375. ufunc_poch_ptr[2*0+1] = <void*>(<char*>"poch")
  11376. ufunc_poch_ptr[2*1] = <void*>_func_cephes_poch
  11377. ufunc_poch_ptr[2*1+1] = <void*>(<char*>"poch")
  11378. ufunc_poch_data[0] = &ufunc_poch_ptr[2*0]
  11379. ufunc_poch_data[1] = &ufunc_poch_ptr[2*1]
  11380. poch = np.PyUFunc_FromFuncAndData(ufunc_poch_loops, ufunc_poch_data, ufunc_poch_types, 2, 2, 1, 0, 'poch', ufunc_poch_doc, 0)
  11381. cdef np.PyUFuncGenericFunction ufunc_powm1_loops[2]
  11382. cdef void *ufunc_powm1_ptr[4]
  11383. cdef void *ufunc_powm1_data[2]
  11384. cdef char ufunc_powm1_types[6]
  11385. cdef char *ufunc_powm1_doc = (
  11386. "powm1(x, y, out=None)\n"
  11387. "\n"
  11388. "Computes ``x**y - 1``.\n"
  11389. "\n"
  11390. "This function is useful when `y` is near 0, or when `x` is near 1.\n"
  11391. "\n"
  11392. "The function is implemented for real types only (unlike ``numpy.power``,\n"
  11393. "which accepts complex inputs).\n"
  11394. "\n"
  11395. "Parameters\n"
  11396. "----------\n"
  11397. "x : array_like\n"
  11398. " The base. Must be a real type (i.e. integer or float, not complex).\n"
  11399. "y : array_like\n"
  11400. " The exponent. Must be a real type (i.e. integer or float, not complex).\n"
  11401. "\n"
  11402. "Returns\n"
  11403. "-------\n"
  11404. "array_like\n"
  11405. " Result of the calculation\n"
  11406. "\n"
  11407. "Notes\n"
  11408. "-----\n"
  11409. ".. versionadded:: 1.10.0\n"
  11410. "\n"
  11411. "The underlying code is implemented for single precision and double\n"
  11412. "precision floats only. Unlike `numpy.power`, integer inputs to\n"
  11413. "`powm1` are converted to floating point, and complex inputs are\n"
  11414. "not accepted.\n"
  11415. "\n"
  11416. "Note the following edge cases:\n"
  11417. "\n"
  11418. "* ``powm1(x, 0)`` returns 0 for any ``x``, including 0, ``inf``\n"
  11419. " and ``nan``.\n"
  11420. "* ``powm1(1, y)`` returns 0 for any ``y``, including ``nan``\n"
  11421. " and ``inf``.\n"
  11422. "\n"
  11423. "This function wraps the ``powm1`` routine from the\n"
  11424. "Boost Math C++ library [1]_.\n"
  11425. "\n"
  11426. "References\n"
  11427. "----------\n"
  11428. ".. [1] The Boost Developers. \"Boost C++ Libraries\". https://www.boost.org/.\n"
  11429. "\n"
  11430. "Examples\n"
  11431. "--------\n"
  11432. ">>> import numpy as np\n"
  11433. ">>> from scipy.special import powm1\n"
  11434. "\n"
  11435. ">>> x = np.array([1.2, 10.0, 0.9999999975])\n"
  11436. ">>> y = np.array([1e-9, 1e-11, 0.1875])\n"
  11437. ">>> powm1(x, y)\n"
  11438. "array([ 1.82321557e-10, 2.30258509e-11, -4.68749998e-10])\n"
  11439. "\n"
  11440. "It can be verified that the relative errors in those results\n"
  11441. "are less than 2.5e-16.\n"
  11442. "\n"
  11443. "Compare that to the result of ``x**y - 1``, where the\n"
  11444. "relative errors are all larger than 8e-8:\n"
  11445. "\n"
  11446. ">>> x**y - 1\n"
  11447. "array([ 1.82321491e-10, 2.30258035e-11, -4.68750039e-10])")
  11448. ufunc_powm1_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  11449. ufunc_powm1_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  11450. ufunc_powm1_types[0] = <char>NPY_FLOAT
  11451. ufunc_powm1_types[1] = <char>NPY_FLOAT
  11452. ufunc_powm1_types[2] = <char>NPY_FLOAT
  11453. ufunc_powm1_types[3] = <char>NPY_DOUBLE
  11454. ufunc_powm1_types[4] = <char>NPY_DOUBLE
  11455. ufunc_powm1_types[5] = <char>NPY_DOUBLE
  11456. ufunc_powm1_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_powm1_float
  11457. ufunc_powm1_ptr[2*0+1] = <void*>(<char*>"powm1")
  11458. ufunc_powm1_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_powm1_double
  11459. ufunc_powm1_ptr[2*1+1] = <void*>(<char*>"powm1")
  11460. ufunc_powm1_data[0] = &ufunc_powm1_ptr[2*0]
  11461. ufunc_powm1_data[1] = &ufunc_powm1_ptr[2*1]
  11462. powm1 = np.PyUFunc_FromFuncAndData(ufunc_powm1_loops, ufunc_powm1_data, ufunc_powm1_types, 2, 2, 1, 0, 'powm1', ufunc_powm1_doc, 0)
  11463. cdef np.PyUFuncGenericFunction ufunc_pseudo_huber_loops[2]
  11464. cdef void *ufunc_pseudo_huber_ptr[4]
  11465. cdef void *ufunc_pseudo_huber_data[2]
  11466. cdef char ufunc_pseudo_huber_types[6]
  11467. cdef char *ufunc_pseudo_huber_doc = (
  11468. "pseudo_huber(delta, r, out=None)\n"
  11469. "\n"
  11470. "Pseudo-Huber loss function.\n"
  11471. "\n"
  11472. ".. math:: \\mathrm{pseudo\\_huber}(\\delta, r) =\n"
  11473. " \\delta^2 \\left( \\sqrt{ 1 + \\left( \\frac{r}{\\delta} \\right)^2 } - 1 \\right)\n"
  11474. "\n"
  11475. "Parameters\n"
  11476. "----------\n"
  11477. "delta : array_like\n"
  11478. " Input array, indicating the soft quadratic vs. linear loss changepoint.\n"
  11479. "r : array_like\n"
  11480. " Input array, possibly representing residuals.\n"
  11481. "out : ndarray, optional\n"
  11482. " Optional output array for the function results\n"
  11483. "\n"
  11484. "Returns\n"
  11485. "-------\n"
  11486. "res : scalar or ndarray\n"
  11487. " The computed Pseudo-Huber loss function values.\n"
  11488. "\n"
  11489. "See Also\n"
  11490. "--------\n"
  11491. "huber: Similar function which this function approximates\n"
  11492. "\n"
  11493. "Notes\n"
  11494. "-----\n"
  11495. "Like `huber`, `pseudo_huber` often serves as a robust loss function\n"
  11496. "in statistics or machine learning to reduce the influence of outliers.\n"
  11497. "Unlike `huber`, `pseudo_huber` is smooth.\n"
  11498. "\n"
  11499. "Typically, `r` represents residuals, the difference\n"
  11500. "between a model prediction and data. Then, for :math:`|r|\\leq\\delta`,\n"
  11501. "`pseudo_huber` resembles the squared error and for :math:`|r|>\\delta` the\n"
  11502. "absolute error. This way, the Pseudo-Huber loss often achieves\n"
  11503. "a fast convergence in model fitting for small residuals like the squared\n"
  11504. "error loss function and still reduces the influence of outliers\n"
  11505. "(:math:`|r|>\\delta`) like the absolute error loss. As :math:`\\delta` is\n"
  11506. "the cutoff between squared and absolute error regimes, it has\n"
  11507. "to be tuned carefully for each problem. `pseudo_huber` is also\n"
  11508. "convex, making it suitable for gradient based optimization. [1]_ [2]_\n"
  11509. "\n"
  11510. ".. versionadded:: 0.15.0\n"
  11511. "\n"
  11512. "References\n"
  11513. "----------\n"
  11514. ".. [1] Hartley, Zisserman, \"Multiple View Geometry in Computer Vision\".\n"
  11515. " 2003. Cambridge University Press. p. 619\n"
  11516. ".. [2] Charbonnier et al. \"Deterministic edge-preserving regularization\n"
  11517. " in computed imaging\". 1997. IEEE Trans. Image Processing.\n"
  11518. " 6 (2): 298 - 311.\n"
  11519. "\n"
  11520. "Examples\n"
  11521. "--------\n"
  11522. "Import all necessary modules.\n"
  11523. "\n"
  11524. ">>> import numpy as np\n"
  11525. ">>> from scipy.special import pseudo_huber, huber\n"
  11526. ">>> import matplotlib.pyplot as plt\n"
  11527. "\n"
  11528. "Calculate the function for ``delta=1`` at ``r=2``.\n"
  11529. "\n"
  11530. ">>> pseudo_huber(1., 2.)\n"
  11531. "1.2360679774997898\n"
  11532. "\n"
  11533. "Calculate the function at ``r=2`` for different `delta` by providing\n"
  11534. "a list or NumPy array for `delta`.\n"
  11535. "\n"
  11536. ">>> pseudo_huber([1., 2., 4.], 3.)\n"
  11537. "array([2.16227766, 3.21110255, 4. ])\n"
  11538. "\n"
  11539. "Calculate the function for ``delta=1`` at several points by providing\n"
  11540. "a list or NumPy array for `r`.\n"
  11541. "\n"
  11542. ">>> pseudo_huber(2., np.array([1., 1.5, 3., 4.]))\n"
  11543. "array([0.47213595, 1. , 3.21110255, 4.94427191])\n"
  11544. "\n"
  11545. "The function can be calculated for different `delta` and `r` by\n"
  11546. "providing arrays for both with compatible shapes for broadcasting.\n"
  11547. "\n"
  11548. ">>> r = np.array([1., 2.5, 8., 10.])\n"
  11549. ">>> deltas = np.array([[1.], [5.], [9.]])\n"
  11550. ">>> print(r.shape, deltas.shape)\n"
  11551. "(4,) (3, 1)\n"
  11552. "\n"
  11553. ">>> pseudo_huber(deltas, r)\n"
  11554. "array([[ 0.41421356, 1.6925824 , 7.06225775, 9.04987562],\n"
  11555. " [ 0.49509757, 2.95084972, 22.16990566, 30.90169944],\n"
  11556. " [ 0.49846624, 3.06693762, 27.37435121, 40.08261642]])\n"
  11557. "\n"
  11558. "Plot the function for different `delta`.\n"
  11559. "\n"
  11560. ">>> x = np.linspace(-4, 4, 500)\n"
  11561. ">>> deltas = [1, 2, 3]\n"
  11562. ">>> linestyles = [\"dashed\", \"dotted\", \"dashdot\"]\n"
  11563. ">>> fig, ax = plt.subplots()\n"
  11564. ">>> combined_plot_parameters = list(zip(deltas, linestyles))\n"
  11565. ">>> for delta, style in combined_plot_parameters:\n"
  11566. "... ax.plot(x, pseudo_huber(delta, x), label=rf\"$\\delta={delta}$\",\n"
  11567. "... ls=style)\n"
  11568. ">>> ax.legend(loc=\"upper center\")\n"
  11569. ">>> ax.set_xlabel(\"$x$\")\n"
  11570. ">>> ax.set_title(r\"Pseudo-Huber loss function $h_{\\delta}(x)$\")\n"
  11571. ">>> ax.set_xlim(-4, 4)\n"
  11572. ">>> ax.set_ylim(0, 8)\n"
  11573. ">>> plt.show()\n"
  11574. "\n"
  11575. "Finally, illustrate the difference between `huber` and `pseudo_huber` by\n"
  11576. "plotting them and their gradients with respect to `r`. The plot shows\n"
  11577. "that `pseudo_huber` is continuously differentiable while `huber` is not\n"
  11578. "at the points :math:`\\pm\\delta`.\n"
  11579. "\n"
  11580. ">>> def huber_grad(delta, x):\n"
  11581. "... grad = np.copy(x)\n"
  11582. "... linear_area = np.argwhere(np.abs(x) > delta)\n"
  11583. "... grad[linear_area]=delta*np.sign(x[linear_area])\n"
  11584. "... return grad\n"
  11585. ">>> def pseudo_huber_grad(delta, x):\n"
  11586. "... return x* (1+(x/delta)**2)**(-0.5)\n"
  11587. ">>> x=np.linspace(-3, 3, 500)\n"
  11588. ">>> delta = 1.\n"
  11589. ">>> fig, ax = plt.subplots(figsize=(7, 7))\n"
  11590. ">>> ax.plot(x, huber(delta, x), label=\"Huber\", ls=\"dashed\")\n"
  11591. ">>> ax.plot(x, huber_grad(delta, x), label=\"Huber Gradient\", ls=\"dashdot\")\n"
  11592. ">>> ax.plot(x, pseudo_huber(delta, x), label=\"Pseudo-Huber\", ls=\"dotted\")\n"
  11593. ">>> ax.plot(x, pseudo_huber_grad(delta, x), label=\"Pseudo-Huber Gradient\",\n"
  11594. "... ls=\"solid\")\n"
  11595. ">>> ax.legend(loc=\"upper center\")\n"
  11596. ">>> plt.show()")
  11597. ufunc_pseudo_huber_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  11598. ufunc_pseudo_huber_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  11599. ufunc_pseudo_huber_types[0] = <char>NPY_FLOAT
  11600. ufunc_pseudo_huber_types[1] = <char>NPY_FLOAT
  11601. ufunc_pseudo_huber_types[2] = <char>NPY_FLOAT
  11602. ufunc_pseudo_huber_types[3] = <char>NPY_DOUBLE
  11603. ufunc_pseudo_huber_types[4] = <char>NPY_DOUBLE
  11604. ufunc_pseudo_huber_types[5] = <char>NPY_DOUBLE
  11605. ufunc_pseudo_huber_ptr[2*0] = <void*>_func_pseudo_huber
  11606. ufunc_pseudo_huber_ptr[2*0+1] = <void*>(<char*>"pseudo_huber")
  11607. ufunc_pseudo_huber_ptr[2*1] = <void*>_func_pseudo_huber
  11608. ufunc_pseudo_huber_ptr[2*1+1] = <void*>(<char*>"pseudo_huber")
  11609. ufunc_pseudo_huber_data[0] = &ufunc_pseudo_huber_ptr[2*0]
  11610. ufunc_pseudo_huber_data[1] = &ufunc_pseudo_huber_ptr[2*1]
  11611. pseudo_huber = np.PyUFunc_FromFuncAndData(ufunc_pseudo_huber_loops, ufunc_pseudo_huber_data, ufunc_pseudo_huber_types, 2, 2, 1, 0, 'pseudo_huber', ufunc_pseudo_huber_doc, 0)
  11612. cdef np.PyUFuncGenericFunction ufunc_rel_entr_loops[2]
  11613. cdef void *ufunc_rel_entr_ptr[4]
  11614. cdef void *ufunc_rel_entr_data[2]
  11615. cdef char ufunc_rel_entr_types[6]
  11616. cdef char *ufunc_rel_entr_doc = (
  11617. "rel_entr(x, y, out=None)\n"
  11618. "\n"
  11619. "Elementwise function for computing relative entropy.\n"
  11620. "\n"
  11621. ".. math::\n"
  11622. "\n"
  11623. " \\mathrm{rel\\_entr}(x, y) =\n"
  11624. " \\begin{cases}\n"
  11625. " x \\log(x / y) & x > 0, y > 0 \\\\\n"
  11626. " 0 & x = 0, y \\ge 0 \\\\\n"
  11627. " \\infty & \\text{otherwise}\n"
  11628. " \\end{cases}\n"
  11629. "\n"
  11630. "Parameters\n"
  11631. "----------\n"
  11632. "x, y : array_like\n"
  11633. " Input arrays\n"
  11634. "out : ndarray, optional\n"
  11635. " Optional output array for the function results\n"
  11636. "\n"
  11637. "Returns\n"
  11638. "-------\n"
  11639. "scalar or ndarray\n"
  11640. " Relative entropy of the inputs\n"
  11641. "\n"
  11642. "See Also\n"
  11643. "--------\n"
  11644. "entr, kl_div, scipy.stats.entropy\n"
  11645. "\n"
  11646. "Notes\n"
  11647. "-----\n"
  11648. ".. versionadded:: 0.15.0\n"
  11649. "\n"
  11650. "This function is jointly convex in x and y.\n"
  11651. "\n"
  11652. "The origin of this function is in convex programming; see\n"
  11653. "[1]_. Given two discrete probability distributions :math:`p_1,\n"
  11654. "\\ldots, p_n` and :math:`q_1, \\ldots, q_n`, the definition of relative\n"
  11655. "entropy in the context of *information theory* is\n"
  11656. "\n"
  11657. ".. math::\n"
  11658. "\n"
  11659. " \\sum_{i = 1}^n \\mathrm{rel\\_entr}(p_i, q_i).\n"
  11660. "\n"
  11661. "To compute the latter quantity, use `scipy.stats.entropy`.\n"
  11662. "\n"
  11663. "See [2]_ for details.\n"
  11664. "\n"
  11665. "References\n"
  11666. "----------\n"
  11667. ".. [1] Boyd, Stephen and Lieven Vandenberghe. *Convex optimization*.\n"
  11668. " Cambridge University Press, 2004.\n"
  11669. " :doi:`https://doi.org/10.1017/CBO9780511804441`\n"
  11670. ".. [2] Kullback-Leibler divergence,\n"
  11671. " https://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence")
  11672. ufunc_rel_entr_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  11673. ufunc_rel_entr_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  11674. ufunc_rel_entr_types[0] = <char>NPY_FLOAT
  11675. ufunc_rel_entr_types[1] = <char>NPY_FLOAT
  11676. ufunc_rel_entr_types[2] = <char>NPY_FLOAT
  11677. ufunc_rel_entr_types[3] = <char>NPY_DOUBLE
  11678. ufunc_rel_entr_types[4] = <char>NPY_DOUBLE
  11679. ufunc_rel_entr_types[5] = <char>NPY_DOUBLE
  11680. ufunc_rel_entr_ptr[2*0] = <void*>_func_rel_entr
  11681. ufunc_rel_entr_ptr[2*0+1] = <void*>(<char*>"rel_entr")
  11682. ufunc_rel_entr_ptr[2*1] = <void*>_func_rel_entr
  11683. ufunc_rel_entr_ptr[2*1+1] = <void*>(<char*>"rel_entr")
  11684. ufunc_rel_entr_data[0] = &ufunc_rel_entr_ptr[2*0]
  11685. ufunc_rel_entr_data[1] = &ufunc_rel_entr_ptr[2*1]
  11686. rel_entr = np.PyUFunc_FromFuncAndData(ufunc_rel_entr_loops, ufunc_rel_entr_data, ufunc_rel_entr_types, 2, 2, 1, 0, 'rel_entr', ufunc_rel_entr_doc, 0)
  11687. cdef np.PyUFuncGenericFunction ufunc_round_loops[2]
  11688. cdef void *ufunc_round_ptr[4]
  11689. cdef void *ufunc_round_data[2]
  11690. cdef char ufunc_round_types[4]
  11691. cdef char *ufunc_round_doc = (
  11692. "round(x, out=None)\n"
  11693. "\n"
  11694. "Round to the nearest integer.\n"
  11695. "\n"
  11696. "Returns the nearest integer to `x`. If `x` ends in 0.5 exactly,\n"
  11697. "the nearest even integer is chosen.\n"
  11698. "\n"
  11699. "Parameters\n"
  11700. "----------\n"
  11701. "x : array_like\n"
  11702. " Real valued input.\n"
  11703. "out : ndarray, optional\n"
  11704. " Optional output array for the function results.\n"
  11705. "\n"
  11706. "Returns\n"
  11707. "-------\n"
  11708. "scalar or ndarray\n"
  11709. " The nearest integers to the elements of `x`. The result is of\n"
  11710. " floating type, not integer type.\n"
  11711. "\n"
  11712. "Examples\n"
  11713. "--------\n"
  11714. ">>> import scipy.special as sc\n"
  11715. "\n"
  11716. "It rounds to even.\n"
  11717. "\n"
  11718. ">>> sc.round([0.5, 1.5])\n"
  11719. "array([0., 2.])")
  11720. ufunc_round_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  11721. ufunc_round_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  11722. ufunc_round_types[0] = <char>NPY_FLOAT
  11723. ufunc_round_types[1] = <char>NPY_FLOAT
  11724. ufunc_round_types[2] = <char>NPY_DOUBLE
  11725. ufunc_round_types[3] = <char>NPY_DOUBLE
  11726. ufunc_round_ptr[2*0] = <void*>_func_cephes_round
  11727. ufunc_round_ptr[2*0+1] = <void*>(<char*>"round")
  11728. ufunc_round_ptr[2*1] = <void*>_func_cephes_round
  11729. ufunc_round_ptr[2*1+1] = <void*>(<char*>"round")
  11730. ufunc_round_data[0] = &ufunc_round_ptr[2*0]
  11731. ufunc_round_data[1] = &ufunc_round_ptr[2*1]
  11732. round = np.PyUFunc_FromFuncAndData(ufunc_round_loops, ufunc_round_data, ufunc_round_types, 2, 1, 1, 0, 'round', ufunc_round_doc, 0)
  11733. cdef np.PyUFuncGenericFunction ufunc_shichi_loops[4]
  11734. cdef void *ufunc_shichi_ptr[8]
  11735. cdef void *ufunc_shichi_data[4]
  11736. cdef char ufunc_shichi_types[12]
  11737. cdef char *ufunc_shichi_doc = (
  11738. "shichi(x, out=None)\n"
  11739. "\n"
  11740. "Hyperbolic sine and cosine integrals.\n"
  11741. "\n"
  11742. "The hyperbolic sine integral is\n"
  11743. "\n"
  11744. ".. math::\n"
  11745. "\n"
  11746. " \\int_0^x \\frac{\\sinh{t}}{t}dt\n"
  11747. "\n"
  11748. "and the hyperbolic cosine integral is\n"
  11749. "\n"
  11750. ".. math::\n"
  11751. "\n"
  11752. " \\gamma + \\log(x) + \\int_0^x \\frac{\\cosh{t} - 1}{t} dt\n"
  11753. "\n"
  11754. "where :math:`\\gamma` is Euler's constant and :math:`\\log` is the\n"
  11755. "principal branch of the logarithm [1]_ (see also [2]_).\n"
  11756. "\n"
  11757. "Parameters\n"
  11758. "----------\n"
  11759. "x : array_like\n"
  11760. " Real or complex points at which to compute the hyperbolic sine\n"
  11761. " and cosine integrals.\n"
  11762. "out : tuple of ndarray, optional\n"
  11763. " Optional output arrays for the function results\n"
  11764. "\n"
  11765. "Returns\n"
  11766. "-------\n"
  11767. "si : scalar or ndarray\n"
  11768. " Hyperbolic sine integral at ``x``\n"
  11769. "ci : scalar or ndarray\n"
  11770. " Hyperbolic cosine integral at ``x``\n"
  11771. "\n"
  11772. "See Also\n"
  11773. "--------\n"
  11774. "sici : Sine and cosine integrals.\n"
  11775. "exp1 : Exponential integral E1.\n"
  11776. "expi : Exponential integral Ei.\n"
  11777. "\n"
  11778. "Notes\n"
  11779. "-----\n"
  11780. "For real arguments with ``x < 0``, ``chi`` is the real part of the\n"
  11781. "hyperbolic cosine integral. For such points ``chi(x)`` and ``chi(x\n"
  11782. "+ 0j)`` differ by a factor of ``1j*pi``.\n"
  11783. "\n"
  11784. "For real arguments the function is computed by calling Cephes'\n"
  11785. "[3]_ *shichi* routine. For complex arguments the algorithm is based\n"
  11786. "on Mpmath's [4]_ *shi* and *chi* routines.\n"
  11787. "\n"
  11788. "References\n"
  11789. "----------\n"
  11790. ".. [1] Milton Abramowitz and Irene A. Stegun, eds.\n"
  11791. " Handbook of Mathematical Functions with Formulas,\n"
  11792. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  11793. " (See Section 5.2.)\n"
  11794. ".. [2] NIST Digital Library of Mathematical Functions\n"
  11795. " https://dlmf.nist.gov/6.2.E15 and https://dlmf.nist.gov/6.2.E16\n"
  11796. ".. [3] Cephes Mathematical Functions Library,\n"
  11797. " http://www.netlib.org/cephes/\n"
  11798. ".. [4] Fredrik Johansson and others.\n"
  11799. " \"mpmath: a Python library for arbitrary-precision floating-point\n"
  11800. " arithmetic\" (Version 0.19) http://mpmath.org/\n"
  11801. "\n"
  11802. "Examples\n"
  11803. "--------\n"
  11804. ">>> import numpy as np\n"
  11805. ">>> import matplotlib.pyplot as plt\n"
  11806. ">>> from scipy.special import shichi, sici\n"
  11807. "\n"
  11808. "`shichi` accepts real or complex input:\n"
  11809. "\n"
  11810. ">>> shichi(0.5)\n"
  11811. "(0.5069967498196671, -0.05277684495649357)\n"
  11812. ">>> shichi(0.5 + 2.5j)\n"
  11813. "((0.11772029666668238+1.831091777729851j),\n"
  11814. " (0.29912435887648825+1.7395351121166562j))\n"
  11815. "\n"
  11816. "The hyperbolic sine and cosine integrals Shi(z) and Chi(z) are\n"
  11817. "related to the sine and cosine integrals Si(z) and Ci(z) by\n"
  11818. "\n"
  11819. "* Shi(z) = -i*Si(i*z)\n"
  11820. "* Chi(z) = Ci(-i*z) + i*pi/2\n"
  11821. "\n"
  11822. ">>> z = 0.25 + 5j\n"
  11823. ">>> shi, chi = shichi(z)\n"
  11824. ">>> shi, -1j*sici(1j*z)[0] # Should be the same.\n"
  11825. "((-0.04834719325101729+1.5469354086921228j),\n"
  11826. " (-0.04834719325101729+1.5469354086921228j))\n"
  11827. ">>> chi, sici(-1j*z)[1] + 1j*np.pi/2 # Should be the same.\n"
  11828. "((-0.19568708973868087+1.556276312103824j),\n"
  11829. " (-0.19568708973868087+1.556276312103824j))\n"
  11830. "\n"
  11831. "Plot the functions evaluated on the real axis:\n"
  11832. "\n"
  11833. ">>> xp = np.geomspace(1e-8, 4.0, 250)\n"
  11834. ">>> x = np.concatenate((-xp[::-1], xp))\n"
  11835. ">>> shi, chi = shichi(x)\n"
  11836. "\n"
  11837. ">>> fig, ax = plt.subplots()\n"
  11838. ">>> ax.plot(x, shi, label='Shi(x)')\n"
  11839. ">>> ax.plot(x, chi, '--', label='Chi(x)')\n"
  11840. ">>> ax.set_xlabel('x')\n"
  11841. ">>> ax.set_title('Hyperbolic Sine and Cosine Integrals')\n"
  11842. ">>> ax.legend(shadow=True, framealpha=1, loc='lower right')\n"
  11843. ">>> ax.grid(True)\n"
  11844. ">>> plt.show()")
  11845. ufunc_shichi_loops[0] = <np.PyUFuncGenericFunction>loop_i_d_dd_As_f_ff
  11846. ufunc_shichi_loops[1] = <np.PyUFuncGenericFunction>loop_i_d_dd_As_d_dd
  11847. ufunc_shichi_loops[2] = <np.PyUFuncGenericFunction>loop_i_D_DD_As_F_FF
  11848. ufunc_shichi_loops[3] = <np.PyUFuncGenericFunction>loop_i_D_DD_As_D_DD
  11849. ufunc_shichi_types[0] = <char>NPY_FLOAT
  11850. ufunc_shichi_types[1] = <char>NPY_FLOAT
  11851. ufunc_shichi_types[2] = <char>NPY_FLOAT
  11852. ufunc_shichi_types[3] = <char>NPY_DOUBLE
  11853. ufunc_shichi_types[4] = <char>NPY_DOUBLE
  11854. ufunc_shichi_types[5] = <char>NPY_DOUBLE
  11855. ufunc_shichi_types[6] = <char>NPY_CFLOAT
  11856. ufunc_shichi_types[7] = <char>NPY_CFLOAT
  11857. ufunc_shichi_types[8] = <char>NPY_CFLOAT
  11858. ufunc_shichi_types[9] = <char>NPY_CDOUBLE
  11859. ufunc_shichi_types[10] = <char>NPY_CDOUBLE
  11860. ufunc_shichi_types[11] = <char>NPY_CDOUBLE
  11861. ufunc_shichi_ptr[2*0] = <void*>_func_xsf_shichi
  11862. ufunc_shichi_ptr[2*0+1] = <void*>(<char*>"shichi")
  11863. ufunc_shichi_ptr[2*1] = <void*>_func_xsf_shichi
  11864. ufunc_shichi_ptr[2*1+1] = <void*>(<char*>"shichi")
  11865. ufunc_shichi_ptr[2*2] = <void*>_func_xsf_cshichi
  11866. ufunc_shichi_ptr[2*2+1] = <void*>(<char*>"shichi")
  11867. ufunc_shichi_ptr[2*3] = <void*>_func_xsf_cshichi
  11868. ufunc_shichi_ptr[2*3+1] = <void*>(<char*>"shichi")
  11869. ufunc_shichi_data[0] = &ufunc_shichi_ptr[2*0]
  11870. ufunc_shichi_data[1] = &ufunc_shichi_ptr[2*1]
  11871. ufunc_shichi_data[2] = &ufunc_shichi_ptr[2*2]
  11872. ufunc_shichi_data[3] = &ufunc_shichi_ptr[2*3]
  11873. shichi = np.PyUFunc_FromFuncAndData(ufunc_shichi_loops, ufunc_shichi_data, ufunc_shichi_types, 4, 1, 2, 0, 'shichi', ufunc_shichi_doc, 0)
  11874. cdef np.PyUFuncGenericFunction ufunc_sici_loops[4]
  11875. cdef void *ufunc_sici_ptr[8]
  11876. cdef void *ufunc_sici_data[4]
  11877. cdef char ufunc_sici_types[12]
  11878. cdef char *ufunc_sici_doc = (
  11879. "sici(x, out=None)\n"
  11880. "\n"
  11881. "Sine and cosine integrals.\n"
  11882. "\n"
  11883. "The sine integral is\n"
  11884. "\n"
  11885. ".. math::\n"
  11886. "\n"
  11887. " \\int_0^x \\frac{\\sin{t}}{t}dt\n"
  11888. "\n"
  11889. "and the cosine integral is\n"
  11890. "\n"
  11891. ".. math::\n"
  11892. "\n"
  11893. " \\gamma + \\log(x) + \\int_0^x \\frac{\\cos{t} - 1}{t}dt\n"
  11894. "\n"
  11895. "where :math:`\\gamma` is Euler's constant and :math:`\\log` is the\n"
  11896. "principal branch of the logarithm [1]_ (see also [2]_).\n"
  11897. "\n"
  11898. "Parameters\n"
  11899. "----------\n"
  11900. "x : array_like\n"
  11901. " Real or complex points at which to compute the sine and cosine\n"
  11902. " integrals.\n"
  11903. "out : tuple of ndarray, optional\n"
  11904. " Optional output arrays for the function results\n"
  11905. "\n"
  11906. "Returns\n"
  11907. "-------\n"
  11908. "si : scalar or ndarray\n"
  11909. " Sine integral at ``x``\n"
  11910. "ci : scalar or ndarray\n"
  11911. " Cosine integral at ``x``\n"
  11912. "\n"
  11913. "See Also\n"
  11914. "--------\n"
  11915. "shichi : Hyperbolic sine and cosine integrals.\n"
  11916. "exp1 : Exponential integral E1.\n"
  11917. "expi : Exponential integral Ei.\n"
  11918. "\n"
  11919. "Notes\n"
  11920. "-----\n"
  11921. "For real arguments with ``x < 0``, ``ci`` is the real part of the\n"
  11922. "cosine integral. For such points ``ci(x)`` and ``ci(x + 0j)``\n"
  11923. "differ by a factor of ``1j*pi``.\n"
  11924. "\n"
  11925. "For real arguments the function is computed by calling Cephes'\n"
  11926. "[3]_ *sici* routine. For complex arguments the algorithm is based\n"
  11927. "on Mpmath's [4]_ *si* and *ci* routines.\n"
  11928. "\n"
  11929. "References\n"
  11930. "----------\n"
  11931. ".. [1] Milton Abramowitz and Irene A. Stegun, eds.\n"
  11932. " Handbook of Mathematical Functions with Formulas,\n"
  11933. " Graphs, and Mathematical Tables. New York: Dover, 1972.\n"
  11934. " (See Section 5.2.)\n"
  11935. ".. [2] NIST Digital Library of Mathematical Functions\n"
  11936. " https://dlmf.nist.gov/6.2.E9, https://dlmf.nist.gov/6.2.E12,\n"
  11937. " and https://dlmf.nist.gov/6.2.E13\n"
  11938. ".. [3] Cephes Mathematical Functions Library,\n"
  11939. " http://www.netlib.org/cephes/\n"
  11940. ".. [4] Fredrik Johansson and others.\n"
  11941. " \"mpmath: a Python library for arbitrary-precision floating-point\n"
  11942. " arithmetic\" (Version 0.19) http://mpmath.org/\n"
  11943. "\n"
  11944. "Examples\n"
  11945. "--------\n"
  11946. ">>> import numpy as np\n"
  11947. ">>> import matplotlib.pyplot as plt\n"
  11948. ">>> from scipy.special import sici, exp1\n"
  11949. "\n"
  11950. "`sici` accepts real or complex input:\n"
  11951. "\n"
  11952. ">>> sici(2.5)\n"
  11953. "(1.7785201734438267, 0.2858711963653835)\n"
  11954. ">>> sici(2.5 + 3j)\n"
  11955. "((4.505735874563953+0.06863305018999577j),\n"
  11956. "(0.0793644206906966-2.935510262937543j))\n"
  11957. "\n"
  11958. "For z in the right half plane, the sine and cosine integrals are\n"
  11959. "related to the exponential integral E1 (implemented in SciPy as\n"
  11960. "`scipy.special.exp1`) by\n"
  11961. "\n"
  11962. "* Si(z) = (E1(i*z) - E1(-i*z))/2i + pi/2\n"
  11963. "* Ci(z) = -(E1(i*z) + E1(-i*z))/2\n"
  11964. "\n"
  11965. "See [1]_ (equations 5.2.21 and 5.2.23).\n"
  11966. "\n"
  11967. "We can verify these relations:\n"
  11968. "\n"
  11969. ">>> z = 2 - 3j\n"
  11970. ">>> sici(z)\n"
  11971. "((4.54751388956229-1.3991965806460565j),\n"
  11972. "(1.408292501520851+2.9836177420296055j))\n"
  11973. "\n"
  11974. ">>> (exp1(1j*z) - exp1(-1j*z))/2j + np.pi/2 # Same as sine integral\n"
  11975. "(4.54751388956229-1.3991965806460565j)\n"
  11976. "\n"
  11977. ">>> -(exp1(1j*z) + exp1(-1j*z))/2 # Same as cosine integral\n"
  11978. "(1.408292501520851+2.9836177420296055j)\n"
  11979. "\n"
  11980. "Plot the functions evaluated on the real axis; the dotted horizontal\n"
  11981. "lines are at pi/2 and -pi/2:\n"
  11982. "\n"
  11983. ">>> x = np.linspace(-16, 16, 150)\n"
  11984. ">>> si, ci = sici(x)\n"
  11985. "\n"
  11986. ">>> fig, ax = plt.subplots()\n"
  11987. ">>> ax.plot(x, si, label='Si(x)')\n"
  11988. ">>> ax.plot(x, ci, '--', label='Ci(x)')\n"
  11989. ">>> ax.legend(shadow=True, framealpha=1, loc='upper left')\n"
  11990. ">>> ax.set_xlabel('x')\n"
  11991. ">>> ax.set_title('Sine and Cosine Integrals')\n"
  11992. ">>> ax.axhline(np.pi/2, linestyle=':', alpha=0.5, color='k')\n"
  11993. ">>> ax.axhline(-np.pi/2, linestyle=':', alpha=0.5, color='k')\n"
  11994. ">>> ax.grid(True)\n"
  11995. ">>> plt.show()")
  11996. ufunc_sici_loops[0] = <np.PyUFuncGenericFunction>loop_i_d_dd_As_f_ff
  11997. ufunc_sici_loops[1] = <np.PyUFuncGenericFunction>loop_i_d_dd_As_d_dd
  11998. ufunc_sici_loops[2] = <np.PyUFuncGenericFunction>loop_i_D_DD_As_F_FF
  11999. ufunc_sici_loops[3] = <np.PyUFuncGenericFunction>loop_i_D_DD_As_D_DD
  12000. ufunc_sici_types[0] = <char>NPY_FLOAT
  12001. ufunc_sici_types[1] = <char>NPY_FLOAT
  12002. ufunc_sici_types[2] = <char>NPY_FLOAT
  12003. ufunc_sici_types[3] = <char>NPY_DOUBLE
  12004. ufunc_sici_types[4] = <char>NPY_DOUBLE
  12005. ufunc_sici_types[5] = <char>NPY_DOUBLE
  12006. ufunc_sici_types[6] = <char>NPY_CFLOAT
  12007. ufunc_sici_types[7] = <char>NPY_CFLOAT
  12008. ufunc_sici_types[8] = <char>NPY_CFLOAT
  12009. ufunc_sici_types[9] = <char>NPY_CDOUBLE
  12010. ufunc_sici_types[10] = <char>NPY_CDOUBLE
  12011. ufunc_sici_types[11] = <char>NPY_CDOUBLE
  12012. ufunc_sici_ptr[2*0] = <void*>_func_xsf_sici
  12013. ufunc_sici_ptr[2*0+1] = <void*>(<char*>"sici")
  12014. ufunc_sici_ptr[2*1] = <void*>_func_xsf_sici
  12015. ufunc_sici_ptr[2*1+1] = <void*>(<char*>"sici")
  12016. ufunc_sici_ptr[2*2] = <void*>_func_xsf_csici
  12017. ufunc_sici_ptr[2*2+1] = <void*>(<char*>"sici")
  12018. ufunc_sici_ptr[2*3] = <void*>_func_xsf_csici
  12019. ufunc_sici_ptr[2*3+1] = <void*>(<char*>"sici")
  12020. ufunc_sici_data[0] = &ufunc_sici_ptr[2*0]
  12021. ufunc_sici_data[1] = &ufunc_sici_ptr[2*1]
  12022. ufunc_sici_data[2] = &ufunc_sici_ptr[2*2]
  12023. ufunc_sici_data[3] = &ufunc_sici_ptr[2*3]
  12024. sici = np.PyUFunc_FromFuncAndData(ufunc_sici_loops, ufunc_sici_data, ufunc_sici_types, 4, 1, 2, 0, 'sici', ufunc_sici_doc, 0)
  12025. cdef np.PyUFuncGenericFunction ufunc_smirnov_loops[3]
  12026. cdef void *ufunc_smirnov_ptr[6]
  12027. cdef void *ufunc_smirnov_data[3]
  12028. cdef char ufunc_smirnov_types[9]
  12029. cdef char *ufunc_smirnov_doc = (
  12030. "smirnov(n, d, out=None)\n"
  12031. "\n"
  12032. "Kolmogorov-Smirnov complementary cumulative distribution function\n"
  12033. "\n"
  12034. "Returns the exact Kolmogorov-Smirnov complementary cumulative\n"
  12035. "distribution function,(aka the Survival Function) of Dn+ (or Dn-)\n"
  12036. "for a one-sided test of equality between an empirical and a\n"
  12037. "theoretical distribution. It is equal to the probability that the\n"
  12038. "maximum difference between a theoretical distribution and an empirical\n"
  12039. "one based on `n` samples is greater than d.\n"
  12040. "\n"
  12041. "Parameters\n"
  12042. "----------\n"
  12043. "n : int\n"
  12044. " Number of samples\n"
  12045. "d : float array_like\n"
  12046. " Deviation between the Empirical CDF (ECDF) and the target CDF.\n"
  12047. "out : ndarray, optional\n"
  12048. " Optional output array for the function results\n"
  12049. "\n"
  12050. "Returns\n"
  12051. "-------\n"
  12052. "scalar or ndarray\n"
  12053. " The value(s) of smirnov(n, d), Prob(Dn+ >= d) (Also Prob(Dn- >= d))\n"
  12054. "\n"
  12055. "See Also\n"
  12056. "--------\n"
  12057. "smirnovi : The Inverse Survival Function for the distribution\n"
  12058. "scipy.stats.ksone : Provides the functionality as a continuous distribution\n"
  12059. "kolmogorov, kolmogi : Functions for the two-sided distribution\n"
  12060. "\n"
  12061. "Notes\n"
  12062. "-----\n"
  12063. "`smirnov` is used by `stats.kstest` in the application of the\n"
  12064. "Kolmogorov-Smirnov Goodness of Fit test. For historical reasons this\n"
  12065. "function is exposed in `scpy.special`, but the recommended way to achieve\n"
  12066. "the most accurate CDF/SF/PDF/PPF/ISF computations is to use the\n"
  12067. "`stats.ksone` distribution.\n"
  12068. "\n"
  12069. "Examples\n"
  12070. "--------\n"
  12071. ">>> import numpy as np\n"
  12072. ">>> from scipy.special import smirnov\n"
  12073. ">>> from scipy.stats import norm\n"
  12074. "\n"
  12075. "Show the probability of a gap at least as big as 0, 0.5 and 1.0 for a\n"
  12076. "sample of size 5.\n"
  12077. "\n"
  12078. ">>> smirnov(5, [0, 0.5, 1.0])\n"
  12079. "array([ 1. , 0.056, 0. ])\n"
  12080. "\n"
  12081. "Compare a sample of size 5 against N(0, 1), the standard normal\n"
  12082. "distribution with mean 0 and standard deviation 1.\n"
  12083. "\n"
  12084. "`x` is the sample.\n"
  12085. "\n"
  12086. ">>> x = np.array([-1.392, -0.135, 0.114, 0.190, 1.82])\n"
  12087. "\n"
  12088. ">>> target = norm(0, 1)\n"
  12089. ">>> cdfs = target.cdf(x)\n"
  12090. ">>> cdfs\n"
  12091. "array([0.0819612 , 0.44630594, 0.5453811 , 0.57534543, 0.9656205 ])\n"
  12092. "\n"
  12093. "Construct the empirical CDF and the K-S statistics (Dn+, Dn-, Dn).\n"
  12094. "\n"
  12095. ">>> n = len(x)\n"
  12096. ">>> ecdfs = np.arange(n+1, dtype=float)/n\n"
  12097. ">>> cols = np.column_stack([x, ecdfs[1:], cdfs, cdfs - ecdfs[:n],\n"
  12098. "... ecdfs[1:] - cdfs])\n"
  12099. ">>> with np.printoptions(precision=3):\n"
  12100. "... print(cols)\n"
  12101. "[[-1.392 0.2 0.082 0.082 0.118]\n"
  12102. " [-0.135 0.4 0.446 0.246 -0.046]\n"
  12103. " [ 0.114 0.6 0.545 0.145 0.055]\n"
  12104. " [ 0.19 0.8 0.575 -0.025 0.225]\n"
  12105. " [ 1.82 1. 0.966 0.166 0.034]]\n"
  12106. ">>> gaps = cols[:, -2:]\n"
  12107. ">>> Dnpm = np.max(gaps, axis=0)\n"
  12108. ">>> print(f'Dn-={Dnpm[0]:f}, Dn+={Dnpm[1]:f}')\n"
  12109. "Dn-=0.246306, Dn+=0.224655\n"
  12110. ">>> probs = smirnov(n, Dnpm)\n"
  12111. ">>> print(f'For a sample of size {n} drawn from N(0, 1):',\n"
  12112. "... f' Smirnov n={n}: Prob(Dn- >= {Dnpm[0]:f}) = {probs[0]:.4f}',\n"
  12113. "... f' Smirnov n={n}: Prob(Dn+ >= {Dnpm[1]:f}) = {probs[1]:.4f}',\n"
  12114. "... sep='\\n')\n"
  12115. "For a sample of size 5 drawn from N(0, 1):\n"
  12116. " Smirnov n=5: Prob(Dn- >= 0.246306) = 0.4711\n"
  12117. " Smirnov n=5: Prob(Dn+ >= 0.224655) = 0.5245\n"
  12118. "\n"
  12119. "Plot the empirical CDF and the standard normal CDF.\n"
  12120. "\n"
  12121. ">>> import matplotlib.pyplot as plt\n"
  12122. ">>> plt.step(np.concatenate(([-2.5], x, [2.5])),\n"
  12123. "... np.concatenate((ecdfs, [1])),\n"
  12124. "... where='post', label='Empirical CDF')\n"
  12125. ">>> xx = np.linspace(-2.5, 2.5, 100)\n"
  12126. ">>> plt.plot(xx, target.cdf(xx), '--', label='CDF for N(0, 1)')\n"
  12127. "\n"
  12128. "Add vertical lines marking Dn+ and Dn-.\n"
  12129. "\n"
  12130. ">>> iminus, iplus = np.argmax(gaps, axis=0)\n"
  12131. ">>> plt.vlines([x[iminus]], ecdfs[iminus], cdfs[iminus], color='r',\n"
  12132. "... alpha=0.5, lw=4)\n"
  12133. ">>> plt.vlines([x[iplus]], cdfs[iplus], ecdfs[iplus+1], color='m',\n"
  12134. "... alpha=0.5, lw=4)\n"
  12135. "\n"
  12136. ">>> plt.grid(True)\n"
  12137. ">>> plt.legend(framealpha=1, shadow=True)\n"
  12138. ">>> plt.show()")
  12139. ufunc_smirnov_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  12140. ufunc_smirnov_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  12141. ufunc_smirnov_loops[2] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  12142. ufunc_smirnov_types[0] = <char>NPY_INTP
  12143. ufunc_smirnov_types[1] = <char>NPY_DOUBLE
  12144. ufunc_smirnov_types[2] = <char>NPY_DOUBLE
  12145. ufunc_smirnov_types[3] = <char>NPY_FLOAT
  12146. ufunc_smirnov_types[4] = <char>NPY_FLOAT
  12147. ufunc_smirnov_types[5] = <char>NPY_FLOAT
  12148. ufunc_smirnov_types[6] = <char>NPY_DOUBLE
  12149. ufunc_smirnov_types[7] = <char>NPY_DOUBLE
  12150. ufunc_smirnov_types[8] = <char>NPY_DOUBLE
  12151. ufunc_smirnov_ptr[2*0] = <void*>_func_cephes_smirnov_wrap
  12152. ufunc_smirnov_ptr[2*0+1] = <void*>(<char*>"smirnov")
  12153. ufunc_smirnov_ptr[2*1] = <void*>_func_smirnov_unsafe
  12154. ufunc_smirnov_ptr[2*1+1] = <void*>(<char*>"smirnov")
  12155. ufunc_smirnov_ptr[2*2] = <void*>_func_smirnov_unsafe
  12156. ufunc_smirnov_ptr[2*2+1] = <void*>(<char*>"smirnov")
  12157. ufunc_smirnov_data[0] = &ufunc_smirnov_ptr[2*0]
  12158. ufunc_smirnov_data[1] = &ufunc_smirnov_ptr[2*1]
  12159. ufunc_smirnov_data[2] = &ufunc_smirnov_ptr[2*2]
  12160. smirnov = np.PyUFunc_FromFuncAndData(ufunc_smirnov_loops, ufunc_smirnov_data, ufunc_smirnov_types, 3, 2, 1, 0, 'smirnov', ufunc_smirnov_doc, 0)
  12161. cdef np.PyUFuncGenericFunction ufunc_smirnovi_loops[3]
  12162. cdef void *ufunc_smirnovi_ptr[6]
  12163. cdef void *ufunc_smirnovi_data[3]
  12164. cdef char ufunc_smirnovi_types[9]
  12165. cdef char *ufunc_smirnovi_doc = (
  12166. "smirnovi(n, p, out=None)\n"
  12167. "\n"
  12168. "Inverse to `smirnov`\n"
  12169. "\n"
  12170. "Returns `d` such that ``smirnov(n, d) == p``, the critical value\n"
  12171. "corresponding to `p`.\n"
  12172. "\n"
  12173. "Parameters\n"
  12174. "----------\n"
  12175. "n : int\n"
  12176. " Number of samples\n"
  12177. "p : float array_like\n"
  12178. " Probability\n"
  12179. "out : ndarray, optional\n"
  12180. " Optional output array for the function results\n"
  12181. "\n"
  12182. "Returns\n"
  12183. "-------\n"
  12184. "scalar or ndarray\n"
  12185. " The value(s) of smirnovi(n, p), the critical values.\n"
  12186. "\n"
  12187. "See Also\n"
  12188. "--------\n"
  12189. "smirnov : The Survival Function (SF) for the distribution\n"
  12190. "scipy.stats.ksone : Provides the functionality as a continuous distribution\n"
  12191. "kolmogorov, kolmogi : Functions for the two-sided distribution\n"
  12192. "scipy.stats.kstwobign : Two-sided Kolmogorov-Smirnov distribution, large n\n"
  12193. "\n"
  12194. "Notes\n"
  12195. "-----\n"
  12196. "`smirnov` is used by `stats.kstest` in the application of the\n"
  12197. "Kolmogorov-Smirnov Goodness of Fit test. For historical reasons this\n"
  12198. "function is exposed in `scpy.special`, but the recommended way to achieve\n"
  12199. "the most accurate CDF/SF/PDF/PPF/ISF computations is to use the\n"
  12200. "`stats.ksone` distribution.\n"
  12201. "\n"
  12202. "Examples\n"
  12203. "--------\n"
  12204. ">>> from scipy.special import smirnovi, smirnov\n"
  12205. "\n"
  12206. ">>> n = 24\n"
  12207. ">>> deviations = [0.1, 0.2, 0.3]\n"
  12208. "\n"
  12209. "Use `smirnov` to compute the complementary CDF of the Smirnov\n"
  12210. "distribution for the given number of samples and deviations.\n"
  12211. "\n"
  12212. ">>> p = smirnov(n, deviations)\n"
  12213. ">>> p\n"
  12214. "array([0.58105083, 0.12826832, 0.01032231])\n"
  12215. "\n"
  12216. "The inverse function ``smirnovi(n, p)`` returns ``deviations``.\n"
  12217. "\n"
  12218. ">>> smirnovi(n, p)\n"
  12219. "array([0.1, 0.2, 0.3])")
  12220. ufunc_smirnovi_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  12221. ufunc_smirnovi_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  12222. ufunc_smirnovi_loops[2] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  12223. ufunc_smirnovi_types[0] = <char>NPY_INTP
  12224. ufunc_smirnovi_types[1] = <char>NPY_DOUBLE
  12225. ufunc_smirnovi_types[2] = <char>NPY_DOUBLE
  12226. ufunc_smirnovi_types[3] = <char>NPY_FLOAT
  12227. ufunc_smirnovi_types[4] = <char>NPY_FLOAT
  12228. ufunc_smirnovi_types[5] = <char>NPY_FLOAT
  12229. ufunc_smirnovi_types[6] = <char>NPY_DOUBLE
  12230. ufunc_smirnovi_types[7] = <char>NPY_DOUBLE
  12231. ufunc_smirnovi_types[8] = <char>NPY_DOUBLE
  12232. ufunc_smirnovi_ptr[2*0] = <void*>_func_cephes_smirnovi_wrap
  12233. ufunc_smirnovi_ptr[2*0+1] = <void*>(<char*>"smirnovi")
  12234. ufunc_smirnovi_ptr[2*1] = <void*>_func_smirnovi_unsafe
  12235. ufunc_smirnovi_ptr[2*1+1] = <void*>(<char*>"smirnovi")
  12236. ufunc_smirnovi_ptr[2*2] = <void*>_func_smirnovi_unsafe
  12237. ufunc_smirnovi_ptr[2*2+1] = <void*>(<char*>"smirnovi")
  12238. ufunc_smirnovi_data[0] = &ufunc_smirnovi_ptr[2*0]
  12239. ufunc_smirnovi_data[1] = &ufunc_smirnovi_ptr[2*1]
  12240. ufunc_smirnovi_data[2] = &ufunc_smirnovi_ptr[2*2]
  12241. smirnovi = np.PyUFunc_FromFuncAndData(ufunc_smirnovi_loops, ufunc_smirnovi_data, ufunc_smirnovi_types, 3, 2, 1, 0, 'smirnovi', ufunc_smirnovi_doc, 0)
  12242. cdef np.PyUFuncGenericFunction ufunc_spence_loops[4]
  12243. cdef void *ufunc_spence_ptr[8]
  12244. cdef void *ufunc_spence_data[4]
  12245. cdef char ufunc_spence_types[8]
  12246. cdef char *ufunc_spence_doc = (
  12247. "spence(z, out=None)\n"
  12248. "\n"
  12249. "Spence's function, also known as the dilogarithm.\n"
  12250. "\n"
  12251. "It is defined to be\n"
  12252. "\n"
  12253. ".. math::\n"
  12254. " \\int_1^z \\frac{\\log(t)}{1 - t}dt\n"
  12255. "\n"
  12256. "for complex :math:`z`, where the contour of integration is taken\n"
  12257. "to avoid the branch cut of the logarithm. Spence's function is\n"
  12258. "analytic everywhere except the negative real axis where it has a\n"
  12259. "branch cut.\n"
  12260. "\n"
  12261. "Parameters\n"
  12262. "----------\n"
  12263. "z : array_like\n"
  12264. " Points at which to evaluate Spence's function\n"
  12265. "out : ndarray, optional\n"
  12266. " Optional output array for the function results\n"
  12267. "\n"
  12268. "Returns\n"
  12269. "-------\n"
  12270. "s : scalar or ndarray\n"
  12271. " Computed values of Spence's function\n"
  12272. "\n"
  12273. "Notes\n"
  12274. "-----\n"
  12275. "There is a different convention which defines Spence's function by\n"
  12276. "the integral\n"
  12277. "\n"
  12278. ".. math::\n"
  12279. " -\\int_0^z \\frac{\\log(1 - t)}{t}dt;\n"
  12280. "\n"
  12281. "this is our ``spence(1 - z)``.\n"
  12282. "\n"
  12283. "Examples\n"
  12284. "--------\n"
  12285. ">>> import numpy as np\n"
  12286. ">>> from scipy.special import spence\n"
  12287. ">>> import matplotlib.pyplot as plt\n"
  12288. "\n"
  12289. "The function is defined for complex inputs:\n"
  12290. "\n"
  12291. ">>> spence([1-1j, 1.5+2j, 3j, -10-5j])\n"
  12292. "array([-0.20561676+0.91596559j, -0.86766909-1.39560134j,\n"
  12293. " -0.59422064-2.49129918j, -1.14044398+6.80075924j])\n"
  12294. "\n"
  12295. "For complex inputs on the branch cut, which is the negative real axis,\n"
  12296. "the function returns the limit for ``z`` with positive imaginary part.\n"
  12297. "For example, in the following, note the sign change of the imaginary\n"
  12298. "part of the output for ``z = -2`` and ``z = -2 - 1e-8j``:\n"
  12299. "\n"
  12300. ">>> spence([-2 + 1e-8j, -2, -2 - 1e-8j])\n"
  12301. "array([2.32018041-3.45139229j, 2.32018042-3.4513923j ,\n"
  12302. " 2.32018041+3.45139229j])\n"
  12303. "\n"
  12304. "The function returns ``nan`` for real inputs on the branch cut:\n"
  12305. "\n"
  12306. ">>> spence(-1.5)\n"
  12307. "nan\n"
  12308. "\n"
  12309. "Verify some particular values: ``spence(0) = pi**2/6``,\n"
  12310. "``spence(1) = 0`` and ``spence(2) = -pi**2/12``.\n"
  12311. "\n"
  12312. ">>> spence([0, 1, 2])\n"
  12313. "array([ 1.64493407, 0. , -0.82246703])\n"
  12314. ">>> np.pi**2/6, -np.pi**2/12\n"
  12315. "(1.6449340668482264, -0.8224670334241132)\n"
  12316. "\n"
  12317. "Verify the identity::\n"
  12318. "\n"
  12319. " spence(z) + spence(1 - z) = pi**2/6 - log(z)*log(1 - z)\n"
  12320. "\n"
  12321. ">>> z = 3 + 4j\n"
  12322. ">>> spence(z) + spence(1 - z)\n"
  12323. "(-2.6523186143876067+1.8853470951513935j)\n"
  12324. ">>> np.pi**2/6 - np.log(z)*np.log(1 - z)\n"
  12325. "(-2.652318614387606+1.885347095151394j)\n"
  12326. "\n"
  12327. "Plot the function for positive real input.\n"
  12328. "\n"
  12329. ">>> fig, ax = plt.subplots()\n"
  12330. ">>> x = np.linspace(0, 6, 400)\n"
  12331. ">>> ax.plot(x, spence(x))\n"
  12332. ">>> ax.grid()\n"
  12333. ">>> ax.set_xlabel('x')\n"
  12334. ">>> ax.set_title('spence(x)')\n"
  12335. ">>> plt.show()")
  12336. ufunc_spence_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  12337. ufunc_spence_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  12338. ufunc_spence_loops[2] = <np.PyUFuncGenericFunction>loop_D_D__As_F_F
  12339. ufunc_spence_loops[3] = <np.PyUFuncGenericFunction>loop_D_D__As_D_D
  12340. ufunc_spence_types[0] = <char>NPY_FLOAT
  12341. ufunc_spence_types[1] = <char>NPY_FLOAT
  12342. ufunc_spence_types[2] = <char>NPY_DOUBLE
  12343. ufunc_spence_types[3] = <char>NPY_DOUBLE
  12344. ufunc_spence_types[4] = <char>NPY_CFLOAT
  12345. ufunc_spence_types[5] = <char>NPY_CFLOAT
  12346. ufunc_spence_types[6] = <char>NPY_CDOUBLE
  12347. ufunc_spence_types[7] = <char>NPY_CDOUBLE
  12348. ufunc_spence_ptr[2*0] = <void*>_func_cephes_spence
  12349. ufunc_spence_ptr[2*0+1] = <void*>(<char*>"spence")
  12350. ufunc_spence_ptr[2*1] = <void*>_func_cephes_spence
  12351. ufunc_spence_ptr[2*1+1] = <void*>(<char*>"spence")
  12352. ufunc_spence_ptr[2*2] = <void*>_func_cspence
  12353. ufunc_spence_ptr[2*2+1] = <void*>(<char*>"spence")
  12354. ufunc_spence_ptr[2*3] = <void*>_func_cspence
  12355. ufunc_spence_ptr[2*3+1] = <void*>(<char*>"spence")
  12356. ufunc_spence_data[0] = &ufunc_spence_ptr[2*0]
  12357. ufunc_spence_data[1] = &ufunc_spence_ptr[2*1]
  12358. ufunc_spence_data[2] = &ufunc_spence_ptr[2*2]
  12359. ufunc_spence_data[3] = &ufunc_spence_ptr[2*3]
  12360. spence = np.PyUFunc_FromFuncAndData(ufunc_spence_loops, ufunc_spence_data, ufunc_spence_types, 4, 1, 1, 0, 'spence', ufunc_spence_doc, 0)
  12361. cdef np.PyUFuncGenericFunction ufunc_stdtr_loops[2]
  12362. cdef void *ufunc_stdtr_ptr[4]
  12363. cdef void *ufunc_stdtr_data[2]
  12364. cdef char ufunc_stdtr_types[6]
  12365. cdef char *ufunc_stdtr_doc = (
  12366. "stdtr(df, t, out=None)\n"
  12367. "\n"
  12368. "Student t distribution cumulative distribution function\n"
  12369. "\n"
  12370. "Returns the integral:\n"
  12371. "\n"
  12372. ".. math::\n"
  12373. " \\frac{\\Gamma((df+1)/2)}{\\sqrt{\\pi df} \\Gamma(df/2)}\n"
  12374. " \\int_{-\\infty}^t (1+x^2/df)^{-(df+1)/2}\\, dx\n"
  12375. "\n"
  12376. "Parameters\n"
  12377. "----------\n"
  12378. "df : array_like\n"
  12379. " Degrees of freedom\n"
  12380. "t : array_like\n"
  12381. " Upper bound of the integral\n"
  12382. "out : ndarray, optional\n"
  12383. " Optional output array for the function results\n"
  12384. "\n"
  12385. "Returns\n"
  12386. "-------\n"
  12387. "scalar or ndarray\n"
  12388. " Value of the Student t CDF at t\n"
  12389. "\n"
  12390. "See Also\n"
  12391. "--------\n"
  12392. "stdtridf : inverse of stdtr with respect to `df`\n"
  12393. "stdtrit : inverse of stdtr with respect to `t`\n"
  12394. "scipy.stats.t : student t distribution\n"
  12395. "\n"
  12396. "Notes\n"
  12397. "-----\n"
  12398. "The student t distribution is also available as `scipy.stats.t`.\n"
  12399. "Calling `stdtr` directly can improve performance compared to the\n"
  12400. "``cdf`` method of `scipy.stats.t` (see last example below).\n"
  12401. "\n"
  12402. "The function is computed using the Boost Math library [1]_, which\n"
  12403. "relies on the incomplete beta function.\n"
  12404. "\n"
  12405. "References\n"
  12406. "----------\n"
  12407. ".. [1] Boost C++ Libraries, http://www.boost.org/\n"
  12408. "\n"
  12409. "Examples\n"
  12410. "--------\n"
  12411. "Calculate the function for ``df=3`` at ``t=1``.\n"
  12412. "\n"
  12413. ">>> import numpy as np\n"
  12414. ">>> from scipy.special import stdtr\n"
  12415. ">>> import matplotlib.pyplot as plt\n"
  12416. ">>> stdtr(3, 1)\n"
  12417. "0.8044988905221148\n"
  12418. "\n"
  12419. "Plot the function for three different degrees of freedom.\n"
  12420. "\n"
  12421. ">>> x = np.linspace(-10, 10, 1000)\n"
  12422. ">>> fig, ax = plt.subplots()\n"
  12423. ">>> parameters = [(1, \"solid\"), (3, \"dashed\"), (10, \"dotted\")]\n"
  12424. ">>> for (df, linestyle) in parameters:\n"
  12425. "... ax.plot(x, stdtr(df, x), ls=linestyle, label=f\"$df={df}$\")\n"
  12426. ">>> ax.legend()\n"
  12427. ">>> ax.set_title(\"Student t distribution cumulative distribution function\")\n"
  12428. ">>> plt.show()\n"
  12429. "\n"
  12430. "The function can be computed for several degrees of freedom at the same\n"
  12431. "time by providing a NumPy array or list for `df`:\n"
  12432. "\n"
  12433. ">>> stdtr([1, 2, 3], 1)\n"
  12434. "array([0.75 , 0.78867513, 0.80449889])\n"
  12435. "\n"
  12436. "It is possible to calculate the function at several points for several\n"
  12437. "different degrees of freedom simultaneously by providing arrays for `df`\n"
  12438. "and `t` with shapes compatible for broadcasting. Compute `stdtr` at\n"
  12439. "4 points for 3 degrees of freedom resulting in an array of shape 3x4.\n"
  12440. "\n"
  12441. ">>> dfs = np.array([[1], [2], [3]])\n"
  12442. ">>> t = np.array([2, 4, 6, 8])\n"
  12443. ">>> dfs.shape, t.shape\n"
  12444. "((3, 1), (4,))\n"
  12445. "\n"
  12446. ">>> stdtr(dfs, t)\n"
  12447. "array([[0.85241638, 0.92202087, 0.94743154, 0.96041658],\n"
  12448. " [0.90824829, 0.97140452, 0.98666426, 0.99236596],\n"
  12449. " [0.93033702, 0.98599577, 0.99536364, 0.99796171]])\n"
  12450. "\n"
  12451. "The t distribution is also available as `scipy.stats.t`. Calling `stdtr`\n"
  12452. "directly can be much faster than calling the ``cdf`` method of\n"
  12453. "`scipy.stats.t`. To get the same results, one must use the following\n"
  12454. "parametrization: ``scipy.stats.t(df).cdf(x) = stdtr(df, x)``.\n"
  12455. "\n"
  12456. ">>> from scipy.stats import t\n"
  12457. ">>> df, x = 3, 1\n"
  12458. ">>> stdtr_result = stdtr(df, x) # this can be faster than below\n"
  12459. ">>> stats_result = t(df).cdf(x)\n"
  12460. ">>> stats_result == stdtr_result # test that results are equal\n"
  12461. "True")
  12462. ufunc_stdtr_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  12463. ufunc_stdtr_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  12464. ufunc_stdtr_types[0] = <char>NPY_FLOAT
  12465. ufunc_stdtr_types[1] = <char>NPY_FLOAT
  12466. ufunc_stdtr_types[2] = <char>NPY_FLOAT
  12467. ufunc_stdtr_types[3] = <char>NPY_DOUBLE
  12468. ufunc_stdtr_types[4] = <char>NPY_DOUBLE
  12469. ufunc_stdtr_types[5] = <char>NPY_DOUBLE
  12470. ufunc_stdtr_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_t_cdf_float
  12471. ufunc_stdtr_ptr[2*0+1] = <void*>(<char*>"stdtr")
  12472. ufunc_stdtr_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_t_cdf_double
  12473. ufunc_stdtr_ptr[2*1+1] = <void*>(<char*>"stdtr")
  12474. ufunc_stdtr_data[0] = &ufunc_stdtr_ptr[2*0]
  12475. ufunc_stdtr_data[1] = &ufunc_stdtr_ptr[2*1]
  12476. stdtr = np.PyUFunc_FromFuncAndData(ufunc_stdtr_loops, ufunc_stdtr_data, ufunc_stdtr_types, 2, 2, 1, 0, 'stdtr', ufunc_stdtr_doc, 0)
  12477. cdef np.PyUFuncGenericFunction ufunc_stdtridf_loops[2]
  12478. cdef void *ufunc_stdtridf_ptr[4]
  12479. cdef void *ufunc_stdtridf_data[2]
  12480. cdef char ufunc_stdtridf_types[6]
  12481. cdef char *ufunc_stdtridf_doc = (
  12482. "stdtridf(p, t, out=None)\n"
  12483. "\n"
  12484. "Inverse of `stdtr` vs df\n"
  12485. "\n"
  12486. "Returns the argument df such that stdtr(df, t) is equal to `p`.\n"
  12487. "\n"
  12488. "Parameters\n"
  12489. "----------\n"
  12490. "p : array_like\n"
  12491. " Probability\n"
  12492. "t : array_like\n"
  12493. " Upper bound of the integral\n"
  12494. "out : ndarray, optional\n"
  12495. " Optional output array for the function results\n"
  12496. "\n"
  12497. "Returns\n"
  12498. "-------\n"
  12499. "df : scalar or ndarray\n"
  12500. " Value of `df` such that ``stdtr(df, t) == p``\n"
  12501. "\n"
  12502. "See Also\n"
  12503. "--------\n"
  12504. "stdtr : Student t CDF\n"
  12505. "stdtrit : inverse of stdtr with respect to `t`\n"
  12506. "scipy.stats.t : Student t distribution\n"
  12507. "\n"
  12508. "Examples\n"
  12509. "--------\n"
  12510. "Compute the student t cumulative distribution function for one\n"
  12511. "parameter set.\n"
  12512. "\n"
  12513. ">>> from scipy.special import stdtr, stdtridf\n"
  12514. ">>> df, x = 5, 2\n"
  12515. ">>> cdf_value = stdtr(df, x)\n"
  12516. ">>> cdf_value\n"
  12517. "0.9490302605850709\n"
  12518. "\n"
  12519. "Verify that `stdtridf` recovers the original value for `df` given\n"
  12520. "the CDF value and `x`.\n"
  12521. "\n"
  12522. ">>> stdtridf(cdf_value, x)\n"
  12523. "5.0")
  12524. ufunc_stdtridf_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  12525. ufunc_stdtridf_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  12526. ufunc_stdtridf_types[0] = <char>NPY_FLOAT
  12527. ufunc_stdtridf_types[1] = <char>NPY_FLOAT
  12528. ufunc_stdtridf_types[2] = <char>NPY_FLOAT
  12529. ufunc_stdtridf_types[3] = <char>NPY_DOUBLE
  12530. ufunc_stdtridf_types[4] = <char>NPY_DOUBLE
  12531. ufunc_stdtridf_types[5] = <char>NPY_DOUBLE
  12532. ufunc_stdtridf_ptr[2*0] = <void*>_func_stdtridf
  12533. ufunc_stdtridf_ptr[2*0+1] = <void*>(<char*>"stdtridf")
  12534. ufunc_stdtridf_ptr[2*1] = <void*>_func_stdtridf
  12535. ufunc_stdtridf_ptr[2*1+1] = <void*>(<char*>"stdtridf")
  12536. ufunc_stdtridf_data[0] = &ufunc_stdtridf_ptr[2*0]
  12537. ufunc_stdtridf_data[1] = &ufunc_stdtridf_ptr[2*1]
  12538. stdtridf = np.PyUFunc_FromFuncAndData(ufunc_stdtridf_loops, ufunc_stdtridf_data, ufunc_stdtridf_types, 2, 2, 1, 0, 'stdtridf', ufunc_stdtridf_doc, 0)
  12539. cdef np.PyUFuncGenericFunction ufunc_stdtrit_loops[2]
  12540. cdef void *ufunc_stdtrit_ptr[4]
  12541. cdef void *ufunc_stdtrit_data[2]
  12542. cdef char ufunc_stdtrit_types[6]
  12543. cdef char *ufunc_stdtrit_doc = (
  12544. "stdtrit(df, p, out=None)\n"
  12545. "\n"
  12546. "The `p`-th quantile of the student t distribution.\n"
  12547. "\n"
  12548. "This function is the inverse of the student t distribution cumulative\n"
  12549. "distribution function (CDF), returning `t` such that `stdtr(df, t) = p`.\n"
  12550. "\n"
  12551. "Returns the argument `t` such that stdtr(df, t) is equal to `p`.\n"
  12552. "\n"
  12553. "Parameters\n"
  12554. "----------\n"
  12555. "df : array_like\n"
  12556. " Degrees of freedom\n"
  12557. "p : array_like\n"
  12558. " Probability\n"
  12559. "out : ndarray, optional\n"
  12560. " Optional output array for the function results\n"
  12561. "\n"
  12562. "Returns\n"
  12563. "-------\n"
  12564. "t : scalar or ndarray\n"
  12565. " Value of `t` such that ``stdtr(df, t) == p``\n"
  12566. "\n"
  12567. "See Also\n"
  12568. "--------\n"
  12569. "stdtr : Student t CDF\n"
  12570. "stdtridf : inverse of stdtr with respect to `df`\n"
  12571. "scipy.stats.t : Student t distribution\n"
  12572. "\n"
  12573. "Notes\n"
  12574. "-----\n"
  12575. "The student t distribution is also available as `scipy.stats.t`. Calling\n"
  12576. "`stdtrit` directly can improve performance compared to the ``ppf``\n"
  12577. "method of `scipy.stats.t` (see last example below).\n"
  12578. "\n"
  12579. "The function is computed using the Boost Math library [1]_, which\n"
  12580. "relies on the incomplete beta function.\n"
  12581. "\n"
  12582. "References\n"
  12583. "----------\n"
  12584. ".. [1] Boost C++ Libraries, http://www.boost.org/\n"
  12585. "\n"
  12586. "Examples\n"
  12587. "--------\n"
  12588. "`stdtrit` represents the inverse of the student t distribution CDF which\n"
  12589. "is available as `stdtr`. Here, we calculate the CDF for ``df`` at\n"
  12590. "``x=1``. `stdtrit` then returns ``1`` up to floating point errors\n"
  12591. "given the same value for `df` and the computed CDF value.\n"
  12592. "\n"
  12593. ">>> import numpy as np\n"
  12594. ">>> from scipy.special import stdtr, stdtrit\n"
  12595. ">>> import matplotlib.pyplot as plt\n"
  12596. ">>> df = 3\n"
  12597. ">>> x = 1\n"
  12598. ">>> cdf_value = stdtr(df, x)\n"
  12599. ">>> stdtrit(df, cdf_value)\n"
  12600. "0.9999999994418539\n"
  12601. "\n"
  12602. "Plot the function for three different degrees of freedom.\n"
  12603. "\n"
  12604. ">>> x = np.linspace(0, 1, 1000)\n"
  12605. ">>> parameters = [(1, \"solid\"), (2, \"dashed\"), (5, \"dotted\")]\n"
  12606. ">>> fig, ax = plt.subplots()\n"
  12607. ">>> for (df, linestyle) in parameters:\n"
  12608. "... ax.plot(x, stdtrit(df, x), ls=linestyle, label=f\"$df={df}$\")\n"
  12609. ">>> ax.legend()\n"
  12610. ">>> ax.set_ylim(-10, 10)\n"
  12611. ">>> ax.set_title(\"Student t distribution quantile function\")\n"
  12612. ">>> plt.show()\n"
  12613. "\n"
  12614. "The function can be computed for several degrees of freedom at the same\n"
  12615. "time by providing a NumPy array or list for `df`:\n"
  12616. "\n"
  12617. ">>> stdtrit([1, 2, 3], 0.7)\n"
  12618. "array([0.72654253, 0.6172134 , 0.58438973])\n"
  12619. "\n"
  12620. "It is possible to calculate the function at several points for several\n"
  12621. "different degrees of freedom simultaneously by providing arrays for `df`\n"
  12622. "and `p` with shapes compatible for broadcasting. Compute `stdtrit` at\n"
  12623. "4 points for 3 degrees of freedom resulting in an array of shape 3x4.\n"
  12624. "\n"
  12625. ">>> dfs = np.array([[1], [2], [3]])\n"
  12626. ">>> p = np.array([0.2, 0.4, 0.7, 0.8])\n"
  12627. ">>> dfs.shape, p.shape\n"
  12628. "((3, 1), (4,))\n"
  12629. "\n"
  12630. ">>> stdtrit(dfs, p)\n"
  12631. "array([[-1.37638192, -0.3249197 , 0.72654253, 1.37638192],\n"
  12632. " [-1.06066017, -0.28867513, 0.6172134 , 1.06066017],\n"
  12633. " [-0.97847231, -0.27667066, 0.58438973, 0.97847231]])\n"
  12634. "\n"
  12635. "The t distribution is also available as `scipy.stats.t`. Calling `stdtrit`\n"
  12636. "directly can be much faster than calling the ``ppf`` method of\n"
  12637. "`scipy.stats.t`. To get the same results, one must use the following\n"
  12638. "parametrization: ``scipy.stats.t(df).ppf(x) = stdtrit(df, x)``.\n"
  12639. "\n"
  12640. ">>> from scipy.stats import t\n"
  12641. ">>> df, x = 3, 0.5\n"
  12642. ">>> stdtrit_result = stdtrit(df, x) # this can be faster than below\n"
  12643. ">>> stats_result = t(df).ppf(x)\n"
  12644. ">>> stats_result == stdtrit_result # test that results are equal\n"
  12645. "True")
  12646. ufunc_stdtrit_loops[0] = <np.PyUFuncGenericFunction>loop_f_ff__As_ff_f
  12647. ufunc_stdtrit_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  12648. ufunc_stdtrit_types[0] = <char>NPY_FLOAT
  12649. ufunc_stdtrit_types[1] = <char>NPY_FLOAT
  12650. ufunc_stdtrit_types[2] = <char>NPY_FLOAT
  12651. ufunc_stdtrit_types[3] = <char>NPY_DOUBLE
  12652. ufunc_stdtrit_types[4] = <char>NPY_DOUBLE
  12653. ufunc_stdtrit_types[5] = <char>NPY_DOUBLE
  12654. ufunc_stdtrit_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_t_ppf_float
  12655. ufunc_stdtrit_ptr[2*0+1] = <void*>(<char*>"stdtrit")
  12656. ufunc_stdtrit_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_t_ppf_double
  12657. ufunc_stdtrit_ptr[2*1+1] = <void*>(<char*>"stdtrit")
  12658. ufunc_stdtrit_data[0] = &ufunc_stdtrit_ptr[2*0]
  12659. ufunc_stdtrit_data[1] = &ufunc_stdtrit_ptr[2*1]
  12660. stdtrit = np.PyUFunc_FromFuncAndData(ufunc_stdtrit_loops, ufunc_stdtrit_data, ufunc_stdtrit_types, 2, 2, 1, 0, 'stdtrit', ufunc_stdtrit_doc, 0)
  12661. cdef np.PyUFuncGenericFunction ufunc_tklmbda_loops[2]
  12662. cdef void *ufunc_tklmbda_ptr[4]
  12663. cdef void *ufunc_tklmbda_data[2]
  12664. cdef char ufunc_tklmbda_types[6]
  12665. cdef char *ufunc_tklmbda_doc = (
  12666. "tklmbda(x, lmbda, out=None)\n"
  12667. "\n"
  12668. "Cumulative distribution function of the Tukey lambda distribution.\n"
  12669. "\n"
  12670. "Parameters\n"
  12671. "----------\n"
  12672. "x, lmbda : array_like\n"
  12673. " Parameters\n"
  12674. "out : ndarray, optional\n"
  12675. " Optional output array for the function results\n"
  12676. "\n"
  12677. "Returns\n"
  12678. "-------\n"
  12679. "cdf : scalar or ndarray\n"
  12680. " Value of the Tukey lambda CDF\n"
  12681. "\n"
  12682. "See Also\n"
  12683. "--------\n"
  12684. "scipy.stats.tukeylambda : Tukey lambda distribution\n"
  12685. "\n"
  12686. "Examples\n"
  12687. "--------\n"
  12688. ">>> import numpy as np\n"
  12689. ">>> import matplotlib.pyplot as plt\n"
  12690. ">>> from scipy.special import tklmbda, expit\n"
  12691. "\n"
  12692. "Compute the cumulative distribution function (CDF) of the Tukey lambda\n"
  12693. "distribution at several ``x`` values for `lmbda` = -1.5.\n"
  12694. "\n"
  12695. ">>> x = np.linspace(-2, 2, 9)\n"
  12696. ">>> x\n"
  12697. "array([-2. , -1.5, -1. , -0.5, 0. , 0.5, 1. , 1.5, 2. ])\n"
  12698. ">>> tklmbda(x, -1.5)\n"
  12699. "array([0.34688734, 0.3786554 , 0.41528805, 0.45629737, 0.5 ,\n"
  12700. " 0.54370263, 0.58471195, 0.6213446 , 0.65311266])\n"
  12701. "\n"
  12702. "When `lmbda` is 0, the function is the logistic sigmoid function,\n"
  12703. "which is implemented in `scipy.special` as `expit`.\n"
  12704. "\n"
  12705. ">>> tklmbda(x, 0)\n"
  12706. "array([0.11920292, 0.18242552, 0.26894142, 0.37754067, 0.5 ,\n"
  12707. " 0.62245933, 0.73105858, 0.81757448, 0.88079708])\n"
  12708. ">>> expit(x)\n"
  12709. "array([0.11920292, 0.18242552, 0.26894142, 0.37754067, 0.5 ,\n"
  12710. " 0.62245933, 0.73105858, 0.81757448, 0.88079708])\n"
  12711. "\n"
  12712. "When `lmbda` is 1, the Tukey lambda distribution is uniform on the\n"
  12713. "interval [-1, 1], so the CDF increases linearly.\n"
  12714. "\n"
  12715. ">>> t = np.linspace(-1, 1, 9)\n"
  12716. ">>> tklmbda(t, 1)\n"
  12717. "array([0. , 0.125, 0.25 , 0.375, 0.5 , 0.625, 0.75 , 0.875, 1. ])\n"
  12718. "\n"
  12719. "In the following, we generate plots for several values of `lmbda`.\n"
  12720. "\n"
  12721. "The first figure shows graphs for `lmbda` <= 0.\n"
  12722. "\n"
  12723. ">>> styles = ['-', '-.', '--', ':']\n"
  12724. ">>> fig, ax = plt.subplots()\n"
  12725. ">>> x = np.linspace(-12, 12, 500)\n"
  12726. ">>> for k, lmbda in enumerate([-1.0, -0.5, 0.0]):\n"
  12727. "... y = tklmbda(x, lmbda)\n"
  12728. "... ax.plot(x, y, styles[k], label=rf'$\\lambda$ = {lmbda:-4.1f}')\n"
  12729. "\n"
  12730. ">>> ax.set_title(r'tklmbda(x, $\\lambda$)')\n"
  12731. ">>> ax.set_label('x')\n"
  12732. ">>> ax.legend(framealpha=1, shadow=True)\n"
  12733. ">>> ax.grid(True)\n"
  12734. "\n"
  12735. "The second figure shows graphs for `lmbda` > 0. The dots in the\n"
  12736. "graphs show the bounds of the support of the distribution.\n"
  12737. "\n"
  12738. ">>> fig, ax = plt.subplots()\n"
  12739. ">>> x = np.linspace(-4.2, 4.2, 500)\n"
  12740. ">>> lmbdas = [0.25, 0.5, 1.0, 1.5]\n"
  12741. ">>> for k, lmbda in enumerate(lmbdas):\n"
  12742. "... y = tklmbda(x, lmbda)\n"
  12743. "... ax.plot(x, y, styles[k], label=fr'$\\lambda$ = {lmbda}')\n"
  12744. "\n"
  12745. ">>> ax.set_prop_cycle(None)\n"
  12746. ">>> for lmbda in lmbdas:\n"
  12747. "... ax.plot([-1/lmbda, 1/lmbda], [0, 1], '.', ms=8)\n"
  12748. "\n"
  12749. ">>> ax.set_title(r'tklmbda(x, $\\lambda$)')\n"
  12750. ">>> ax.set_xlabel('x')\n"
  12751. ">>> ax.legend(framealpha=1, shadow=True)\n"
  12752. ">>> ax.grid(True)\n"
  12753. "\n"
  12754. ">>> plt.tight_layout()\n"
  12755. ">>> plt.show()\n"
  12756. "\n"
  12757. "The CDF of the Tukey lambda distribution is also implemented as the\n"
  12758. "``cdf`` method of `scipy.stats.tukeylambda`. In the following,\n"
  12759. "``tukeylambda.cdf(x, -0.5)`` and ``tklmbda(x, -0.5)`` compute the\n"
  12760. "same values:\n"
  12761. "\n"
  12762. ">>> from scipy.stats import tukeylambda\n"
  12763. ">>> x = np.linspace(-2, 2, 9)\n"
  12764. "\n"
  12765. ">>> tukeylambda.cdf(x, -0.5)\n"
  12766. "array([0.21995157, 0.27093858, 0.33541677, 0.41328161, 0.5 ,\n"
  12767. " 0.58671839, 0.66458323, 0.72906142, 0.78004843])\n"
  12768. "\n"
  12769. ">>> tklmbda(x, -0.5)\n"
  12770. "array([0.21995157, 0.27093858, 0.33541677, 0.41328161, 0.5 ,\n"
  12771. " 0.58671839, 0.66458323, 0.72906142, 0.78004843])\n"
  12772. "\n"
  12773. "The implementation in ``tukeylambda`` also provides location and scale\n"
  12774. "parameters, and other methods such as ``pdf()`` (the probability\n"
  12775. "density function) and ``ppf()`` (the inverse of the CDF), so for\n"
  12776. "working with the Tukey lambda distribution, ``tukeylambda`` is more\n"
  12777. "generally useful. The primary advantage of ``tklmbda`` is that it is\n"
  12778. "significantly faster than ``tukeylambda.cdf``.")
  12779. ufunc_tklmbda_loops[0] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  12780. ufunc_tklmbda_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  12781. ufunc_tklmbda_types[0] = <char>NPY_FLOAT
  12782. ufunc_tklmbda_types[1] = <char>NPY_FLOAT
  12783. ufunc_tklmbda_types[2] = <char>NPY_FLOAT
  12784. ufunc_tklmbda_types[3] = <char>NPY_DOUBLE
  12785. ufunc_tklmbda_types[4] = <char>NPY_DOUBLE
  12786. ufunc_tklmbda_types[5] = <char>NPY_DOUBLE
  12787. ufunc_tklmbda_ptr[2*0] = <void*>_func_xsf_tukeylambdacdf
  12788. ufunc_tklmbda_ptr[2*0+1] = <void*>(<char*>"tklmbda")
  12789. ufunc_tklmbda_ptr[2*1] = <void*>_func_xsf_tukeylambdacdf
  12790. ufunc_tklmbda_ptr[2*1+1] = <void*>(<char*>"tklmbda")
  12791. ufunc_tklmbda_data[0] = &ufunc_tklmbda_ptr[2*0]
  12792. ufunc_tklmbda_data[1] = &ufunc_tklmbda_ptr[2*1]
  12793. tklmbda = np.PyUFunc_FromFuncAndData(ufunc_tklmbda_loops, ufunc_tklmbda_data, ufunc_tklmbda_types, 2, 2, 1, 0, 'tklmbda', ufunc_tklmbda_doc, 0)
  12794. cdef np.PyUFuncGenericFunction ufunc_wrightomega_loops[4]
  12795. cdef void *ufunc_wrightomega_ptr[8]
  12796. cdef void *ufunc_wrightomega_data[4]
  12797. cdef char ufunc_wrightomega_types[8]
  12798. cdef char *ufunc_wrightomega_doc = (
  12799. "wrightomega(z, out=None)\n"
  12800. "\n"
  12801. "Wright Omega function.\n"
  12802. "\n"
  12803. "Defined as the solution to\n"
  12804. "\n"
  12805. ".. math::\n"
  12806. "\n"
  12807. " \\omega + \\log(\\omega) = z\n"
  12808. "\n"
  12809. "where :math:`\\log` is the principal branch of the complex logarithm.\n"
  12810. "\n"
  12811. "Parameters\n"
  12812. "----------\n"
  12813. "z : array_like\n"
  12814. " Points at which to evaluate the Wright Omega function\n"
  12815. "out : ndarray, optional\n"
  12816. " Optional output array for the function values\n"
  12817. "\n"
  12818. "Returns\n"
  12819. "-------\n"
  12820. "omega : scalar or ndarray\n"
  12821. " Values of the Wright Omega function\n"
  12822. "\n"
  12823. "See Also\n"
  12824. "--------\n"
  12825. "lambertw : The Lambert W function\n"
  12826. "\n"
  12827. "Notes\n"
  12828. "-----\n"
  12829. ".. versionadded:: 0.19.0\n"
  12830. "\n"
  12831. "The function can also be defined as\n"
  12832. "\n"
  12833. ".. math::\n"
  12834. "\n"
  12835. " \\omega(z) = W_{K(z)}(e^z)\n"
  12836. "\n"
  12837. "where :math:`K(z) = \\lceil (\\Im(z) - \\pi)/(2\\pi) \\rceil` is the\n"
  12838. "unwinding number and :math:`W` is the Lambert W function.\n"
  12839. "\n"
  12840. "The implementation here is taken from [1]_.\n"
  12841. "\n"
  12842. "References\n"
  12843. "----------\n"
  12844. ".. [1] Lawrence, Corless, and Jeffrey, \"Algorithm 917: Complex\n"
  12845. " Double-Precision Evaluation of the Wright :math:`\\omega`\n"
  12846. " Function.\" ACM Transactions on Mathematical Software,\n"
  12847. " 2012. :doi:`10.1145/2168773.2168779`.\n"
  12848. "\n"
  12849. "Examples\n"
  12850. "--------\n"
  12851. ">>> import numpy as np\n"
  12852. ">>> from scipy.special import wrightomega, lambertw\n"
  12853. "\n"
  12854. ">>> wrightomega([-2, -1, 0, 1, 2])\n"
  12855. "array([0.12002824, 0.27846454, 0.56714329, 1. , 1.5571456 ])\n"
  12856. "\n"
  12857. "Complex input:\n"
  12858. "\n"
  12859. ">>> wrightomega(3 + 5j)\n"
  12860. "(1.5804428632097158+3.8213626783287937j)\n"
  12861. "\n"
  12862. "Verify that ``wrightomega(z)`` satisfies ``w + log(w) = z``:\n"
  12863. "\n"
  12864. ">>> w = -5 + 4j\n"
  12865. ">>> wrightomega(w + np.log(w))\n"
  12866. "(-5+4j)\n"
  12867. "\n"
  12868. "Verify the connection to ``lambertw``:\n"
  12869. "\n"
  12870. ">>> z = 0.5 + 3j\n"
  12871. ">>> wrightomega(z)\n"
  12872. "(0.0966015889280649+1.4937828458191993j)\n"
  12873. ">>> lambertw(np.exp(z))\n"
  12874. "(0.09660158892806493+1.4937828458191993j)\n"
  12875. "\n"
  12876. ">>> z = 0.5 + 4j\n"
  12877. ">>> wrightomega(z)\n"
  12878. "(-0.3362123489037213+2.282986001579032j)\n"
  12879. ">>> lambertw(np.exp(z), k=1)\n"
  12880. "(-0.33621234890372115+2.282986001579032j)")
  12881. ufunc_wrightomega_loops[0] = <np.PyUFuncGenericFunction>loop_d_d__As_f_f
  12882. ufunc_wrightomega_loops[1] = <np.PyUFuncGenericFunction>loop_d_d__As_d_d
  12883. ufunc_wrightomega_loops[2] = <np.PyUFuncGenericFunction>loop_D_D__As_F_F
  12884. ufunc_wrightomega_loops[3] = <np.PyUFuncGenericFunction>loop_D_D__As_D_D
  12885. ufunc_wrightomega_types[0] = <char>NPY_FLOAT
  12886. ufunc_wrightomega_types[1] = <char>NPY_FLOAT
  12887. ufunc_wrightomega_types[2] = <char>NPY_DOUBLE
  12888. ufunc_wrightomega_types[3] = <char>NPY_DOUBLE
  12889. ufunc_wrightomega_types[4] = <char>NPY_CFLOAT
  12890. ufunc_wrightomega_types[5] = <char>NPY_CFLOAT
  12891. ufunc_wrightomega_types[6] = <char>NPY_CDOUBLE
  12892. ufunc_wrightomega_types[7] = <char>NPY_CDOUBLE
  12893. ufunc_wrightomega_ptr[2*0] = <void*>scipy.special._ufuncs_cxx._export_wrightomega_real
  12894. ufunc_wrightomega_ptr[2*0+1] = <void*>(<char*>"wrightomega")
  12895. ufunc_wrightomega_ptr[2*1] = <void*>scipy.special._ufuncs_cxx._export_wrightomega_real
  12896. ufunc_wrightomega_ptr[2*1+1] = <void*>(<char*>"wrightomega")
  12897. ufunc_wrightomega_ptr[2*2] = <void*>scipy.special._ufuncs_cxx._export_wrightomega
  12898. ufunc_wrightomega_ptr[2*2+1] = <void*>(<char*>"wrightomega")
  12899. ufunc_wrightomega_ptr[2*3] = <void*>scipy.special._ufuncs_cxx._export_wrightomega
  12900. ufunc_wrightomega_ptr[2*3+1] = <void*>(<char*>"wrightomega")
  12901. ufunc_wrightomega_data[0] = &ufunc_wrightomega_ptr[2*0]
  12902. ufunc_wrightomega_data[1] = &ufunc_wrightomega_ptr[2*1]
  12903. ufunc_wrightomega_data[2] = &ufunc_wrightomega_ptr[2*2]
  12904. ufunc_wrightomega_data[3] = &ufunc_wrightomega_ptr[2*3]
  12905. wrightomega = np.PyUFunc_FromFuncAndData(ufunc_wrightomega_loops, ufunc_wrightomega_data, ufunc_wrightomega_types, 4, 1, 1, 0, 'wrightomega', ufunc_wrightomega_doc, 0)
  12906. cdef np.PyUFuncGenericFunction ufunc_yn_loops[3]
  12907. cdef void *ufunc_yn_ptr[6]
  12908. cdef void *ufunc_yn_data[3]
  12909. cdef char ufunc_yn_types[9]
  12910. cdef char *ufunc_yn_doc = (
  12911. "yn(n, x, out=None)\n"
  12912. "\n"
  12913. "Bessel function of the second kind of integer order and real argument.\n"
  12914. "\n"
  12915. "Parameters\n"
  12916. "----------\n"
  12917. "n : array_like\n"
  12918. " Order (integer).\n"
  12919. "x : array_like\n"
  12920. " Argument (float).\n"
  12921. "out : ndarray, optional\n"
  12922. " Optional output array for the function results\n"
  12923. "\n"
  12924. "Returns\n"
  12925. "-------\n"
  12926. "Y : scalar or ndarray\n"
  12927. " Value of the Bessel function, :math:`Y_n(x)`.\n"
  12928. "\n"
  12929. "See Also\n"
  12930. "--------\n"
  12931. "yv : For real order and real or complex argument.\n"
  12932. "y0: faster implementation of this function for order 0\n"
  12933. "y1: faster implementation of this function for order 1\n"
  12934. "\n"
  12935. "Notes\n"
  12936. "-----\n"
  12937. "Wrapper for the Cephes [1]_ routine `yn`.\n"
  12938. "\n"
  12939. "The function is evaluated by forward recurrence on `n`, starting with\n"
  12940. "values computed by the Cephes routines `y0` and `y1`. If ``n = 0`` or 1,\n"
  12941. "the routine for `y0` or `y1` is called directly.\n"
  12942. "\n"
  12943. "References\n"
  12944. "----------\n"
  12945. ".. [1] Cephes Mathematical Functions Library,\n"
  12946. " http://www.netlib.org/cephes/\n"
  12947. "\n"
  12948. "Examples\n"
  12949. "--------\n"
  12950. "Evaluate the function of order 0 at one point.\n"
  12951. "\n"
  12952. ">>> from scipy.special import yn\n"
  12953. ">>> yn(0, 1.)\n"
  12954. "0.08825696421567697\n"
  12955. "\n"
  12956. "Evaluate the function at one point for different orders.\n"
  12957. "\n"
  12958. ">>> yn(0, 1.), yn(1, 1.), yn(2, 1.)\n"
  12959. "(0.08825696421567697, -0.7812128213002888, -1.6506826068162546)\n"
  12960. "\n"
  12961. "The evaluation for different orders can be carried out in one call by\n"
  12962. "providing a list or NumPy array as argument for the `v` parameter:\n"
  12963. "\n"
  12964. ">>> yn([0, 1, 2], 1.)\n"
  12965. "array([ 0.08825696, -0.78121282, -1.65068261])\n"
  12966. "\n"
  12967. "Evaluate the function at several points for order 0 by providing an\n"
  12968. "array for `z`.\n"
  12969. "\n"
  12970. ">>> import numpy as np\n"
  12971. ">>> points = np.array([0.5, 3., 8.])\n"
  12972. ">>> yn(0, points)\n"
  12973. "array([-0.44451873, 0.37685001, 0.22352149])\n"
  12974. "\n"
  12975. "If `z` is an array, the order parameter `v` must be broadcastable to\n"
  12976. "the correct shape if different orders shall be computed in one call.\n"
  12977. "To calculate the orders 0 and 1 for a 1D array:\n"
  12978. "\n"
  12979. ">>> orders = np.array([[0], [1]])\n"
  12980. ">>> orders.shape\n"
  12981. "(2, 1)\n"
  12982. "\n"
  12983. ">>> yn(orders, points)\n"
  12984. "array([[-0.44451873, 0.37685001, 0.22352149],\n"
  12985. " [-1.47147239, 0.32467442, -0.15806046]])\n"
  12986. "\n"
  12987. "Plot the functions of order 0 to 3 from 0 to 10.\n"
  12988. "\n"
  12989. ">>> import matplotlib.pyplot as plt\n"
  12990. ">>> fig, ax = plt.subplots()\n"
  12991. ">>> x = np.linspace(0., 10., 1000)\n"
  12992. ">>> for i in range(4):\n"
  12993. "... ax.plot(x, yn(i, x), label=f'$Y_{i!r}$')\n"
  12994. ">>> ax.set_ylim(-3, 1)\n"
  12995. ">>> ax.legend()\n"
  12996. ">>> plt.show()")
  12997. ufunc_yn_loops[0] = <np.PyUFuncGenericFunction>loop_d_pd__As_pd_d
  12998. ufunc_yn_loops[1] = <np.PyUFuncGenericFunction>loop_d_dd__As_ff_f
  12999. ufunc_yn_loops[2] = <np.PyUFuncGenericFunction>loop_d_dd__As_dd_d
  13000. ufunc_yn_types[0] = <char>NPY_INTP
  13001. ufunc_yn_types[1] = <char>NPY_DOUBLE
  13002. ufunc_yn_types[2] = <char>NPY_DOUBLE
  13003. ufunc_yn_types[3] = <char>NPY_FLOAT
  13004. ufunc_yn_types[4] = <char>NPY_FLOAT
  13005. ufunc_yn_types[5] = <char>NPY_FLOAT
  13006. ufunc_yn_types[6] = <char>NPY_DOUBLE
  13007. ufunc_yn_types[7] = <char>NPY_DOUBLE
  13008. ufunc_yn_types[8] = <char>NPY_DOUBLE
  13009. ufunc_yn_ptr[2*0] = <void*>_func_cephes_yn_wrap
  13010. ufunc_yn_ptr[2*0+1] = <void*>(<char*>"yn")
  13011. ufunc_yn_ptr[2*1] = <void*>_func_yn_unsafe
  13012. ufunc_yn_ptr[2*1+1] = <void*>(<char*>"yn")
  13013. ufunc_yn_ptr[2*2] = <void*>_func_yn_unsafe
  13014. ufunc_yn_ptr[2*2+1] = <void*>(<char*>"yn")
  13015. ufunc_yn_data[0] = &ufunc_yn_ptr[2*0]
  13016. ufunc_yn_data[1] = &ufunc_yn_ptr[2*1]
  13017. ufunc_yn_data[2] = &ufunc_yn_ptr[2*2]
  13018. yn = np.PyUFunc_FromFuncAndData(ufunc_yn_loops, ufunc_yn_data, ufunc_yn_types, 3, 2, 1, 0, 'yn', ufunc_yn_doc, 0)
  13019. from ._special_ufuncs import (_cospi, _gen_harmonic, _lambertw, _normalized_gen_harmonic, _scaled_exp1, _sinpi, _spherical_jn, _spherical_jn_d, _spherical_yn, _spherical_yn_d, _spherical_in, _spherical_in_d, _spherical_kn, _spherical_kn_d, airy, airye, bei, beip, ber, berp, binom, exp1, expi, expit, exprel, gamma, gammaln, hankel1, hankel1e, hankel2, hankel2e, hyp2f1, it2i0k0, it2j0y0, it2struve0, itairy, iti0k0, itj0y0, itmodstruve0, itstruve0, iv, _iv_ratio, _iv_ratio_c, ive, jv, jve, kei, keip, kelvin, ker, kerp, kv, kve, log_expit, log_wright_bessel, loggamma, logit, mathieu_a, mathieu_b, mathieu_cem, mathieu_modcem1, mathieu_modcem2, mathieu_modsem1, mathieu_modsem2, mathieu_sem, modfresnelm, modfresnelp, obl_ang1, obl_ang1_cv, obl_cv, obl_rad1, obl_rad1_cv, obl_rad2, obl_rad2_cv, pbdv, pbvv, pbwa, pro_ang1, pro_ang1_cv, pro_cv, pro_rad1, pro_rad1_cv, pro_rad2, pro_rad2_cv, psi, rgamma, wright_bessel, yv, yve, zetac, _zeta, sindg, cosdg, tandg, cotdg, i0, i0e, i1, i1e, k0, k0e, k1, k1e, y0, y1, j0, j1, struve, modstruve, beta, betaln, besselpoly, gammaln, gammasgn, cbrt, radian, cosm1, gammainc, gammaincinv, gammaincc, gammainccinv, fresnel, ellipe, ellipeinc, ellipk, ellipkinc, ellipkm1, ellipj, _riemann_zeta, erf, erfc, erfcx, erfi, voigt_profile, wofz, dawsn, ndtr, log_ndtr, exp2, exp10, expm1, log1p, xlogy, xlog1py, _log1pmx, _log1mexp)
  13020. #
  13021. # Aliases
  13022. #
  13023. jn = jv