Computers either have an integer processing unit and/or a basic floating point unit. Using series expansions must take a lot of time if high accuracy is required. So how is say, tan(34.5) calculated so fast?

In: Engineering

Because most calculators of limited power don’t use the slow functions. They use specifically chosen approximations, Taylor series, etc. and optimise the algorithm towards whatever the processor does best – e.g. integer operation, fixed-point or floating-point, multiplications, additions, bitwise operations, etc.

If you choose the right algorithm it can converge to a calculator-number of digits very quickly, probably only a handful of iterations of maybe a few dozen operations each. Even at 1KHz, that means almost no time at all to converge to something you can display to 10 decimal places, even if you have to prep the numbers involved, use a weird algorithm, and then convert back from integer to float at the end.

Simple answer. Because the computer or calculator is running really fast.

A simple floating point operation or integer can be done in one clock cycle. And there are dedicated hardware to do special functions, but let’s ignore those for now.

With high end calculators running 10mhz processors that means they can do 10 million calculations per second. So yeah that’s basically instantaneous to you.