10 Stuff That Doesn’t Belong Anywhere Else
(require math/utils) | package: math-lib |
10.1 Parallelization
parameter
(max-math-threads num) → void? num : Positive-Integer
10.2 Discrete Fourier Transform Conventions
parameter
(dft-convention) → (List Real Real)
(dft-convention lst) → void? lst : (List Real Real)
See Mathematica’s documentation on Fourier, from which this excellent idea was stolen.
procedure
(dft-inverse-convention) → (List Real Real)
10.3 Floating-Point Compliance Testing
In each test, a function is applied to some carefully chosen values, as well as n additional random values. Its corresponding bigfloat function is applied to the same values, and the answers are compared. Each test returns a list of failures, which are appended and returned.
The threshold for reporting unexpected inaccuracy depends on the function tested. All the arithmetic and irrational functions exported by racket/flonum, for example, must have no more than 0.5 ulps error in order to be compliant.
(list 'not-fl2? x y)
Tests of functions that operate on and return flonum expansions are the strictest tests, requiring hardware arithmetic to be perfectly IEEE 754 compliant. They reliably fail on seemingly innocuous noncompliant behavior, such as computing intermediate results with 80-bit precision.
parameter
(print-fp-test-progress? print?) → void? print? : Boolean