# Benchmarks

Source: https://sh4zam.com/benchmarks/

> SH4ZAM v0.11.0 cycle counts on a real Dreamcast, against newlib, cglm, raymath, std::complex and plain C for every benchmarked routine

Every number on this page was measured on a physical Dreamcast with the SH4 performance counters, using SH4ZAM v0.11.0's own test scenario. Each SH4ZAM routine runs back-to-back, in the same test case, against the C code it replaces: newlib's libm, [cglm](https://github.com/recp/cglm), raymath, `std::complex`, KallistiOS, or a plain C loop.

The build used **GCC 15.2.0** with a stock KallistiOS `environ.sh` (no `-ffast-math`, LTO or `-mlra`) and SH4ZAM's default CMake Release configuration, which compiles SH4ZAM and the references with `-O3 -m4-single -ml -mfsrra -mfsca`. Speedup is reference cycles ÷ SH4ZAM cycles, so higher is better. **Cached** runs each call with warm caches; **uncached** flushes the instruction and operand caches before each call. Each cell gives the speedup, then SH4ZAM's cycles vs the reference's. Bold means at least 1.05× faster.

| | |
|---|--:|
| Benchmarks | 429 |
| Routines | 386 |
| Faster than the reference (cached or uncached) | 369 |
| Geometric mean speedup, cached | 3.33× |
| Geometric mean speedup, uncached | 3.73× |

Numbers are updated for every release. Accuracy and preconditions differ between routines, and some are fast approximations: check a routine's API page before swapping it in.

## Scalar

Geometric mean: 2.05× cached, 2.66× uncached.

| Routine | Reference | Cached | Uncached |
|---|---|--:|--:|
| [`shz_pow2f()`](https://sh4zam.com/api/scalar/shz_pow2f/) | `exp2f` | **21.72×**<br/>25 vs 543 cc | **33.15×**<br/>46 vs 1525 cc |
| [`shz_pow10f()`](https://sh4zam.com/api/scalar/shz_pow10f/) | `powf(10.0f, x)` | **15.94×**<br/>31 vs 494 cc | **26.30×**<br/>60 vs 1578 cc |
| [`shz_powf()`](https://sh4zam.com/api/scalar/shz_powf/) | `powf` | **15.63×**<br/>35 vs 547 cc | **24.08×**<br/>62 vs 1493 cc |
| [`shz_log2f()`](https://sh4zam.com/api/scalar/shz_log2f/) | `log2f` | **11.93×**<br/>15 vs 179 cc | **24.87×**<br/>30 vs 746 cc |
| [`shz_log10f()`](https://sh4zam.com/api/scalar/shz_log10f/) | `log10f` | **11.50×**<br/>18 vs 207 cc | **22.21×**<br/>33 vs 733 cc |
| [`shz_hypotf()`](https://sh4zam.com/api/scalar/shz_hypotf/) | `hypotf` | **10.17×**<br/>36 vs 366 cc | **11.40×**<br/>72 vs 821 cc |
| [`shz_logf()`](https://sh4zam.com/api/scalar/shz_logf/) | `logf` | **8.83×**<br/>18 vs 159 cc | **20.30×**<br/>33 vs 670 cc |
| [`shz_hypotf()`](https://sh4zam.com/api/scalar/shz_hypotf/) \|x\| + \|y\| > 2^62 | `hypotf` | **8.64×**<br/>50 vs 432 cc | **7.97×**<br/>118 vs 941 cc |
| [`shz_expf()`](https://sh4zam.com/api/scalar/shz_expf/) | `expf` | **5.93×**<br/>28 vs 166 cc | **9.92×**<br/>51 vs 506 cc |
| [`shz_fminf()`](https://sh4zam.com/api/scalar/shz_fminf/) | `fminf` | **5.54×**<br/>13 vs 72 cc | **6.71×**<br/>31 vs 208 cc |
| [`shz_fmaxf()`](https://sh4zam.com/api/scalar/shz_fmaxf/) | `fmaxf` | **5.46×**<br/>13 vs 71 cc | **7.32×**<br/>31 vs 227 cc |
| [`shz_fdimf()`](https://sh4zam.com/api/scalar/shz_fdimf/) | `fdimf` | **4.80×**<br/>15 vs 72 cc | **4.77×**<br/>48 vs 229 cc |
| [`shz_remainderf()`](https://sh4zam.com/api/scalar/shz_remainderf/) | `remainderf` | **4.78×**<br/>60 vs 287 cc | **4.97×**<br/>144 vs 716 cc |
| [`shz_sqrtf_fsrra()`](https://sh4zam.com/api/scalar/shz_sqrtf_fsrra/) ×4 | `sqrtf x4` | **4.33×**<br/>39 vs 169 cc | **5.39×**<br/>69 vs 372 cc |
| [`shz_log1pf()`](https://sh4zam.com/api/scalar/shz_log1pf/) | `log1pf` | **4.21×**<br/>34 vs 143 cc | **6.61×**<br/>62 vs 410 cc |
| [`shz_inv_sqrtf_fsrra()`](https://sh4zam.com/api/scalar/shz_inv_sqrtf_fsrra/) | `1.0f / sqrtf` | **4.07×**<br/>15 vs 61 cc | **7.80×**<br/>30 vs 234 cc |
| [`shz_expm1f()`](https://sh4zam.com/api/scalar/shz_expm1f/) \|x\| < 0.1 | `expm1f` | **4.04×**<br/>23 vs 93 cc | **3.97×**<br/>74 vs 294 cc |
| [`shz_ldexpf()`](https://sh4zam.com/api/scalar/shz_ldexpf/) | `ldexpf` | **4.04×**<br/>26 vs 105 cc | **7.08×**<br/>49 vs 347 cc |
| [`shz_expm1f()`](https://sh4zam.com/api/scalar/shz_expm1f/) | `expm1f` | **3.91×**<br/>34 vs 133 cc | **6.73×**<br/>62 vs 417 cc |
| [`shz_equalf_rel()`](https://sh4zam.com/api/scalar/shz_equalf_rel/) | `fabsf(a - b) < eps * max` | **3.86×**<br/>21 vs 81 cc | **5.80×**<br/>45 vs 261 cc |
| [`shz_inv_sqrtf()`](https://sh4zam.com/api/scalar/shz_inv_sqrtf/) | `1.0f / sqrtf` | **3.59×**<br/>17 vs 61 cc | **7.31×**<br/>32 vs 234 cc |
| [`shz_equalf()`](https://sh4zam.com/api/scalar/shz_equalf/) | `fabsf(a - b) < eps \|\| rel` | **3.22×**<br/>27 vs 87 cc | **5.13×**<br/>52 vs 267 cc |
| [`shz_remainderf()`](https://sh4zam.com/api/scalar/shz_remainderf/) \|q\| >= 4096 | `remainderf` | **2.71×**<br/>189 vs 513 cc | **2.42×**<br/>406 vs 982 cc |
| [`shz_sqrtf()`](https://sh4zam.com/api/scalar/shz_sqrtf/) | `sqrtf` | **2.58×**<br/>19 vs 49 cc | **6.06×**<br/>34 vs 206 cc |
| [`shz_sqrtf_fsrra()`](https://sh4zam.com/api/scalar/shz_sqrtf_fsrra/) | `sqrtf` | **2.45×**<br/>20 vs 49 cc | **5.89×**<br/>35 vs 206 cc |
| [`shz_sqrtf_fsrra_safe()`](https://sh4zam.com/api/scalar/shz_sqrtf_fsrra_safe/) | `sqrtf` | **2.45×**<br/>20 vs 49 cc | **5.89×**<br/>35 vs 206 cc |
| [`shz_truncf()`](https://sh4zam.com/api/scalar/shz_truncf/) \|x\| >= 2^23 | `truncf` | **2.21×**<br/>14 vs 31 cc | **3.61×**<br/>31 vs 112 cc |
| [`shz_randf()`](https://sh4zam.com/api/scalar/shz_randf/) | `rand() / RAND_MAX` | **2.13×**<br/>23 vs 49 cc | **4.66×**<br/>50 vs 233 cc |
| [`shz_randf_range()`](https://sh4zam.com/api/scalar/shz_randf_range/) | `min + (max - min) * rand() / RAND_MAX` | **2.12×**<br/>26 vs 55 cc | **4.28×**<br/>54 vs 231 cc |
| [`shz_logbf()`](https://sh4zam.com/api/scalar/shz_logbf/) | `logbf` | **2.00×**<br/>16 vs 32 cc | **4.32×**<br/>31 vs 134 cc |
| [`shz_fmodf()`](https://sh4zam.com/api/scalar/shz_fmodf/) | `fmodf` | **1.96×**<br/>53 vs 104 cc | **3.64×**<br/>112 vs 408 cc |
| [`shz_fmodf()`](https://sh4zam.com/api/scalar/shz_fmodf/) \|q\| >= 4096 | `fmodf` | **1.91×**<br/>166 vs 317 cc | **1.94×**<br/>323 vs 628 cc |
| [`shz_truncf()`](https://sh4zam.com/api/scalar/shz_truncf/) | `truncf` | **1.84×**<br/>19 vs 35 cc | **3.29×**<br/>34 vs 112 cc |
| [`shz_scalbnf()`](https://sh4zam.com/api/scalar/shz_scalbnf/) | `scalbnf` | **1.81×**<br/>26 vs 47 cc | **3.63×**<br/>49 vs 178 cc |
| [`shz_floorf()`](https://sh4zam.com/api/scalar/shz_floorf/) | `floorf` | **1.79×**<br/>24 vs 43 cc | **3.48×**<br/>46 vs 160 cc |
| [`shz_erff()`](https://sh4zam.com/api/scalar/shz_erff/) | `erff` | **1.77×**<br/>56 vs 99 cc | **2.63×**<br/>108 vs 284 cc |
| [`shz_fractf()`](https://sh4zam.com/api/scalar/shz_fractf/) | `x - floorf(x)` | **1.69×**<br/>29 vs 49 cc | **2.86×**<br/>51 vs 146 cc |
| [`shz_ceilf()`](https://sh4zam.com/api/scalar/shz_ceilf/) | `ceilf` | **1.52×**<br/>23 vs 35 cc | **3.13×**<br/>46 vs 144 cc |
| [`shz_cbrtf()`](https://sh4zam.com/api/scalar/shz_cbrtf/) | `cbrtf` | **1.45×**<br/>73 vs 106 cc | **1.84×**<br/>129 vs 238 cc |
| [`shz_cbrtf()`](https://sh4zam.com/api/scalar/shz_cbrtf/) \|x\| >= 2^126 | `cbrtf` | **1.45×**<br/>73 vs 106 cc | **1.84×**<br/>129 vs 238 cc |
| [`shz_cbrtf()`](https://sh4zam.com/api/scalar/shz_cbrtf/) \|x\| < 2^-110 | `cbrtf` | **1.45×**<br/>73 vs 106 cc | **1.84×**<br/>129 vs 238 cc |
| [`shz_remquof()`](https://sh4zam.com/api/scalar/shz_remquof/) | `remquof` | **1.34×**<br/>102 vs 137 cc | **1.96×**<br/>268 vs 526 cc |
| [`shz_invf_fsrra()`](https://sh4zam.com/api/scalar/shz_invf_fsrra/) | `1.0f / x` | **1.18×**<br/>17 vs 20 cc | **1.09×**<br/>32 vs 35 cc |
| [`shz_signf()`](https://sh4zam.com/api/scalar/shz_signf/) | `glm_signf` | **1.13×**<br/>15 vs 17 cc | **1.07×**<br/>30 vs 32 cc |
| [`shz_invf()`](https://sh4zam.com/api/scalar/shz_invf/) | `1.0f / x` | **1.11×**<br/>18 vs 20 cc | **1.06×**<br/>33 vs 35 cc |
| [`shz_powif()`](https://sh4zam.com/api/scalar/shz_powif/) | `__builtin_powif` | **1.11×**<br/>37 vs 41 cc | **1.60×**<br/>73 vs 117 cc |
| [`shz_divf_fsrra()`](https://sh4zam.com/api/scalar/shz_divf_fsrra/) | `num / denom` | **1.05×**<br/>20 vs 21 cc | 1.03×<br/>36 vs 37 cc |
| [`shz_normalizef_fsrra()`](https://sh4zam.com/api/scalar/shz_normalizef_fsrra/) | `raymath Normalize` | 1.04×<br/>24 vs 25 cc | **1.07×**<br/>41 vs 44 cc |
| [`shz_remapf_fsrra()`](https://sh4zam.com/api/scalar/shz_remapf_fsrra/) | `raymath Remap` | 1.03×<br/>29 vs 30 cc | 1.02×<br/>47 vs 48 cc |
| [`shz_roundf()`](https://sh4zam.com/api/scalar/shz_roundf/) | `roundf` | 1.03×<br/>39 vs 40 cc | **1.24×**<br/>92 vs 114 cc |
| [`shz_quadratic_roots()`](https://sh4zam.com/api/scalar/shz_quadratic_roots/) | `quadratic formula` | 1.02×<br/>56 vs 57 cc | 0.96×<br/>108 vs 104 cc |
| [`shz_wrapf_fsrra()`](https://sh4zam.com/api/scalar/shz_wrapf_fsrra/) | `raymath Wrap` | 1.00×<br/>61 vs 61 cc | **1.71×**<br/>113 vs 193 cc |
| [`shz_divf()`](https://sh4zam.com/api/scalar/shz_divf/) +denom | `num / denom` | 1.00×<br/>21 vs 21 cc | 1.03×<br/>36 vs 37 cc |
| [`shz_equalf_abs()`](https://sh4zam.com/api/scalar/shz_equalf_abs/) | `fabsf(a - b) < eps` | 1.00×<br/>16 vs 16 cc | 1.00×<br/>32 vs 32 cc |
| [`shz_clampf()`](https://sh4zam.com/api/scalar/shz_clampf/) | `glm_clamp` | 1.00×<br/>16 vs 16 cc | 1.00×<br/>35 vs 35 cc |
| [`shz_saturatef()`](https://sh4zam.com/api/scalar/shz_saturatef/) | `glm_clamp_zo` | 1.00×<br/>15 vs 15 cc | 1.00×<br/>30 vs 30 cc |
| [`shz_fabsf()`](https://sh4zam.com/api/scalar/shz_fabsf/) | `fabsf` | 1.00×<br/>10 vs 10 cc | 1.00×<br/>30 vs 30 cc |
| [`shz_copysignf()`](https://sh4zam.com/api/scalar/shz_copysignf/) | `copysignf` | 1.00×<br/>13 vs 13 cc | 1.00×<br/>30 vs 30 cc |
| [`shz_fmaf()`](https://sh4zam.com/api/scalar/shz_fmaf/) | `fmaf` | 1.00×<br/>13 vs 13 cc | 1.00×<br/>35 vs 35 cc |
| [`shz_lerpf()`](https://sh4zam.com/api/scalar/shz_lerpf/) | `glm_lerp` | 1.00×<br/>15 vs 15 cc | 1.00×<br/>37 vs 37 cc |
| [`shz_stepf()`](https://sh4zam.com/api/scalar/shz_stepf/) | `glm_step` | 1.00×<br/>13 vs 13 cc | 1.00×<br/>31 vs 31 cc |
| [`shz_dot8f()`](https://sh4zam.com/api/scalar/shz_dot8f/) | `x1 * x2 + y1 * y2 + z1 * z2 + w1 * w2` | 1.00×<br/>22 vs 22 cc | 1.00×<br/>89 vs 89 cc |
| [`shz_mag_sqr4f()`](https://sh4zam.com/api/scalar/shz_mag_sqr4f/) | `x * x + y * y + z * z + w * w` | 1.00×<br/>20 vs 20 cc | 1.00×<br/>41 vs 41 cc |
| [`shz_remapf()`](https://sh4zam.com/api/scalar/shz_remapf/) | `raymath Remap` | 1.00×<br/>30 vs 30 cc | 0.77×<br/>62 vs 48 cc |
| [`shz_normalizef()`](https://sh4zam.com/api/scalar/shz_normalizef/) | `raymath Normalize` | 1.00×<br/>25 vs 25 cc | 0.76×<br/>58 vs 44 cc |
| [`shz_roundf()`](https://sh4zam.com/api/scalar/shz_roundf/) \|x\| >= 2^23 | `roundf` | 0.97×<br/>33 vs 32 cc | 0.98×<br/>115 vs 113 cc |
| [`shz_divf()`](https://sh4zam.com/api/scalar/shz_divf/) -denom | `num / denom` | 0.95×<br/>22 vs 21 cc | 0.77×<br/>48 vs 37 cc |
| [`shz_invf()`](https://sh4zam.com/api/scalar/shz_invf/) | `1.0f / x` | 0.95×<br/>21 vs 20 cc | 0.76×<br/>46 vs 35 cc |
| [`shz_smoothstepf_safe()`](https://sh4zam.com/api/scalar/shz_smoothstepf_safe/) | `glm_smoothstep` | 0.93×<br/>42 vs 39 cc | 0.70×<br/>84 vs 59 cc |
| [`shz_barycentric_lerpf()`](https://sh4zam.com/api/scalar/shz_barycentric_lerpf/) | `a * w + b * u + c * v` | 0.88×<br/>26 vs 23 cc | 0.83×<br/>48 vs 40 cc |
| [`shz_wrapf()`](https://sh4zam.com/api/scalar/shz_wrapf/) | `raymath Wrap` | 0.87×<br/>70 vs 61 cc | **1.37×**<br/>141 vs 193 cc |
| [`shz_dot6f()`](https://sh4zam.com/api/scalar/shz_dot6f/) | `x1 * x2 + y1 * y2 + z1 * z2` | 0.87×<br/>23 vs 20 cc | 0.93×<br/>42 vs 39 cc |
| [`shz_mag_sqr3f()`](https://sh4zam.com/api/scalar/shz_mag_sqr3f/) | `x * x + y * y + z * z` | 0.85×<br/>20 vs 17 cc | 0.92×<br/>39 vs 36 cc |
| [`shz_smoothstepf()`](https://sh4zam.com/api/scalar/shz_smoothstepf/) | `glm_smoothstep` | 0.80×<br/>49 vs 39 cc | 0.69×<br/>86 vs 59 cc |

## Trigonometry

Geometric mean: 6.00× cached, 9.58× uncached.

| Routine | Reference | Cached | Uncached |
|---|---|--:|--:|
| [`shz_asinhf()`](https://sh4zam.com/api/trig/shz_asinhf/) | `asinhf` | **15.52×**<br/>33 vs 512 cc | **20.83×**<br/>54 vs 1125 cc |
| [`shz_acoshf()`](https://sh4zam.com/api/trig/shz_acoshf/) | `acoshf` | **15.44×**<br/>34 vs 525 cc | **26.73×**<br/>49 vs 1310 cc |
| [`shz_asechf()`](https://sh4zam.com/api/trig/shz_asechf/) | `acoshf(1.0f / x)` | **12.71×**<br/>42 vs 534 cc | **20.09×**<br/>65 vs 1306 cc |
| [`shz_acosf()`](https://sh4zam.com/api/trig/shz_acosf/) \|x\| < 1 | `acosf` | **11.54×**<br/>41 vs 473 cc | **13.00×**<br/>88 vs 1144 cc |
| [`shz_acschf()`](https://sh4zam.com/api/trig/shz_acschf/) | `asinhf(1.0f / x)` | **10.91×**<br/>44 vs 480 cc | **16.98×**<br/>64 vs 1087 cc |
| [`shz_acothf()`](https://sh4zam.com/api/trig/shz_acothf/) | `atanhf(1.0f / x)` | **7.25×**<br/>36 vs 261 cc | **14.12×**<br/>60 vs 847 cc |
| [`shz_atanhf()`](https://sh4zam.com/api/trig/shz_atanhf/) | `atanhf` | **7.08×**<br/>36 vs 255 cc | **12.46×**<br/>68 vs 847 cc |
| [`shz_sinf()`](https://sh4zam.com/api/trig/shz_sinf/) | `sinf` | **6.70×**<br/>23 vs 154 cc | **16.24×**<br/>38 vs 617 cc |
| [`shz_cosf()`](https://sh4zam.com/api/trig/shz_cosf/) | `cosf` | **6.58×**<br/>24 vs 158 cc | **13.51×**<br/>39 vs 527 cc |
| [`shz_tgammaf()`](https://sh4zam.com/api/trig/shz_tgammaf/) | `tgammaf` | **5.59×**<br/>115 vs 643 cc | **7.37×**<br/>220 vs 1622 cc |
| [`shz_asinf()`](https://sh4zam.com/api/trig/shz_asinf/) | `asinf` | **5.29×**<br/>24 vs 127 cc | **5.13×**<br/>120 vs 616 cc |
| [`shz_tgammaf()`](https://sh4zam.com/api/trig/shz_tgammaf/) x < 0 | `tgammaf` | **5.19×**<br/>174 vs 903 cc | **6.58×**<br/>381 vs 2508 cc |
| [`shz_sinhf()`](https://sh4zam.com/api/trig/shz_sinhf/) | `sinhf` | **5.17×**<br/>46 vs 238 cc | **10.28×**<br/>82 vs 843 cc |
| [`shz_coshf()`](https://sh4zam.com/api/trig/shz_coshf/) | `coshf` | **5.11×**<br/>46 vs 235 cc | **9.90×**<br/>82 vs 812 cc |
| [`shz_sechf()`](https://sh4zam.com/api/trig/shz_sechf/) | `1.0f / coshf` | **4.49×**<br/>55 vs 247 cc | **9.47×**<br/>87 vs 824 cc |
| [`shz_atan2f()`](https://sh4zam.com/api/trig/shz_atan2f/) | `atan2f` | **4.37×**<br/>51 vs 223 cc | **9.21×**<br/>90 vs 829 cc |
| [`shz_cschf()`](https://sh4zam.com/api/trig/shz_cschf/) | `1.0f / sinhf` | **4.37×**<br/>57 vs 249 cc | **6.83×**<br/>126 vs 861 cc |
| [`shz_cothf()`](https://sh4zam.com/api/trig/shz_cothf/) | `1.0f / tanhf` | **4.26×**<br/>57 vs 243 cc | **5.49×**<br/>130 vs 714 cc |
| [`shz_tanhf()`](https://sh4zam.com/api/trig/shz_tanhf/) | `tanhf` | **4.20×**<br/>55 vs 231 cc | **7.63×**<br/>92 vs 702 cc |
| [`shz_lgammaf()`](https://sh4zam.com/api/trig/shz_lgammaf/) x < 0 | `lgammaf` | **4.07×**<br/>123 vs 500 cc | **6.94×**<br/>264 vs 1831 cc |
| [`shz_atanf()`](https://sh4zam.com/api/trig/shz_atanf/) | `atanf` | **4.00×**<br/>36 vs 144 cc | **3.64×**<br/>122 vs 444 cc |
| [`shz_asinf()`](https://sh4zam.com/api/trig/shz_asinf/) \|x\| < 1 | `asinf` | **3.95×**<br/>41 vs 162 cc | **6.83×**<br/>82 vs 560 cc |
| [`shz_acosf()`](https://sh4zam.com/api/trig/shz_acosf/) | `acosf` | **3.86×**<br/>29 vs 112 cc | **5.06×**<br/>124 vs 628 cc |
| [`shz_lgammaf()`](https://sh4zam.com/api/trig/shz_lgammaf/) | `lgammaf` | **3.53×**<br/>87 vs 307 cc | **6.74×**<br/>160 vs 1079 cc |

## Vector

Geometric mean: 2.13× cached, 1.84× uncached.

| Routine | Reference | Cached | Uncached |
|---|---|--:|--:|
| [`shz_vec3_rotate_xyz()`](https://sh4zam.com/api/vector/shz_vec3_rotate_xyz/) | `glm_euler_xyz + glm_vec3_rotate_m4` | **19.48×**<br/>67 vs 1305 cc | **13.70×**<br/>179 vs 2453 cc |
| [`shz_vec3_rotate_zyx()`](https://sh4zam.com/api/vector/shz_vec3_rotate_zyx/) | `glm_euler_zyx + glm_vec3_rotate_m4` | **16.68×**<br/>66 vs 1101 cc | **12.92×**<br/>179 vs 2313 cc |
| [`shz_vec3_rotate_zyx_u16()`](https://sh4zam.com/api/vector/shz_vec3_rotate_zyx_u16/) | `glm_euler_zyx + glm_vec3_rotate_m4` | **16.66×**<br/>65 vs 1083 cc | **13.70×**<br/>161 vs 2205 cc |
| [`shz_vec3_rotate_yxz_u16()`](https://sh4zam.com/api/vector/shz_vec3_rotate_yxz_u16/) | `glm_euler_yxz + glm_vec3_rotate_m4` | **16.25×**<br/>68 vs 1105 cc | **13.81×**<br/>161 vs 2223 cc |
| [`shz_vec3_rotate_zxy_u16()`](https://sh4zam.com/api/vector/shz_vec3_rotate_zxy_u16/) | `glm_euler_zxy + glm_vec3_rotate_m4` | **16.19×**<br/>67 vs 1085 cc | **13.42×**<br/>165 vs 2215 cc |
| [`shz_vec3_rotate_xyz_u16()`](https://sh4zam.com/api/vector/shz_vec3_rotate_xyz_u16/) | `glm_euler_xyz + glm_vec3_rotate_m4` | **15.90×**<br/>68 vs 1081 cc | **13.31×**<br/>167 vs 2223 cc |
| [`shz_vec3_rotate_yxz()`](https://sh4zam.com/api/vector/shz_vec3_rotate_yxz/) | `glm_euler_yxz + glm_vec3_rotate_m4` | **14.83×**<br/>66 vs 979 cc | **11.78×**<br/>185 vs 2179 cc |
| [`shz_vec3_rotate_zxy()`](https://sh4zam.com/api/vector/shz_vec3_rotate_zxy/) | `glm_euler_zxy + glm_vec3_rotate_m4` | **13.96×**<br/>68 vs 949 cc | **11.69×**<br/>179 vs 2093 cc |
| [`shz_vec3_rotate_y()`](https://sh4zam.com/api/vector/shz_vec3_rotate_y/) | `glm_vec3_rotate` | **12.21×**<br/>34 vs 415 cc | **12.44×**<br/>107 vs 1331 cc |
| [`shz_vec3_rotate_x_u16()`](https://sh4zam.com/api/vector/shz_vec3_rotate_x_u16/) | `glm_vec3_rotate` | **10.23×**<br/>31 vs 317 cc | **7.81×**<br/>133 vs 1039 cc |
| [`shz_vec2_rotate_u16()`](https://sh4zam.com/api/vector/shz_vec2_rotate_u16/) | `glm_vec2_rotate` | **10.17×**<br/>29 vs 295 cc | **8.88×**<br/>114 vs 1012 cc |
| [`shz_vec3_rotate_y_u16()`](https://sh4zam.com/api/vector/shz_vec3_rotate_y_u16/) | `glm_vec3_rotate` | **9.97×**<br/>32 vs 319 cc | **7.72×**<br/>137 vs 1057 cc |
| [`shz_vec3_rotate_z_u16()`](https://sh4zam.com/api/vector/shz_vec3_rotate_z_u16/) | `glm_vec3_rotate` | **9.94×**<br/>32 vs 318 cc | **7.61×**<br/>137 vs 1043 cc |
| [`shz_vec2_rotate()`](https://sh4zam.com/api/vector/shz_vec2_rotate/) | `glm_vec2_rotate` | **9.87×**<br/>30 vs 296 cc | **16.44×**<br/>61 vs 1003 cc |
| [`shz_vec3_rotate_x()`](https://sh4zam.com/api/vector/shz_vec3_rotate_x/) | `glm_vec3_rotate` | **9.61×**<br/>33 vs 317 cc | **10.01×**<br/>103 vs 1031 cc |
| [`shz_vec3_rotate_z()`](https://sh4zam.com/api/vector/shz_vec3_rotate_z/) | `glm_vec3_rotate` | **9.38×**<br/>34 vs 319 cc | **10.31×**<br/>105 vs 1083 cc |
| [`shz_vec3_rotate_dir_u16()`](https://sh4zam.com/api/vector/shz_vec3_rotate_dir_u16/) | `glm_vec3_rotate` | **6.67×**<br/>55 vs 367 cc | **6.23×**<br/>181 vs 1127 cc |
| [`shz_vec3_rotate_dir()`](https://sh4zam.com/api/vector/shz_vec3_rotate_dir/) | `glm_vec3_rotate` | **6.57×**<br/>56 vs 368 cc | **6.71×**<br/>175 vs 1175 cc |
| [`shz_vec3_rotate()`](https://sh4zam.com/api/vector/shz_vec3_rotate/) | `glm_vec3_rotate` | **5.24×**<br/>70 vs 367 cc | **6.14×**<br/>180 vs 1105 cc |
| [`shz_vec3_rotate_u16()`](https://sh4zam.com/api/vector/shz_vec3_rotate_u16/) | `glm_vec3_rotate` | **5.03×**<br/>73 vs 367 cc | **5.28×**<br/>213 vs 1125 cc |
| [`shz_vec4_sqrtf_fsrra()`](https://sh4zam.com/api/vector/shz_vec4_sqrtf_fsrra/) | `sqrtf x4` | **4.84×**<br/>32 vs 155 cc | **4.56×**<br/>78 vs 356 cc |
| [`shz_vec4_sqrtf()`](https://sh4zam.com/api/vector/shz_vec4_sqrtf/) | `sqrtf x4` | **4.19×**<br/>37 vs 155 cc | **3.83×**<br/>93 vs 356 cc |
| [`shz_vec2_sqrtf_fsrra()`](https://sh4zam.com/api/vector/shz_vec2_sqrtf_fsrra/) | `sqrtf x2` | **3.95×**<br/>21 vs 83 cc | **6.47×**<br/>38 vs 246 cc |
| [`shz_vec2_sqrtf()`](https://sh4zam.com/api/vector/shz_vec2_sqrtf/) | `sqrtf x2` | **3.95×**<br/>21 vs 83 cc | **5.35×**<br/>46 vs 246 cc |
| [`shz_vec3_sqrtf()`](https://sh4zam.com/api/vector/shz_vec3_sqrtf/) | `sqrtf x3` | **3.61×**<br/>31 vs 112 cc | **5.92×**<br/>51 vs 302 cc |
| [`shz_vec3_sqrtf_fsrra()`](https://sh4zam.com/api/vector/shz_vec3_sqrtf_fsrra/) | `sqrtf x3` | **3.61×**<br/>31 vs 112 cc | **5.58×**<br/>52 vs 290 cc |
| [`shz_vec2_half_angle()`](https://sh4zam.com/api/vector/shz_vec2_half_angle/) | `glm_vec2_normalize_to + glm_vec2_add + glm_vec2_normalize` | **2.41×**<br/>49 vs 118 cc | **2.06×**<br/>80 vs 165 cc |
| [`shz_vec2_normalize()`](https://sh4zam.com/api/vector/shz_vec2_normalize/) | `glm_vec2_normalize_to` | **2.00×**<br/>24 vs 48 cc | **1.20×**<br/>55 vs 66 cc |
| [`shz_vec4_divf()`](https://sh4zam.com/api/vector/shz_vec4_divf/) | `v / s` | **1.89×**<br/>28 vs 53 cc | **1.36×**<br/>72 vs 98 cc |
| [`shz_vec4_inv_fsrra()`](https://sh4zam.com/api/vector/shz_vec4_inv_fsrra/) | `glm_vec4_div(1, v)` | **1.85×**<br/>27 vs 50 cc | **1.12×**<br/>59 vs 66 cc |
| [`shz_vec2_magnitude_inv_fsrra()`](https://sh4zam.com/api/vector/shz_vec2_magnitude_inv_fsrra/) | `1.0f / glm_vec2_norm` | **1.85×**<br/>20 vs 37 cc | **1.47×**<br/>36 vs 53 cc |
| [`shz_vec4_normalize()`](https://sh4zam.com/api/vector/shz_vec4_normalize/) | `glm_vec4_normalize_to` | **1.78×**<br/>32 vs 57 cc | **1.47×**<br/>59 vs 87 cc |
| [`shz_vec2_move()`](https://sh4zam.com/api/vector/shz_vec2_move/) | `raymath Vector2MoveTowards` | **1.77×**<br/>40 vs 71 cc | **1.18×**<br/>88 vs 104 cc |
| [`shz_vec3_inv_fsrra()`](https://sh4zam.com/api/vector/shz_vec3_inv_fsrra/) | `glm_vec3_div(1, v)` | **1.74×**<br/>23 vs 40 cc | 0.92×<br/>73 vs 67 cc |
| [`shz_vec2_normalize_or()`](https://sh4zam.com/api/vector/shz_vec2_normalize_or/) | `glm_vec2_normalize_to` | **1.71×**<br/>28 vs 48 cc | 0.80×<br/>83 vs 66 cc |
| [`shz_vec2_normalize_safe()`](https://sh4zam.com/api/vector/shz_vec2_normalize_safe/) | `glm_vec2_normalize_to` | **1.71×**<br/>28 vs 48 cc | 0.80×<br/>83 vs 66 cc |
| [`shz_vec4_divf_fsrra()`](https://sh4zam.com/api/vector/shz_vec4_divf_fsrra/) | `v / s` | **1.71×**<br/>31 vs 53 cc | **1.38×**<br/>71 vs 98 cc |
| [`shz_vec4_move()`](https://sh4zam.com/api/vector/shz_vec4_move/) | `raymath Vector4MoveTowards` | **1.66×**<br/>64 vs 106 cc | **1.27×**<br/>168 vs 213 cc |
| [`shz_vec4_magnitude_inv_fsrra()`](https://sh4zam.com/api/vector/shz_vec4_magnitude_inv_fsrra/) | `1.0f / glm_vec4_norm` | **1.65×**<br/>26 vs 43 cc | **1.39×**<br/>44 vs 61 cc |
| [`shz_vec3_divf()`](https://sh4zam.com/api/vector/shz_vec3_divf/) | `v / s` | **1.64×**<br/>25 vs 41 cc | 0.95×<br/>62 vs 59 cc |
| [`shz_vec3_half_angle()`](https://sh4zam.com/api/vector/shz_vec3_half_angle/) | `glm_vec3_normalize_to + glm_vec3_add + glm_vec3_normalize` | **1.62×**<br/>85 vs 138 cc | **1.10×**<br/>206 vs 227 cc |
| [`shz_vec3_normalize()`](https://sh4zam.com/api/vector/shz_vec3_normalize/) | `glm_vec3_normalize_to` | **1.61×**<br/>31 vs 50 cc | 0.96×<br/>76 vs 73 cc |
| [`shz_vec2_magnitude_inv()`](https://sh4zam.com/api/vector/shz_vec2_magnitude_inv/) | `1.0f / glm_vec2_norm` | **1.61×**<br/>23 vs 37 cc | **1.36×**<br/>39 vs 53 cc |
| [`shz_vec3_divf_fsrra()`](https://sh4zam.com/api/vector/shz_vec3_divf_fsrra/) | `v / s` | **1.58×**<br/>26 vs 41 cc | 0.77×<br/>77 vs 59 cc |
| [`shz_vec3_move()`](https://sh4zam.com/api/vector/shz_vec3_move/) | `raymath Vector3MoveTowards` | **1.55×**<br/>56 vs 87 cc | **1.20×**<br/>148 vs 178 cc |
| [`shz_vec4_half_angle()`](https://sh4zam.com/api/vector/shz_vec4_half_angle/) | `glm_vec4_normalize_to + glm_vec4_add + glm_vec4_normalize` | **1.55×**<br/>98 vs 152 cc | 0.89×<br/>274 vs 244 cc |
| [`shz_vec3_magnitude_inv_fsrra()`](https://sh4zam.com/api/vector/shz_vec3_magnitude_inv_fsrra/) | `1.0f / glm_vec3_norm` | **1.54×**<br/>26 vs 40 cc | **1.33×**<br/>43 vs 57 cc |
| [`shz_vec2_bisector()`](https://sh4zam.com/api/vector/shz_vec2_bisector/) | `glm_vec2_norm + glm_vec2_scale + glm_vec2_add` | **1.50×**<br/>34 vs 51 cc | **1.31×**<br/>59 vs 77 cc |
| [`shz_vec2_inv_fsrra()`](https://sh4zam.com/api/vector/shz_vec2_inv_fsrra/) | `glm_vec2_div(1, v)` | **1.50×**<br/>20 vs 30 cc | **1.14×**<br/>50 vs 57 cc |
| [`shz_vec4_div_fsrra()`](https://sh4zam.com/api/vector/shz_vec4_div_fsrra/) | `glm_vec4_div` | **1.50×**<br/>36 vs 54 cc | **1.07×**<br/>104 vs 111 cc |
| [`shz_vec4_magnitude_inv()`](https://sh4zam.com/api/vector/shz_vec4_magnitude_inv/) | `1.0f / glm_vec4_norm` | **1.48×**<br/>29 vs 43 cc | **1.09×**<br/>56 vs 61 cc |
| [`shz_vec3_div_fsrra()`](https://sh4zam.com/api/vector/shz_vec3_div_fsrra/) | `glm_vec3_div` | **1.48×**<br/>29 vs 43 cc | 0.90×<br/>82 vs 74 cc |
| [`shz_vec4_normalize_or()`](https://sh4zam.com/api/vector/shz_vec4_normalize_or/) | `glm_vec4_normalize_to` | **1.46×**<br/>39 vs 57 cc | **1.49×**<br/>68 vs 101 cc |
| [`shz_vec4_normalize_safe()`](https://sh4zam.com/api/vector/shz_vec4_normalize_safe/) | `glm_vec4_normalize_to` | **1.46×**<br/>39 vs 57 cc | **1.49×**<br/>68 vs 101 cc |
| [`shz_vec3_normalize_or()`](https://sh4zam.com/api/vector/shz_vec3_normalize_or/) | `glm_vec3_normalize_to` | **1.43×**<br/>35 vs 50 cc | 0.85×<br/>86 vs 73 cc |
| [`shz_vec3_normalize_safe()`](https://sh4zam.com/api/vector/shz_vec3_normalize_safe/) | `glm_vec3_normalize_to` | **1.43×**<br/>35 vs 50 cc | 0.85×<br/>86 vs 73 cc |
| [`shz_vec3_magnitude_inv()`](https://sh4zam.com/api/vector/shz_vec3_magnitude_inv/) | `1.0f / glm_vec3_norm` | **1.38×**<br/>29 vs 40 cc | 0.98×<br/>58 vs 57 cc |
| [`shz_vec2_divf_fsrra()`](https://sh4zam.com/api/vector/shz_vec2_divf_fsrra/) | `v / s` | **1.35×**<br/>23 vs 31 cc | 1.00×<br/>49 vs 49 cc |
| [`shz_vec2_div_fsrra()`](https://sh4zam.com/api/vector/shz_vec2_div_fsrra/) | `glm_vec2_div` | **1.35×**<br/>23 vs 31 cc | 0.89×<br/>55 vs 49 cc |
| [`shz_vec2_divf()`](https://sh4zam.com/api/vector/shz_vec2_divf/) | `v / s` | **1.29×**<br/>24 vs 31 cc | **1.26×**<br/>39 vs 49 cc |
| [`shz_vec3_cubic_hermite()`](https://sh4zam.com/api/vector/shz_vec3_cubic_hermite/) | `raymath Vector3CubicHermite` | **1.27×**<br/>51 vs 65 cc | **1.18×**<br/>139 vs 164 cc |
| [`shz_vec2_div()`](https://sh4zam.com/api/vector/shz_vec2_div/) | `glm_vec2_div` | **1.15×**<br/>27 vs 31 cc | 0.61×<br/>80 vs 49 cc |
| [`shz_vec3_div()`](https://sh4zam.com/api/vector/shz_vec3_div/) | `glm_vec3_div` | **1.13×**<br/>38 vs 43 cc | 0.80×<br/>93 vs 74 cc |
| [`shz_vec3_barycenter()`](https://sh4zam.com/api/vector/shz_vec3_barycenter/) | `raymath Vector3Barycenter` | **1.09×**<br/>74 vs 81 cc | 0.88×<br/>206 vs 182 cc |
| [`shz_vec4_bisector()`](https://sh4zam.com/api/vector/shz_vec4_bisector/) | `glm_vec4_norm + glm_vec4_scale + glm_vec4_add` | **1.08×**<br/>60 vs 65 cc | 0.68×<br/>198 vs 134 cc |
| [`shz_vec3_bisector()`](https://sh4zam.com/api/vector/shz_vec3_bisector/) | `glm_vec3_norm + glm_vec3_scale + glm_vec3_add` | **1.07×**<br/>55 vs 59 cc | 0.88×<br/>139 vs 123 cc |
| [`shz_vec2_divf_fsrra()`](https://sh4zam.com/api/vector/shz_vec2_divf_fsrra/) | `v * (1.0f / s)` | 1.04×<br/>23 vs 24 cc | 0.80×<br/>49 vs 39 cc |
| [`shz_vec3_dot2()`](https://sh4zam.com/api/vector/shz_vec3_dot2/) | `scalar C` | 1.03×<br/>30 vs 31 cc | **1.07×**<br/>95 vs 102 cc |
| [`shz_vec2_reject()`](https://sh4zam.com/api/vector/shz_vec2_reject/) | `glm_vec2_dot + glm_vec2_scale + glm_vec2_sub` | 1.03×<br/>31 vs 32 cc | 0.97×<br/>66 vs 64 cc |
| [`shz_vec4_div()`](https://sh4zam.com/api/vector/shz_vec4_div/) | `glm_vec4_div` | 1.02×<br/>53 vs 54 cc | 0.63×<br/>176 vs 111 cc |
| [`shz_vec2_distance()`](https://sh4zam.com/api/vector/shz_vec2_distance/) | `glm_vec2_distance` | 1.00×<br/>29 vs 29 cc | 1.04×<br/>51 vs 53 cc |
| [`shz_vec4_reject()`](https://sh4zam.com/api/vector/shz_vec4_reject/) | `glm_vec4_dot + glm_vec4_scale + glm_vec4_sub` | 1.00×<br/>47 vs 47 cc | 1.03×<br/>142 vs 146 cc |
| [`shz_vec2_magnitude()`](https://sh4zam.com/api/vector/shz_vec2_magnitude/) | `glm_vec2_norm` | 1.00×<br/>25 vs 25 cc | 1.00×<br/>41 vs 41 cc |
| [`shz_vec4_magnitude()`](https://sh4zam.com/api/vector/shz_vec4_magnitude/) | `glm_vec4_norm` | 1.00×<br/>31 vs 31 cc | 1.00×<br/>49 vs 49 cc |
| [`shz_vec2_inv()`](https://sh4zam.com/api/vector/shz_vec2_inv/) | `glm_vec2_div(1, v)` | 1.00×<br/>30 vs 30 cc | 1.00×<br/>57 vs 57 cc |
| [`shz_vec2_divf()`](https://sh4zam.com/api/vector/shz_vec2_divf/) | `v * (1.0f / s)` | 1.00×<br/>24 vs 24 cc | 1.00×<br/>39 vs 39 cc |
| [`shz_vec3_inv()`](https://sh4zam.com/api/vector/shz_vec3_inv/) | `glm_vec3_div(1, v)` | 1.00×<br/>40 vs 40 cc | 1.00×<br/>67 vs 67 cc |
| [`shz_vec3_divf()`](https://sh4zam.com/api/vector/shz_vec3_divf/) | `v * (1.0f / s)` | 1.00×<br/>25 vs 25 cc | 1.00×<br/>62 vs 62 cc |
| [`shz_vec4_inv()`](https://sh4zam.com/api/vector/shz_vec4_inv/) | `glm_vec4_div(1, v)` | 1.00×<br/>50 vs 50 cc | 1.00×<br/>66 vs 66 cc |
| [`shz_vec4_divf()`](https://sh4zam.com/api/vector/shz_vec4_divf/) | `v * (1.0f / s)` | 1.00×<br/>28 vs 28 cc | 1.00×<br/>72 vs 72 cc |
| [`shz_vec4_distance()`](https://sh4zam.com/api/vector/shz_vec4_distance/) | `glm_vec4_distance` | 1.00×<br/>38 vs 38 cc | 1.00×<br/>115 vs 115 cc |
| [`shz_vec2_dot3()`](https://sh4zam.com/api/vector/shz_vec2_dot3/) | `scalar C` | 1.00×<br/>24 vs 24 cc | 0.98×<br/>93 vs 91 cc |
| [`shz_vec4_magnitude_fsrra()`](https://sh4zam.com/api/vector/shz_vec4_magnitude_fsrra/) | `glm_vec4_norm` | 0.97×<br/>32 vs 31 cc | 0.98×<br/>50 vs 49 cc |
| [`shz_vec2_magnitude_fsrra()`](https://sh4zam.com/api/vector/shz_vec2_magnitude_fsrra/) | `glm_vec2_norm` | 0.96×<br/>26 vs 25 cc | 0.98×<br/>42 vs 41 cc |
| [`shz_vec3_divf_fsrra()`](https://sh4zam.com/api/vector/shz_vec3_divf_fsrra/) | `v * (1.0f / s)` | 0.96×<br/>26 vs 25 cc | 0.81×<br/>77 vs 62 cc |
| [`shz_vec3_reject()`](https://sh4zam.com/api/vector/shz_vec3_reject/) | `glm_vec3_proj + glm_vec3_sub` | 0.95×<br/>42 vs 40 cc | 0.97×<br/>117 vs 113 cc |
| [`shz_vec3_distance()`](https://sh4zam.com/api/vector/shz_vec3_distance/) | `glm_vec3_distance` | 0.92×<br/>37 vs 34 cc | 0.84×<br/>67 vs 56 cc |
| [`shz_vec4_divf_fsrra()`](https://sh4zam.com/api/vector/shz_vec4_divf_fsrra/) | `v * (1.0f / s)` | 0.90×<br/>31 vs 28 cc | 1.01×<br/>71 vs 72 cc |
| [`shz_vec3_magnitude()`](https://sh4zam.com/api/vector/shz_vec3_magnitude/) | `glm_vec3_norm` | 0.90×<br/>31 vs 28 cc | 0.94×<br/>48 vs 45 cc |
| [`shz_vec3_triple()`](https://sh4zam.com/api/vector/shz_vec3_triple/) | `glm_vec3_cross + glm_vec3_dot` | 0.89×<br/>35 vs 31 cc | **1.38×**<br/>84 vs 116 cc |
| [`shz_vec4_dot2()`](https://sh4zam.com/api/vector/shz_vec4_dot2/) | `scalar C` | 0.88×<br/>34 vs 30 cc | 1.03×<br/>102 vs 105 cc |
| [`shz_vec4_dot3()`](https://sh4zam.com/api/vector/shz_vec4_dot3/) | `scalar C` | 0.88×<br/>49 vs 43 cc | **1.25×**<br/>137 vs 171 cc |
| [`shz_vec3_magnitude_fsrra()`](https://sh4zam.com/api/vector/shz_vec3_magnitude_fsrra/) | `glm_vec3_norm` | 0.88×<br/>32 vs 28 cc | 0.92×<br/>49 vs 45 cc |
| [`shz_vec3_dot3()`](https://sh4zam.com/api/vector/shz_vec3_dot3/) | `scalar C` | 0.86×<br/>36 vs 31 cc | 0.85×<br/>128 vs 109 cc |
| [`shz_vec2_dot2()`](https://sh4zam.com/api/vector/shz_vec2_dot2/) | `scalar C` | 0.83×<br/>23 vs 19 cc | 1.00×<br/>64 vs 64 cc |

## Quaternion

Geometric mean: 3.51× cached, 3.53× uncached.

| Routine | Reference | Cached | Uncached |
|---|---|--:|--:|
| [`shz_quat_from_rotation_zyx_u16()`](https://sh4zam.com/api/quat/shz_quat_from_rotation_zyx_u16/) | `glm_euler_zyx_quat` | **10.61×**<br/>61 vs 647 cc | **13.14×**<br/>108 vs 1419 cc |
| [`shz_quat_from_rotation_xyz_u16()`](https://sh4zam.com/api/quat/shz_quat_from_rotation_xyz_u16/) | `glm_euler_xyz_quat` | **10.53×**<br/>59 vs 621 cc | **14.77×**<br/>94 vs 1388 cc |
| [`shz_quat_from_rotation_yxz_u16()`](https://sh4zam.com/api/quat/shz_quat_from_rotation_yxz_u16/) | `glm_euler_yxz_quat` | **10.40×**<br/>60 vs 624 cc | **14.91×**<br/>94 vs 1402 cc |
| [`shz_quat_from_rotation_zxy_u16()`](https://sh4zam.com/api/quat/shz_quat_from_rotation_zxy_u16/) | `glm_euler_zxy_quat` | **10.15×**<br/>61 vs 619 cc | **13.16×**<br/>108 vs 1421 cc |
| [`shz_quat_from_rotation_xyz()`](https://sh4zam.com/api/quat/shz_quat_from_rotation_xyz/) | `glm_euler_xyz_quat` | **6.70×**<br/>70 vs 469 cc | **7.91×**<br/>133 vs 1052 cc |
| [`shz_quat_from_rotation_zyx()`](https://sh4zam.com/api/quat/shz_quat_from_rotation_zyx/) | `glm_euler_zyx_quat` | **6.65×**<br/>71 vs 472 cc | **8.29×**<br/>126 vs 1044 cc |
| [`shz_quat_from_rotation_yxz()`](https://sh4zam.com/api/quat/shz_quat_from_rotation_yxz/) | `glm_euler_yxz_quat` | **6.63×**<br/>71 vs 471 cc | **7.91×**<br/>132 vs 1044 cc |
| [`shz_quat_from_rotation_zxy()`](https://sh4zam.com/api/quat/shz_quat_from_rotation_zxy/) | `glm_euler_zxy_quat` | **6.56×**<br/>72 vs 472 cc | **8.27×**<br/>125 vs 1034 cc |
| [`shz_quat_to_angles_xyz()`](https://sh4zam.com/api/quat/shz_quat_to_angles_xyz/) | `glm_quat_mat4 + glm_euler_angles` | **5.28×**<br/>272 vs 1436 cc | **3.61×**<br/>678 vs 2447 cc |
| [`shz_quat_slerp()`](https://sh4zam.com/api/quat/shz_quat_slerp/) | `raylibQuaternionSlerp` | **5.24×**<br/>153 vs 802 cc | **4.50×**<br/>418 vs 1883 cc |
| [`shz_quat_to_angles_zxy()`](https://sh4zam.com/api/quat/shz_quat_to_angles_zxy/) | `glm_quat_mat4 + glm_euler_angles` | **4.91×**<br/>292 vs 1434 cc | **3.46×**<br/>711 vs 2463 cc |
| [`shz_quat_to_angles_zyx()`](https://sh4zam.com/api/quat/shz_quat_to_angles_zyx/) | `glm_quat_mat4 + glm_euler_angles` | **4.90×**<br/>292 vs 1430 cc | **3.49×**<br/>705 vs 2457 cc |
| [`shz_quat_to_angles_yxz()`](https://sh4zam.com/api/quat/shz_quat_to_angles_yxz/) | `glm_quat_mat4 + glm_euler_angles` | **4.85×**<br/>297 vs 1440 cc | **3.46×**<br/>707 vs 2445 cc |
| [`shz_quat_normalize()`](https://sh4zam.com/api/quat/shz_quat_normalize/) | `glm_quat_normalize_to` | **1.81×**<br/>32 vs 58 cc | **1.56×**<br/>59 vs 92 cc |
| [`shz_quat_magnitude_inv_fsrra()`](https://sh4zam.com/api/quat/shz_quat_magnitude_inv_fsrra/) | `1.0f / glm_quat_norm` | **1.65×**<br/>26 vs 43 cc | **1.48×**<br/>44 vs 65 cc |
| [`shz_quat_normalize_or()`](https://sh4zam.com/api/quat/shz_quat_normalize_or/) | `glm_quat_normalize_to` | **1.49×**<br/>39 vs 58 cc | **1.35×**<br/>68 vs 92 cc |
| [`shz_quat_normalize_safe()`](https://sh4zam.com/api/quat/shz_quat_normalize_safe/) | `glm_quat_normalize_to` | **1.49×**<br/>39 vs 58 cc | **1.35×**<br/>68 vs 92 cc |
| [`shz_quat_magnitude_inv()`](https://sh4zam.com/api/quat/shz_quat_magnitude_inv/) | `1.0f / glm_quat_norm` | **1.48×**<br/>29 vs 43 cc | **1.16×**<br/>56 vs 65 cc |
| [`shz_quat_transform_vec3()`](https://sh4zam.com/api/quat/shz_quat_transform_vec3/) | `Vector3RotateByQuaternion` | **1.29×**<br/>59 vs 76 cc | **1.32×**<br/>168 vs 222 cc |
| [`shz_quat_inv()`](https://sh4zam.com/api/quat/shz_quat_inv/) | `glm_quat_inv` | **1.09×**<br/>35 vs 38 cc | **1.35×**<br/>62 vs 84 cc |
| [`shz_quat_magnitude()`](https://sh4zam.com/api/quat/shz_quat_magnitude/) | `glm_quat_norm` | 1.00×<br/>31 vs 31 cc | **1.08×**<br/>49 vs 53 cc |
| [`shz_quat_magnitude_fsrra()`](https://sh4zam.com/api/quat/shz_quat_magnitude_fsrra/) | `glm_quat_norm` | 0.97×<br/>32 vs 31 cc | **1.06×**<br/>50 vs 53 cc |

## XMTRX

Geometric mean: 5.05× cached, 6.68× uncached.

| Routine | Reference | Cached | Uncached |
|---|---|--:|--:|
| [`shz_xmtrx_init_rotation_zxy_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_zxy_u16/) | `glm_mat4_identity + glm_rotate_z/x/y` | **54.15×**<br/>47 vs 2545 cc | **46.02×**<br/>93 vs 4280 cc |
| [`shz_xmtrx_init_rotation_zxy()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_zxy/) | `glm_mat4_identity + glm_rotate_z/x/y` | **33.16×**<br/>61 vs 2023 cc | **35.48×**<br/>114 vs 4045 cc |
| [`shz_xmtrx_init_rotation_xyz_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_xyz_u16/) | `glm_mat4_identity + glm_rotate_x/y/z` | **31.50×**<br/>46 vs 1449 cc | **31.45×**<br/>92 vs 2893 cc |
| [`shz_xmtrx_init_rotation_zyx_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_zyx_u16/) | `glm_mat4_identity + glm_rotate_z/y/x` | **29.06×**<br/>48 vs 1395 cc | **33.74×**<br/>91 vs 3070 cc |
| [`shz_xmtrx_init_rotation_yxz_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_yxz_u16/) | `glm_mat4_identity + glm_rotate_y/x/z` | **27.17×**<br/>47 vs 1277 cc | **31.78×**<br/>94 vs 2987 cc |
| [`shz_xmtrx_init_rotation_zyx()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_zyx/) | `glm_mat4_identity + glm_rotate_z/y/x` | **27.15×**<br/>59 vs 1602 cc | **27.59×**<br/>110 vs 3035 cc |
| [`shz_xmtrx_init_rotation_yxz()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_yxz/) | `glm_mat4_identity + glm_rotate_y/x/z` | **26.97×**<br/>61 vs 1645 cc | **30.82×**<br/>115 vs 3544 cc |
| [`shz_xmtrx_init_rotation_xyz()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_xyz/) | `glm_mat4_identity + glm_rotate_x/y/z` | **21.67×**<br/>60 vs 1300 cc | **26.76×**<br/>109 vs 2917 cc |
| [`shz_xmtrx_rotate_xyz_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_xyz_u16/) | `glm_rotate_x/y/z` | **20.58×**<br/>62 vs 1276 cc | **22.26×**<br/>129 vs 2872 cc |
| [`shz_xmtrx_rotate_yxz_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_yxz_u16/) | `glm_rotate_y/x/z` | **20.16×**<br/>61 vs 1230 cc | **21.86×**<br/>131 vs 2864 cc |
| [`shz_xmtrx_rotate_zyx_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_zyx_u16/) | `glm_rotate_z/y/x` | **20.16×**<br/>61 vs 1230 cc | **20.98×**<br/>137 vs 2874 cc |
| [`shz_xmtrx_rotate_zxy_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_zxy_u16/) | `glm_rotate_z/x/y` | **19.52×**<br/>63 vs 1230 cc | **21.93×**<br/>130 vs 2851 cc |
| [`shz_xmtrx_rotate_zyx()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_zyx/) | `glm_rotate_z/y/x` | **18.65×**<br/>66 vs 1231 cc | **25.97×**<br/>111 vs 2883 cc |
| [`shz_xmtrx_rotate_yxz()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_yxz/) | `glm_rotate_y/x/z` | **17.93×**<br/>70 vs 1255 cc | **24.43×**<br/>118 vs 2883 cc |
| [`shz_xmtrx_rotate_xyz()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_xyz/) | `glm_rotate_x/y/z` | **17.34×**<br/>71 vs 1231 cc | **26.01×**<br/>110 vs 2861 cc |
| [`shz_xmtrx_rotate_zxy()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_zxy/) | `glm_rotate_z/x/y` | **17.10×**<br/>72 vs 1231 cc | **24.84×**<br/>116 vs 2882 cc |
| [`shz_xmtrx_init_rotation_z_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_z_u16/) | `glm_mat4_identity + glm_rotate_z` | **13.85×**<br/>26 vs 360 cc | **17.19×**<br/>67 vs 1152 cc |
| [`shz_xmtrx_init_rotation_y_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_y_u16/) | `glm_mat4_identity + glm_rotate_y` | **12.92×**<br/>26 vs 336 cc | **17.30×**<br/>67 vs 1159 cc |
| [`shz_xmtrx_init_rotation_x_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_x_u16/) | `glm_mat4_identity + glm_rotate_x` | **12.44×**<br/>27 vs 336 cc | **17.12×**<br/>67 vs 1147 cc |
| [`shz_xmtrx_rotate_x_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_x_u16/) | `glm_rotate_x` | **11.18×**<br/>38 vs 425 cc | **16.47×**<br/>73 vs 1202 cc |
| [`shz_xmtrx_init_rotation_z_xy()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_z_xy/) | `glm_mat4_identity + glm_rotate_z` | **11.05×**<br/>20 vs 221 cc | **11.18×**<br/>72 vs 805 cc |
| [`shz_xmtrx_rotate_y_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_y_u16/) | `glm_rotate_y` | **10.65×**<br/>37 vs 394 cc | **16.04×**<br/>79 vs 1267 cc |
| [`shz_xmtrx_rotate_z_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_z_u16/) | `glm_rotate_z` | **10.59×**<br/>37 vs 392 cc | **16.31×**<br/>75 vs 1223 cc |
| [`shz_xmtrx_init_rotation_y_xz()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_y_xz/) | `glm_mat4_identity + glm_rotate_y` | **10.48×**<br/>21 vs 220 cc | **11.18×**<br/>72 vs 805 cc |
| [`shz_xmtrx_init_rotation_x_yz()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_x_yz/) | `glm_mat4_identity + glm_rotate_x` | **10.33×**<br/>21 vs 217 cc | **14.75×**<br/>56 vs 826 cc |
| [`shz_xmtrx_apply_4x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_apply_4x4/) | `glm_mat4_mul` | **9.93×**<br/>30 vs 298 cc | **12.92×**<br/>65 vs 840 cc |
| [`shz_xmtrx_rotate_dir()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_dir/) | `glm_rotate` | **9.56×**<br/>64 vs 612 cc | **13.13×**<br/>110 vs 1444 cc |
| [`shz_xmtrx_rotate_dir_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_dir_u16/) | `glm_rotate` | **9.41×**<br/>66 vs 621 cc | **9.38×**<br/>158 vs 1482 cc |
| [`shz_xmtrx_load_apply_4x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_load_apply_4x4/) | `glm_mat4_mul` | **7.98×**<br/>41 vs 327 cc | **7.61×**<br/>104 vs 791 cc |
| [`shz_xmtrx_rotate_y()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_y/) | `glm_rotate_y` | **7.27×**<br/>37 vs 269 cc | **16.19×**<br/>59 vs 955 cc |
| [`shz_xmtrx_init_rotation_y()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_y/) | `glm_mat4_identity + glm_rotate_y` | **7.21×**<br/>29 vs 209 cc | **12.27×**<br/>70 vs 859 cc |
| [`shz_xmtrx_init_rotation_z()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_z/) | `glm_mat4_identity + glm_rotate_z` | **7.17×**<br/>29 vs 208 cc | **12.09×**<br/>70 vs 846 cc |
| [`shz_xmtrx_rotate_x()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_x/) | `glm_rotate_x` | **7.16×**<br/>38 vs 272 cc | **15.49×**<br/>57 vs 883 cc |
| [`shz_xmtrx_rotate_z()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_z/) | `glm_rotate_z` | **6.97×**<br/>37 vs 258 cc | **15.19×**<br/>58 vs 881 cc |
| [`shz_xmtrx_init_rotation_x()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_x/) | `glm_mat4_identity + glm_rotate_x` | **6.97×**<br/>30 vs 209 cc | **12.37×**<br/>68 vs 841 cc |
| [`shz_xmtrx_rotate_u16()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_u16/) | `glm_rotate` | **5.96×**<br/>85 vs 507 cc | **8.48×**<br/>176 vs 1492 cc |
| [`shz_xmtrx_rotate()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate/) | `glm_rotate` | **5.71×**<br/>85 vs 485 cc | **8.27×**<br/>177 vs 1464 cc |
| [`shz_xmtrx_load_apply_store_4x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_load_apply_store_4x4/) | `glm_mat4_mul` | **5.57×**<br/>51 vs 284 cc | **2.91×**<br/>249 vs 724 cc |
| [`shz_xmtrx_init_rotation_dir()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_dir/) | `glm_rotate_make` | **5.47×**<br/>49 vs 268 cc | **9.35×**<br/>105 vs 982 cc |
| [`shz_xmtrx_rotate_x_yz()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_x_yz/) | `glm_mul_rot` | **5.36×**<br/>28 vs 150 cc | **8.46×**<br/>48 vs 406 cc |
| [`shz_xmtrx_rotate_z_xy()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_z_xy/) | `glm_mul_rot` | **5.22×**<br/>27 vs 141 cc | **8.40×**<br/>48 vs 403 cc |
| [`shz_xmtrx_rotate_y_xz()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_y_xz/) | `glm_mul_rot` | **4.93×**<br/>28 vs 138 cc | **9.15×**<br/>48 vs 439 cc |
| [`shz_xmtrx_scale_reverse()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_scale_reverse/) | `glm scale_reverse` | **4.83×**<br/>36 vs 174 cc | **6.52×**<br/>71 vs 463 cc |
| [`shz_xmtrx_load_apply_unaligned_4x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_load_apply_unaligned_4x4/) | `glm_mat4_mul` | **4.59×**<br/>63 vs 289 cc | **3.10×**<br/>251 vs 777 cc |
| [`shz_xmtrx_translate_reverse()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_translate_reverse/) | `glm translate_reverse` | **4.58×**<br/>36 vs 165 cc | **6.14×**<br/>71 vs 436 cc |
| [`shz_xmtrx_negate()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_negate/) | `glm_mat4_scale` | **4.58×**<br/>19 vs 87 cc | **5.88×**<br/>33 vs 194 cc |
| [`shz_xmtrx_rotate_quat()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_rotate_quat/) | `glm_quat_rotate` | **3.47×**<br/>57 vs 198 cc | **3.94×**<br/>140 vs 551 cc |
| [`shz_xmtrx_scale_3x3()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_scale_3x3/) | `glm_scale` | **3.43×**<br/>23 vs 79 cc | **3.66×**<br/>56 vs 205 cc |
| [`shz_xmtrx_lookat()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_lookat/) | `glm_lookat_rh + glm_mat4_mul` | **3.31×**<br/>124 vs 411 cc | **4.16×**<br/>235 vs 977 cc |
| [`shz_xmtrx_billboard_y()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_billboard_y/) | `glm_vec2_normalize + glm_mul_rot` | **3.15×**<br/>60 vs 189 cc | **3.29×**<br/>169 vs 556 cc |
| [`shz_xmtrx_add_4x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_add_4x4/) | `4 x glm_vec4_add` | **3.15×**<br/>34 vs 107 cc | **2.90×**<br/>94 vs 273 cc |
| [`shz_xmtrx_sub_4x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_sub_4x4/) | `4 x glm_vec4_sub` | **3.15×**<br/>34 vs 107 cc | **2.90×**<br/>94 vs 273 cc |
| [`shz_xmtrx_billboard_z()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_billboard_z/) | `glm_vec2_normalize + glm_mul_rot` | **3.14×**<br/>57 vs 179 cc | **3.74×**<br/>126 vs 471 cc |
| [`shz_xmtrx_billboard_x()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_billboard_x/) | `glm_vec2_normalize + glm_mul_rot` | **3.13×**<br/>60 vs 188 cc | **3.13×**<br/>165 vs 516 cc |
| [`shz_xmtrx_blend()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_blend/) | `naive per-element accum` | **3.11×**<br/>36 vs 112 cc | **3.06×**<br/>109 vs 334 cc |
| [`shz_xmtrx_add_translation()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_add_translation/) | `glm_translate` | **2.94×**<br/>17 vs 50 cc | **4.58×**<br/>38 vs 174 cc |
| [`shz_xmtrx_translate()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_translate/) | `mat_translate` | **2.86×**<br/>21 vs 60 cc | **6.17×**<br/>42 vs 259 cc |
| [`shz_xmtrx_scale()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_scale/) | `glm_scale` | **2.69×**<br/>26 vs 70 cc | **3.48×**<br/>54 vs 188 cc |
| [`shz_xmtrx_blend_4x3()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_blend_4x3/) | `naive per-element accum` | **2.46×**<br/>35 vs 86 cc | **2.56×**<br/>94 vs 241 cc |
| [`shz_xmtrx_blend_3x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_blend_3x4/) | `naive per-element accum` | **2.43×**<br/>35 vs 85 cc | **2.47×**<br/>96 vs 237 cc |
| [`shz_xmtrx_transform_vec4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_transform_vec4/) | `glm_mat4_mulv` | **2.36×**<br/>22 vs 52 cc | **4.69×**<br/>39 vs 183 cc |
| [`shz_xmtrx_init_identity()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_identity/) | `glm_mat4_identity` | **2.35×**<br/>17 vs 40 cc | **4.16×**<br/>31 vs 129 cc |
| [`shz_xmtrx_init_rotation_quat()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_quat/) | `glm_quat_mat4` | **2.33×**<br/>48 vs 112 cc | **2.48×**<br/>141 vs 349 cc |
| [`shz_xmtrx_get_rotation()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_get_rotation/) | `glm_mat4_quat + glm_quat_angle/axis` | **2.29×**<br/>137 vs 314 cc | **2.81×**<br/>387 vs 1087 cc |
| [`shz_xmtrx_invert_rigid()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_invert_rigid/) | `glm_inv_tr` | **2.26×**<br/>23 vs 52 cc | **4.11×**<br/>35 vs 144 cc |
| [`shz_xmtrx_scale()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_scale/) | `mat_scale` | **2.23×**<br/>26 vs 58 cc | **4.31×**<br/>54 vs 233 cc |
| [`shz_xmtrx_load_apply_store_3x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_load_apply_store_3x4/) | `R_ConcatTransforms` | **2.09×**<br/>65 vs 136 cc | **1.51×**<br/>271 vs 409 cc |
| [`shz_xmtrx_translate()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_translate/) | `glm_translate` | **1.96×**<br/>26 vs 51 cc | **3.20×**<br/>54 vs 173 cc |
| [`shz_xmtrx_init_rotation_x_yz()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_x_yz/) | `C init_rotation_x_yz` | **1.95×**<br/>21 vs 41 cc | **2.96×**<br/>49 vs 145 cc |
| [`shz_xmtrx_init_rotation_z_xy()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_z_xy/) | `C init_rotation_z_xy` | **1.95×**<br/>20 vs 39 cc | **2.84×**<br/>49 vs 139 cc |
| [`shz_xmtrx_init_billboard_z()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_billboard_z/) | `glm_vec2_normalize + rotation` | **1.83×**<br/>47 vs 86 cc | **1.68×**<br/>133 vs 223 cc |
| [`shz_xmtrx_init_rotation_y_xz()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_y_xz/) | `C init_rotation_y_xz` | **1.81×**<br/>21 vs 38 cc | **2.96×**<br/>50 vs 148 cc |
| [`shz_xmtrx_init_billboard_x()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_billboard_x/) | `glm_vec2_normalize + rotation` | **1.80×**<br/>50 vs 90 cc | **1.56×**<br/>137 vs 214 cc |
| [`shz_xmtrx_get_rotation()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_get_rotation/) near pi | `glm_mat4_quat + glm_quat_angle/axis [near pi]` | **1.77×**<br/>200 vs 355 cc | **2.39×**<br/>553 vs 1323 cc |
| [`shz_xmtrx_init_billboard_y()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_billboard_y/) | `glm_vec2_normalize + rotation` | **1.76×**<br/>49 vs 86 cc | **1.78×**<br/>138 vs 246 cc |
| [`shz_xmtrx_load_apply_store_3x3()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_load_apply_store_3x3/) | `glm_mat3_mul` | **1.74×**<br/>57 vs 99 cc | **1.47×**<br/>208 vs 306 cc |
| [`shz_xmtrx_get_scale()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_get_scale/) | `glm_decompose_scalev` | **1.74×**<br/>34 vs 59 cc | **2.70×**<br/>71 vs 192 cc |
| [`shz_xmtrx_init_translation()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_translation/) | `glm_translate_make` | **1.71×**<br/>21 vs 36 cc | **4.18×**<br/>57 vs 238 cc |
| [`shz_xmtrx_init_scale()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_scale/) | `glm_scale_make` | **1.64×**<br/>22 vs 36 cc | **4.25×**<br/>55 vs 234 cc |
| [`shz_xmtrx_get_translation()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_get_translation/) | `glm_vec3(mat[3])` | **1.45×**<br/>11 vs 16 cc | **2.33×**<br/>33 vs 77 cc |
| [`shz_xmtrx_set_scale()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_set_scale/) | `glm direct diagonal write` | **1.24×**<br/>17 vs 21 cc | **2.25×**<br/>52 vs 117 cc |
| [`shz_xmtrx_store_4x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_store_4x4/) | `mat_store` | **1.22×**<br/>18 vs 22 cc | **1.61×**<br/>74 vs 119 cc |
| [`shz_xmtrx_load_4x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_load_4x4/) | `mat_load` | **1.17×**<br/>18 vs 21 cc | **1.51×**<br/>72 vs 109 cc |
| [`shz_xmtrx_trace_2x2()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_trace_2x2/) | `glm_mat2_trace` | **1.15×**<br/>13 vs 15 cc | **1.97×**<br/>35 vs 69 cc |
| [`shz_xmtrx_trace_3x3()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_trace_3x3/) | `glm_mat3_trace` | **1.13×**<br/>16 vs 18 cc | **1.85×**<br/>47 vs 87 cc |
| [`shz_xmtrx_trace_4x4()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_trace_4x4/) | `glm_mat4_trace` | **1.11×**<br/>19 vs 21 cc | **2.14×**<br/>49 vs 105 cc |
| [`shz_xmtrx_set_translation()`](https://sh4zam.com/api/xmtrx/shz_xmtrx_set_translation/) | `glm direct column write` | 0.93×<br/>14 vs 13 cc | **1.86×**<br/>35 vs 65 cc |

## Matrix

Geometric mean: 3.31× cached, 3.32× uncached.

| Routine | Reference | Cached | Uncached |
|---|---|--:|--:|
| [`shz_mat4x4_init_rotation_zxy_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_zxy_u16/) | `glm_mat4_identity + glm_rotate_z/x/y` | **24.71×**<br/>59 vs 1458 cc | **16.53×**<br/>182 vs 3009 cc |
| [`shz_mat4x4_init_rotation_xyz_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_xyz_u16/) | `glm_mat4_identity + glm_rotate_x/y/z` | **23.07×**<br/>58 vs 1338 cc | **16.19×**<br/>186 vs 3012 cc |
| [`shz_mat4x4_init_rotation_yxz_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_yxz_u16/) | `glm_mat4_identity + glm_rotate_y/x/z` | **22.61×**<br/>59 vs 1334 cc | **16.38×**<br/>184 vs 3014 cc |
| [`shz_mat4x4_init_rotation_zyx_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_zyx_u16/) | `glm_mat4_identity + glm_rotate_z/y/x` | **22.23×**<br/>60 vs 1334 cc | **16.62×**<br/>182 vs 3024 cc |
| [`shz_mat4x4_rotate_xyz_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_xyz_u16/) | `glm_rotate_x/y/z` | **17.78×**<br/>81 vs 1440 cc | **15.90×**<br/>183 vs 2910 cc |
| [`shz_mat4x4_rotate_zyx_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_zyx_u16/) | `glm_rotate_z/y/x` | **16.58×**<br/>79 vs 1310 cc | **16.43×**<br/>177 vs 2908 cc |
| [`shz_mat4x4_rotate_yxz_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_yxz_u16/) | `glm_rotate_y/x/z` | **16.43×**<br/>80 vs 1314 cc | **15.99×**<br/>181 vs 2894 cc |
| [`shz_mat4x4_rotate_zxy_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_zxy_u16/) | `glm_rotate_z/x/y` | **15.95×**<br/>82 vs 1308 cc | **15.17×**<br/>192 vs 2913 cc |
| [`shz_mat4x4_rotate_zyx()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_zyx/) | `glm_rotate_z/y/x` | **14.91×**<br/>88 vs 1312 cc | **12.78×**<br/>220 vs 2812 cc |
| [`shz_mat4x4_rotate_yxz()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_yxz/) | `glm_rotate_y/x/z` | **14.30×**<br/>92 vs 1316 cc | **12.37×**<br/>225 vs 2784 cc |
| [`shz_mat4x4_rotate_xyz()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_xyz/) | `glm_rotate_x/y/z` | **14.15×**<br/>93 vs 1316 cc | **12.97×**<br/>217 vs 2815 cc |
| [`shz_mat4x4_rotate_zxy()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_zxy/) | `glm_rotate_z/x/y` | **13.96×**<br/>94 vs 1312 cc | **12.43×**<br/>224 vs 2785 cc |
| [`shz_mat4x4_init_rotation_x_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_x_u16/) | `glm_mat4_identity + glm_rotate_x` | **11.86×**<br/>35 vs 415 cc | **8.77×**<br/>141 vs 1237 cc |
| [`shz_mat4x4_init_rotation_z_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_z_u16/) | `glm_mat4_identity + glm_rotate_z` | **9.76×**<br/>34 vs 332 cc | **9.26×**<br/>136 vs 1259 cc |
| [`shz_mat4x4_init_rotation_y_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_y_u16/) | `glm_mat4_identity + glm_rotate_y` | **9.71×**<br/>34 vs 330 cc | **9.46×**<br/>136 vs 1287 cc |
| [`shz_mat4x4_rotate_x_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_x_u16/) | `glm_rotate_x` | **7.00×**<br/>56 vs 392 cc | **8.66×**<br/>134 vs 1161 cc |
| [`shz_mat4x4_init_rotation_x_yz()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_x_yz/) | `glm_mat4_identity + glm_rotate_x` | **7.00×**<br/>30 vs 210 cc | **7.55×**<br/>110 vs 830 cc |
| [`shz_mat4x4_init_rotation_y_xz()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_y_xz/) | `glm_mat4_identity + glm_rotate_y` | **7.00×**<br/>30 vs 210 cc | **7.49×**<br/>110 vs 824 cc |
| [`shz_mat4x4_init_rotation_z_xy()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_z_xy/) | `glm_mat4_identity + glm_rotate_z` | **6.71×**<br/>31 vs 208 cc | **7.87×**<br/>105 vs 826 cc |
| [`shz_mat4x4_rotate_dir_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_dir_u16/) | `glm_rotate` | **6.12×**<br/>86 vs 526 cc | **6.01×**<br/>239 vs 1436 cc |
| [`shz_mat4x4_rotate_z_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_z_u16/) | `glm_rotate_z` | **5.60×**<br/>55 vs 308 cc | **8.81×**<br/>135 vs 1189 cc |
| [`shz_mat4x4_rotate_y_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_y_u16/) | `glm_rotate_y` | **5.56×**<br/>55 vs 306 cc | **8.90×**<br/>136 vs 1211 cc |
| [`shz_mat4x4_rotate_dir()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_dir/) | `glm_rotate` | **5.56×**<br/>86 vs 478 cc | **6.13×**<br/>231 vs 1415 cc |
| [`shz_mat4x4_rotate()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate/) | `glm_rotate` | **4.55×**<br/>105 vs 478 cc | **5.93×**<br/>241 vs 1429 cc |
| [`shz_mat4x4_rotate_u16()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_u16/) | `glm_rotate` | **4.46×**<br/>106 vs 473 cc | **5.36×**<br/>268 vs 1436 cc |
| [`shz_mat4x4_init_rotation_dir()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_dir/) | `glm_rotate_make` | **4.41×**<br/>59 vs 260 cc | **5.24×**<br/>164 vs 859 cc |
| [`shz_mat4x4_scale_reverse()`](https://sh4zam.com/api/matrix/shz_mat4x4_scale_reverse/) | `glm scale_reverse` | **3.68×**<br/>53 vs 195 cc | **4.08×**<br/>145 vs 592 cc |
| [`shz_mat4x4_copy()`](https://sh4zam.com/api/matrix/shz_mat4x4_copy/) | `memcpy` | **3.34×**<br/>29 vs 97 cc | **2.56×**<br/>115 vs 294 cc |
| [`shz_mat4x4_translate_reverse()`](https://sh4zam.com/api/matrix/shz_mat4x4_translate_reverse/) | `glm translate_reverse` | **3.25×**<br/>52 vs 169 cc | **2.88×**<br/>138 vs 398 cc |
| [`shz_mat4x4_rotate_z_xy()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_z_xy/) | `glm_mul_rot` | **2.51×**<br/>47 vs 118 cc | **2.54×**<br/>150 vs 381 cc |
| [`shz_mat4x4_get_rotation()`](https://sh4zam.com/api/matrix/shz_mat4x4_get_rotation/) | `glm_mat4_quat + glm_quat_angle/axis` | **2.46×**<br/>127 vs 312 cc | **3.17×**<br/>328 vs 1040 cc |
| [`shz_mat4x4_rotate_x_yz()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_x_yz/) | `glm_mul_rot` | **2.44×**<br/>48 vs 117 cc | **2.81×**<br/>150 vs 422 cc |
| [`shz_mat4x4_rotate_y_xz()`](https://sh4zam.com/api/matrix/shz_mat4x4_rotate_y_xz/) | `glm_mul_rot` | **2.42×**<br/>48 vs 116 cc | **2.79×**<br/>150 vs 418 cc |
| [`shz_mat4x4_swap()`](https://sh4zam.com/api/matrix/shz_mat4x4_swap/) | `std::swap` | **2.41×**<br/>44 vs 106 cc | **2.14×**<br/>129 vs 276 cc |
| [`shz_mat4x4_billboard_z()`](https://sh4zam.com/api/matrix/shz_mat4x4_billboard_z/) | `glm_vec2_normalize + glm_mul_rot` | **2.10×**<br/>79 vs 166 cc | **2.35×**<br/>218 vs 513 cc |
| [`shz_mat4x4_billboard_x()`](https://sh4zam.com/api/matrix/shz_mat4x4_billboard_x/) | `glm_vec2_normalize + glm_mul_rot` | **2.06×**<br/>80 vs 165 cc | **2.36×**<br/>243 vs 574 cc |
| [`shz_mat4x4_billboard_y()`](https://sh4zam.com/api/matrix/shz_mat4x4_billboard_y/) | `glm_vec2_normalize + glm_mul_rot` | **1.99×**<br/>80 vs 159 cc | **2.13×**<br/>247 vs 527 cc |
| [`shz_mat4x4_inverse()`](https://sh4zam.com/api/matrix/shz_mat4x4_inverse/) | `glm_mat4_inv` | **1.91×**<br/>199 vs 381 cc | **1.51×**<br/>563 vs 850 cc |
| [`shz_mat4x4_get_rotation()`](https://sh4zam.com/api/matrix/shz_mat4x4_get_rotation/) near pi | `glm_mat4_quat + glm_quat_angle/axis [near pi]` | **1.86×**<br/>190 vs 354 cc | **2.61×**<br/>488 vs 1276 cc |
| [`shz_mat4x4_blend()`](https://sh4zam.com/api/matrix/shz_mat4x4_blend/) | `naive per-element accum` | **1.80×**<br/>59 vs 106 cc | **1.58×**<br/>212 vs 335 cc |
| [`shz_mat4x4_inverse_rigid()`](https://sh4zam.com/api/matrix/shz_mat4x4_inverse_rigid/) | `glm_inv_tr` | **1.79×**<br/>47 vs 84 cc | **1.39×**<br/>208 vs 289 cc |
| [`shz_mat4x4_scale()`](https://sh4zam.com/api/matrix/shz_mat4x4_scale/) | `glm_scale` | **1.70×**<br/>40 vs 68 cc | 1.04×<br/>150 vs 156 cc |
| [`shz_mat4x4_scale_3x3()`](https://sh4zam.com/api/matrix/shz_mat4x4_scale_3x3/) | `glm_vec3_scale x3` | **1.66×**<br/>32 vs 53 cc | **1.08×**<br/>115 vs 124 cc |
| [`shz_mat4x4_get_scale()`](https://sh4zam.com/api/matrix/shz_mat4x4_get_scale/) | `glm_decompose_scalev` | **1.51×**<br/>39 vs 59 cc | **1.46×**<br/>103 vs 150 cc |
| [`shz_mat4x4_init_zero()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_zero/) | `glm_mat4_zero` | **1.42×**<br/>19 vs 27 cc | **1.62×**<br/>76 vs 123 cc |
| [`shz_mat4x4_init_billboard_y()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_billboard_y/) | `glm_vec2_normalize + rotation` | **1.41×**<br/>61 vs 86 cc | **1.18×**<br/>208 vs 246 cc |
| [`shz_mat4x4_transform_vec3()`](https://sh4zam.com/api/matrix/shz_mat4x4_transform_vec3/) | `glm_mat4_mulv3` | **1.37×**<br/>30 vs 41 cc | **1.34×**<br/>96 vs 129 cc |
| [`shz_mat4x4_to_quat()`](https://sh4zam.com/api/matrix/shz_mat4x4_to_quat/) | `glm_mat4_quat` | **1.35×**<br/>46 vs 62 cc | **1.40×**<br/>148 vs 207 cc |
| [`shz_mat4x4_init_billboard_x()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_billboard_x/) | `glm_vec2_normalize + rotation` | **1.34×**<br/>58 vs 78 cc | **1.25×**<br/>187 vs 234 cc |
| [`shz_mat4x4_init_billboard_z()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_billboard_z/) | `glm_vec2_normalize + rotation` | **1.29×**<br/>59 vs 76 cc | **1.16×**<br/>185 vs 215 cc |
| [`shz_mat4x4_init_fill()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_fill/) | `C fill` | **1.27×**<br/>22 vs 28 cc | **1.26×**<br/>111 vs 140 cc |
| [`shz_mat4x4_init_diagonal()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_diagonal/) | `glm_mat4_zero + diagonal` | **1.19×**<br/>26 vs 31 cc | **1.22×**<br/>115 vs 140 cc |
| [`shz_mat4x4_transform_vec4_transpose()`](https://sh4zam.com/api/matrix/shz_mat4x4_transform_vec4_transpose/) | `glm_vec4_dot x4` | **1.19×**<br/>42 vs 50 cc | **1.34×**<br/>142 vs 190 cc |
| [`shz_mat4x4_init_identity()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_identity/) | `glm_mat4_identity` | **1.17×**<br/>23 vs 27 cc | **1.45×**<br/>82 vs 119 cc |
| [`shz_mat4x4_translate()`](https://sh4zam.com/api/matrix/shz_mat4x4_translate/) | `glm_translate` | **1.11×**<br/>44 vs 49 cc | **1.18×**<br/>122 vs 144 cc |
| [`shz_mat4x4_init_scale()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_scale/) | `glm_scale_make` | **1.11×**<br/>27 vs 30 cc | **1.17×**<br/>121 vs 141 cc |
| [`shz_mat4x4_transform_vec4()`](https://sh4zam.com/api/matrix/shz_mat4x4_transform_vec4/) | `glm_mat4_mulv` | 1.04×<br/>48 vs 50 cc | **1.28×**<br/>150 vs 192 cc |
| [`shz_mat4x4_transform_vec4()`](https://sh4zam.com/api/matrix/shz_mat4x4_transform_vec4/) alignas(32) | `glm_mat4_mulv` | 1.04×<br/>48 vs 50 cc | **1.28×**<br/>150 vs 192 cc |
| [`shz_mat4x4_init_rotation_x_yz()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_x_yz/) | `C init_rotation_x_yz` | 1.03×<br/>30 vs 31 cc | **1.18×**<br/>119 vs 141 cc |
| [`shz_mat4x4_init_rotation_y_xz()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_y_xz/) | `C init_rotation_y_xz` | 1.03×<br/>30 vs 31 cc | **1.18×**<br/>119 vs 141 cc |
| [`shz_mat4x4_transform_vec3_transpose()`](https://sh4zam.com/api/matrix/shz_mat4x4_transform_vec3_transpose/) | `glm_vec3_dot x3` | 1.03×<br/>31 vs 32 cc | 1.03×<br/>105 vs 108 cc |
| [`shz_mat4x4_determinant()`](https://sh4zam.com/api/matrix/shz_mat4x4_determinant/) | `glm_mat4_det` | 1.01×<br/>84 vs 85 cc | **1.08×**<br/>233 vs 252 cc |
| [`shz_mat4x4_init_rotation_z_xy()`](https://sh4zam.com/api/matrix/shz_mat4x4_init_rotation_z_xy/) | `C init_rotation_z_xy` | 1.00×<br/>31 vs 31 cc | **1.31×**<br/>105 vs 138 cc |
| [`shz_mat4x4_set_scale()`](https://sh4zam.com/api/matrix/shz_mat4x4_set_scale/) | `glm direct diagonal write` | 1.00×<br/>27 vs 27 cc | 1.00×<br/>128 vs 128 cc |
| [`shz_mat4x4_inverse()`](https://sh4zam.com/api/matrix/shz_mat4x4_inverse/) dense | `glm_mat4_inv [dense]` | 0.97×<br/>394 vs 381 cc | 0.86×<br/>971 vs 832 cc |

## Complex

Geometric mean: 9.78× cached, 11.79× uncached.

| Routine | Reference | Cached | Uncached |
|---|---|--:|--:|
| [`shz_ccotf()`](https://sh4zam.com/api/complex/shz_ccotf/) | `std::cos/std::sin` | **27.58×**<br/>97 vs 2675 cc | **24.38×**<br/>182 vs 4437 cc |
| [`shz_ccothf()`](https://sh4zam.com/api/complex/shz_ccothf/) | `std::cosh/std::sinh` | **26.33×**<br/>81 vs 2133 cc | **27.43×**<br/>139 vs 3813 cc |
| [`shz_casinhf()`](https://sh4zam.com/api/complex/shz_casinhf/) | `std::asinh` | **23.58×**<br/>124 vs 2924 cc | **25.85×**<br/>178 vs 4601 cc |
| [`shz_casinf()`](https://sh4zam.com/api/complex/shz_casinf/) | `std::asin` | **21.56×**<br/>136 vs 2932 cc | **18.39×**<br/>248 vs 4561 cc |
| [`shz_cacosf()`](https://sh4zam.com/api/complex/shz_cacosf/) | `std::acos` | **21.41×**<br/>140 vs 2998 cc | **19.36×**<br/>243 vs 4705 cc |
| [`shz_ccosf()`](https://sh4zam.com/api/complex/shz_ccosf/) | `std::cos` | **20.26×**<br/>61 vs 1236 cc | **21.89×**<br/>130 vs 2846 cc |
| [`shz_csinf()`](https://sh4zam.com/api/complex/shz_csinf/) | `std::sin` | **20.26×**<br/>61 vs 1236 cc | **21.28×**<br/>133 vs 2830 cc |
| [`shz_cacschf()`](https://sh4zam.com/api/complex/shz_cacschf/) | `std::asinh(1/z)` | **20.21×**<br/>147 vs 2971 cc | **20.48×**<br/>234 vs 4793 cc |
| [`shz_casecf()`](https://sh4zam.com/api/complex/shz_casecf/) | `std::acos(1/z)` | **19.66×**<br/>164 vs 3224 cc | **18.84×**<br/>271 vs 5106 cc |
| [`shz_cacscf()`](https://sh4zam.com/api/complex/shz_cacscf/) | `std::asin(1/z)` | **19.52×**<br/>159 vs 3103 cc | **19.07×**<br/>260 vs 4957 cc |
| [`shz_clogf()`](https://sh4zam.com/api/complex/shz_clogf/) | `std::log` | **18.85×**<br/>68 vs 1282 cc | **22.55×**<br/>116 vs 2616 cc |
| [`shz_csqrtf()`](https://sh4zam.com/api/complex/shz_csqrtf/) | `std::sqrt` | **17.96×**<br/>55 vs 988 cc | **26.77×**<br/>71 vs 1901 cc |
| [`shz_csinhf()`](https://sh4zam.com/api/complex/shz_csinhf/) | `std::sinh` | **17.85×**<br/>61 vs 1089 cc | **18.29×**<br/>133 vs 2433 cc |
| [`shz_cacoshf()`](https://sh4zam.com/api/complex/shz_cacoshf/) | `std::acosh` | **17.77×**<br/>172 vs 3056 cc | **20.21×**<br/>234 vs 4730 cc |
| [`shz_casechf()`](https://sh4zam.com/api/complex/shz_casechf/) | `std::acosh(1/z)` | **17.69×**<br/>190 vs 3361 cc | **18.89×**<br/>284 vs 5366 cc |
| [`shz_inv_cabsf()`](https://sh4zam.com/api/complex/shz_inv_cabsf/) | `1.0f/std::abs` | **17.65×**<br/>23 vs 406 cc | **25.92×**<br/>39 vs 1011 cc |
| [`shz_ccoshf()`](https://sh4zam.com/api/complex/shz_ccoshf/) | `std::cosh` | **17.56×**<br/>61 vs 1071 cc | **17.81×**<br/>133 vs 2369 cc |
| [`shz_cpowf()`](https://sh4zam.com/api/complex/shz_cpowf/) | `std::pow` | **16.99×**<br/>113 vs 1920 cc | **16.75×**<br/>216 vs 3619 cc |
| [`shz_ccscf()`](https://sh4zam.com/api/complex/shz_ccscf/) | `1/std::sin` | **16.82×**<br/>84 vs 1413 cc | **20.46×**<br/>154 vs 3151 cc |
| [`shz_csecf()`](https://sh4zam.com/api/complex/shz_csecf/) | `1/std::cos` | **16.77×**<br/>84 vs 1409 cc | **20.02×**<br/>157 vs 3143 cc |
| [`shz_clog10f()`](https://sh4zam.com/api/complex/shz_clog10f/) | `std::log10` | **16.31×**<br/>80 vs 1305 cc | **19.17×**<br/>136 vs 2607 cc |
| [`shz_cabsf()`](https://sh4zam.com/api/complex/shz_cabsf/) | `std::abs` | **15.76×**<br/>25 vs 394 cc | **24.37×**<br/>41 vs 999 cc |
| [`shz_ctanf()`](https://sh4zam.com/api/complex/shz_ctanf/) | `std::tan` | **15.30×**<br/>82 vs 1255 cc | **20.50×**<br/>136 vs 2788 cc |
| [`shz_ctanhf()`](https://sh4zam.com/api/complex/shz_ctanhf/) | `std::tanh` | **13.92×**<br/>78 vs 1086 cc | **17.54×**<br/>158 vs 2771 cc |
| [`shz_catanhf()`](https://sh4zam.com/api/complex/shz_catanhf/) | `std::atanh` | **11.09×**<br/>93 vs 1031 cc | **13.57×**<br/>181 vs 2457 cc |
| [`shz_cdivf()`](https://sh4zam.com/api/complex/shz_cdivf/) | `operator/(complex)` | **10.58×**<br/>19 vs 201 cc | **9.24×**<br/>46 vs 425 cc |
| [`shz_cexpf()`](https://sh4zam.com/api/complex/shz_cexpf/) | `std::exp` | **10.00×**<br/>40 vs 400 cc | **19.18×**<br/>66 vs 1266 cc |
| [`shz_ccschf()`](https://sh4zam.com/api/complex/shz_ccschf/) | `1/std::sinh` | **9.74×**<br/>126 vs 1227 cc | **13.93×**<br/>200 vs 2785 cc |
| [`shz_csechf()`](https://sh4zam.com/api/complex/shz_csechf/) | `1/std::cosh` | **9.70×**<br/>131 vs 1271 cc | **13.92×**<br/>197 vs 2743 cc |
| [`shz_cacothf()`](https://sh4zam.com/api/complex/shz_cacothf/) | `std::atanh(1/z)` | **8.45×**<br/>122 vs 1031 cc | **9.87×**<br/>256 vs 2527 cc |
| [`shz_cacotf()`](https://sh4zam.com/api/complex/shz_cacotf/) | `std::atan(1/z)` | **7.79×**<br/>126 vs 981 cc | **11.39×**<br/>212 vs 2415 cc |
| [`shz_catanf()`](https://sh4zam.com/api/complex/shz_catanf/) | `std::atan` | **7.21×**<br/>104 vs 750 cc | **10.53×**<br/>191 vs 2011 cc |
| [`shz_crecipf()`](https://sh4zam.com/api/complex/shz_crecipf/) | `1/(std::complex)` | **6.70×**<br/>30 vs 201 cc | **8.17×**<br/>54 vs 441 cc |
| [`shz_cargf()`](https://sh4zam.com/api/complex/shz_cargf/) | `std::arg` | **3.27×**<br/>51 vs 167 cc | **7.20×**<br/>90 vs 648 cc |
| [`shz_cmulf()`](https://sh4zam.com/api/complex/shz_cmulf/) | `operator*(complex)` | **3.13×**<br/>15 vs 47 cc | **7.16×**<br/>31 vs 222 cc |
| [`shz_fft()`](https://sh4zam.com/api/complex/shz_fft/) | `cooley_tukey_fft` | **1.58×**<br/>81433 vs 128268 cc | **1.54×**<br/>88498 vs 136206 cc |
| [`shz_conjf()`](https://sh4zam.com/api/complex/shz_conjf/) | `std::conj` | **1.36×**<br/>11 vs 15 cc | **2.45×**<br/>31 vs 76 cc |
| [`shz_cnormf()`](https://sh4zam.com/api/complex/shz_cnormf/) | `std::norm` | **1.36×**<br/>14 vs 19 cc | **2.03×**<br/>30 vs 61 cc |
| [`shz_caddf()`](https://sh4zam.com/api/complex/shz_caddf/) | `operator+(complex)` | 1.00×<br/>12 vs 12 cc | 1.00×<br/>31 vs 31 cc |
| [`shz_csubf()`](https://sh4zam.com/api/complex/shz_csubf/) | `operator-(complex)` | 1.00×<br/>12 vs 12 cc | 1.00×<br/>31 vs 31 cc |
| [`shz_cscalef()`](https://sh4zam.com/api/complex/shz_cscalef/) | `operator*(float)` | 1.00×<br/>12 vs 12 cc | 1.00×<br/>33 vs 33 cc |

## Memory

Geometric mean: 1.51× cached, 1.46× uncached.

| Routine | Reference | Cached | Uncached |
|---|---|--:|--:|
| [`shz_memcpy8()`](https://sh4zam.com/api/memory/shz_memcpy8/) 4 KB | `memcpy` | **2.70×**<br/>1576 vs 4261 cc | **1.89×**<br/>6217 vs 11747 cc |
| [`shz_memcpy128()`](https://sh4zam.com/api/memory/shz_memcpy128/) 4 KB | `memcpy` | **2.60×**<br/>1631 vs 4237 cc | **3.33×**<br/>3531 vs 11745 cc |
| [`shz_memcpy32()`](https://sh4zam.com/api/memory/shz_memcpy32/) 4 KB | `memcpy` | **2.52×**<br/>1684 vs 4237 cc | **3.25×**<br/>3621 vs 11753 cc |
| [`shz_memcpy64()`](https://sh4zam.com/api/memory/shz_memcpy64/) 4 KB | `memcpy` | **2.52×**<br/>1684 vs 4237 cc | **3.24×**<br/>3625 vs 11733 cc |
| [`shz_memcpy()`](https://sh4zam.com/api/memory/shz_memcpy/) 512 B, src+0 dst+0 | `memcpy` | **2.19×**<br/>250 vs 548 cc | **1.85×**<br/>869 vs 1607 cc |
| [`shz_memcpy()`](https://sh4zam.com/api/memory/shz_memcpy/) 4 KB | `memcpy` | **2.04×**<br/>2078 vs 4237 cc | **3.00×**<br/>3915 vs 11729 cc |
| [`shz_memset8()`](https://sh4zam.com/api/memory/shz_memset8/) | `uint64_t loop` | **1.94×**<br/>803 vs 1554 cc | **3.88×**<br/>1140 vs 4428 cc |
| [`shz_memcpy()`](https://sh4zam.com/api/memory/shz_memcpy/) 256 B, src+0 dst+0 | `memcpy` | **1.76×**<br/>166 vs 292 cc | **1.14×**<br/>649 vs 737 cc |
| [`shz_memcpy2()`](https://sh4zam.com/api/memory/shz_memcpy2/) 4 KB | `memcpy` | **1.70×**<br/>2528 vs 4295 cc | **1.12×**<br/>10475 vs 11745 cc |
| [`shz_memcpy4()`](https://sh4zam.com/api/memory/shz_memcpy4/) 4 KB | `memcpy` | **1.59×**<br/>2660 vs 4237 cc | **1.09×**<br/>10747 vs 11741 cc |
| [`shz_sq_memcpy32_xmtrx()`](https://sh4zam.com/api/memory/shz_sq_memcpy32_xmtrx/) 4 KB | `memcpy` | **1.59×**<br/>2601 vs 4132 cc | **1.61×**<br/>7276 vs 11693 cc |
| [`shz_memcpy()`](https://sh4zam.com/api/memory/shz_memcpy/) 256 B, src+4 dst+0 | `memcpy` | **1.53×**<br/>191 vs 292 cc | **1.13×**<br/>807 vs 909 cc |
| [`shz_memcpy()`](https://sh4zam.com/api/memory/shz_memcpy/) 512 B, src+8 dst+16 | `memcpy` | **1.53×**<br/>359 vs 548 cc | **1.18×**<br/>1262 vs 1495 cc |
| [`shz_memcpy()`](https://sh4zam.com/api/memory/shz_memcpy/) 512 B, src+0 dst+24 | `memcpy` | **1.52×**<br/>361 vs 548 cc | **1.09×**<br/>1210 vs 1315 cc |
| [`shz_sq_memcpy32()`](https://sh4zam.com/api/memory/shz_sq_memcpy32/) 4 KB | `memcpy` | **1.46×**<br/>2922 vs 4275 cc | **1.59×**<br/>7366 vs 11725 cc |
| [`shz_sq_memcpy32()`](https://sh4zam.com/api/memory/shz_sq_memcpy32/) 4 KB | `sq_fast_cpy` | **1.08×**<br/>2584 vs 2799 cc | 1.01×<br/>7252 vs 7295 cc |
| [`shz_memcpy()`](https://sh4zam.com/api/memory/shz_memcpy/) 256 B, src+0 dst+4 | `memcpy` | 1.03×<br/>283 vs 292 cc | 0.72×<br/>995 vs 719 cc |
| [`shz_sq_memcpy32_xmtrx()`](https://sh4zam.com/api/memory/shz_sq_memcpy32_xmtrx/) 4 KB | `sq_fast_cpy` | 1.01×<br/>2995 vs 3018 cc | 1.00×<br/>7390 vs 7384 cc |
| [`shz_memcpy()`](https://sh4zam.com/api/memory/shz_memcpy/) 512 B, src+3 dst+17 | `memcpy` | 0.99×<br/>633 vs 624 cc | 0.95×<br/>1773 vs 1686 cc |
| [`shz_memcpy()`](https://sh4zam.com/api/memory/shz_memcpy/) 256 B, src+1 dst+0 | `memcpy` | 0.98×<br/>426 vs 417 cc | 0.92×<br/>1145 vs 1058 cc |
| [`shz_memcpy1()`](https://sh4zam.com/api/memory/shz_memcpy1/) 4 KB | `memcpy` | 0.34×<br/>12475 vs 4283 cc | 0.58×<br/>20137 vs 11755 cc |

## Reproducing

Build the test scenario with `make tests` and run it on a Dreamcast with `make run`; the log prints every benchmark. `node scripts/gen-benchmarks.mjs import <log> <version> <toolchain> <flags>` in `doc/site` turns that log into this page's data. See [Testing and Contributing](https://sh4zam.com/guides/testing-and-contributing/).
