Skip to content

wblangdon/gi_invsqrt

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

gi_invsqrt

Reciprocal square root

The evolved code is accurate to double precision

C Code derived from:

W. B. Langdon. Genetic Improvement of Data gives double precision invsqrt. In 7th edition of GI @ GECCO Companion 2019, pages 1709-1714, Prague, Czech Republic, 2019. ACM http://www.cs.ucl.ac.uk/staff/W.Langdon/ftp/papers/langdon_2019_GI7.pdf https://doi.org/10.1145/3319619.3326800

GGGP project at http://www.cs.ucl.ac.uk/staff/W.Langdon/gggp

Based on gi_cbrt.tar.gz README.txt 12 March 2020 gi_cbrt.tar.gz contains full results and code for several functions: only invsqrt is included here

Compiling


gcc -c invsqrt.c

to compile example:

gcc -c main.c; gcc invsqrt.o main.o -lm


Testing
~~~~~~~
./a.out 4
0.5 = invsqrt(4)

About

evolved C code for reciprocol of square root (replaces divide by sqrt with multiply invsqrt)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages