code: def evalf_trig(v: "Expr", prec: int, options: OPT_DICT) -> TMP_RES:
      """
      This function handles sin and cos of complex arguments.
  
      TODO: should also handle tan of complex arguments.
      """
      from sympy.functions.elementary.trigonometric import cos, sin
  
      if isinstance(v, cos):
          func = mpf_cos
      elif isinstance(v, sin):
          func = mpf_sin
      else:
          raise NotImplementedError
      arg = v.args[0]
      # 20 extra bits is possibly overkill. It does make the need
      # to restart very unlikely
      xprec = prec + 20
      re, im, re_acc, im_acc = evalf(arg, xprec, options)
      if im:
          if "subs" in options:
              v = v.subs(options["subs"])
          return evalf(v._eval_evalf(prec), prec, options)
      if not re:
          if isinstance(v, cos):
              return fone, None, prec, None
          elif isinstance(v, sin):
              return None, None, None, None
          else:
              raise NotImplementedError
      # For trigonometric functions, we are interested in the
      # fixed-point (absolute) accuracy of the argument.
      xsize = fastlog(re)
      # Magnitude <= 1.0. OK to compute directly, because there is no
      # danger of hitting the first root of cos (with sin, magnitude
      # <= 2.0 would actually be ok)
      if xsize < 1:
          return func(re, prec, rnd), None, prec, None
      # Very large
      if xsize >= 10:
          xprec = prec + xsize
          re, im, re_acc, im_acc = evalf(arg, xprec, options)
      # Need to repeat in case the argument is very close to a
      # multiple of pi (or pi/2), hitting close to a root
      while 1:
          y = func(re, prec, rnd)
          ysize = fastlog(y)
          gap = -ysize
          accuracy = (xprec - xsize) - gap
          if accuracy < prec:
              if options.get("verbose"):
                  print("SIN/COS", accuracy, "wanted", prec, "gap", gap)
                  print(to_str(y, 10))
              if xprec > options.get("maxprec", DEFAULT_MAXPREC):
                  return y, None, accuracy, None
              xprec += gap
              re, im, re_acc, im_acc = evalf(arg, xprec, options)
              continue
          else:
              return y, None, prec, None
  
imports: from __future__ import annotations
  from typing import Tuple, Optional, Union, Callable, List, Dict, Type, TYPE_CHECKING, Any, overload
  import math
  import mpmath.libmp
  from mpmath import make_mpc, make_mpf, mp, mpc, mpf, nsum, quadts, quadosc, workprec
  from mpmath import inf
  from mpmath.libmp import from_int, from_man_exp, from_rational, fhalf, fnan, finf, fninf, fnone, fone, fzero, mpf_abs, mpf_add, mpf_atan, mpf_atan2, mpf_cmp, mpf_cos, mpf_e, mpf_exp, mpf_log, mpf_lt, mpf_mul, mpf_neg, mpf_pi, mpf_pow, mpf_pow_int, mpf_shift, mpf_sin, mpf_sqrt, normalize, round_nearest, to_int, to_str
  from mpmath.libmp import bitcount
  from mpmath.libmp.backend import MPZ
  from mpmath.libmp.libmpc import _infs_nan
  from mpmath.libmp.libmpf import dps_to_prec, prec_to_dps
  from .sympify import sympify
  from .singleton import S
  from sympy.external.gmpy import SYMPY_INTS
  from sympy.utilities.iterables import is_sequence
  from sympy.utilities.lambdify import lambdify
  from sympy.utilities.misc import as_int
label_desc: Use image node_id 28 for calling a global function with example usage: evalf_trig(v, prec, options) and returns: evalf, func,  None,  prec,  None, fone,  None,  prec,  None, y,  None,  prec,  None, None,  None,  None,  None, y,  None,  accuracy,  None