> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/functions/acosh.md).

# acosh

Use the `acosh()` function to calculate the inverse hyperbolic cosine of a numeric value.

## Syntax

```sql
acosh(<number>)
```

## Parameters

| Name     | Type           | Required | Description                                                                  |
| -------- | -------------- | -------- | ---------------------------------------------------------------------------- |
| `number` | integer, float | Yes      | The numeric value to evaluate. The value must be greater than or equal to 1. |

## Returns

**Type**: float

**Description**: The `acosh()` function returns the inverse hyperbolic cosine of the input value. If the input is `null` or less than 1, the function returns `null`.

## Usage notes

* **Input type**: XQL doesn't support NaN or infinite values as input and these value types also can not be returned.
* **Valid Input Range**: The input `number` must be greater than or equal to 1 (x ≥ 1). Mathematically, the inverse hyperbolic cosine is only defined for values in this range.
* **Out of Range Behavior**: If the input is less than 1, the function returns `null`.
* **Null Handling**: If the input expression is `null`, the function returns `null`.
* **Common Use Cases**: This function is typically used within the `alter` stage to create new fields containing the calculated results. It is useful in mathematical modeling, signal processing, and scientific computations.
* **Identity Value**: `acosh(1)` always returns `0.0`, since `cosh(0) = 1`.

## Examples

### Example 1: Calculate inverse hyperbolic cosine of literal values

**Goal**: Calculate the inverse hyperbolic cosine for specific numeric literals to verify known mathematical results.

**XQL code**:

```sql
dataset = xdr_data
| limit 1
| alter result1 = acosh(1), result2 = acosh(2), result3 = acosh(10)
| fields result1, result2, result3
```

**Explanation**: You use `acosh()` on three different literal values. The function calculates the inverse hyperbolic cosine for each. `acosh(1)` returns `0.0` because `cosh(0) = 1`. `acosh(2)` returns approximately `1.317`, and `acosh(10)` returns approximately `2.993`.

**Output**:

| RESULT1 | RESULT2 | RESULT3 |
| ------- | ------- | ------- |
| 0.0     | 1.31696 | 2.99322 |

### Example 2: Calculate inverse hyperbolic cosine from a field value

**Goal**: Calculate the inverse hyperbolic cosine of values stored in a specific field, ensuring they are within the valid mathematical range.

**XQL code**:

```sql
config timeframe = 1d
| dataset = sample_xql_raw
| filter numeric_value >= 1
| alter acosh_result = acosh(numeric_value)
| fields event_id, numeric_value, acosh_result
| limit 3
```

**Explanation**: This query first filters the dataset to ensure `numeric_value` contains only values greater than or equal to 1, avoiding mathematically invalid inputs. It then computes the inverse hyperbolic cosine for each value using `acosh()` in the `alter` stage and stores the result in `acosh_result`. For example, the inverse hyperbolic cosine of `1.0` evaluates to `0.0`.

**Output**:

| EVENT\_ID | NUMERIC\_VALUE | ACOSH\_RESULT |
| --------- | -------------- | ------------- |
| 101       | 1.0            | 0.0           |
| 102       | 1.54308        | 1.0           |
| 103       | 3.76219        | 2.0           |

### Example 3: Apply inverse hyperbolic cosine to a calculated expression

**Goal**: Compute the inverse hyperbolic cosine of a derived value by first transforming a field to ensure it falls within the valid input range.

**XQL code**:

```sql
config timeframe = 1d
| dataset = sample_xql_raw
| alter adjusted_value = add(1, abs(duration_seconds))
| alter acosh_adjusted = acosh(adjusted_value)
| fields event_id, duration_seconds, adjusted_value, acosh_adjusted
| limit 3
```

**Explanation**: Since `acosh()` requires input values of 1 or greater, this query first creates `adjusted_value` by adding 1 to the absolute value of `duration_seconds`, guaranteeing the result is always ≥ 1. The `acosh()` function is then applied to this adjusted value.

**Output**:

| EVENT\_ID | DURATION\_SECONDS | ADJUSTED\_VALUE | ACOSH\_ADJUSTED |
| --------- | ----------------- | --------------- | --------------- |
| 101       | 1.5               | 2.5             | 1.56680         |
| 102       | 0.8               | 1.8             | 1.19205         |
| 103       | 10.2              | 11.2            | 3.10746         |

## Related articles

* **Stages**: [`alter`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/alter.md), [`filter`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/filter.md), [`fields`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/fields.md), [`limit`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/limit.md)
* **Functions**: [`cosh`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/functions/cosh.md), [`asinh`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/functions/asinh.md), [`atanh`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/functions/atanh.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/functions/acosh.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
