code: def _call_2002(s, k, t, r, b, sigma):
      """Calculates the approximate value of an American call option."""
      # (15) in reference [1].
  
      dtype = sigma.dtype
  
      # Divide time into two subperiods (0, t) and (t, T).
      t1 = 0.5 * (tf.math.sqrt(tf.constant(5.0, dtype=dtype)) - 1) * t
  
      beta = (
          0.5
          - b / sigma**2
          + tf.math.sqrt(
              (b / sigma**2 - 0.5) ** 2 + 2 * r / sigma**2
          )
      )
  
      x1 = _boundary1_2002(k, t, r, b, sigma, beta)
      x2 = _boundary2_2002(k, t, r, b, sigma, beta)
  
      alpha1 = (x1 - k) * x1 ** (-beta)
      alpha2 = (x2 - k) * x2 ** (-beta)
  
      return tf.where(
          s >= x2,
          s - k,
          (
              alpha2 * s**beta
              - alpha2 * _phi_1993(s, t1, beta, x2, x2, r, b, sigma)
              + _phi_1993(s, t1, 1, x2, x2, r, b, sigma)
              - _phi_1993(s, t1, 1, x1, x2, r, b, sigma)
              - k * _phi_1993(s, t1, 0, x2, x2, r, b, sigma)
              + k * _phi_1993(s, t1, 0, x1, x2, r, b, sigma)
              + alpha1 * _phi_1993(s, t1, beta, x1, x2, r, b, sigma)
              - alpha1
              * _psi_2002(s, t, beta, x1, x2, x1, t1, r, b, sigma)
              + _psi_2002(s, t, 1, x1, x2, x1, t1, r, b, sigma)
              - _psi_2002(s, t, 1, k, x2, x1, t1, r, b, sigma)
              - k * _psi_2002(s, t, 0, x1, x2, x1, t1, r, b, sigma)
              + k * _psi_2002(s, t, 0, k, x2, x1, t1, r, b, sigma)
          ),
      )
  
imports: from typing import Tuple
  import numpy
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance.black_scholes import vanilla_prices
  from tf_quant_finance.math import gradient
  from tf_quant_finance.math import integration
  from tf_quant_finance.math.root_search import newton
label_desc: Use image node_id 7 for calling a global function with example usage: _call_2002(s, k, t, r, b, sigma) and returns: tf