Excel 16.0 build 19929
Windows, bitness not recorded, CPU not recorded
35 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 2,117 recorded answers
Recorded: 2,114 in the answer bank and 3 workbook cells. How we measure this · See the Rust code
Every language in the source keeps the English name.
| Language | Name in Excel |
|---|---|
| Arabic | TAN |
| Bulgarian | TAN |
| Czech | TAN |
| Danish | TAN |
| German | TAN |
| Greek | TAN |
| English (Australia) | TAN |
| English (United Kingdom) | TAN |
| English (United States) | TAN |
| Spanish | TAN |
| Estonian | TAN |
| Finnish | TAN |
| French | TAN |
| Hebrew | TAN |
| Croatian | TAN |
| Hungarian | TAN |
| Indonesian | TAN |
| Italian | TAN |
| Japanese | TAN |
| Korean | TAN |
| Lithuanian | TAN |
| Latvian | TAN |
| Norwegian | TAN |
| Dutch | TAN |
| Polish | TAN |
| Portuguese (Brazil) | TAN |
| Portuguese (Portugal) | TAN |
| Romanian | TAN |
| Russian | TAN |
| Slovak | TAN |
| Slovenian | TAN |
| Serbian (Latin) | TAN |
| Swedish | TAN |
| Thai | TAN |
| Turkish | TAN |
| Ukrainian | TAN |
| Vietnamese | TAN |
| Chinese (Simplified) | TAN |
| Chinese (Hong Kong) | TAN |
| Chinese (Traditional) | TAN |
Names from Microsoft's support site.
TAN(number)
TAN(number) is the circular tangent of an angle measured in radians:
tan x = sin x / cos x
pi/2, where cos x = 0.(-infinity, +infinity) on
each of its branches.x = (2k+1) * pi/2 for every integer k. The function changes
sign across each pole: tan(x) -> +infinity from the left of pi/2 and -infinity from the
right. These are genuine poles of the real function, not branch cuts; tangent is meromorphic.pi, not 2*pi. This is the identity most often mis-remembered, and it is why a
correct implementation reduces modulo pi/2 and then selects between a tangent and a
cotangent kernel.tan x = x + x^3/3 + 2 x^5/15 + 17 x^7/315 + ..., with radius of
convergence pi/2 — the distance to the nearest pole. The coefficients involve the Bernoulli
numbers; A&S chapter 4 gives the closed form.pi, same as sine.The identity that matters for implementation is the half-angle relation
tan(x + pi/2) = -1/tan(x) — the reason a tangent kernel and its reciprocal are the same
kernel with a branch selector.
Microsoft's page states one remark and it is the calling convention: the argument is in
radians; convert degrees by multiplying by PI()/180 or by using RADIANS.
| Argument | Meaning | Default |
|---|---|---|
number | The angle, in radians. Required. | — |
The misunderstood position, again, is the units. TAN(45) is not one.
Returns Number.
The pole is the edge that has no clean answer. No binary64 number is an odd multiple of
pi/2, so no representable argument sits exactly on a pole: TAN always has a finite answer
to give. What it gives near a pole is enormous and almost entirely determined by how accurately
the implementation knows the distance from the argument to the true pole — see Numerical
notes. A reader who expects TAN(PI()/2) to be an error or an infinity should expect neither;
PI()/2 is a double that differs from the real pi/2, and the tangent of that double is a
large finite number.
Microsoft's page lists no errors for TAN.
TAN inherits every argument-reduction difficulty of SIN (see that page for the three-regime
scheme, Cody-Waite and Payne-Hanek) and adds one of its own: conditioning near the poles.
The conditioning statement. The relative condition number of tangent is
x / (sin x cos x), which blows up as x approaches a pole. Concretely: if the reduced
argument r — the distance from x to the nearest odd multiple of pi/2 — carries a relative
error eps, then tan x carries a relative error of roughly eps as well, but r itself is
the result of a catastrophic cancellation. For an argument near a pole, almost all the
significant digits of r came from the bits of pi used in the reduction. An implementation
whose stored pi is short delivers a TAN near the poles whose leading digits are noise.
This is the practical reason the trig family's substrate matters more for TAN than for SIN.
Sine is bounded and locally linear at its zeros, so a reduction error shows up as a small
absolute error. Tangent multiplies the same reduction error by an unbounded factor.
Do not compute TAN as SIN/COS. Two separately rounded transcendental evaluations,
divided, give you both errors plus the division's; worse, near a pole the COS in the
denominator is itself the badly conditioned quantity, so the composition compounds exactly the
error you most wanted to control. The standard formulations (Cody & Waite; fdlibm's
__kernel_tan) evaluate a single rational approximation on the reduced argument and select
between t and -1/t from the parity of the reduction quotient, so the reduction is performed
once and the reciprocal branch reuses it.
Testing implication. A vector suite for TAN that samples uniformly over a wide interval
is testing the easy part. The informative vectors are: arguments within a few ULP of
k*pi + pi/2 for a spread of k; arguments within a few ULP of k*pi; and the large-argument
witnesses from the reduction literature.
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.
TAN · 3 lines · calc-func/src/catalogue/math.rs on GitHub20 tan "TAN" (1, 1) [V "number"] |s, a, sv| {
raw(s, a, ExcelRealPolicy::CIRCULAR_TRIG, k::tan::tan_kernel)
}
raw catalogue/mathtan_with ported/excel_numericexcel_tan 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_chs ported/excel_numeric/soft87tan_kernel ported/tanNo 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 | 35 |
| 20131 | Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics | 890 |
| 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
35 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
890 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,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 and COS — TAN = SIN/COS mathematically, though a good implementation does not
compute it that way (see below).ATAN and ATAN2 — the inverses. ATAN returns the principal branch (-pi/2, pi/2);
ATAN2 recovers the quadrant from a coordinate pair and is the function to use when the
angle of a vector is wanted.TANH — the hyperbolic sibling, related by tan(ix) = i tanh(x). The contrast is
instructive: TANH is bounded and has no real poles, so it is numerically placid where TAN
is not.RADIANS / DEGREES / PI — the conversion apparatus.No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents