Efficient Calculation Techniques for Common Mathematical Functions

  • Context: Undergrad 
  • Thread starter Thread starter ice109
  • Start date Start date
  • Tags Tags
    Algorithms
Click For Summary

Discussion Overview

The discussion revolves around efficient calculation techniques for various mathematical functions, including logarithms, square roots, and trigonometric functions. Participants explore both mental calculation strategies and algorithmic approaches, sharing personal experiences and tricks that facilitate quick computations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant expresses curiosity about efficient methods for evaluating logarithms, square roots, and trigonometric functions, referencing Gauss's mental calculation abilities.
  • Another participant shares a trick for squaring numbers ending in 5, explaining the method without delving into its theoretical justification.
  • A subsequent reply provides a mathematical breakdown of the squaring trick, demonstrating how it can be factored to show its validity.
  • One participant suggests looking into the "Numerical Recipes" books, particularly the Newton-Raphson method, as a useful resource for numerical approximations.
  • Another participant mentions using Taylor series expansions for trigonometric functions and Simpson's rule for logarithms, along with the Newton-Raphson method for square roots and Stirling's approximation for large factorials.

Areas of Agreement / Disagreement

Participants share various techniques and approaches, but there is no consensus on a single best method for all calculations. Multiple competing views and methods remain present in the discussion.

Contextual Notes

Some methods discussed rely on specific assumptions or conditions, such as the proximity of angles to known values for trigonometric functions or the applicability of series expansions. The discussion does not resolve the effectiveness or limitations of these methods.

ice109
Messages
1,708
Reaction score
6
what are some for evaluating logs? square roots? trig functions? this makes me curious

wiki said:
Gauss was a prodigious mental calculator. Reputedly, when asked how he had been able to predict the trajectory of Ceres with such accuracy he replied, "I used logarithms." The questioner then wanted to know how he had been able to look up so many numbers from the tables so quickly. "Look them up?" Gauss responded. "Who needs to look them up? I just calculate them in my head!"

obviously i don't intend to be gauss but it made me realize these things are never taught and just taken for granted. and obviously I am not talking about
[tex]log_{10}(100)[/tex] maybe something like to a rational number.

actually now that I am thinking about it you could just solve the series expansion for the first couple of terms for the exponential but there's got to be a better way.
 
Mathematics news on Phys.org
That is an interesting topic, I am too, interested in such algorithms, as using calculator for some simple or not so simple calculations is a distraction for what can be a fluent flow of thoughts.

Anyway, a little contribution from me: my father showed me this little trick and I have not to this day even tried to see why it works, but frequently use it. It is a quick multiplication rule for squaring numbers which have last digit 5. The rule is as follows:
Multiply the "first" part (the non-five part) of the number with the following integer and then simply put 25 at the end. i.e. 15 x 15 = 1x2|25 = 225; 25 x 25 =2x3|25 = 625; 35 x 35 = 3x4|25 = 1225; 125 x 125 = 12x13|25 = 15625 and so on, you get the idea.

As I said, I've used this method frequently in my school years, but I had never thought why this works the way it does to this very day. So, feel free to use it from now on and if anyone has any hints on why it works that way it will be appreciated.

Also any hints for algorithms to other easy or not so easy calculations will be appreciated.
 
Last edited:
It works like this. Think of the number as [tex]k5[/tex] where [tex]k[/tex] represents the digits in front of the 5.
Then, we can write the value of the number as [tex]10k + 5[/tex].

Squaring the number gives us: [tex](10k + 5)^{2} = 100k^{2} + 100k + 25[/tex].

But, this can be factored: [tex]100k(k + 1) + 25[/tex].

And there it is.
 
You're looking for the Numerical Recipes books. They're available in their entirety here:

Numerical Recipes Online

You might be most interested in the Newton-Raphson method, which is the numerical approximation algorithm used by most pocket calculators.

- Warren
 
BSMSMSTMSPHD said:
It works like this. Think of the number as [tex]k5[/tex] where [tex]k[/tex] represents the digits in front of the 5.
Then, we can write the value of the number as [tex]10k + 5[/tex].

Squaring the number gives us: [tex](10k + 5)^{2} = 100k^{2} + 100k + 25[/tex].

But, this can be factored: [tex]100k(k + 1) + 25[/tex].

And there it is.

simple and beautiful. thank you.
 
BSMSMSTMSPHD said:
It works like this. Think of the number as [tex]k5[/tex] where [tex]k[/tex] represents the digits in front of the 5.
Then, we can write the value of the number as [tex]10k + 5[/tex].

Squaring the number gives us: [tex](10k + 5)^{2} = 100k^{2} + 100k + 25[/tex].

But, this can be factored: [tex]100k(k + 1) + 25[/tex].

And there it is.

Nice! very cool
 
sometimes a good taylor series is all you need though. most trig functions i quickly use a 3 term expansions, but if its close to some exact value eg sin 61 degrees, then i use the expansion to sin (x+y) and use the small angle properties. its actually accurate. for logs i define them as the area under 1/x blah blah, and for that i use simpsons rule a few times. square rooting, usually Newton-rhapson method. for large factorials there's stirlings approximation.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 30 ·
2
Replies
30
Views
11K
  • · Replies 30 ·
2
Replies
30
Views
7K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K