How can I compute an exponent with a rational number, using no calculator?

46 Views Asked by At

I would like to note before hand I am trying to improve my math by making a calculator application.

Anyways, let's say I would like to compute $2^{2.534}$.

Beforehand, I know that:

  1. $$a^x=e^{xln(a)}$$

I already have a working algorithm on finding $ln(a)$, but ultimately in the end this still gives me a rational number and without actually knowing how to compute it, I arrive to my original problem again.

At this point, I figure I can store a table of already computed values for $e^{x}$, and then just interpolate values? However, I feel that my accuracy would greatly depend on how many values I store and it makes me come to hte question of how did anyone create these tables in the first place?

1

There are 1 best solutions below

2
On BEST ANSWER

The logarithm and trigonometric tables were tools I still used in the early 70s when I attended high school and calculators were too expensive ans/or not allowed in classroom. The mathematicians of precomputer era calculated tables by hand. They had polynomial expansion like Taylor or MacLaurin formulae.

Logarithm standard formula

$$\log(1+x)=x-x^2/2+x^3/3-x^4/4+x^5/5-x^6/6+x^7/7-x^8/8+\ldots$$

is too slow, and soon were invented accelerated methods for alternating series like this.

Essentially the calculation were done by hand

Example. For small $x$

$\sin x\approx x-\frac{x^3}{6}+\frac{x^5}{120}$

Try $x=0.15$

$\sin 0.15 \approx 0.15 -\frac{0.15^3}{6}+\frac{0.15}{120}=\frac{3}{20}-\frac{27}{8000}+\frac{243}{3200000}= \color{red}{0.149438132}8125$

My calculator gives $\color{red}{0.149438132}4736$

Impressive, isn't it? Only three terms, such a precision... but caution if we look for values "far" from zero, like $x=2$ we get a bad result

$\sin 2\approx 2-8/3+32/120\approx 0.93$

while $\sin 1\approx 0.909297$

Hope this can be useful