Skip to content

feat(math): machine-checked rounding bound for the f32 cosine kernel (MATHF32-P05 rounding half) - #304

Merged
avrabe merged 1 commit into
mainfrom
feat/cos-poly-rounding-proof
Jul 22, 2026
Merged

feat(math): machine-checked rounding bound for the f32 cosine kernel (MATHF32-P05 rounding half)#304
avrabe merged 1 commit into
mainfrom
feat/cos-poly-rounding-proof

Conversation

@avrabe

@avrabe avrabe commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The cosine analogue of the shipped sin rounding proof (MATHF32-P03) — the second machine-checked FP-kernel proof, landed this session.

What lands

  • proofs/gappa/cos_poly_rounding.gappa: the f32 Horner evaluation of cos_poly is within 2⁻²³ of the exact real value of the same polynomial over r ∈ [−0.8, 0.8]. Gappa → Flocq → coqc kernel-check (Gappa's own success never trusted).
  • 2⁻²³ (vs sin's 2⁻²⁴): cos_poly carries the extra 1 − 0.5·z subtraction — one more rounding step.
  • Non-vacuous, verified clean: 2⁻²⁸ fails to build ("some properties were not satisfied"); 2⁻²³ builds green. Teeth confirmed.
  • Auto-enforced by the required rocq.yml gate (//proofs/gappa:all).

Provenance

Drafted in parallel by a Fable subagent, then independently re-verified here — I re-ran the kernel-check and the negative test myself rather than trust the agent's reported bound (the first ambiguous "cached PASSED" was rejected; the marginal 2⁻²⁴ was set aside for a clean 2⁻²⁸ refutation).

Honest scope

This is the rounding half of MATHF32-P05. The approximation half (|Q(r) − cos r|, Coq-Interval) is blocked on a toolchain gap — Coq-Interval won't load without mathcomp, filed as rules_rocq_rust#43. P05 stays proposed until that half lands; nothing over-claimed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG

…(MATHF32-P05, rounding half)

The cosine analogue of the shipped sin proof (MATHF32-P03): the f32 Horner
evaluation of cos_poly is faithful to within 2^-23 of the exact real value
of the same polynomial over the reduced range r ∈ [-0.8, 0.8]. Gappa
(gappa -Bcoq) emits a Flocq/Rocq term; coqc KERNEL-CHECKS it — never
trusting Gappa's own success (rules_rocq_rust gappa_proof, rivet CC-002).

2^-23 (not 2^-24 like sin): cos_poly carries the extra `1 - 0.5*z`
subtraction, which contributes an additional rounding step. Verified
green + NON-VACUOUS in a clean run — an impossible bound (2^-28) fails to
build ("some properties were not satisfied"), so the pass has teeth.
Auto-enforced by the required rocq.yml gate (//proofs/gappa:all).

Drafted in parallel by a subagent and INDEPENDENTLY re-verified here (its
own claim of the bound was not taken on trust — I re-ran the kernel-check
and the negative test myself).

This is the ROUNDING half of MATHF32-P05. The APPROXIMATION half
(|Q(r)-cos r|, Coq-Interval) is BLOCKED on a toolchain gap: Coq-Interval
won't load without mathcomp (rules_rocq_rust#43). P05 stays proposed
until that half lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG
@avrabe
avrabe merged commit 85b6fa4 into main Jul 22, 2026
59 checks passed
@avrabe
avrabe deleted the feat/cos-poly-rounding-proof branch July 22, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant