This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Public Domain under http://unlicense.org, see link for details. | |
| // except: | |
| // * core-math function `cr_cbrtf` (see license below) | |
| // * musl flavored fdlib function `fdlibm_cbrtf` (see license below) | |
| // code and test driver for cube root and it's reciprocal based on: | |
| // "Fast Calculation of Cube and Inverse Cube Roots Using | |
| // a Magic Constant and Its Implementation on Microcontrollers" | |
| // Moroz, Samotyy, Walczyk, Cieslinski, 2021 | |
| // (PDF: https://www.mdpi.com/1996-1073/14/4/1058) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl6 | |
| use v6; | |
| use Stats; | |
| #Tim's original times: | |
| #primes-inline-loop(1000) ran in 2.425 seconds (σ = 0.213 seconds). | |
| #primes-inline-loop-upto-sqrt(1000) ran in 2.311 seconds (σ = 0.131 seconds). | |
| #primes-inline-loop-upto-int-sqrt(1000) ran in 2.274 seconds (σ = 0.161). | |
| sub bench($name, &code) { |