TANH Function (LibreOffice Calc)
Use LibreOffice TANH to compress signed values, reproduce nonzero examples and understand saturation. Compare TAN, hyperbolic identities and inverse limits.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: TANH returns the hyperbolic tangent. TANH(1) is approximately 0.7615941560. Its signed, saturating shape can compress values, but the result is not automatically a probability.
Availability and version history
- Introduced: Documented by LibreOffice 26.8.1.1; original introduction not established.
- Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
The TANH function in LibreOffice Calc is used for this task: Returns the hyperbolic tangent of a number. Find the hyperbolic tangent of zero.
This guide explains how to read the formula, reproduce a concrete example, interpret its result and recognize common input mistakes.
Syntax and arguments
TANH(number)
| Argument | Required? | Meaning |
|---|---|---|
Number |
Yes | The value for which the hyperbolic tangent is to be calculated. |
Calc formulas normally use semicolons (;) between arguments in common configurations; the displayed separator may depend on settings or locale.
Worked example
=TANH(0)
Expected result: 0.
Why it works: Find the hyperbolic tangent of zero.
How to use it in your own spreadsheet
- Identify the cells or inputs that correspond to the sample values above.
- Enter the formula in an empty cell, changing the references or literal values to match your sheet.
- Compare the output with a manual check on a small known example.
- Extend the formula to a larger dataset only after you understand the result.
Common problems and practical checks
- Check the accepted numeric domain, units and array dimensions for the specific operation.
- If an error appears, check that the function arguments are of the expected type.
- A pasted formula may produce an error when it uses the other program’s argument separator or unsupported options.
Additional worked application and edge cases
Required input and hyperbolic definition
Number is the single required numeric input. The mathematical definition is SINH(x)/COSH(x), equivalently (EXP(x)-EXP(-x))/(EXP(x)+EXP(-x)). No second argument selects degrees, radians or a rounding mode.
TANH is the hyperbolic tangent. It is not TAN: it is not periodic and does not have the ordinary tangent’s repeated vertical asymptotes. For a finite real x, its exact mathematical value is strictly between -1 and 1, with TANH(0)=0. Spreadsheet results use finite precision and can round to an endpoint at a sufficiently large magnitude.
Stepwise example: signs and saturation
Enter the seven x values below in A2:A8. Enter =TANH(A2) in B2 and fill through B8. Display ten decimal places.
| Row | A: x | B: independently expected TANH(x) |
|---|---|---|
| 2 | -3 | -0.9950547537 |
| 3 | -2 | -0.9640275801 |
| 4 | -1 | -0.7615941560 |
| 5 | 0 | 0 |
| 6 | 1 | 0.7615941560 |
| 7 | 2 | 0.9640275801 |
| 8 | 3 | 0.9950547537 |
Positive and negative inputs have opposite outputs of equal magnitude. Increasing x from 1 to 2 changes the output much more than increasing it from 2 to 3. This is saturation: extreme magnitudes are increasingly compressed, not discarded.
In C2 enter =SINH(A2)/COSH(A2) and fill down. It agrees with the independently calculated TANH results for this moderate fixture to the displayed precision. The identity explains the operation; it is not a reason to replace TANH with a less robust expression at very large magnitudes.
Advanced application: a deliberately bounded display score
Suppose a synthetic dashboard displays signed deviations and should limit how much large magnitudes dominate its visual scale. Enter -20, -10, 0, 10, 20 in E2:E6, and put a positive scaling parameter 10 in H1. Enter this formula in F2 and fill down:
=100*TANH(E2/$H$1)
The independently expected display scores are approximately -96.40275801, -76.15941560, 0, 76.15941560, 96.40275801. Dividing by H1 makes the input dimensionless if deviations and scale use the same units. Multiplying by 100 changes the display range, not the underlying deviation units.
Keep the raw deviations alongside the scores, label the scale and document why 10 was selected. For a fixed nonzero deviation, a larger positive scale gives a smaller absolute display score. The scale must be nonzero for this formula; a negative scale reverses signs. This is a chosen visualization transform, not a probability estimate, a percentage change or evidence that extreme observations are invalid. Exact real outputs are inside -100 to 100; finite-precision values can reach a displayed or stored endpoint.
Inverse checks and information loss
For the seven-row moderate fixture, =ATANH(B2) filled down has expected results close to the original x values. You can compare with =ABS(ATANH(B2)-A2)<1E-12 for this fixture. Use the unrounded result cell, not a manually copied ten-decimal number.
A large input may produce a result rounded to 1 or -1. ATANH requires an input strictly between those endpoints, so it cannot then recover the original finite input. Even before that point, saturation and display rounding can make different inputs appear identical. Keep the originals if later reconstruction matters.
FISHERINV has the same real-valued hyperbolic-tangent relationship in its statistical role. That mathematical relationship does not make TANH an ordinary tangent, nor does it collapse their different named worksheet uses into one guide.
Errors, precision and implementation scope
The pinned ScTanHyp implementation calls tanh on its numeric argument. A manually expanded exponential quotient can overflow even when the mathematical TANH value is bounded. Use the function directly rather than generating huge intermediate exponentials yourself.
Nonnumeric inputs and upstream errors need inspection. A zero H1 in the advanced example creates a division-by-zero problem before TANH has a valid input. Formatting a cell as a percentage or date does not turn a badly scaled argument into the intended dimensionless value. Avoid blanket error suppression until you know which input failed.
The documented function and the reviewed source support the behavior described here. This does not establish every older release’s numerical implementation, another application’s edge behavior, or a first introduction date beyond the retained lifecycle evidence.
Verification scope for this addition: These added results were independently calculated or derived from the cited documentation/source. They were not newly tested in LibreOffice Calc. The original example-specific Calc 25.2.3.2 claims elsewhere on this page remain historical and apply only to those original examples. The cited 26.8.1.1 source tag is a code reference, not a claim of a new run in that release.
Related functions
Documentation and verification
- LibreOffice Calc Help
- The standalone example was calculated using LibreOffice Calc 25.2.3.2 on October 9, 2026 and its computed result matched the expected value. This does not certify every option, version, or other example.