// the find
jph00/BaseMath
Basic math functions for float and double in Swift
A Swift library that adds vectorized math operations to arrays of floats and doubles by going through raw pointers rather than Swift's value-type machinery. It's a building block for numerical computing in Swift, notably used by SwiftyMKL as a lower-level foundation. Aimed at Swift developers doing ML or signal processing work who need more than stdlib offers.
The 3-5x speedup claim is credible — bypassing copy-on-write checking and using pointer arithmetic genuinely does avoid overhead Swift can't elide. The GYB (Generate Your Boilerplate) templating approach is the right call for this kind of repetitive math binding; it keeps the actual source manageable. The in-place (`_` suffix) and reduction (`sum` prefix) naming convention is consistent and easy to remember once you've seen it once. AlignedStorage as an explicit alternative to Array is a thoughtful escape hatch for users who want predictable memory layout without CoW surprises.
Last commit was May 2019 — seven years ago. Swift has changed substantially (Swift 5.9+ actors, typed throws, borrowing/consuming ownership) and this predates all of it; whether it even compiles cleanly on a modern Swift toolchain is an open question. The README flags that tests won't run on Mac due to XCTest/Objective-C issues, which is a significant red flag for a library that bypasses safety checks around memory — you want tests to run where you deploy. No SIMD intrinsics or Accelerate framework usage; Apple's own vDSP would likely outperform this on ARM Mac hardware, making the performance story weaker for the primary Swift platform today. The article linked for implementation details is still marked TBA after seven years.