ELI5: Floating Point functions

A floating-point operation is performing a single operation (addition, subtraction, multiplication, division) involving floating point numbers. Floating point numbers are the most common type of decimal (as opposed to integral) numbers that computers use, and it's the one that has the most hardware support these days. FLOPS (Floating-Point OPerations per Second) is one measure of performance, and it's usually used to compare Supercomputers. Modern supercomputers can achieving performance in the PetaFLOPS range, i.e. quadrillions of FLOPS.

It's important to note that FLOPS is a theoretical measure, and in real scenarios programs are often held back for some other reason besides the raw speed of the processor. In addition, home computer CPU performance isn't usually measured in FLOPS, though there's no reason it couldn't be. Due to that, I cannot predict with certainty how fast your computer's processor is, in terms of FLOPS. A naive estimate, based on the estimate of 4 FLOPs per cycle given on the wikipedia page, would be that a 5th-generation i5 with 1.6 GHz per core would be able to process about 6.4 billion FLOPS, for a total of 12.8 billion FLOPS total.

In practice, there's a lot of reasons why you wouldn't be able to achieve that level of performance, but nevertheless you can expect a well-optimized program to be able to process millions of segments per second or more.

And a final note, if you're attempting to achieve extreme accuracy and your curve has a definite mathematical model, integrating the function is much less computationally intensive than the trapezium rule, and gives a perfectly accurate result. On the other hand, programming a computer to be able to integrate mathematical functions is a fair bit more difficult than programming it to perform the trapezium rule repeatedly, so it's a trade-off.

/r/explainlikeimfive Thread