code: def _log_prob_3(concentration, value):
      # We integrate along a ray, factorizing the integrand as a product of:
      # a truncated normal distribution over coordinate t parallel to the ray, and
      # a bivariate normal distribution over coordinate r perpendicular to the ray.
      t = _dot(concentration, value)
      t2 = t.square()
      r2 = _dot(concentration, concentration) - t2
      perp_part = r2.mul(-0.5) - math.log(2 * math.pi)
  
      # This is the log of a definite integral, computed by mathematica:
      # Integrate[x^2/(E^((x-t)^2/2) Sqrt[2 Pi]), {x, 0, Infinity}]
      # = t/(E^(t^2/2) Sqrt[2 Pi]) + ((1 + t^2) (1 + Erf[t/Sqrt[2]]))/2
      # = t/(E^(t^2/2) Sqrt[2 Pi]) + ((1 + t^2) Erfc[-t/Sqrt[2]])/2
      para_part = _safe_log(
          t * t2.mul(-0.5).exp() / (2 * math.pi) ** 0.5
          + (1 + t2) * (t * -(0.5**0.5)).erfc() / 2
      )
  
      return para_part + perp_part
  
file_path: pyro/pyro/distributions/projected_normal.py
imports: import math
  import torch
  from pyro.ops.tensor_utils import safe_normalize
  from .None import constraints
  from .torch_distribution import TorchDistribution
label_desc: Use image node_id 4 for calling a global function with example usage: _log_prob_3(concentration, value) and returns: unknown