Excel 16.0 build 19929
Windows, bitness not recorded, CPU not recorded
32 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.
Math and trigonometry functions
Matches all 3,711 recorded answers
Recorded: 3,684 in the answer bank and 27 workbook cells. How we measure this · See the Rust code
Every language in the source keeps the English name.
| Language | Name in Excel |
|---|---|
| Arabic | COS |
| Bulgarian | COS |
| Czech | COS |
| Danish | COS |
| German | COS |
| Greek | COS |
| English (Australia) | COS |
| English (United Kingdom) | COS |
| English (United States) | COS |
| Spanish | COS |
| Estonian | COS |
| Finnish | COS |
| French | COS |
| Hebrew | COS |
| Croatian | COS |
| Hungarian | COS |
| Indonesian | COS |
| Italian | COS |
| Japanese | COS |
| Korean | COS |
| Lithuanian | COS |
| Latvian | COS |
| Norwegian | COS |
| Dutch | COS |
| Polish | COS |
| Portuguese (Brazil) | COS |
| Portuguese (Portugal) | COS |
| Romanian | COS |
| Russian | COS |
| Slovak | COS |
| Slovenian | COS |
| Serbian (Latin) | COS |
| Swedish | COS |
| Thai | COS |
| Turkish | COS |
| Ukrainian | COS |
| Vietnamese | COS |
| Chinese (Simplified) | COS |
| Chinese (Hong Kong) | COS |
| Chinese (Traditional) | COS |
Names from Microsoft's support site.
COS(number)
COS(number) returns the cosine of an angle in radians. Microsoft's page says exactly that,
and adds the conversion note: use RADIANS(x) or multiply degrees by PI()/180.
The mathematics, as A&S chapter 4.3 states it:
cos z = (e^{iz} + e^{-iz}) / 2
cos x = 1 - x²/2! + x⁴/4! - x⁶/6! + … (convergent for all x)
| Property | Statement |
|---|---|
| Domain | all real x (mathematically; see the guard note below) |
| Range | [-1, 1], attained |
| Parity | even: cos(-x) = cos(x) |
| Period | 2π, and cos(x + π) = -cos(x) |
| Zeros | x = π/2 + kπ, all simple — none of them is a binary64 number |
| Pythagorean identity | cos²x + sin²x = 1 |
| Phase shift | cos x = sin(x + π/2) |
| Derivative | d/dx cos x = -sin x |
| Entire | no poles, no branch cuts anywhere in the complex plane |
The row that carries the most practical weight is the one about zeros. π/2 is irrational, so
no double is exactly a zero of the cosine; COS(PI()/2) is not zero and cannot honestly be
expected to be. What it is equals, to first order, the distance from the double PI()/2 to
the true π/2 — which makes it a direct readout of how well the constant is rounded, not a
defect in the cosine.
There is no analytic difficulty in cosine anywhere. It is entire, it is bounded, and its Taylor series converges everywhere. The entire numerical problem is argument reduction, and that is the subject of the numerical notes.
| Argument | Meaning | Notes |
|---|---|---|
number | The angle in radians. Required. | Microsoft states no magnitude constraint on this page |
Returns Number in [-1, 1].
COS(0) = 1 exactly, and that is the one value the function returns exactly for
a reason rather than by luck.cos of it has one true value.
The question is only whether an implementation computes it. See below.COS(PI()) — not exactly -1, for the same reason COS(PI()/2) is not exactly 0.non_finite=num half of the
real-result policy can only fire because of the argument guard, never because of the value.Microsoft's COS page documents no error conditions. The shared call model supplies the rest:
non-numeric text in the numeric slot surfaces #VALUE!, and an error value in the argument
propagates. The mechanically rendered battery beside this page shows the boundary probes.
If the circular_trig_overflow guard noted above corresponds to Excel behaviour, a large enough
argument would produce #NUM! — an outcome Microsoft's page does not document for COS. That
is stated here as an open question, not as behaviour.
Cosine is the textbook case where the interesting error is committed before the approximation starts.
The reduction problem. To evaluate cos x you write x = k·(π/2) + r with |r| ≤ π/4,
then use a polynomial in r and a quadrant rule. Since π/2 is irrational, computing r
requires the true π/2 to enough bits. If the reduction uses a π/2 stored to p bits, the
computed r carries an absolute error of roughly |x| · 2^-p, and because cos has unit
derivative near its zeros, that absolute error passes straight into the result. For |x| near
2^30 and a 64-bit stored constant the reduced argument can be wrong in its leading bits;
by |x| near 2^60 it can be entirely noise.
The three standard answers:
x - k·π/2 in stages. Cheap, and correct only up to a stated argument
magnitude, which the authors state.2/π
and keep only the fractional part. Correct for every finite double, at real cost. This is
what a math-correct flavour must do.FPREM1 instruction reduces against a π stored in ROM to
66 bits. Fast, and its accuracy ceiling is that constant.What the evidence says. EV-MATH-0004 is a substrate identification covering all six
circular surfaces, each scored individually. It names the substrate as the x87
FSIN/FPTAN chain with FPREM1 argument reduction against the 64-bit ROM π, and it
records that Cody–Waite reduction against extended π is ruled out — the pre-sign-off
catalogue row recorded large argument-reduction drift in the moderate-to-large range, which is
the fingerprint of a limited-precision reduction constant rather than a bad polynomial. The
figures live in the evidence layer and render beside this page. The record also carries a
host-CPU microcode caveat on FPREM1/FSIN/FPTAN: an answer produced through those
instructions is a property of the CPU as much as of the software, so this surface's last bits
are platform-scoped by construction.
The polynomial half is the easy half. Once |r| ≤ π/4, a minimax polynomial in r² of
modest degree delivers well under an ulp; A&S 4.3.98–4.3.99 gives the classical coefficient
sets, fdlibm's __kernel_cos is the standard modern reference, and correctly-rounded
implementations (CRlibm, and the CORE-MATH successors) show the achievable target.
A note for anyone building SEC or comparing against it: computing 1/COS(x) from the
published (already rounded to binary64) cosine double-rounds — the cosine's own error is
inverted along with the value. That is a different function from a directly-evaluated secant,
and EV-MATH-0004 records the reciprocal construction explicitly.
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
COS · 3 lines · calc-func/src/catalogue/math.rs on GitHub10 cos "COS" (1, 1) [V "number"] |s, a, sv| {
raw(s, a, ExcelRealPolicy::CIRCULAR_TRIG, k::cos::cos_kernel)
}
cos_kernel · 5 lines · calc-func/src/ported/cos.rs on GitHub/// W109 G4-01: the COS π/2-quadrant chain with the |x| < 2^-26 -> 1.0
/// shortcut (see `excel_numeric::excel_cos`).
pub fn cos_kernel(n: f64) -> f64 {
crate::ported::excel_numeric::excel_cos(n)
}
raw catalogue/mathcos_with ported/excel_numericexcel_cos ported/excel_numericpack_raw ported/excel_numeric/soft87zero ported/excel_numeric/soft87inf ported/excel_numeric/soft87pack ported/excel_numeric/soft87ext_pi ported/excel_numeric/soft87ext_one ported/excel_numeric/soft87ext_abs ported/excel_numeric/soft87ext_chs ported/excel_numeric/soft87No implementation has been published with a Handbook test suite for this function.
The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.
| Excel 16.0 build | Platform and CPU | Captured inputs |
|---|---|---|
| 19929 | Windows, bitness not recorded, CPU not recorded | 32 |
| 20131 | Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics | 913 |
| 20228 | Windows, 64-bit, CPU not recorded | 1,540 |
| 20430 | Windows, 64-bit, CPU not recorded | 1,224 |
Agreement on these compared inputs does not establish agreement on unmeasured inputs.
Recorded environments and comparison details.
Windows, bitness not recorded, CPU not recorded
32 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.
Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics
913 captured inputs are indexed for this environment. Capture dates: 2026-07-11 to 2026-07-11. This is a reading count, not a comparison with another build.
Windows, 64-bit, CPU not recorded
1,540 captured inputs are indexed for this environment. Capture dates: 2026-08-09 to 2026-08-09. This is a reading count, not a comparison with another build.
Windows, 64-bit, CPU not recorded
1,224 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.
SIN, TAN — the other two published primaries. EV-MATH-0004 treats all six circular
functions as one identification problem, and it is the right way to read them.SEC — the reciprocal, 1/COS. EV-MATH-0004 records that the reciprocal surfaces are
built from the published primaries, which matters: see the numerical notes.ACOS — the inverse, principal branch [0, π]. ACOS(COS(x)) recovers x only on
[0, π]; elsewhere it returns the folded representative.cosh x = cos(ix). The name is the only
thing they share computationally: COSH overflows and has no reduction problem, COS cannot
overflow and has nothing but a reduction problem.RADIANS, DEGREES — the unit converters that stand between this
function and most spreadsheet users.IMCOS — the complex-argument version, which needs COS, SIN, COSH and SINH
together.PI() — the constant whose rounding sets the error at every "should be zero" point.No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents