parameters: (x)
return_statement: return reshape(out, x.shape)
docstring: Elementwise log of the cumulative distribution function of a standard normal random variable.
  
      Implementation is a quadratic approximation with modest accuracy over [-4, 4].
docstring_summary: Elementwise log of the cumulative distribution function of a standard normal random variable.
docstring_tokens: Elementwise log of the cumulative distribution function of a standard normal random variable .
function: def log_normcdf(x):
      """Elementwise log of the cumulative distribution function of a standard normal random variable.
  
      Implementation is a quadratic approximation with modest accuracy over [-4, 4].
      """
      A = scipy.sparse.diags(
          np.sqrt(
              [
                  0.02301291,
                  0.08070214,
                  0.16411522,
                  0.09003495,
                  0.08200854,
                  0.01371543,
                  0.04641081,
              ]
          )
      )
      b = np.array([[3.0, 2.0, 1.0, 0.0, -1.0, -2.5, -3.5]]).reshape(-1, 1)
  
      x = Expression.cast_to_const(x)
      flat_x = reshape(x, (1, x.size))
  
      y = A @ (b @ np.ones(flat_x.shape) - np.ones(b.shape) @ flat_x)
      out = -sum_(maximum(y, 0) ** 2, axis=0)
  
      return reshape(out, x.shape)
function_tokens: def log_normcdf ( x ) : A = scipy . sparse . diags ( np . sqrt ( [ 0.02301291 , 0.08070214 , 0.16411522 , 0.09003495 , 0.08200854 , 0.01371543 , 0.04641081 , ] ) ) b = np . array ( [ [ 3.0 , 2.0 , 1.0 , 0.0 , - 1.0 , - 2.5 , - 3.5 ] ] ) . reshape ( - 1 , 1 ) x = Expression . cast_to_const ( x ) flat_x = reshape ( x , ( 1 , x . size ) ) y = A @ ( b @ np . ones ( flat_x . shape ) - np . ones ( b . shape ) @ flat_x ) out = - sum_ ( maximum ( y , 0 ) ** 2 , axis = 0 ) return reshape ( out , x . shape )