code: def logcdf(x, a, b, loc=0, scale=1):
      x, a, b, loc, scale = promote_args_inexact(
          "truncnorm.logcdf", x, a, b, loc, scale
      )
      x, a, b = jnp.broadcast_arrays(x, a, b)
      x = lax.div(lax.sub(x, loc), scale)
      logcdf = _log_gauss_mass(a, x) - _log_gauss_mass(a, b)
      logsf = _log_gauss_mass(x, b) - _log_gauss_mass(a, b)
  
      logcdf = jnp.select(
          # third condition: avoid catastrophic cancellation (from scipy)
          [x >= b, x <= a, logcdf > -0.1, x > a],
          [0, -jnp.inf, jnp.log1p(-jnp.exp(logsf)), logcdf],
      )
      logcdf = jnp.where(a >= b, jnp.nan, logcdf)
      return logcdf
  
file_path: jax/jax/_src/scipy/stats/truncnorm.py
imports: import scipy.stats
  from jax import lax
  import jax.numpy
  from jax._src.numpy.util import _wraps, promote_args_inexact
  from jax._src.scipy.stats import norm
  from jax._src.scipy.special import logsumexp, log_ndtr, ndtr
label_desc: Use image node_id 7 for calling a global function with example usage: logcdf(x, a, b, loc, scale) and returns: logcdf