
=== 1. signed overflow, x+1 > x, called with x = INT_MAX ===
clang -O0            f(INT_MAX) = 0
clang -O2            f(INT_MAX) = 1
clang -O2 -fwrapv    f(INT_MAX) = 0
with -ftrapv at -O0: exit code -4 (SIGILL is 4, SIGTRAP is 5, so -4 or -5 means the overflow trapped)

=== 2. INT_MIN / -1 in C ===
exit code (negative = killed by signal): -8 (SIGFPE is 8, so -8)
our floordiv on the same inputs: -2147483648

=== 3. a*b+c with and without fused multiply add ===
clang -march=native -ffp-contract=fast         -> 5.96046448e-08
clang -march=native -ffp-contract=off          -> 0
python, rounding a*b first as float32 does: 0 (matches the unfused build)
python, rounding once after the add, as a fused instruction does: 5.96046448e-08 (matches the fused build)
fused instruction in the assembly: ['vfmadd213ss\t%xmm2, %xmm1, %xmm0     # xmm0 = (xmm1 * xmm0) + xmm2']

=== 4. float rules that look free and are not ===
x + 0.0      simplify gives unchanged
x + (-0.0)   simplify gives x
x * 1.0      simplify gives x
x * 0.0      simplify gives unchanged
   at x = -0.0:  x+0.0 -> 0.0   x*0.0 -> -0.0
   at x = inf:  x+0.0 -> inf   x*0.0 -> nan
   at x = nan:  x+0.0 -> nan   x*0.0 -> nan

=== 5. hash consing ===
(p+q) is (p+q): True
nodes in (p+q)*(p+q)+(p+q): 5 (a tree would have 11)
-0.0 and 0.0 are different nodes: True
1 and True are different nodes: True
python says 1 == True: True  and 0.0 == -0.0: True

=== 6. rules that undo each other never reach a fixpoint ===
RewriteLimit raised: more than 1000 rewrite steps; busiest rules: [('distribute', 498), ('factor', 497)]
distribute alone terminates: %5 = add %2, %4

=== 7. index arithmetic before and after (i in [0,15], j in [0,3], k in [0,7]) ===
(i*4+j)//4         nodes  6 ->  1   i                        checked on all 512 inputs: True
(i*4+j)%4          nodes  6 ->  1   j                        checked on all 512 inputs: True
j%4                nodes  3 ->  1   j                        checked on all 512 inputs: True
(i*8+k)//8         nodes  6 ->  1   i                        checked on all 512 inputs: True
((i*4+j)//2)//2    nodes  8 ->  1   i                        checked on all 512 inputs: True
(i*6+k)%6          nodes  6 ->  3   (k % 6)                  checked on all 512 inputs: True
(i*6+k)//3         nodes  7 ->  7   ((i * 2) + (k // 3))     checked on all 512 inputs: True
max(j,4)           nodes  3 ->  1   4                        checked on all 512 inputs: True
j<4                nodes  3 ->  1   True                     checked on all 512 inputs: True
(i+3)+5            nodes  5 ->  3   (i + 8)                  checked on all 512 inputs: True
(i*2)*3            nodes  5 ->  3   (i * 6)                  checked on all 512 inputs: True
(i+k)*0            nodes  5 ->  1   0                        checked on all 512 inputs: True

=== 8. relu(x*y+1) rendered ===
float relu(float p0, float p1) {
  float v0 = p0 * p1;
  float v1 = v0 + 1.0f;
  float v2 = (v1 > 0.0f) ? v1 : 0.0f;
  return v2;
}

relu(2, 3) = 7.0  relu(-2, 3) = 0.0
