FN-DISC-001: The discount-security functions run a fixed formula order on the x87 unit
Detail for matching Excel's bits · measured · recorded 2026-11-04
With B the year basis and D the day count, Excel evaluates DISC = (1 - pr/red) * (B/D); INTRATE = ((red - inv)/inv) * (B/D); RECEIVED = inv / (1 - (disc*D)/B); PRICEDISC = red - ((disc*red)*D)/B; TBILLYIELD = ((100 - pr)/pr) * (360/D), each + - * / taken from the x87 unit at precision 64 and stored to binary64. Results can sit several units from the exact value: the DISC row below is 5 units below it.
| Call and input route | Inputs | Excel | Correct value | Recorded in |
|---|---|---|---|---|
DISC(37655, 38261, 94.87631295104353, 102.73579504052532, 3)cell-value2 | settlement: 376550x40e262e000000000maturity: 382610x40e2aea000000000pr: 94.876312951043530x4057b81582ea72c4redemption: 102.735795040525320x4059af174414e760basis: 30x4008000000000000 | 0.0460778686841366860x3fa79784b622b014 | 0.046077868684136720x3fa79784b622b019 | Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H |
TBILLYIELD(47701, 47702, 2.279784366464575)cell-value2 | settlement: 477010x40e74aa000000000maturity: 477020x40e74ac000000000pr: 2.2797843664645750x40023cff95ff2def | 15430.967132487090x40ce237bcaff517a | 15430.9671324870870x40ce237bcaff5178 | Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H |
INTRATE(58548, 58599, 428532.13421818457, 6.805737049418593, 0)cell-value2 | settlement: 585480x40ec968000000000maturity: 585990x40ec9ce000000000investment: 428532.134218184570x411a27d089707de5redemption: 6.8057370494185930x401b39132211b6adbasis: 00x0000000000000000 | -7.1998856531334690xc01cccaed31c9766 | — | Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H |
Correct value: Exact rational value of the same formula from the binary64 inputs, correctly rounded.
Correct value: Exact rational value of the same formula from the binary64 inputs, correctly rounded.
Basis: 2,400 of 2,400 rows for each function with stored precision-64 arithmetic. Plain binary64 matches 2,398 to 2,399 of the same rows, so few rows separate the two; keeping intermediates in 80-bit registers without stores loses 475 to 1,335.
Evidence and capture sources
- DnaCalc · crates/calc-func/tests/f3_financial.rs 26bb1800d3b349e44d594bed5f8bb589b528ef10 · lines 435-466 recorded answers pinned
- DnaCalc-Research · evidence/round23/security-1900-hard/summary.json f1774082865e3a5ab7dec27ead7aeebb73b078c2 · counts stored-PC64 against other precisions
- DnaCalc-Research · round23-result.json f1774082865e3a5ab7dec27ead7aeebb73b078c2 · recorded_completed_groups 18,040 of 18,040 outcomes
- CalcFunc-Evidence · cache/oracle-20430/build-20430/DISC.jsonl.gz 4d5320dfdc385354469b4d506153357bb932ab08 · line 1458, key DISC|0x40e262e000000000|0x40e2aea000000000|0x4057b81582ea72c4|0x4059af174414e760|0x4008000000000000
- CalcFunc-Evidence · cache/oracle-20430/build-20430/TBILLYIELD.jsonl.gz 4d5320dfdc385354469b4d506153357bb932ab08 · line 413, key TBILLYIELD|0x40e74aa000000000|0x40e74ac000000000|0x40023cff95ff2def
- CalcFunc-Evidence · cache/oracle-20430/build-20430/INTRATE.jsonl.gz 4d5320dfdc385354469b4d506153357bb932ab08 · line 2326, key INTRATE|0x40ec968000000000|0x40ec9ce000000000|0x411a27d089707de5|0x401b39132211b6ad|0x0000000000000000