I'm trying to implement $\log({\bf q})$ in python, where ${\bf q} = (q_0,\ldots,q_7) \in \mathbb{O}$ is an octonion. There is a well known definition of $\log({\bf q})$ for quaternions ${\bf q} = (s,v) \in \mathbb{H}$, which essentially boils down to $$\log({\bf q}) = \left( \log(\|{\bf q}\|),\left( \frac{1}{\|v\|} \arccos \frac{s}{\|{\bf q}\|}\right)v \right) \in \mathbb{H}$$ for ${\bf q} = (s,v)$ with $v \not= 0$ (see f.i. https://math.stackexchange.com/questions/2552/the-logarithm-of-quaternion). This definition can be extended to octonions ${\bf q}$ immediately with $v = (q_1,\ldots,q_7)$. With this definition we get $\exp(\log({\bf q})) = {\bf q}$ for a wide range of ${\bf q} \in \mathbb{O}$, but unfortunately $\log(\exp({\bf q})) \not= {\bf q}$ even for many ${\bf q} \in \mathbb{H}$. Is there /can there be any definition of $\log({\bf q})$ for ${\bf q} \in \mathbb{H}$ or ${\bf q} \in \mathbb{O}$ such that $\exp(\log({\bf q})) = {\bf q}$ and $\log(\exp({\bf q})) = {\bf q}$ for a wide range of ${\bf q}$?
Edit: If $|s| > \|v\|$ for ${\bf q} = (s,v)$ (the power series can be used in principle) we get $\log(\exp({\bf q})) = {\bf q}$. But what if $|s| < \|v\|$?