Skip to content

Commit 7bd773d

Browse files
committed
Fixed formatting on fast-inv-square.md and corrected references.
1 parent 43defe1 commit 7bd773d

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

chapters/math/fast-inv-square.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ chapter: Math
55
---
66
## Problem
77

8-
You would like to calculate a the inverse square root[5] of a number quickly.
8+
You would like to calculate a the inverse square root of a number [quickly][5].
99

1010
## Solution
11-
Appearing in the Quake III Arena source code[1], this strange algorithm uses
11+
Appearing in the Quake III Arena [source code][1], this strange algorithm uses
1212
integer operations along with a 'magic number' to calculate floating point
1313
approximation values of inverse square roots.
1414

1515
In this CoffeeScript variant I supply the original classic, and newer optimal
16-
32 bit magic numbers found by Chris Lomont[2]. Also supplied is the 64-bit
16+
32 bit magic numbers found by [Chris Lomont][2]. Also supplied is the 64-bit
1717
sized magic number.
1818

1919
Another feature included is the ability to alter the level of precision.
20-
This is done by controling the number of iterations for performing Newton's
21-
method[3].
20+
This is done by controling the number of iterations for performing [Newton's
21+
method][3].
2222

2323
Depending on the machine and level of percision this algorithm may still
2424
provide performance increases over the classic.
@@ -29,14 +29,20 @@ To run this, compile the script with coffee:
2929
Then copy & paste the compiled js code in to the JavaSript console of your
3030
browser.
3131

32-
Note: You will need a browser which supports typed-arrays[4].
32+
Note: You will need a browser which supports [typed-arrays][4].
3333

34-
References:
35-
* [1] [ftp://ftp.idsoftware.com/idstuff/source/quake3-1.32b-source.zip](ftp://ftp.idsoftware.com/idstuff/source/quake3-1.32b-source.zip)
36-
* [2] [http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf](http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf)
37-
* [3] [http://en.wikipedia.org/wiki/Newton%27s_method](http://en.wikipedia.org/wiki/Newton%27s_method)
38-
* [4] [https://developer.mozilla.org/en/JavaScript_typed_arrays](https://developer.mozilla.org/en/JavaScript_typed_arrays)
39-
* [5] [http://en.wikipedia.org/wiki/Fast_inverse_square_root](http://en.wikipedia.org/wiki/Fast_inverse_square_root)
34+
References:
35+
1. [ftp://ftp.idsoftware.com/idstuff/source/quake3-1.32b-source.zip](ftp://ftp.idsoftware.com/idstuff/source/quake3-1.32b-source.zip)
36+
2. [http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf](http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf)
37+
3. [http://en.wikipedia.org/wiki/Newton%27s_method](http://en.wikipedia.org/wiki/Newton%27s_method)
38+
4. [https://developer.mozilla.org/en/JavaScript_typed_arrays](https://developer.mozilla.org/en/JavaScript_typed_arrays)
39+
5. [http://en.wikipedia.org/wiki/Fast_inverse_square_root](http://en.wikipedia.org/wiki/Fast_inverse_square_root)
40+
41+
[1]: ftp://ftp.idsoftware.com/idstuff/source/quake3-1.32b-source.zip "ftp://ftp.idsoftware.com/idstuff/source/quake3-1.32b-source.zip"
42+
[2]: http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf "http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf"
43+
[3]: http://en.wikipedia.org/wiki/Newton%27s_method "http://en.wikipedia.org/wiki/Newton%27s_method"
44+
[4]: https://developer.mozilla.org/en/JavaScript_typed_arrays "https://developer.mozilla.org/en/JavaScript_typed_arrays"
45+
[5]: http://en.wikipedia.org/wiki/Fast_inverse_square_root "http://en.wikipedia.org/wiki/Fast_inverse_square_root"
4046

4147
This code is in gist form here:
4248
[https://gist.github.com/1036533](https://gist.github.com/1036533)
@@ -50,7 +56,7 @@ Author: Jason Giedymin <jasong _a_t_ apache -dot- org>
5056

5157
Appearing in the Quake III Arena source code[1], this strange algorithm uses
5258
integer operations along with a 'magic number' to calculate floating point
53-
approximation values of inverse square roots.
59+
approximation values of inverse square roots[5].
5460

5561
In this CoffeeScript variant I supply the original classic, and newer optimal
5662
32 bit magic numbers found by Chris Lomont[2]. Also supplied is the 64-bit
@@ -76,6 +82,7 @@ References:
7682
[2] http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf
7783
[3] http://en.wikipedia.org/wiki/Newton%27s_method
7884
[4] https://developer.mozilla.org/en/JavaScript_typed_arrays
85+
[5] http://en.wikipedia.org/wiki/Fast_inverse_square_root
7986

8087
###
8188

0 commit comments

Comments
 (0)