code: def exp(q, eps=1e-8):
      """Computes the quaternion exponential.
  
      References:
        https://en.wikipedia.org/wiki/Quaternion#Exponential,_logarithm,_and_power_functions
  
      Args:
        q: the quaternion in (x,y,z,w) format or (x,y,z) if is_pure is True.
        eps: an epsilon value for numerical stability.
  
      Returns:
        The exponential of q.
      """
      is_pure = q.shape[-1] == 3
      if is_pure:
          s = jnp.zeros_like(q[..., -1:])
          v = q
      else:
          v = im(q)
          s = re(q)
  
      norm_v = linalg.norm(v, axis=-1, keepdims=True)
      exp_s = jnp.exp(s)
      w = jnp.cos(norm_v)
      xyz = (
          jnp.sin(norm_v)
          * v
          / jnp.maximum(norm_v, eps * jnp.ones_like(norm_v))
      )
      return exp_s * jnp.concatenate((xyz, w), axis=-1)
  
file_path: nerfies/nerfies/quaternion.py
imports: from jax import numpy
  from jax.numpy import linalg
label_desc: Use image node_id 12 for calling a global function with example usage: exp(q, eps) and returns: unknown