Math and trigonometry functions

ATANH

Matches all 22,011 recorded answers

Recorded: 22,008 in the answer bank and 3 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicATANH
BulgarianATANH
CzechARCTGH
DanishARCTANH
GermanATANH
GreekATANH
English (Australia)ATANH
English (United Kingdom)ATANH
English (United States)ATANH
SpanishATANH
EstonianATANH
FinnishATANH
FrenchATANH
HebrewATANH
CroatianATANH
HungarianATANH
IndonesianATANH
ItalianATANH
JapaneseATANH
KoreanATANH
LithuanianATANH
LatvianATANH
NorwegianATANH
DutchATANH
PolishATANH
Portuguese (Brazil)ATANH
Portuguese (Portugal)ATANH
RomanianATANH
RussianATANH
SlovakATANH
SlovenianATANH
Serbian (Latin)ATANH
SwedishARCTANH
ThaiATANH
TurkishATANH işlevi
UkrainianATANH
VietnameseATANH
Chinese (Simplified)ATANH
Chinese (Hong Kong)ATANH
Chinese (Traditional)ATANH

Names from Microsoft's support site.

What it does

ATANH(number)

ATANH(number) is the inverse hyperbolic tangent.

atanh x  =  (1/2) * ln( (1 + x) / (1 - x) ),     -1 < x < 1
  • Domain: the open interval (-1, 1). tanh maps R bijectively onto (-1, 1), so the inverse is defined exactly there and needs no branch choice. Microsoft's Learn reference states the domain as "between -1 and 1 (excluding -1 and 1)".
  • Range: all real numbers.
  • Parity: odd, exactly, as mathematics. atanh(-x) = -atanh(x). Whether an implementation preserves that to the last bit is a separate question, and on this surface it is a live one — see the numerical notes.
  • Monotonicity: strictly increasing on the whole domain.
  • Poles: logarithmic singularities at both endpoints. atanh(x) -> +infinity as x -> 1- and -> -infinity as x -> -1+. The growth is slow: even one ulp inside an endpoint the value is only around 18.4, so nothing overflows anywhere in this function. The poles are real and numerically harmless.
  • Derivative: d/dx atanh x = 1/(1 - x^2), which is at least 1 everywhere and unbounded at the endpoints.
  • Series about zero: atanh x = x + x^3/3 + x^5/5 + x^7/7 + ... for |x| < 1. For small x, atanh x -> x, so subnormals pass through unchanged.
  • Near the poles: with x = 1 - t, atanh(1 - t) = (1/2) ln(2/t) + O(t).
  • Relations: atanh x = acoth(1/x) (complementary domain — see ACOTH); atanh x = asinh( x / sqrt(1 - x^2) ); and atanh(tanh t) = t for every real t, which is the round trip Microsoft's Learn reference states.
  • Complex continuation: branch cuts along (-infinity, -1] and [1, +infinity) — the exact complement of the real domain, and the mirror image of ACOTH's cut.

Abramowitz & Stegun give the closed form in chapter 4 section 4.6.

Why this function matters beyond hyperbolic geometry

ATANH is Fisher's z-transform. For a sample correlation coefficient r, z = atanh(r) is approximately normally distributed with variance 1/(n-3) — the variance-stabilising transform Fisher introduced in 1921, and the standard route to a confidence interval for a correlation. Excel exposes it twice: as ATANH, and as FISHER, whose entire content is the same formula. That makes ATANH a statistics function wearing a hyperbolic name, and it means its accuracy near |x| = 1 has consequences for confidence intervals on strong correlations.

Arguments

ArgumentMeaningDefault
numberAny real number strictly between -1 and 1. Required.—

Microsoft's Learn reference gives both the description and the constraint: the number must be between -1 and 1, excluding the endpoints.

The misunderstood position is the openness of the interval. Readers who arrive with a correlation coefficient of exactly 1 — which happens whenever a column is regressed against itself — get an error, and that error is mathematically correct: the transform of a perfect correlation is infinite.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

Result and edge cases

Returns Number.

  • x = 1 and x = -1 are not in the domain. These are the poles; there is no value.
  • Just inside the endpoints the answer is finite and modest. There is no overflow in this function at all, which is worth stating because a function with poles usually has one.
  • Zero returns zero, and the sign of zero should survive an odd implementation.
  • Subnormals and very small arguments pass through unchanged: atanh(x) = x to within rounding. This is not automatic — it is emergent from the correct small-argument branch and destroyed by the naive one, which is precisely what makes it a diagnostic. See the numerical notes.
  • Anything with |x| >= 1, including large magnitudes and anything a text conversion is likely to produce, is a domain failure.
  • Arrays lift elementwise, with element-local errors on out-of-domain elements.

How to implement

Numerical notes

ATANH's hazard is at the origin, not at the poles — the opposite of what the graph suggests, and the same inversion seen on the ACOTH page.

The small-argument failure. Evaluate (1/2) ln((1+x)/(1-x)) for small x. The ratio is close to 1, and the answer — which is close to x — lives entirely in the digits that the division has just rounded away. Concretely: once |x| falls below about 2^-53, the doubles 1+x and 1-x are both exactly 1, the ratio is exactly 1, its logarithm is exactly 0, and the naive form returns zero for an argument whose atanh is the argument itself. The collapse is complete, and it starts degrading long before it becomes total.

This is why the subnormal pass-through is a diagnostic: an implementation that returns the input unchanged for a subnormal argument is not using the naive ratio there, and one that returns zero is.

The remedies, both standard:

  1. log1p on a rearranged argument. atanh(x) = (1/2) * log1p( 2x / (1 - x) ). Nothing near 1 is formed and nothing is subtracted from 1 except x, which is exact. fdlibm's e_atanh.c uses this form.
  2. The log1p difference. atanh(x) = (1/2) * ( log1p(x) - log1p(-x) ). Symmetric, and it makes the oddness manifest — the two terms swap under x -> -x, so the result negates exactly.
  3. The series for very small |x|: x + x^3/3, truncated as soon as the cubic term falls below the rounding of x. Below a threshold, x itself is correctly rounded.

Higham's discussion of log(1+x) is the standard statement of why the log1p primitive exists. Excel does not expose log1p as a worksheet function, which is why a worksheet-level workaround is awkward and why an implementer of this surface must supply it internally.

Near the poles the naive form is fine. (1+x)/(1-x) is large there, ln of a large number is well conditioned, and 1 - x is exact for doubles near 1 by Sterbenz's lemma. So the correct branch structure is: naive ratio-log in the outer band, log1p form near zero — the reverse of the intuitive ordering, exactly as for ACOTH.

What is on record upstream. EV-MATH-0005 is a substrate-identification record for this surface. The identification it carries is a piecewise shape of that kind: a direct ratio-logarithm over the main band including the near-pole rows, and a small-argument logarithm-of-one-plus pair below a threshold, with the threshold placed inside a gap between the two regions' clean bands and with residual rows still open in the switch band itself. The record publishes a per-surface count and names the open rows; its figures are rendered mechanically beside this page and are not restated in this prose, and its own status text is the authority on what the count does and does not establish. The Handbook publishes it as an upstream identification — a hypothesis with supporting evidence and open residuals — not as a settled fact about Excel.

The oddness question, which is genuinely open. The upstream production note for this surface states that the signed ratio is evaluated directly rather than by computing on |x| and restoring the sign, with the consequence that the negative argument rounds independently and exact oddness is not guaranteed by construction. A retained test in the same module asserts exact odd symmetry at a specific near-pole witness. Those two statements are not formally contradictory — a non-odd-by-construction implementation can still be odd at particular points — but together they leave the general question unresolved, and the Handbook records it as unresolved rather than picking a side. It matters: FISHER's statistical use assumes atanh(-r) = -atanh(r), and a one-ulp asymmetry there is a real, if small, defect.

Why switch placement dominates. As with ACOTH, two forms that are each individually excellent will disagree in the last bits over the band between their switch points. An implementation that places its threshold differently from Excel's will differ from Excel on every argument in the gap. That is why identification work here concentrates on locating switches rather than on improving accuracy, and it is why the residual rows recorded upstream cluster in exactly that band.

Rust code

Show the CalcFunc source of this function

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.

ATANH · 3 lines · calc-func/src/catalogue/math.rs on GitHub
9 atanh "ATANH" (1, 1) [V "number"] |s, a, sv| {
    out(s, k::atanh::atanh_kernel(num_with_subnormal(s, a, 0)?))
}
atanh_kernel · 28 lines · calc-func/src/ported/atanh.rs on GitHub
pub fn atanh_kernel(n: f64) -> Result<f64, WorksheetErrorCode> {
    let a = n.abs();
    if a >= 1.0 {
        return Err(WorksheetErrorCode::Num);
    }
    // Current-reference Excel observes DAZ inputs in this legacy body. Both
    // signs of every subnormal input publish positive zero.
    if a < f64::MIN_POSITIVE {
        return Ok(0.0);
    }
    // W109 G4-02 (build 20228/CV2, NoCache): the old apparent x87-ln1p pair
    // was observationally equivalent only on the sparse small-input corpus.
    // Dense disagreement mapping identifies the actual body as the ordinary
    // binary64 cubic `x + x^3/3`, up to the exact threshold above.
    if a < ATANH_RATIO_FLOOR {
        return Ok(n + (n * n * n) / 3.0);
    }

    // The ratio body is a legacy x87 spill unit: each wrapper operation is
    // RN53(RN64(op)) before the established x87 LN publication. All three
    // add/sub/div stores are independently required by the fresh wrapper-mask
    // held-out. The signed ratio is evaluated directly, so this region is not
    // globally odd.
    let numerator = crate::ported::excel_numeric::excel_x87_add(1.0, n);
    let denominator = crate::ported::excel_numeric::excel_x87_sub(1.0, n);
    let ratio = crate::ported::excel_numeric::excel_x87_div(numerator, denominator);
    Ok(0.5 * crate::ported::excel_numeric::excel_log(ratio))
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

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 buildPlatform and CPUCaptured inputs
19929Windows, bitness not recorded, CPU not recorded21
20131Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics350
20228Windows, 64-bit, CPU not recorded20,436
20430Windows, 64-bit, CPU not recorded1,224
  • XC-ATANH-001: build 19929 versus build 20131; 1 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.
  • XC-ATANH-002: build 19929 versus build 20430; 1 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.
  • XC-ATANH-003: build 20131 versus build 20228; 6 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.
  • XC-ATANH-004: build 20131 versus build 20430; 3 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.
  • XC-ATANH-005: build 20228 versus build 20430; 2 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.

Agreement on these compared inputs does not establish agreement on unmeasured inputs.

Recorded environments and comparison details.

Excel 16.0 build 19929

Windows, bitness not recorded, CPU not recorded

21 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.

Excel 16.0 build 20131

Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics

350 captured inputs are indexed for this environment. Capture dates: 2026-07-12 to 2026-07-12. This is a reading count, not a comparison with another build.

Excel 16.0 build 20228

Windows, 64-bit, CPU not recorded

20,436 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.

Excel 16.0 build 20430

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.

Alternatives

Relationships

  • TANH — the forward function. ATANH(TANH(t)) = t for every real t, the cleanest round trip in the family, and the best oracle-free test on this page.
  • FISHER — the same formula under a statistical name. FISHER(r) and ATANH(r) should be identical; if they are not, one of them is a separate implementation and that is worth knowing. FISHERINV is TANH.
  • ACOTH — the complementary-domain partner, atanh(x) = acoth(1/x). Upstream identification work treats the two together, and both carry evidence records here.
  • ACOSH — the third inverse hyperbolic primary. Between ATANH on (-1,1), ACOSH on [1,infinity) and ASINH on R, the family covers the line several times over with different shapes.
  • ATAN — the circular namesake, and structurally the inverse arrangement: ATAN has an unbounded domain and a bounded range, ATANH a bounded domain and an unbounded range.
  • CORREL, PEARSON, RSQ — the producers of the arguments that make this function statistically interesting.
  • LN — the substrate of the closed form.
  • Confused with: ATAN, by name; and with 1/TANH, which is COTH.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents