This commit is contained in:
Miloslav Ciz 2025-02-08 19:09:45 +01:00
parent 16b8c6accd
commit 85321afd67
35 changed files with 1971 additions and 1919 deletions

View file

@ -14,7 +14,7 @@ Examples of approximations:
- **[Square root](sqrt.md)/square** (integer) can be roughly approximated too. E.g. to get a quick "almost square" of a number you can try something like doubling each binary digit and shifting everything right, e.g. `101` -> `11001` -- it's not very accurate but may be [good enough](good_enough.md) e.g. for some graphics effects and may be especially effective as hardware implementation as it works instantly and uses literally no [logic gates](logic_gate.md) (you just reorder bits)! A bit improved version may construct a pair of digits from each digit as logical AND (upper bit) and logical OR (lower bit) of the bit with its lower neighbor (lowest bit may still just be doubled), e.g. `1101` -> `11010111`. Square root can similarly be roughly estimated by reducing each pair of bits with logical OR down to a single bit (e.g. `101100` -> `110`). { Dunno if this is actually used anywhere, I came up with this once before I fell asleep. ~drummyfish } A famous hack in Quake, called *fast inverse square root*, uses a similar approximation in [floating point](float.md).
- **[3D graphics](3d_rendering.md)** is almost completely about approximations, e.g. basically all shapes are approximated with triangle meshes, [screen space](screen_space.md) effects (like [SSAO](ssao.md)) are used to approximate global illumination, reflections etc. Similarly [ray tracing](ray_tracing.md) neglects indirect lighting etcetc.
- **[Real numbers](real_number.md)** are practically always approximated with [floating point](floating_point.md) or [fixed point](fixed_point.md) (rational numbers).
- **[Numerical methods](numerical.md)** offer generality and typically yield approximate solutions while their precision vs speed can be adjusted via parameters such as number of iterations.
- **[Numerical methods](numerical.md)** allow us to find approximate solutions to very general equations (ones that are impossible or impractical to solve analytically with absolute precision) by iterative evaluation of infinite series that converge towards the solution. These methods allow fine tuning speed vs precision via parameters such as the number of iterations or desired error against correct solution. This is very often used in engineering and practical applications of mathematics to the [real world](irl.md) where we encounter very complex equations. One of the simplest and most famous numerical tools is the Newton's method that (as long as some conditions hold) iterates towards the solution based on first [derivative](detivative.md) of the function.
- **[Taylor series](taylor_series.md)** approximates given mathematical function and can be used to e.g. estimate solutions of [differential equations](differential_equation.md).
- [Rotation](rotation.md) around an axis, especially by small angles, can be approximated by skewing in one direction, then in another.
- Primitive [music](music.md) synthesis often uses simple functions like triangle/saw/square wave to approximate [sin](sin.md) waves (though many times it's done for the actual sound of these waves, sometimes it may be simply to save on resources).