The logarithm of a quaternion $q$ that has a real part $a$ and imaginary parts $v$ is defined as
$$ \ln q = \ln a + \hat{v} \arccos \frac{a}{\left\lvert q \right\rvert} $$
The exponentional of a quaternion $q$ that has a real part $a$ and imaginary parts $v$ is defined as
$$ \exp q = e^a \left(\cos \left\lvert v\right\rvert+ \hat{v} \sin \left\lvert v \right\rvert\right) $$
Is it true that for all purely imaginary quaternions that:
$$ \ln (\exp u * \exp v) = u + v $$ $$ c u = \ln (\exp u)^c $$
I have a math program I wrote which seems to be inaccurate and want to know if the bug is in my program or in my idea of quarternions.
No, this is not true, and as usual the problem is lack of commutativity. The correct statement in general is surprisingly complicated and is given by the Baker-Campbell-Hausdorff formula.
(You already have to be a bit careful with this rule for complex numbers, but for quaternions it just totally goes out the window.)