code: def test_log2():
      # Eval
      assert log2(8) == 3
      assert log2(pi) != log(pi) / log(
          2
      )  # log2 should *save* (CPU) instructions
  
      x = Symbol("x", real=True)
      assert log2(x) != log(x) / log(2)
      assert log2(2**x) == x
  
      # Expand
      assert log2(x).expand(func=True) - log(x) / log(2) == 0
  
      # Diff
      assert log2(42 * x).diff() - 1 / (log(2) * x) == 0
      assert (
          log2(42 * x).diff() - log2(42 * x).expand(func=True).diff(x)
          == 0
      )
  
file_path: sympy/sympy/codegen/tests/test_cfunctions.py
imports: from sympy.core.numbers import Rational, pi
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.functions.elementary.exponential import exp, log
  from sympy.codegen.cfunctions import expm1, log1p, exp2, log2, fma, log10, Sqrt, Cbrt, hypot
  from sympy.core.function import expand_log
label_desc: Use image node_id 4 for calling a global function with example usage: test_log2() without return types