code: def reciprocal(self, input_in_01=False):
      r"""
      Args:
          input_in_01 (bool) : Allows a user to indicate that the input is in the range [0, 1],
                      causing the function optimize for this range. This is useful for improving
                      the accuracy of functions on probabilities (e.g. entropy functions).
  
      Methods:
          'NR' : `Newton-Raphson`_ method computes the reciprocal using iterations
                  of :math:`x_{i+1} = (2x_i - self * x_i^2)` and uses
                  :math:`3*exp(1 - 2x) + 0.003` as an initial guess by default
  
          'log' : Computes the reciprocal of the input from the observation that:
                  :math:`x^{-1} = exp(-log(x))`
  
      Configuration params:
          reciprocal_method (str):  One of 'NR' or 'log'.
          reciprocal_nr_iters (int):  determines the number of Newton-Raphson iterations to run
                          for the `NR` method
          reciprocal_log_iters (int): determines the number of Householder
              iterations to run when computing logarithms for the `log` method
          reciprocal_all_pos (bool): determines whether all elements of the
              input are known to be positive, which optimizes the step of
              computing the sign of the input.
          reciprocal_initial (tensor): sets the initial value for the
              Newton-Raphson method. By default, this will be set to :math:
              `3*exp(-(x-.5)) + 0.003` as this allows the method to converge over
              a fairly large domain
  
      .. _Newton-Raphson:
          https://en.wikipedia.org/wiki/Newton%27s_method
      """
      pos_override = {"functions.reciprocal_all_pos": True}
      if input_in_01:
          with cfg.temp_override(pos_override):
              rec = reciprocal(self.mul(64)).mul(64)
          return rec
  
      # Get config options
      method = cfg.functions.reciprocal_method
      all_pos = cfg.functions.reciprocal_all_pos
      initial = cfg.functions.reciprocal_initial
  
      if not all_pos:
          sgn = self.sign()
          pos = sgn * self
          with cfg.temp_override(pos_override):
              return sgn * reciprocal(pos)
  
      if method == "NR":
          nr_iters = cfg.functions.reciprocal_nr_iters
          if initial is None:
              # Initialization to a decent estimate (found by qualitative inspection):
              #                1/x = 3exp(1 - 2x) + 0.003
              result = 3 * (1 - 2 * self).exp() + 0.003
          else:
              result = initial
          for _ in range(nr_iters):
              if hasattr(result, "square"):
                  result += result - result.square().mul_(self)
              else:
                  result = 2 * result - result * result * self
          return result
      elif method == "log":
          log_iters = cfg.functions.reciprocal_log_iters
          with cfg.temp_override({"functions.log_iters": log_iters}):
              return exp(-log(self))
      else:
          raise ValueError(
              f"Invalid method {method} given for reciprocal function"
          )
  
file_path: CrypTen/crypten/common/functions/approximations.py
imports: import math
  import crypten
  import torch
  from crypten.config import cfg
label_desc: Use image node_id 3 for calling a global function with example usage: reciprocal(input_in_01) and returns: rec, result, unknown, exp