Fast math across float32

Every float32 bit pattern through NVIDIA's float32 instructions, with and without --use_fast_math. Each cell summarizes 131,072 inputs; color shows the largest error.

Reference: float64 result → rounded to float32
function
A
B
color
Drag on a heatmap to zoom.

A

B

Bit layout

15 bits pick the cell (click to flip). The other 17 vary inside it: 2 × 256 × 64 cells × 131,072 = 232.

Rows: exponent. Columns: mantissa. Left +x, right −x. Drag to zoom, Esc to reset.

Error by magnitude

Max ULP error per exponent binade, A vs B Symlog y axis. The amber crosshair follows the hovered row.

Max ULP per exponent row. Solid: A. Dashed: B.

Instructions

A

source

        
PTX

      

B

source

        
PTX

      

PTX from nvcc , -arch=sm_90 -O3 (B adds --use_fast_math where shown), load/store boilerplate removed. Amber: approx, ftz, full.

Example inputs

Measured outputs for the selected function. Click a row to jump to its cell.

Fast math is a bundle of instruction choices. Each one trades accuracy differently; compare the instructions, not the flag.