Thursday, October 31, 2024

Numerical Analysis

 
The advent of computers allowed us to use algorithms to rapidly work out solutions to maths problems. E.g. working out square roots of numbers or finding roots of equations (where a graph of the equation crosses the x-axis). The solutions are often approximate to a desired level of accuracy, rather than an exact analytical solution. This area of maths, using algorithms to solve problems is called numerical analysis. If you've ever wondered how a scientific calculator works out e.g. the sine of an angle, it just uses an infinite series or other technique and does lots of simple arithmetic to add each element of the series together. The most basic microprocessors can only do simple arithmetic such as addition and subtraction of integers (whole numbers), so anything more complex such as multiplication, division and the handling of decimal numbers must be done using algorithms. For example, multiplication can be thought of as adding numbers multiple times (e.g. 4 x 3 = 4 + 4 + 4). In the 80s, math coprocessors became common as separate integrated circuits (ICs) or "chips", dedicated to doing faster maths calculations in hardware rather than software. These could be bought as an upgrade for PCs. Eventually the functionality of these chips was built into the main processor.
This article from Medium shows how the square root of a number can be calculated using the Newton Raphson algorithm: