UNPKG

@stdlib/esm

Version:

ES module distribution for Stdlib, a standard library for JavaScript and Node.js.

3 lines 1.21 kB
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 import r from"./../../../../utils/define-nonenumerable-read-only-property.js";import t from"./../../../../math/base/assert/is-nonnegative-integer.js";import o from"./../../../../math/base/special/binomcoefln.js";import a from"./../../../../math/base/assert/is-nan.js";import n from"./../../../../math/base/special/log1p.js";import e from"./../../../../math/base/special/ln.js";import s from"./../../../../constants/math/float64-ninf.js";import m from"./../../../../constants/math/float64-pinf.js";import i from"./../../../../utils/constant-function.js";import f from"./../degenerate/logpmf.js";var p=t,l=o,c=a,u=n,j=e,b=s,h=m;function v(r,t,o){var a;return c(r)||c(t)||c(o)||o<0||o>1||!p(t)||t===h?NaN:p(r)?r>t?b:0===o?0===r?0:b:1===o?r===t?0:b:(a=l(t,r),a+=r*j(o)+(t-r)*u(-o)):b}var N=t,g=i,d=o,y=f.factory,x=a,k=n,q=e,w=s,z=m;function A(r,t){return x(r)||x(t)||!N(r)||r===z||t<0||t>1?g(NaN):0===t||0===r?y(0):1===t?y(r):function(o){var a;if(x(o))return NaN;if(N(o))return o>r?w:(a=d(r,o),a+=o*q(t)+(r-o)*k(-t));return w}}var B=r,C=v,D=A;B(C,"factory",D);export default C; //# sourceMappingURL=logpmf.js.map