I have tried to find a general formula outlining the algorithm of operation that is $x^n$, however, it was much harder than I thought. I ended up with a pretty big monster of an equation that takes into account positive, negative and non-integer exponents. Here it is: $$x,n \in \Bbb R, \quad0^0=1$$ $\equiv$
$$x^{\pm n} = ((\prod_{k=1}^{\lfloor n \rfloor} k^0 \times x + 0^{\pm1\times\lfloor n \rfloor})\times (\sqrt[\frac{1}{\{n\}+0^{\pm1\times\{n\}}}] \frac{x^{1+\lceil\{n\}\rceil}}{x})\times 0^{(\pm1 \times n)\mp (\pm1 \times n)}) + ((1\div(\prod_{k=1}^{\lfloor n \rfloor} k^0 \times x + 0^{\pm1\times\lfloor n \rfloor})) \times (1 \div (\sqrt[\frac{1}{\{n\}+0^{\pm1 \times\{n\}}}] \frac{x^{1+\lceil\{n\}\rceil}}{x} ))\times 0^{n\pm n})$$
Two questions:
Is this formula correct? I have checked it with a calculator, but checking through a program like Mathematica would be safer.
Does there exist another and/or better general formula for a real number raised to the power of a real number (I have yet to integrate imaginary and complex numbers into this formula)? If not, has this one been found before?
PS, some of the parentheses are just there for clarity. If anyone finds these mathematically superfluous parentheses distracting, I'll remove them.
There is a much easier way. $$a^{b} =\begin{cases} \text{undefined} & a=b=0\\ 0 & a=0,b\neq 0\\ 1 & a\neq 0,b=0\\ \exp( b\log a) & a\neq 0,b\neq 0 \end{cases}$$ This works for more general $a,b\in\mathbb{C}$ as well. To compute $\exp$ one can use $$\exp z=\sum_{k=0}^\infty \frac{z^k}{k!}$$ And to compute $\log$ one can use $$\log z=\log |z|+i\operatorname{arg}z$$ Where $\arg$ is the principal argument. Letting $x,y\in\mathbb R$ the definition is $$\arg( x+iy) =\begin{cases} \arctan( y/x) & x >0\\ \arctan( y/x) +\pi & x< 0,y\geq 0\\ \arctan( y/x) -\pi & x< 0,y< 0\\ \pi /2 & x=0,y >0\\ -\pi /2 & x=0,y< 0\\ \text{undefined} & x=y=0 \end{cases}$$ And for $x\in\mathbb R_+$ one can use the integral definition of the logarithm: $$\log x=\int_1^x \frac{1}{t}\mathrm dt$$ This is the standard definition of exponentiation and I think avoids a lot of the confusion present in your approach.