Skip to content

Givens rotations and Householder reflectors, one at a time

mp-numerics#13, part of the series in stillwater-sc/mtl5#666. This study measures how a single plane rotation or a single Householder reflector behaves in each number system, before any factorization is built on them. It tests MTL5’s own kernels, mtl::apply_givens_rotation (operation/givens.hpp) and mtl::householder (operation/householder.hpp), against the forms LAPACK uses and against two power-of-two-scaled forms written here.

It covers 65 types: the hardware IEEE types, posits, fixed point, the cfloat matrix from FP8 to 256 bits in three variants, lns, linear takums, and double-double and quad-double.

Terminal window
cmake --build build --target givens_householder_study
./build/benchmarks/linalg/givens_householder/givens_householder_study results/
python3 benchmarks/linalg/givens_householder/summarize.py results/
python3 benchmarks/linalg/givens_householder/plot.py results/ figures/

--quick runs a small sample, and --family ieee,posit,fixpnt,cfloat,lns,takum,dd,qd picks families (all by default). The full run takes about four minutes against MTL5 5.21.0, most of it in the wide cfloats. Against 5.22.0 it takes over two hours: givens_mtl5 and householder_mtl5 then go through MTL5’s pow2_scaling, whose exponent search costs one multiplication per binade (mtl5#680). MTL5 main fixes that (mtl5#681), and the run takes about four minutes again. Each CSV has a .sysinfo sidecar recording the platform, compiler, sample counts and the commits of mp-numerics, MTL5 and Universal. The commits are read when CMake configures, so reconfigure before a run whose results are kept; +dirty marks uncommitted changes. The inputs come from std::mt19937_64 and std::cos/std::sin, so another platform’s libm can move an input by an ulp and change the last digits. The committed results are byte-identical between GCC 15 and Clang 21 on x86-64. plot.py needs matplotlib; summarize.py needs only the standard library.

A default configure measures whatever MTL5 and Universal it gets: an installed MTL5 of at least 5.22 and an installed Universal through find_package, or otherwise both fetched from main. To reproduce a recorded run, check out the three commits in its .sysinfo and point CMake at the checkouts:

Terminal window
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_DISABLE_FIND_PACKAGE_MTL5=ON -DCMAKE_DISABLE_FIND_PACKAGE_universal=ON \
-DFETCHCONTENT_SOURCE_DIR_MTL5=/path/to/mtl5 \
-DFETCHCONTENT_SOURCE_DIR_UNIVERSAL=/path/to/universal

The two DISABLE flags keep an installed copy from taking precedence over the checkouts. The runs this README reports:

runmp-numericsMTL5Universal
committed results (5.21.0)d29d67dd442189: v5.21.0’s headers2d5c785
rerun against 5.22.07fedb19cf2f8a5: v5.22.0’s headers85172d9
rerun against main92e26d08b3104785172d9

Each operator is built for x = (a, b) and measured exactly. The computed values are read out of the number type as exact Shewchuk expansions (include/sw/mp_numerics/exact.hpp), so every error below is the error of the operator the arithmetic produced, rounded once to double for the CSV. Values beyond double’s range are first scaled by a power of two inside the type, which is exact. lns values are not dyadic and are read through double, which rounds far below lns<32,23>‘s own resolution.

columnmeaning
orth‖QᵀQ − I‖₂ of the computed operator: |c² + s² − 1| for a rotation, |g|·|g − 2| with g = τ vᵀv for a reflector
r_err|stored entry − ‖x‖| / ‖x‖, for the value a factorization keeps in place of a (r, or the first entry of H x)
annih|second entry of Q x| / ‖x‖, with Q applied exactly
annih_fpthe same entry computed in the type
nonfinitesamples with an infinity or NaN in the operator or its result
identitysamples where the routine returned the identity
grosssamples with orth or annih above max(1/2, 16 eps): the operator is wrong beyond what rounding explains. The 16 eps floor matters only for the 8-bit types. A computed value that, scaled like its data, falls outside double’s range cannot be read; it is finite, so it counts as gross, not as nonfinite: it is off by a factor near 2^1000. r_err is left out, because at the ends of a tapered or fixed-point range it mostly measures how coarsely the type represents ‖x‖

eps is std::numeric_limits<T>::epsilon(), the spacing at 1, and the tables give errors in units of it. Two cautions in reading them. A tapered type (posit, takum) is coarser below 1 than at 1, so rounding alone can cost a few eps. And dd and qd carry a bit or three more than their epsilon() (2^-105 and 2^-209) suggests, so their errors can fall below 1 eps.

namewhat it is
givens_mtl5mtl::apply_givens_rotation: r = sqrt(a·a + b·b), c = a/r, s = b/r. GMRES uses it, and MINRES and the symmetric QR iteration use the same formula
givens_max_scaleddivide by m = max(|a|, |b|) first, as LAPACK’s lapy2 does; c = a/r
givens_safe_scaledAnderson’s safe scaling, transcribed from Reference-LAPACK dlartg.f90 (3.10), its thresholds taken from std::numeric_limits
givens_pow2_scaledscale by an exact 2^-e with 2^e ≤ max(|a|, |b|), so the squares sit near 1; c and s from the scaled values
householder_mtl5mtl::householder: max-scaled, Parlett’s sign (onto +‖x‖e₁ for x₀ > 0), v(0) = 1, applied as qr_solve applies it
householder_textbookmtl::householder(x, tag::textbook_reflector): v = x − αe₁ with α = −sign(x₀)‖x‖, unscaled, unnormalized
householder_lapack_pow2dlarfg’s sign (onto −sign(x₀)‖x‖e₁) and v(0) = 1, on x scaled by an exact 2^-e

givens_mtl5 and householder_mtl5 describe MTL5 5.21.0, which the committed results measured. MTL5 5.22.0 adopted the two remedies below, so a rerun against it measures givens_mtl5 as the power-of-two scaled rotation and householder_mtl5 as the dlarfg-signed, power-of-two scaled reflector. How closely they reproduce givens_pow2_scaled and householder_lapack_pow2 is in Rerun against MTL5 5.22.0, and after the fix for the failures found there, in Rerun against MTL5 main.

inputxper row
baserandom directions, ‖x‖ = 110000 samples
scalerandom directions, ‖x‖ = 2^k for k across the type’s whole range (param = k)32 samples
tail(±1, ±2^-j (1 + u)), j from 0 to 8 past the type’s precision (param = j)32 samples
repeatpower: one operator applied k times to 16 unit vectors (dev = max | ‖y‖ − ‖y₀‖ | / ‖y₀‖, against the start vector as rounded into the type); product: k fresh operators accumulated into an 8 × 8 Q (dev = ‖QᵀQ − I‖_F)8 and 4 trials
familytypes
ieeefloat, double, long double (x87 80-bit here; the bits column records which one ran)
positposit<8,2>, <16,2>, <32,2>, <64,2>, and posit<16,1>
fixpntfixpnt<16,8> and <32,16>, each wrapping (mod) and saturating (sat)
cfloatcfloat<8,4> (FP8 E4M3) and <8,5> (E5M2), <16,5>, <24,8>, <32,8>, <40,11>, <48,11>, <56,11>, <64,11>, <80,15>, <128,15>, <256,19>; the exponent is IEEE’s where IEEE defines the size, truncated from the next IEEE size otherwise. Each in three variants: IEEE behaviour (gradual underflow, overflow to infinity), nosub (no subnormals) and sat (overflow saturates to max). The three variants of a size see the same inputs
lnslns<8,3>, <16,10>, <32,23>: the ranges of E4M3 (2^±8), binary16 (2^±16) and binary32 (2^±128)
takumlinear takum<8>, <16>, <32>, <64>, with the specified three regime bits; range 2^±255
dd, qdsw::universal::dd and qd: double’s range, two and four times its precision

test_rotations checks that cfloat<32,8> and cfloat<64,11> give float’s and double’s measures bit for bit through all seven operators, subnormals to overflow, so the cfloat rows can be read as the corresponding IEEE type’s would be.

Findings 1 to 7 come from the first part of the study (IEEE, posit, fixpnt) and hold for the types added since. Findings 8 to 12 are about the added types.

1. MTL5’s rotation fails outside half the exponent range. a·a overflows once |a| passes sqrt(max), and underflows below sqrt(min), long before r would. The clean band is k ∈ [−74, 63] for float out of [−149, 127], and [−533, 509] for double. How it fails depends on the type. In IEEE, r becomes infinite, so c = s = 0 and the rotation is the zero matrix; or r underflows to 0, and the rotation is the identity with r = 0 stored for ‖x‖. In a posit or a saturating fixed-point type, the square saturates and the rotation is finite and wrong. A wrapping fixed-point type wraps. Even inside the band, a posit’s squares land where it has few bits: posit<64,2> reaches 5×10⁸ eps. Every type added since loses the top half of its range the same way, cfloat<256,19> included (clean for k ∈ [−130423, 130188] of [−262378, 262143]). The bottom half fails in the types with IEEE-like underflow. A posit, a takum or an lns rounds a tiny square up to its smallest value instead, so there the rotation stays finite and not gross, only inaccurate (finding 8).

2. lapy2’s scaling stops the overflow, but not the loss of accuracy. With c = a/r, the error of r at the input’s own magnitude goes into c. That magnitude is subnormal in IEEE, or far from 1 in a posit, where r has few bits. The operator is not grossly wrong there, but its orthogonality error reaches 0.25: 1.1×10¹⁵ eps in double near the subnormal range, and 1.4×10¹⁷ eps in posit<64,2>. The cause is the subnormals: in every cfloat without them the max-scaled rotation is clean across the whole range, within 2.7 eps.

3. dlartg’s safe scaling guards the range, not the precision. In IEEE it is what it was designed to be: clean across the whole range, within 2.1 eps, in every cfloat from 8 to 256 bits too. In a posit it never fails grossly, but its thresholds come from the range: it scales only when an entry is beyond sqrt(min) or sqrt(max/2), and inside those bounds a posit’s squares fall where it has few bits. posit<64,2> reaches 5×10⁸ eps and posit<32,2> 9×10³ eps. The thresholds would have to come from where the type is precise, not from where it overflows. Findings 10 and 11 show the same for takum and dd.

4. Scaling by an exact power of two fixes the rotation in every type. givens_pow2_scaled is clean across the whole range of all 65 types, within 4.6 eps in dd and takum and within 2.2 eps in every other type. The scaling rounds nothing in a floating-point type and puts the squares near 1.

5. MTL5’s reflector loses accuracy on small tails in tapered and fixed-point types, because of its choice of sign. Parlett’s sign gives v₀ = −σ/(x₀ + ‖x‖), which is small when the tail is small, so after normalizing v(0) = 1 the second entry is v₁ ≈ −2x₀/x₁, which is large. In IEEE that costs nothing (about 9 eps at worst). In a posit, v₁ and 1 + v₁² land where the posit has few bits: on the tail sweep posit<32,2> reaches 512 eps and posit<64,2> 8×10⁵ eps; takum<64> reaches 207 eps. In fixed point, which has absolute precision, the reflector reaches 2.4×10³ eps in fixpnt<32,16>. In the tail sweep x₀ = ±1, so MTL5’s scaling divides by 1 and rounds nothing: the sign alone is the cause. With dlarfg’s sign, |v₀| = |x₀| + ‖x‖ ≥ ‖x‖, so every entry of the normalized v is at most 1, and householder_lapack_pow2 stays within 8.7 eps for every type, at every scale and every tail (5.4 eps outside takum). Its only failures are a few non-finite samples in the top binade of the 8- and 16-bit cfloats with IEEE overflow, where a value the reflector must form, ‖x‖ or the dot product of its application, overflows the type. MTL5’s identity fallback (mtl5#662) catches the worst cases, but only once the error exceeds the tail: from j = 8 in posit<16,2> and j = 40 in posit<64,2>.

6. MTL5’s textbook reflector is accurate but unscaled. It has the LAPACK sign and no normalization, so it is within 6.4 eps on every tail in IEEE, posits and fixed point, and within 1 eps in fixed point. Its unscaled sum of squares limits it to the same half-range band as the unscaled rotation.

7. Repeated application. One rounded rotation applied k times stretches or shrinks every vector by about k·|c² + s² − 1|/2, so the error grows linearly: 10³ to 10⁴ eps at k = 4096 (880 to 3.4×10⁴) in every type of 16 bits or more, whichever way the rotation was computed; qd, at 22 to 109 eps, holds more bits than its eps counts. A reflector is its own inverse, so applied repeatedly its errors partly cancel, and how much depends on the operator and the type: from 6 to 10⁵ eps, and more where a type saturates (finding 9). Accumulating k fresh operators into an 8 × 8 Q grows far more slowly: 30 to 540 eps at k = 1024 in every type of 16 bits or more. The 8-bit types are too narrow for it: 230 eps at best (takum<8> with power-of-two scaling) and up to 10¹⁰ eps (E5M2).

8. Without subnormals, the unscaled forms lose accuracy before they fail. A square below the smallest normal flushes to zero instead of losing bits gradually, so r and c take a relative error up to 1/2 at the bottom of the band while staying under the gross threshold: MTL5’s rotation reaches 6.6×10¹³ eps in cfloat<64,11,nosub> against 1.2 eps in cfloat<64,11>, and 2.7×10⁶ eps in cfloat<32,8,nosub>. lns has no gradual underflow either: a square below its smallest value rounds up to that value, and MTL5’s rotation reaches 5.7×10⁵ eps in lns<32,23> at the bottom of its band. The scaled forms never square a small number and are unaffected.

9. Saturation turns overflow into a large finite error. In the sweeps the saturating cfloats behave as the IEEE ones do: their rows are identical but at the very top of the range, where the norm overflows in IEEE and is clamped here. In repeated application they differ. A rounded rotation that is slightly expansive grows a vector until it overflows: in IEEE FP8, some of the 8 power trials of each rotation end at infinity (1 to 6, depending on the rotation), and are counted as non-finite. With saturation the same trials end clamped at max, and the deviation they report is 2.3×10³ eps in E4M3, 2.7×10⁵ eps in E5M2 and 3.9×10⁶ eps for MTL5’s reflector in cfloat<16,5,sat>: wrong, and nothing in the value says so.

10. Takums behave like posits, but far more gently. Their precision falls off toward the ends of the range more slowly than a posit’s. dlartg’s scaling reaches 50 to 95 eps (posit<64,2>: 5×10⁸), lapy2’s 106 to 126 eps (posit<64,2>: 1.4×10¹⁷), and MTL5’s reflector 30 to 61 eps on the scale sweep and 207 eps on the tail sweep in takum<64>. The power-of-two forms stay within 3.7 and 7.9 eps. takum<8> is too narrow to say much: at the gross threshold of 2, MTL5’s rotation is clean only from k = −239 to 122.

11. dd and qd hold full precision over less than double’s range. Below 2^-969 the low limb of a dd underflows, so its precision falls toward a double’s. numeric_limits<dd> reports double’s exponent range all the same, so dlartg’s thresholds (sqrt(min) ≈ 2^-511) let squares into that zone: 6.5×10¹³ eps in dd, 1.4×10⁴⁵ eps in qd, both near 2^-59 in absolute terms. MTL5’s rotation reaches 4.7×10²¹ eps in dd inside its band, from k = −494 down. The power-of-two forms keep the squares near 1 and stay within 3.8 eps.

12. The wide cfloats behave as IEEE does, at every width. cfloat<80,15>, <128,15> and <256,19> reproduce findings 1 to 6: the unscaled forms are limited to half the range, the scaled ones are clean to within 2.2 eps, and MTL5’s reflector stays within 9 eps. The one excess is at the bottom edge of the unscaled band, where the squares are subnormal: 1.8×10¹⁹ eps (2^-48) in cfloat<128,15>.

Both were filed as MTL5 issues and adopted on MTL5 main, to ship in 5.22.0:

  • apply_givens_rotation, and the same formula in MINRES and the symmetric QR iteration, could scale by an exact power of two before squaring, as givens_pow2_scaled does. In IEEE that costs two exponent extractions and removes the half-range limit; in a posit, takum, dd, lns or fixed point it also keeps the accuracy. It was the only rotation clean and accurate in all 65 types (mtl5#671, done in mtl5#673).
  • householder() could reflect onto −sign(x₀)‖x‖e₁, as dlarfg does. That changes the sign of R’s diagonal, which MTL5 5.21.0 kept positive (mtl5#672, done in mtl5#675, which also scales by an exact power of two and adds qr_normalize_signs for the old sign).
  • Thresholds taken from std::numeric_limits describe where a type overflows, not where it is precise. Tapered types, dd and qd need the second.

The study was rerun against MTL5 5.22.0 (cf2f8a5, mp-numerics 7fedb19, Universal 85172d9). With the remedies adopted, givens_mtl5 should reproduce givens_pow2_scaled and householder_mtl5 should reproduce householder_lapack_pow2. Comparing the two rows of each pair, every column of every input class:

pairidentical rows (base, scale, tail, repeat)
givens_mtl5 vs givens_pow2_scaled57/57, 6947/7177, 3139/3139, 1368/1368
householder_mtl5 vs householder_lapack_pow244/57, 6923/7177, 3057/3139, 905/1368

Outside the table below, the rows that differ do so at the rounding level: each pair’s worst errors are within 20% of each other. The reflector rounds differently because MTL5 forms x₀² + Σᵢ₌₁ xᵢ², adding x₀² last, where householder_lapack_pow2 sums from x₀.

The exception is the exponents nearest each end of the range in the es = 2 posits and takum<8>. There MTL5’s adopted forms fail, and the remedies don’t. The worst ‖GᵀG − I‖ over the scale sweep:

typegivens_mtl5givens_pow2_scaledhouseholder_mtl5householder_lapack_pow2
posit<8,2>1.05×10⁶ eps (192 gross)1.32 eps8 eps3.22 eps
posit<16,2>1.2×10¹⁸ eps (384 gross)1.80 eps2.1×10³ eps (331 gross)3.83 eps
posit<32,2>1.4×10⁴² eps (384 gross)1.98 eps1.3×10⁸ eps (333 gross)4.76 eps
posit<64,2>2.0×10⁹⁰ eps (384 gross)2.01 eps5.8×10¹⁷ eps (326 gross)4.28 eps
takum<8>7.1×10⁷² eps (1,376 gross)1.12 eps8 eps3.28 eps

The scaling itself is exact. The fault is in how MTL5 finds the exponent to scale by. pow2_scaling<T>::exponent(m) halves m toward [1, 2) and stops when a halving doesn’t decrease it, taking that for a non-finite m. Near the ends of a tapered type’s range, not every binade is representable, so m·½ can round back to m. The search then stops early, often at e = 0:

  • posit<16,2> at 2⁵⁶ gets e = 0 against 52.
  • takum<8> at 2¹⁰⁰ to 2²⁵⁰ gets e = 0 against 103 to 239.

The rotation then squares unscaled values. This study’s binary_exponent reads the exponent through double after exact power-of-two steps, and gets all of these right. The same search costs one multiplication per binade: 88 ms per call for cfloat<256,19> near 2²⁰⁰⁰⁰⁰, against 0.014 ms here. That is the two hours. Both are filed as mtl5#680, and fixed on MTL5 main; see Rerun against MTL5 main.

The rerun also moved the remedies’ own rows in dd and qd: 5 base, 743 dd and 43 qd scale, and 140 tail rows. The two runs used different Universal commits: 2d5c785 for the committed results, 85172d9 for the rerun. Between them Universal fixed the dd and qd defects this study reported:

  • the two_prod residual at the top of the double range (universal#1884);
  • the numeric_limits traits (universal#1887, universal#1890);
  • sums at the top of the range (universal#1892);
  • dd’s sqrt (85172d9).

These address universal#1881, universal#1882 and universal#1883. The dd and qd findings above describe Universal at 2d5c785.

The committed results stay those of 5.21.0, which the findings above describe.

mtl5#681 fixed mtl5#680 on MTL5 main. pow2_scaling’s fallback now reads the exponent through double, as binary_exponent does here, and steps by squared powers of two where a type’s range passes double’s. The study was rerun against MTL5 main at 8b31047, with mp-numerics 92e26d0 and the same Universal as the 5.22.0 rerun, 85172d9, so MTL5 is the only change between the two. The full run took 235 s, against 7,974 s for 5.22.0.

Identical rows, counted as above:

pair5.22.0 (base, scale, tail, repeat)main
givens_mtl5 vs givens_pow2_scaled57/57, 6947/7177, 3139/3139, 1368/136857/57, 7152/7177, 3139/3139, 1368/1368
householder_mtl5 vs householder_lapack_pow244/57, 6923/7177, 3057/3139, 905/136844/57, 7131/7177, 3057/3139, 905/1368

The failures are gone. The worst ‖GᵀG − I‖ over the scale sweep, now with no gross samples in any of these types:

typegivens_mtl5givens_pow2_scaledhouseholder_mtl5householder_lapack_pow2
posit<8,2>1.32 eps1.32 eps3.22 eps3.22 eps
posit<16,2>1.80 eps1.80 eps3.83 eps3.83 eps
posit<32,2>1.98 eps1.98 eps4.76 eps4.76 eps
posit<64,2>2.01 eps2.01 eps4.28 eps4.28 eps
takum<8>1.12 eps1.12 eps3.28 eps3.28 eps

Of the rows that still differ, all but 20 are unchanged from the 5.22.0 rerun, the differences described there. The 20 new ones are takums:

  • takum<8>: 11 rotation rows, from 2⁻²³⁹ to 2⁻²³³ and four from 2²³³ to 2²³⁹, and 7 reflector rows, from 2⁻²³⁹ to 2⁻²³³. They differ at the rounding level, in both directions. At the low end the rotation’s ‖GᵀG − I‖ is 1 eps against 0.44 eps, and the reflector’s annihilation error 0.19 eps against 0.92 eps.
  • takum<32>, takum<64>: one rotation row each, at 2⁻²⁵⁴, where the error in r is 86 to 88 eps against 58 to 62 eps.

Both scalings multiply once by 2^k where 2^k is a value of the type. From 2^±233 to 2^±237 it is not a value of takum<8>, and rounds to 2^±239: scale_pow2 here multiplies by that rounded 2^k, where MTL5 steps x by exact powers of two instead, so the two round differently.

The .sysinfo sidecars of this run record universal_commit=unknown, because Universal was used as an exported tree rather than a clone. The CSVs are not committed.

Not changed here; filed in Universal so the results can be read correctly.

  • std::numeric_limits<dd>::max() is not a normalized pair: its low limb is more than half an ulp of its high limb, so it converts to an infinity, and max() * dd(1) is NaN. The study takes dd’s top from double (universal#1882).
  • dd and qd products near DBL_MAX return NaN: Universal’s Dekker split rounds the high half of a value near DBL_MAX up to 2^1024, so dd(DBL_MAX) * dd(0x1p-512) is a NaN. dd_cascade’s division hits the same split. The study scales dd and qd with their own limb-wise ldexp (universal#1881).
  • std::numeric_limits<dd>::min() is 2^-969, where dd still has full precision, but min_exponent is double’s −1021 (finding 11, universal#1882).
  • dd’s sqrt is not correctly rounded: up to 7.9 units of 2^-106 (3.96 dd eps) against a qd reference on [1, 4), where dd_cascade’s is within 0.75 (universal#1883). The cfloat, lns, takum and qd square roots are correctly rounded.

plot.py draws them from results/ into figures/.

figureshows
scale_clean_range.svgthe share of each type’s exponent range where every sample is clean, per operator; each sampled exponent counts for the span of exponents it stands for, and one where every input flushes to zero counts as not clean
scale_rotations_ieee_posit_fixpnt.svg, scale_rotations_cfloat.svg, scale_rotations_lns_takum_dd_qd.svg, scale_reflectors_ieee_posit_fixpnt.svg, scale_reflectors_cfloat.svg, scale_reflectors_lns_takum_dd_qd.svgworst orthogonality across the exponent range, one panel per type; gross and non-finite rows are drawn in a band above the largest finite error
tail_reflectors_ieee_posit_fixpnt.svg, tail_reflectors_cfloat.svg, tail_reflectors_lns_takum_dd_qd.svgworst orthogonality of the three reflectors across the tail sweep
repeat_power.svg, repeat_product.svgdeviation against k for repeated application, one line per type, over the trials that stayed finite; an x marks a checkpoint where some trials overflowed, a triangle at the top one where all did

Clean share of the exponent range

Generated by summarize.py from results/. Each entry is in units of the type’s eps.

Each entry gives the range of k with no gross or non-finite sample, then the worst orthogonality within it.

typerange of kgivens_mtl5givens_max_scaledgivens_safe_scaledgivens_pow2_scaledhouseholder_mtl5householder_textbookhouseholder_lapack_pow2
float-149..127-74..63, 3.89-147..127, 2.1e+06all, 1.99all, 1.99all, 7.62-74..63, 3.5e+06all, 4.42
double-1074..1023-533..509, 1.23-1072..1023, 1.1e+15all, 1.85all, 1.46all, 8.44-533..509, 1.9e+13all, 4.31
long double-16445..16383-8186..8124, 1.99-16443..16383, 2.3e+18all, 1.99all, 2.07all, 9.09-8186..8124, 3.22all, 4.76
posit<8,2>-24..24-24..12, 8all, 8all, 5.75all, 1.32all, 3.47-24..12, 8all, 3.22
posit<16,2>-56..56-28..28, 72-43..44, 512all, 42.5all, 1.8all, 15.6-18..17, 682all, 3.83
posit<32,2>-120..120-60..60, 2.0e+04-108..108, 3.4e+07all, 9.08e+03all, 1.98all, 69.6-49..49, 4.4e+07all, 4.76
posit<64,2>-248..248-120..120, 5.0e+08-232..239, 1.4e+17all, 5.0e+08all, 2.01all, 33.6-114..111, 1.9e+17all, 4.28
posit<16,1>-28..28-13..14, 45-25..24, 1.02e+03all, 45all, 1.44all, 68.6-10..9, 1.36e+03all, 3.76
fixpnt<16,8,mod>-8..6-4..3, 16-7..6, 64all, 12.2all, 1.63all, 67.4-3..2, 59.4all, 2.94
fixpnt<16,8,sat>-8..6-4..3, 50.6-7..6, 64all, 12.2all, 1.56all, 67.4-3..2, 59.4all, 2.75
fixpnt<32,16,mod>-16..14-8..7, 327-15..14, 1.6e+04all, 252all, 1.83all, 2.01e+03-7..6, 1.3e+04all, 4.43
fixpnt<32,16,sat>-16..14-8..7, 1.03e+03-15..14, 1.6e+04all, 1.03e+03all, 1.83all, 2.08e+03-7..6, 2.5e+04all, 3.68
cfloat<8,4>-9..7-9..3, 1.06all, 8all, 1.32all, 1.12-9..6, 3.47-9..2, 3.53-9..6, 3.22
cfloat<8,4,nosub>-6..7-6..3, 2.53all, 1.32all, 1.32all, 1.06-6..6, 3.47-6..2, 2.94-6..6, 2.55
cfloat<8,4,sat>-9..7-9..4, 2.62all, 8all, 1.32all, 1.12all, 3.47-9..3, 3.93all, 3.22
cfloat<8,5>-16..15-16..7, 1.31all, 1all, 1.31all, 1.31-16..13, 3.22-16..6, 3.06-16..14, 3.22
cfloat<8,5,nosub>-14..15-14..7, 1.31all, 1all, 1.31all, 1.31-14..14, 3.22-14..6, 3.06-14..14, 3.22
cfloat<8,5,sat>-16..15-16..8, 2.81all, 1all, 1.31all, 1.31all, 3.22-16..7, 4.16all, 3.22
cfloat<16,5>-24..15-12..7, 1.2-22..15, 256all, 1.79all, 1.79-24..14, 6.24-11..6, 214-24..14, 3.89
cfloat<16,5,nosub>-13..15-6..7, 264all, 2.23all, 1.67all, 1.2all, 6.23-6..6, 240all, 3.89
cfloat<16,5,sat>-24..15-12..8, 1.84-22..15, 256all, 1.79all, 1.79all, 6.24-11..7, 214all, 3.89
cfloat<24,8>-141..127-70..63, 1.23-139..127, 8.19e+03all, 2.08all, 2.08all, 9.05-70..63, 1.4e+04all, 4.18
cfloat<24,8,nosub>-126..127-126..63, 1.1e+04all, 2.46all, 1.74all, 1.25all, 9.05-126..63, 1.0e+04all, 4.18
cfloat<24,8,sat>-141..127-70..63, 1.23-139..127, 8.19e+03all, 2.08all, 2.08all, 9.05-70..63, 1.4e+04all, 4.18
cfloat<32,8>-149..127-74..63, 4.11-147..127, 2.1e+06all, 1.77all, 1.68all, 8.3-74..63, 3.9e+06all, 5.24
cfloat<32,8,nosub>-125..127-62..63, 2.7e+06all, 2.4all, 1.77all, 1.28all, 8.14-62..63, 2.7e+06all, 4.25
cfloat<32,8,sat>-149..127-74..63, 4.11-147..127, 2.1e+06all, 1.77all, 1.68all, 8.3-74..63, 3.9e+06all, 5.24
cfloat<40,11>-1050..1023-515..501, 1.26-1049..1023, 6.7e+07all, 1.77all, 1.39all, 7.82-515..501, 455all, 4.66
cfloat<40,11,nosub>-1021..1023-508..509, 3.5e+06all, 2.49all, 1.77all, 1.26all, 7.82-508..509, 3.5e+06all, 4.66
cfloat<40,11,sat>-1050..1023-515..501, 1.26-1049..1023, 6.7e+07all, 1.77all, 1.39all, 7.82-515..501, 455all, 4.66
cfloat<48,11>-1058..1023-521..499, 1.24-1056..1023, 1.7e+10all, 1.89all, 1.89all, 7.85-521..499, 1.2e+06all, 4.45
cfloat<48,11,nosub>-1021..1023-508..509, 1.0e+09all, 2.34all, 1.87all, 1.25all, 7.85-508..509, 2.0e+08all, 4.45
cfloat<48,11,sat>-1058..1023-521..499, 1.24-1056..1023, 1.7e+10all, 1.89all, 1.89all, 7.85-521..499, 1.2e+06all, 4.45
cfloat<56,11>-1066..1023-527..511, 1.23-1064..1023, 4.4e+12all, 1.78all, 1.72all, 7.61-527..511, 5.2e+09all, 4.52
cfloat<56,11,nosub>-1021..1023-508..509, 2.5e+11all, 2.46all, 1.78all, 1.23all, 7.61-508..509, 2.5e+11all, 4.52
cfloat<56,11,sat>-1066..1023-527..511, 1.23-1064..1023, 4.4e+12all, 1.78all, 1.72all, 7.61-527..511, 5.2e+09all, 4.52
cfloat<64,11>-1074..1023-533..509, 1.24-1072..1023, 1.1e+15all, 1.87all, 1.75all, 7.68-533..509, 2.8e+13all, 4.44
cfloat<64,11,nosub>-1021..1023-508..509, 6.6e+13all, 2.52all, 1.87all, 1.27all, 7.51-508..509, 6.6e+13all, 4.44
cfloat<64,11,sat>-1074..1023-533..509, 1.24-1072..1023, 1.1e+15all, 1.87all, 1.75all, 7.68-533..509, 2.8e+13all, 4.44
cfloat<80,15>-16446..16383-8187..8124, 2.07-16444..16383, 4.6e+18all, 2.07all, 2.14all, 7.36-8187..8124, 3.1all, 4.88
cfloat<80,15,nosub>-16381..16383-8139..8140, 2.07all, 2.61all, 2.07all, 2.14all, 7.36-8139..8140, 3.1all, 4.88
cfloat<80,15,sat>-16446..16383-8187..8124, 2.07-16444..16383, 4.6e+18all, 2.07all, 2.14all, 7.36-8187..8124, 3.1all, 4.88
cfloat<128,15>-16494..16383-8223..8112, 1.8e+19-16492..16383, 1.3e+33all, 1.88all, 1.79all, 8.88-8223..8112, 2.3e+19all, 5.07
cfloat<128,15,nosub>-16381..16383-8139..8140, 1.52all, 2.7all, 1.88all, 1.79all, 8.88-8139..8140, 2.78all, 5.07
cfloat<128,15,sat>-16494..16383-8223..8112, 1.8e+19-16492..16383, 1.3e+33all, 1.88all, 1.79all, 8.88-8223..8112, 2.3e+19all, 5.07
cfloat<256,19>-262378..262143-130423..130188, 1.44-262376..262143, 2.8e+70all, 1.89all, 1.45all, 8.48-130423..130188, 2.85all, 4.31
cfloat<256,19,nosub>-262141..262143-130246..130247, 1.44all, 2.58all, 1.89all, 1.52all, 8.48-130246..130247, 2.85all, 4.31
cfloat<256,19,sat>-262378..262143-130423..130188, 1.44-262376..262143, 2.8e+70all, 1.89all, 1.45all, 8.48-130423..130188, 2.85all, 4.31
lns<8,3>-7..7-7..4, 4all, 1.44all, 1.44all, 1all, 2.43-7..3, 7.15all, 2.5
lns<16,10>-15..15-7..8, 484all, 1.5all, 1.5all, 0.994all, 3.11-7..7, 374all, 2.85
lns<32,23>-127..127-62..64, 5.7e+05all, 1.5all, 1.5all, 0.996all, 3.34-62..63, 5.8e+05all, 2.93
takum<8>-239..239-239..122, 8all, 8-239..239, 8all, 1.12all, 5.78-239..107, 8all, 3.28
takum<16>-255..254-127..126, 669all, 106all, 50.3all, 3.65all, 30.2-127..126, 599all, 6
takum<32>-255..254-127..126, 4.5e+07all, 126all, 55.8all, 3.74all, 53.6-127..126, 4.4e+07all, 7.91
takum<64>-255..254-127..126, 1.9e+17all, 117all, 94.9all, 3.65all, 60.8-127..126, 1.9e+17all, 7.62
dd-1074..1023-533..509, 4.7e+21-1072..1023, 1.0e+31all, 6.5e+13all, 3.79all, 8.92-533..509, 1.9e+29all, 4.2
qd-1074..1023-533..509, 9.6e+52-1073..1023, 2.1e+62all, 1.4e+45all, 0.133all, 0.187-533..509, 3.8e+60all, 0.149

The worst orthogonality, and the first j at which the routine returns the identity (I). The fixed-point identities of householder_lapack_pow2 start where the tail rounds to zero in the type.

typegivens_mtl5givens_max_scaledgivens_safe_scaledgivens_pow2_scaledhouseholder_mtl5householder_textbookhouseholder_lapack_pow2
float1.611.611.611.618.3 (I from j=22)3.494.07
double1.771.661.771.777.43 (I from j=51)3.893.98
long double1.662.261.661.668.53 (I from j=62)3.853.71
posit<8,2>1.321.691.321.323.47 (I from j=3)2.533.22
posit<16,2>1.881.481.881.8823.3 (I from j=8)3.664.02
posit<32,2>1.792.221.791.79512 (I from j=18)3.563.8
posit<64,2>1.911.911.911.918.0e+05 (I from j=40)3.94.14
posit<16,1>1.592.081.591.5956.1 (I from j=6)6.313.63
fixpnt<16,8,mod>1.442.151.441.4463.8 (I from j=3)0.7382.3 (I from j=10)
fixpnt<16,8,sat>1.671.861.671.6767.4 (I from j=2)0.7952.86 (I from j=10)
fixpnt<32,16,mod>1.771.771.771.772.36e+03 (I from j=5)0.8732.74 (I from j=18)
fixpnt<32,16,sat>1.992.61.991.992.41e+03 (I from j=5)0.9262.78 (I from j=18)
cfloat<8,4>1.321.691.321.323.47 (I from j=3)2.533.22 (I from j=11)
cfloat<8,4,nosub>1.321.691.321.323.47 (I from j=3)2.533.22 (I from j=7)
cfloat<8,4,sat>1.321.691.321.323.47 (I from j=3)2.533.22 (I from j=11)
cfloat<8,5>11113.22 (I from j=1)2.572.33
cfloat<8,5,nosub>11113.22 (I from j=1)2.572.33
cfloat<8,5,sat>11113.22 (I from j=1)2.572.33
cfloat<16,5>1.491.691.491.495.67 (I from j=8)3.533.46
cfloat<16,5,nosub>1.491.691.491.495.67 (I from j=7)3.533.46 (I from j=15)
cfloat<16,5,sat>1.491.691.491.495.67 (I from j=8)3.533.46
cfloat<24,8>1.61.61.61.66.56 (I from j=14)3.553.47
cfloat<24,8,nosub>1.61.61.61.66.56 (I from j=14)3.553.47
cfloat<24,8,sat>1.61.61.61.66.56 (I from j=14)3.553.47
cfloat<32,8>1.671.961.671.677.11 (I from j=22)3.714.02
cfloat<32,8,nosub>1.671.961.671.677.11 (I from j=22)3.714.02
cfloat<32,8,sat>1.671.961.671.677.11 (I from j=22)3.714.02
cfloat<40,11>1.551.71.551.557.18 (I from j=27)3.793.89
cfloat<40,11,nosub>1.551.71.551.557.18 (I from j=27)3.793.89
cfloat<40,11,sat>1.551.71.551.557.18 (I from j=27)3.793.89
cfloat<48,11>1.621.831.621.627.72 (I from j=35)3.823.97
cfloat<48,11,nosub>1.621.831.621.627.72 (I from j=35)3.823.97
cfloat<48,11,sat>1.621.831.621.627.72 (I from j=35)3.823.97
cfloat<56,11>1.671.671.671.677.98 (I from j=43)3.734.06
cfloat<56,11,nosub>1.671.671.671.677.98 (I from j=43)3.734.06
cfloat<56,11,sat>1.671.671.671.677.98 (I from j=43)3.734.06
cfloat<64,11>1.591.591.591.598.19 (I from j=51)3.733.89
cfloat<64,11,nosub>1.591.591.591.598.19 (I from j=51)3.733.89
cfloat<64,11,sat>1.591.591.591.598.19 (I from j=51)3.733.89
cfloat<80,15>1.711.711.711.717.95 (I from j=63)3.713.84
cfloat<80,15,nosub>1.711.711.711.717.95 (I from j=63)3.713.84
cfloat<80,15,sat>1.711.711.711.717.95 (I from j=63)3.713.84
cfloat<128,15>1.882.11.881.887.88 (I from j=111)3.84.08
cfloat<128,15,nosub>1.882.11.881.887.88 (I from j=111)3.84.08
cfloat<128,15,sat>1.882.11.881.887.88 (I from j=111)3.84.08
cfloat<256,19>1.51.51.51.57.72 (I from j=235)2.243.88
cfloat<256,19,nosub>1.51.51.51.57.72 (I from j=235)2.243.88
cfloat<256,19,sat>1.51.51.51.57.72 (I from j=235)2.243.88
lns<8,3>1.441.441.441.442.43 (I from j=4)2.092.09 (I from j=8)
lns<16,10>1.51.51.51.52.9 (I from j=8)1.972.9 (I from j=17)
lns<32,23>1.491.491.491.493.14 (I from j=25)1.993.14
takum<8>2221.786.45 (I from j=1)18.34.18
takum<16>2.132.132.132.1329.3 (I from j=7)7.265.15
takum<32>3.321.613.323.3296.8 (I from j=22)8.885.75
takum<64>2.352.352.352.35207 (I from j=53)8.756.07
dd4.564.564.564.565.21 (I from j=106)1.914.81
qd0.0810.0650.0810.0810.159 (I from j=215)0.09310.159

The worst deviation at the largest k, over the trials that stayed finite; “(n/m inf)” counts the trials that overflowed.

power, k = 4096:

typegivens_mtl5givens_max_scaledgivens_safe_scaledgivens_pow2_scaledhouseholder_mtl5householder_textbookhouseholder_lapack_pow2
float2.34e+033.52e+032.34e+032.34e+0314743.23.56e+03
double1.74e+032.94e+031.74e+031.74e+0330.423.52.48e+03
long double1.87e+033.46e+031.87e+031.87e+034.71e+03165623
posit<8,2>1342.4e+0313413476.27.632.45
posit<16,2>2.18e+032.18e+032.18e+032.18e+0315014.528.4
posit<32,2>1.43e+033.33e+031.43e+031.43e+0343.814.418.3
posit<64,2>1.85e+033.76e+031.85e+031.85e+0330.71471.64e+03
posit<16,1>1.73e+034.7e+031.73e+032.27e+035.4e+044982.04e+03
fixpnt<16,8,mod>3.3e+043.3e+043.3e+043.3e+043.3e+047.625.83
fixpnt<16,8,sat>3.4e+043.3e+043.4e+049.44e+038.5e+03112.2e+04
fixpnt<32,16,mod>5.57e+033.53e+035.57e+032.16e+031.7e+058.4629
fixpnt<32,16,sat>4.83e+032.09e+034.83e+032.09e+035.0e+045.88.06
cfloat<8,4>1.9 (6/8 inf)7.86 (5/8 inf)1.9 (6/8 inf)1.9 (6/8 inf)6.75 (1/8 inf)4.633.99
cfloat<8,4,nosub>1.9 (6/8 inf)7.32 (5/8 inf)1.9 (6/8 inf)1.9 (6/8 inf)6.75 (1/8 inf)4.633.99
cfloat<8,4,sat>2.25e+032.25e+032.25e+032.25e+031.11e+034.633.99
cfloat<8,5>1.22 (4/8 inf)2.49 (1/8 inf)1.22 (4/8 inf)1.22 (4/8 inf)45.45.4
cfloat<8,5,nosub>1.22 (4/8 inf)2.49 (1/8 inf)1.22 (4/8 inf)1.22 (4/8 inf)45.45.4
cfloat<8,5,sat>2.7e+052.6e+052.7e+052.7e+0545.45.4
cfloat<16,5>7.96e+031.6e+047.96e+037.96e+03972 (1/8 inf)25.351
cfloat<16,5,nosub>7.96e+031.6e+047.96e+037.96e+03972 (1/8 inf)25.351
cfloat<16,5,sat>7.96e+031.6e+047.96e+037.96e+033.9e+0625.351
cfloat<24,8>1.9e+032.73e+031.9e+031.9e+032.12e+036086.77e+03
cfloat<24,8,nosub>1.9e+032.73e+031.9e+031.9e+032.12e+036086.77e+03
cfloat<24,8,sat>1.9e+032.73e+031.9e+031.9e+032.12e+036086.77e+03
cfloat<32,8>1.03e+032.71e+031.03e+031.03e+035.23e+0376.2255
cfloat<32,8,nosub>1.03e+032.71e+031.03e+031.03e+035.23e+0376.2255
cfloat<32,8,sat>1.03e+032.71e+031.03e+031.03e+035.23e+0376.2255
cfloat<40,11>1.09e+031.09e+031.09e+031.09e+034.31e+031761.6
cfloat<40,11,nosub>1.09e+031.09e+031.09e+031.09e+034.31e+031761.6
cfloat<40,11,sat>1.09e+031.09e+031.09e+031.09e+034.31e+031761.6
cfloat<48,11>1.47e+032.44e+031.47e+031.47e+038.16e+032.17e+032.66e+03
cfloat<48,11,nosub>1.47e+032.44e+031.47e+031.47e+038.16e+032.17e+032.66e+03
cfloat<48,11,sat>1.47e+032.44e+031.47e+031.47e+038.16e+032.17e+032.66e+03
cfloat<56,11>8784.08e+038788781.1e+0412153.1
cfloat<56,11,nosub>8784.08e+038788781.1e+0412153.1
cfloat<56,11,sat>8784.08e+038788781.1e+0412153.1
cfloat<64,11>1.77e+031.77e+031.77e+031.77e+038.04e+0371.16.93e+03
cfloat<64,11,nosub>1.77e+031.77e+031.77e+031.77e+038.04e+0371.16.93e+03
cfloat<64,11,sat>1.77e+031.77e+031.77e+031.77e+038.04e+0371.16.93e+03
cfloat<80,15>1.36e+032.52e+031.36e+031.36e+031.69e+0363.6171
cfloat<80,15,nosub>1.36e+032.52e+031.36e+031.36e+031.69e+0363.6171
cfloat<80,15,sat>1.36e+032.52e+031.36e+031.36e+031.69e+0363.6171
cfloat<128,15>2.26e+033.76e+032.26e+032.26e+037.73e+0397.4117
cfloat<128,15,nosub>2.26e+033.76e+032.26e+032.26e+037.73e+0397.4117
cfloat<128,15,sat>2.26e+033.76e+032.26e+032.26e+037.73e+0397.4117
cfloat<256,19>1.55e+032.4e+031.55e+031.55e+034.92e+033.61e+032.69e+03
cfloat<256,19,nosub>1.55e+032.4e+031.55e+031.55e+034.92e+033.61e+032.69e+03
cfloat<256,19,sat>1.55e+032.4e+031.55e+031.55e+034.92e+033.61e+032.69e+03
lns<8,3>2.99e+032.99e+032.99e+032.99e+032.04e+038711.86e+03
lns<16,10>4.15e+033.08e+034.15e+034.15e+032.2e+042.2e+042.2e+04
lns<32,23>2.05e+032.65e+032.05e+032.05e+034.1e+034.1e+034.1e+03
takum<8>71.271.271.271.26.0811.12.78
takum<16>2.72e+039.13e+032.72e+032.72e+031.87e+031.02e+03267
takum<32>2.27e+032.78e+032.27e+031.74e+039.7e+034.33e+0368
takum<64>1.51e+031.51e+031.51e+034.08e+037.92e+032441.1e+04
dd3.5e+036.31e+033.5e+033.5e+035.39e+032055.29e+03
qd22.110922.122.114311236.9

product, k = 1024:

typegivens_mtl5givens_max_scaledgivens_safe_scaledgivens_pow2_scaledhouseholder_mtl5householder_textbookhouseholder_lapack_pow2
float16312716516394.510489.2
double18312417318387.398.792.9
long double25060.825125010911386.2
posit<8,2>1.3e+044.2e+048.62e+031.3e+044.6e+041.2e+051.75e+03
posit<16,2>15819316515994.7106109
posit<32,2>16114916316486.211686.7
posit<64,2>23939.624324910110793.4
posit<16,1>141171150160100143107
fixpnt<16,8,mod>50810451485.4200212242
fixpnt<16,8,sat>466107487105231175227
fixpnt<32,16,mod>41712542784.2224195235
fixpnt<32,16,sat>4109238890.7229181218
cfloat<8,4>2.1e+047.5e+041.0e+042.1e+046.8e+04 (2/4 inf)- (4/4 inf)1.04e+03
cfloat<8,4,nosub>1.9e+045.1e+042.2e+041.9e+043.4e+05 (2/4 inf)- (4/4 inf)826
cfloat<8,4,sat>2.1e+047.5e+041.0e+042.1e+044.2e+051.8e+051.04e+03
cfloat<8,5>1.3e+084.0e+056.6e+071.3e+084.6e+04- (4/4 inf)7.0e+06
cfloat<8,5,nosub>1.3e+084.0e+056.6e+071.3e+084.6e+04- (4/4 inf)7.0e+06
cfloat<8,5,sat>1.3e+084.0e+056.6e+071.3e+084.6e+041.4e+107.0e+06
cfloat<16,5>16419116516494.613088.9
cfloat<16,5,nosub>16619416516689.9122105
cfloat<16,5,sat>16419116516494.613088.9
cfloat<24,8>17313616917387.892.588.1
cfloat<24,8,nosub>17313616917387.892.588.1
cfloat<24,8,sat>17313616917387.892.588.1
cfloat<32,8>17414416817489.411689.9
cfloat<32,8,nosub>17414416817489.411689.9
cfloat<32,8,sat>17414416817489.411689.9
cfloat<40,11>16014915916097.510987.8
cfloat<40,11,nosub>16014915916097.510987.8
cfloat<40,11,sat>16014915916097.510987.8
cfloat<48,11>1711311541719796.894.6
cfloat<48,11,nosub>1711311541719796.894.6
cfloat<48,11,sat>1711311541719796.894.6
cfloat<56,11>17212017317290.210287.1
cfloat<56,11,nosub>17212017317290.210287.1
cfloat<56,11,sat>17212017317290.210287.1
cfloat<64,11>1641121631648212079.5
cfloat<64,11,nosub>1641121631648212079.5
cfloat<64,11,sat>1641121631648212079.5
cfloat<80,15>24043.2233240103104105
cfloat<80,15,nosub>24043.2233240103104105
cfloat<80,15,sat>24043.2233240103104105
cfloat<128,15>47.643.546.147.685.287.294.3
cfloat<128,15,nosub>47.643.546.147.685.287.294.3
cfloat<128,15,sat>47.643.546.147.685.287.294.3
cfloat<256,19>38.143.631.738.183.997.578
cfloat<256,19,nosub>38.143.631.738.183.997.578
cfloat<256,19,sat>38.143.631.738.183.997.578
lns<8,3>2861.5e+042932861.2e+042.1e+05591
lns<16,10>39.341.839.139.3114131120
lns<32,23>33.441.933.633.4125132125
takum<8>1.7e+043.8e+035.28e+032307141.8e+042.32e+03
takum<16>173168174100159228156
takum<32>16811717179.7149228152
takum<64>21475.4211381143234151
dd14053914514037253.8366
qd1.491.391.351.492.591.213.07