v135 · javascript
Float16Array
Adds the Float16Array typed array. Number values are rounded to IEEE fp16 when writing into Float16Array instances.
concepts
-
Float16Array round-trip
Bit-level demo: type a value, see what survives an fp16 round-trip, and compare byte counts against Float32 / Float64.
-
Image tensor downsample
The motivating ML / graphics use case from the TC39 proposal. A 64×64 image is normalised into a tensor; the fp32 and fp16 reconstructions sit side-by-side along with bytes used and peak per-channel error.
-
Half-precision budget
Type any Float64 value and see what it becomes in Float32 vs Float16. Bytes saved — per element and per million-element tensor — appear alongside the rounding error so you can decide which pipelines can afford the cut.
-
Precision Visualizer
Enter any number and see the fp16 vs fp32 stored values, bit patterns, absolute and relative error, and a number-line showing the gap between representable Float16 values. Includes a tensor memory footprint slider.
-
Audio sample compression
One second of PCM audio (44100 samples) stored as
Float32Array(172 KB) vsFloat16Array(86 KB). Side-by-side waveforms show the compression is visually lossless. Choose from five signal types — sine, square, sawtooth, white noise, and speech envelope — and see max error, mean absolute error, estimated SNR, and a per-sample precision table.
why it shipped
Stage 3 TC39 proposal