5
$\begingroup$

I can calculate the result of $x^y$ provided that $y \in\mathbb{N}, x \neq 0$ using a simple recursive function:

$$ f(x,y) = \begin {cases} 1 & y = 0 \\ (x)f(x, y-1) & y > 0 \end {cases} $$

or, perhaps more simply stated, by multiplying $x$ by itself $y$ times.

Unfortunately, I am unsure how I can numerically approximate $x^y$ for non-integer rationals.

For example, what method can I use to approximate 33.3?

If possible, I would like to be able to do this using only elementary arithmetic operations, i.e. addition, subtraction, multiplication, and division.

  • 2
    If the exponent is rational, you'll have to use an iterative method like Newton-Raphson. For more general exponents, you'll definitely need $\exp$ and $\ln$.2011-09-06
  • 0
    @J.M. For my purposes, I can assume that the exponent is rational.2011-09-06
  • 0
    For the specific case of $3^{\frac{33}{10}}$, you can use Newton-Raphson for $\sqrt[10]{3}$ and then use your method to exponentiate that 33 times.2011-09-06
  • 0
    Of course, you'll want to first make sure that the fractional exponent is in lowest terms before you go through that trouble. Alternatively for your example, since $\frac{33}{10}=3+\frac3{10}$, you can cube both $3$ and $\sqrt[10]{3}$ and multiply their results.2011-09-06
  • 1
    If you can also take square roots, you can expand the exponent as a binary number and repeatedly take square roots to get $x^{1/2^k}$ and multiply when the bit in the exponent is a 1. There is a technique for taking $x^{1/2}$ when x is close to 1 that preserves accuracy - write $x = 1+y$ so $x^{1/2} \approx 1+y/2$. I think I saw this in a book by Henrici many years ago.2011-09-06
  • 3
    Are you asking how $x^y$ is defined for rational $y=n/m$? It is as $(x^{1/m})^n$, where $x^{1/m}$ is defined as the $m$th root of $x$, that is, the unique number $t>0$ such that $t^m=x$. To approximate $t=x^{1/m}$ you can, as said, use Newton-Raphson to find the root to the function $f(t)=t^m-x$. Arbitrary real exponents can be treated as limits of rational exponents. For example, $x^{3.14159}$ will approximate $x^\pi$.2011-09-06
  • 0
    There is the good old binomial series: For $-1 and arbitrary $\alpha\in{\mathbb C}$ one has $$(1+x)^\alpha=\sum_{k=0}^\infty {\alpha\choose k}\ x^k\ .$$2011-10-06

3 Answers 3