Excel 16.0 build 19929
Windows, bitness not recorded, CPU not recorded
43 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 181,412 recorded answers
Recorded: 181,409 in the answer bank and 3 workbook cells. How we measure this · See the Rust code
| Language | Name in Excel |
|---|---|
| Arabic | ATAN |
| Bulgarian | ATAN |
| Czech | ATAN |
| Danish | ARCTAN |
| German | ARCTAN |
| Greek | ATAN |
| English (Australia) | ATAN |
| English (United Kingdom) | ATAN |
| English (United States) | ATAN |
| Spanish | ATAN |
| Estonian | ATAN |
| Finnish | ATAN |
| French | ATAN |
| Hebrew | ATAN |
| Croatian | ATAN |
| Hungarian | ARCTAN |
| Indonesian | ATAN |
| Italian | ARCTAN |
| Japanese | ATAN |
| Korean | ATAN |
| Lithuanian | ATAN |
| Latvian | ATAN |
| Norwegian | ATAN |
| Dutch | BOOGTAN |
| Polish | ATAN |
| Portuguese (Brazil) | ATAN |
| Portuguese (Portugal) | ATAN |
| Romanian | ATAN |
| Russian | ATAN |
| Slovak | ATAN |
| Slovenian | ATAN |
| Serbian (Latin) | ATAN |
| Swedish | ATAN |
| Thai | ATAN |
| Turkish | ATAN |
| Ukrainian | ATAN |
| Vietnamese | ATAN |
| Chinese (Simplified) | ATAN |
| Chinese (Hong Kong) | ATAN |
| Chinese (Traditional) | ATAN |
Names from Microsoft's support site.
ATAN(number)
ATAN(number) is the principal inverse tangent: the angle in radians whose tangent is number.
atan: R -> (-pi/2, pi/2), tan(atan x) = x
tan maps each open interval (k*pi - pi/2, k*pi + pi/2) onto the
whole real line, so the inverse needs a branch choice but no domain restriction.(-pi/2, pi/2). The endpoints are approached and never attained;
atan(x) -> ±pi/2 only in the limit.atan(-x) = -atan(x).d/dx atan x = 1/(1 + x^2). Bounded by 1, never zero, smooth everywhere.
ATAN has no singularities, no poles, no branch points on the real line, and no domain edge.
It is the best-conditioned of the inverse circular functions and that is why it is the one
everything else is built from.atan x = x - x^3/3 + x^5/5 - x^7/7 + ... for |x| <= 1 (the Gregory
series). It converges glacially near |x| = 1 — at x = 1 it is the Leibniz series for pi/4,
famous for needing hundreds of terms per digit — which is why no implementation uses it without
reduction.atan x = pi/2 - 1/x + 1/(3x^3) - ... for large positive x.atan(x) + atan(1/x) = pi/2 for x > 0, and -pi/2 for x < 0. This is the reciprocal
reduction, and it is what makes large arguments cheap.atan(u) + atan(v) = atan((u+v)/(1-uv)) modulo pi, which is the basis
of every classical range reduction and of the Machin-like formulas for pi.atan(x) = asin(x / sqrt(1 + x^2)).[-i, i] — nothing on the
real line is cut, which is the exact statement of the unrestricted real domain.Abramowitz & Stegun cover the arctangent in chapter 4 section 4.4, including the addition formula and the continued fraction.
| Argument | Meaning | Default |
|---|---|---|
number | The tangent of the angle you want. Required. | — |
The quoted one-line description is Microsoft's text, from its support article https://support.microsoft.com/en-us/office/atan-function-50746fa8-630a-406b-81d0-4a2aed395543.
The misunderstood point is the quadrant. ATAN cannot tell you which quadrant a point is in,
because it receives only a ratio: ATAN(y/x) gives the same answer for (1, 1) and (-1, -1).
That is what ATAN2 is for, and it is the single most common reason ATAN is the wrong function.
Returns Number — an angle in radians, strictly between -pi/2 and pi/2.
atan x = x to within
rounding there.ATAN(1) is pi/4 and ATAN(-1) is -pi/4; these are the reduction anchors and are
worth checking in any implementation.pi/2. Because the range is open, no argument should return
exactly the double nearest pi/2... except that, in binary64, the correctly rounded value of
atan(x) is that double for all sufficiently large x. The mathematical openness of the range
and the representable range therefore disagree: the function saturates. That is not a defect, it
is what rounding to a finite grid means, but it is worth stating because it is what makes ACOT
built as pi/2 - ATAN(x) fail — see the ACOT page.pi/2.| Error | Condition | Source |
|---|---|---|
#VALUE! | The argument does not convert to a number | Shared coercion rules |
| propagated | An error value in the argument is returned unchanged | Shared coercion rules |
There is no domain error and no overflow error. ATAN is one of the very few surfaces in this
category whose only failures are conversion failures — which is a consequence of a bounded range
over an unrestricted domain.
ATAN is the easy one, and the reason is structural: the derivative is bounded by 1, so the
function never amplifies an input error, and the range is bounded, so the answer is never so small
that relative accuracy becomes precarious — except near zero, where the function is the identity
and therefore trivially accurate. There is no cancellation anywhere and no overflow anywhere.
The whole implementation problem is approximation efficiency, not stability.
The Gregory series is unusable directly. Its convergence rate is governed by |x|, and at
|x| = 1 it needs a prohibitive number of terms. So every implementation reduces first.
The two reductions, both from the identities above:
|x| > 1:
atan(x) = sign(x) * pi/2 - atan(1/x).
This maps the whole outer half of the domain onto [-1, 1]. The subtraction here is safe
because the answer is near ±pi/2, not near zero — the exact opposite of the ACOT situation.[0, 1]:
split at tan(pi/12) = 2 - sqrt(3) and tan(pi/6), and for arguments above the split use
atan(x) = pi/6 + atan((x*sqrt(3) - 1)/(x + sqrt(3)))
or its pi/4 analogue. Each application shrinks the working interval, so a short polynomial
suffices. Cody & Waite give the classical four-interval version; fdlibm's s_atan.c is the
published implementation.The split-constant technique. The reductions add pi/2, pi/4 or pi/6 at the end. Each of
those is irrational and its double approximation carries an error of about 2^-53 relative — which
is comparable to the final rounding of the answer and would therefore dominate the error budget.
The standard fix is to store the constant as an exact-plus-tail pair, c = c_hi + c_lo, with
c_hi having trailing zero bits so that additions involving it are exact, and to add c_lo last.
This is the same device that makes trigonometric argument reduction work, and it is the reason
implementations of ATAN contain two constants where the mathematics has one.
Where implementations differ. Since there is no instability, differences between
implementations of ATAN are last-bit differences arising from the polynomial coefficients, the
placement of the interval boundaries, and whether intermediate arithmetic happened in extended
precision. Those are exactly the kinds of difference that identification work in this Handbook's
upstream record has found elsewhere in the elementary set, and they are invisible to any test that
compares to fewer than about sixteen digits.
Symmetry. atan is odd, so an implementation should fold the sign and get exact antisymmetry.
ATAN(x) + ATAN(-x) being exactly zero is a cheap and complete test of that.
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.
ATAN · 3 lines · calc-func/src/catalogue/math.rs on GitHub7 atan "ATAN" (1, 1) [V "number"] |s, a, sv| {
raw(s, a, ExcelRealPolicy::PASS, k::atan::atan_kernel)
}
atan_kernel · 3 lines · calc-func/src/ported/atan.rs on GitHubpub fn atan_kernel(n: f64) -> f64 {
crate::ported::excel_numeric::excel_atan_reduced(n)
}
raw catalogue/mathatan_with ported/excel_numericatan_reduced_with ported/excel_numericexcel_atan_reduced 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/soft87atan ported/excel_numeric/x87atan_reduced ported/excel_numeric/x87No 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 | 43 |
| 20430 | Windows, 64-bit, CPU not recorded | 181,409 |
Agreement on these compared inputs does not establish agreement on unmeasured inputs.
Recorded environments and comparison details.
Windows, bitness not recorded, CPU not recorded
43 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.
Windows, 64-bit, CPU not recorded
181,409 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.
ATAN2 — the four-quadrant version, and the one you usually want. Note Excel's unusual
argument order: ATAN2(x_num, y_num) takes x first, the reverse of the C convention. See
that page.TAN — the forward function. TAN(ATAN(x)) = x to rounding for every x;
ATAN(TAN(t)) folds t into (-pi/2, pi/2).ACOT — ACOT(x) = PI()/2 - ATAN(x) on Excel's documented continuous branch. That identity
is exact mathematics and a numerically poor program for large x; the ACOT page is where that
is worked out.ASIN and ACOS — both expressible through ATAN, and both harder, because they carry
a domain restriction and an endpoint singularity that ATAN does not.ATANH — the hyperbolic namesake, and structurally the opposite: bounded domain (-1, 1),
unbounded range, poles at the ends. ATAN is bounded in range and unbounded in domain. The pair
is a good illustration that a hyperbolic namesake inverts the geometry.DEGREES — the usual consumer of the result.PI — the reduction constants, and the reason a two-part split constant appears in the
numerical notes.1/TAN(x), which is COT; and with ATAN2, when the quadrant matters.No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents