Why does my calculator compute ln(5) faster than ln(e)?

  • Thread starter NoOne0507
  • Start date
  • Tags
    Calculator
In summary, the calculation of logarithms on electronic calculators can vary depending on the specific calculator and its programming. Some may use the power series expansion method, while others may use more efficient methods such as the ratio of two cubic polymonials. The use of decimal or binary arithmetic can also affect the speed of calculations.
  • #1
NoOne0507
16
0
Straightforward question for anyone who knows how calculators work.
 
Mathematics news on Phys.org
  • #2
First thought. 5 is a simple integrer. e is calculated as a limit or by series expansion.
 
  • #3
Yes, I think it's a reasonable explanation. The ln is computed using the power series, so it's considerably faster with natural numbers.
 
  • #4
Okay. Makes sense, thanks.
 
  • #5
You think there is a separate code for calculating logarithms of integer numbers? That would be rather unexpected - and I don't see a reason for such approach. Unnecessary complication.
 
  • #6
Borek said:
You think there is a separate code for calculating logarithms of integer numbers? That would be rather unexpected - and I don't see a reason for such approach. Unnecessary complication.

The binary representation of 5 will have only 2 1 bits, so multiplying by it will be much faster, espescially on a very old processor with only 8 (or even 4) bits, and no multiplication instruction. (and it has to be something like that, or the calculation time would be too fast to notice a delay).

Actually the calculator may begin with ln(5) = 2 * ln(2) + ln(1.25), and then use the power series expansion of ln(x) around x = 1, so you end up with powers of 1/4, so you have only 1 bit to multiply by.
 
  • #7
A couple of posts here have used the words "the power series", as if there was only one such thing. Presumably they mean a Taylor series that they learned about in a calculus course.

That is very rarely the way functions like logs are calculated in "serious" numerical work. For example one well-known method of calculating logs uses the ratio of two cubic polymonials, and is accurate to 16 decimal places in the range [itex]\sqrt {1/2} \le x \le \sqrt 2[/itex]. That is much quicker than using enough terms to get the same accuracy from a Taylor series. (Ref: Plauger, "The Standard C library" - though the algorithm comes from an earlier book by Cody & Waite)

Having said that, some of the early electronic calculators (back in the 1970s) used horrible numerical methods. IIRC it was possible to send one of the early Sinclair calculators into an "infinte loop" evaluating some math functions, but with modern electronics there's no excuse for that sort of thing.

It's possible that some calculators do all their arithmetic in decimal rather than binary, and do multiplications the same way as doing long multiplication by hand. In that case it's possible that a value with a small number of non-zero digits will compute faster, if the program skips over doing operations on the zeros.

FWIW on my calculator (a Casio) I can't detect any speed difference in the OP's example, and I haven't noticed anything similar for other functions.
 

1. Why does my calculator compute ln(5) faster than ln(e)?

There are a few possible reasons for this. One possibility is that the calculator's algorithm for calculating ln(e) is more complex and requires more computational steps than the algorithm for ln(5). Another possibility is that the calculator has pre-programmed values for commonly used numbers like ln(e) and can retrieve them more quickly than calculating them. It could also be a combination of both factors.

2. Is there a significant difference in computing time between ln(5) and ln(e)?

It depends on the specific calculator and its algorithms. Some calculators may have a noticeable difference in computing time while others may not. However, in general, the difference in computing time between ln(5) and ln(e) is not significant.

3. Does this mean that ln(5) is a simpler calculation than ln(e)?

Not necessarily. Both ln(5) and ln(e) are relatively simple calculations, but they may use different algorithms or require different steps. Additionally, the difference in computing time could also be due to the calculator's pre-programmed values for ln(5) and ln(e).

4. Are there any other numbers that my calculator will compute faster than ln(e)?

Yes, it is possible that your calculator will compute other numbers faster than ln(e). This may vary depending on the calculator and its pre-programmed values. Generally, numbers that are commonly used or have simple algorithms may be computed faster.

5. Is there any advantage to using ln(e) instead of ln(5)?

Both ln(e) and ln(5) serve different purposes in mathematics. ln(e) is often used in calculus and exponential functions, while ln(5) may be used in other applications. The advantage of using one over the other would depend on the specific problem or equation being solved. However, in terms of computing time, there is not a significant advantage to using one over the other.

Similar threads

Replies
9
Views
3K
Replies
1
Views
1K
  • Programming and Computer Science
Replies
15
Views
2K
Replies
3
Views
214
  • Introductory Physics Homework Help
Replies
12
Views
563
Replies
9
Views
2K
  • General Math
Replies
8
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
662
Replies
7
Views
798
Back
Top