

# Trigonometric and hyperbolic functions

Use these functions to compute the sine, cosine, tangent, and cotangent of an angle, the hyperbolic sine, cosine, and tangent of a number, and their inverses. You can also convert angles between degrees and radians. The trigonometric functions take and return angles in radians.

## `acos` function
<a name="athena-duckdb-functions-numeric-acos"></a>

Returns the angle, in radians, whose cosine is `x`. The result is from `0` to pi, which is about `3.14159`. If `x` is `NULL`, the result is `NULL`.

To convert the result to degrees, use the [`degrees` function](#athena-duckdb-functions-numeric-degrees). To compute the cosine of an angle, use the [`cos` function](#athena-duckdb-functions-numeric-cos).

### Syntax
<a name="athena-duckdb-functions-numeric-acos-syntax"></a>

```sql
acos({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-acos-arguments"></a>

The `acos` function takes the following argument:

**{{x}}**  
The cosine of the angle that the function returns, as a `DOUBLE` value from `-1` to `1`. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-acos-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-acos-examples"></a>

The following SQL query returns the arccosine of `0.5`, in radians.

```sql
SELECT acos(0.5) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.0471975511965979` | 

The following SQL query converts the arccosine of `0.5` to degrees and rounds it to six decimal places. It also returns the arccosine of `-1`, which is pi.

```sql
SELECT
    round(degrees(acos(0.5)), 6) AS in_degrees,
    acos(-1) AS pi_radians
```

The query returns the following result.


| in\_degrees | pi\_radians | 
| --- | --- | 
| `60.0` | `3.141592653589793` | 

The following SQL query uses `isnan` to show that a value greater than `1` returns NaN, and shows that a `NULL` input returns `NULL`.

```sql
SELECT
    isnan(acos(2)) AS out_of_range,
    acos(NULL) AS null_input
```

The query returns the following result.


| out\_of\_range | null\_input | 
| --- | --- | 
| `true` | `NULL` | 

### Considerations
<a name="athena-duckdb-functions-numeric-acos-considerations"></a>

If `x` is less than `-1` or greater than `1`, the result is NaN, and the query does not fail. To test for this result, use the [`isnan` function](duckdb-functions-numeric-sign-and-floating-point.md#athena-duckdb-functions-numeric-isnan).

The result is approximate. For example, `degrees(acos(0.5))` can return a value slightly different from `60`, so round the result before you compare or display it, as in `round(degrees(acos(0.5)), 6)`.

## `acosh` function
<a name="athena-duckdb-functions-numeric-acosh"></a>

Returns the value whose hyperbolic cosine is `x`. The result is `0` or greater, and `acosh(1)` returns `0.0`. If `x` is `NULL`, the result is `NULL`.

To compute the hyperbolic cosine of a value, use the [`cosh` function](#athena-duckdb-functions-numeric-cosh).

### Syntax
<a name="athena-duckdb-functions-numeric-acosh-syntax"></a>

```sql
acosh({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-acosh-arguments"></a>

The `acosh` function takes the following argument:

**{{x}}**  
The hyperbolic cosine of the value that the function returns, as a `DOUBLE` value of `1` or greater. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-acosh-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-acosh-examples"></a>

The following SQL query returns the inverse hyperbolic cosine of `2.3`.

```sql
SELECT acosh(2.3) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.4750447812414251` | 

The following SQL query shows that `acosh(1)` returns `0.0`, and uses `isnan` to show that a value less than `1` returns NaN.

```sql
SELECT
    acosh(1) AS at_one,
    isnan(acosh(0.5)) AS below_one
```

The query returns the following result.


| at\_one | below\_one | 
| --- | --- | 
| `0.0` | `true` | 

The following SQL query shows that `cosh` reverses `acosh`. The result is rounded, because it is approximate.

```sql
SELECT round(cosh(acosh(2.3)), 10) AS round_trip
```

The query returns the following result.


| round\_trip | 
| --- | 
| `2.3` | 

### Considerations
<a name="athena-duckdb-functions-numeric-acosh-considerations"></a>

If `x` is less than `1`, the result is NaN, and the query does not fail. To test for this result, use the [`isnan` function](duckdb-functions-numeric-sign-and-floating-point.md#athena-duckdb-functions-numeric-isnan).

## `asin` function
<a name="athena-duckdb-functions-numeric-asin"></a>

Returns the angle, in radians, whose sine is `x`. The result is between `-pi() / 2` and `pi() / 2`. If `x` is `NULL`, the result is `NULL`.

To get the angle in degrees, pass the result to `degrees`. To compute the sine of an angle, use the [`sin` function](#athena-duckdb-functions-numeric-sin).

### Syntax
<a name="athena-duckdb-functions-numeric-asin-syntax"></a>

```sql
asin({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-asin-arguments"></a>

The `asin` function takes the following argument:

**{{x}}**  
The sine of the angle that the function returns, as a `DOUBLE` value from `-1` to `1`. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-asin-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-asin-examples"></a>

The following SQL query returns the arcsine of `0.5`, in radians.

```sql
SELECT asin(0.5) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.5235987755982989` | 

The following SQL query converts the arcsine of `0.5` to degrees and rounds it to six decimal places.

```sql
SELECT round(degrees(asin(0.5)), 6) AS result
```

The query returns the following result.


| result | 
| --- | 
| `30.0` | 

The following SQL query passes `2`, which is outside the range from `-1` to `1`, and uses `isnan` to show that the result is `NaN`.

```sql
SELECT isnan(asin(2)) AS is_nan
```

The query returns the following result.


| is\_nan | 
| --- | 
| `true` | 

### Considerations
<a name="athena-duckdb-functions-numeric-asin-considerations"></a>

If `x` is less than `-1` or greater than `1`, the result is `NaN` (not a number), and the query does not fail. To find such results, test them with `isnan`.

The result is a floating-point approximation. Round it before you compare it with a constant, for example `round(degrees(asin({{x}})), 6) = 30`.

## `asinh` function
<a name="athena-duckdb-functions-numeric-asinh"></a>

Returns the inverse hyperbolic sine of `x`, which is the value whose hyperbolic sine is `x`. You can pass any real number as `x`, and the result has the same sign as `x`. If `x` is `NULL`, the result is `NULL`.

To compute the hyperbolic sine, use the [`sinh` function](#athena-duckdb-functions-numeric-sinh).

### Syntax
<a name="athena-duckdb-functions-numeric-asinh-syntax"></a>

```sql
asinh({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-asinh-arguments"></a>

The `asinh` function takes the following argument:

**{{x}}**  
The hyperbolic sine of the value that the function returns, as a `DOUBLE` value. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-asinh-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-asinh-examples"></a>

The following SQL query returns the inverse hyperbolic sine of `0.5`.

```sql
SELECT asinh(0.5) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.48121182505960347` | 

The following SQL query shows that `sinh` reverses `asinh`. The result is rounded to ten decimal places.

```sql
SELECT round(sinh(asinh(2.5)), 10) AS result
```

The query returns the following result.


| result | 
| --- | 
| `2.5` | 

## `atan` function
<a name="athena-duckdb-functions-numeric-atan"></a>

Returns the angle, in radians, whose tangent is `x`. The result is between `-pi() / 2` and `pi() / 2`. If `x` is `NULL`, the result is `NULL`.

Because `atan` takes only the ratio of two coordinates, it cannot tell the point (1, 1) from the point (-1, -1). To get the angle of a point in any of the four quadrants, use the [`atan2` function](#athena-duckdb-functions-numeric-atan2).

### Syntax
<a name="athena-duckdb-functions-numeric-atan-syntax"></a>

```sql
atan({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-atan-arguments"></a>

The `atan` function takes the following argument:

**{{x}}**  
The tangent of the angle that the function returns, as a `DOUBLE` value. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-atan-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-atan-examples"></a>

The following SQL query returns the arctangent of `0.5`, in radians.

```sql
SELECT atan(0.5) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.4636476090008061` | 

The following SQL query converts the arctangent of `1` to degrees and rounds it to six decimal places.

```sql
SELECT round(degrees(atan(1)), 6) AS result
```

The query returns the following result.


| result | 
| --- | 
| `45.0` | 

### Considerations
<a name="athena-duckdb-functions-numeric-atan-considerations"></a>

The result is a floating-point approximation. Round it before you compare it with a constant.

## `atan2` function
<a name="athena-duckdb-functions-numeric-atan2"></a>

Returns the angle, in radians, between the positive x-axis and the point (`x`, `y`). The result is between `-pi()` and `pi()`. Unlike `atan({{y}} / {{x}})`, `atan2` uses the signs of both coordinates, so the result tells you which quadrant the point is in. If either argument is `NULL`, the result is `NULL`.

The y-coordinate is the first argument and the x-coordinate is the second.

### Syntax
<a name="athena-duckdb-functions-numeric-atan2-syntax"></a>

```sql
atan2({{y}}, {{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-atan2-arguments"></a>

The `atan2` function takes the following arguments:

**{{y}}**  
The y-coordinate of the point, as a `DOUBLE` value. Values of other numeric types are converted to `DOUBLE`.

**{{x}}**  
The x-coordinate of the point, as a `DOUBLE` value. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-atan2-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-atan2-examples"></a>

The following SQL query returns the angle of the point (0, 1), which is `pi() / 2` radians. The y-coordinate, `1.0`, is the first argument.

```sql
SELECT atan2(1.0, 0.0) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.5707963267948966` | 

The following SQL query compares `atan` and `atan2` for the point (-1, -1), in degrees. `atan` sees only the ratio `1` and returns 45 degrees, while `atan2` returns -135 degrees.

```sql
SELECT
    round(
        degrees(atan(-1.0 / -1.0)), 6
    ) AS atan_degrees,
    round(degrees(atan2(-1, -1)), 6) AS atan2_degrees
```

The query returns the following result.


| atan\_degrees | atan2\_degrees | 
| --- | --- | 
| `45.0` | `-135.0` | 

### Considerations
<a name="athena-duckdb-functions-numeric-atan2-considerations"></a>

`atan2(0, 0)` returns `0`, and the query does not fail.

## `atanh` function
<a name="athena-duckdb-functions-numeric-atanh"></a>

Returns the inverse hyperbolic tangent of `x`, which is the value whose hyperbolic tangent is `x`. If `x` is `NULL`, the result is `NULL`.

To compute the hyperbolic tangent, use the [`tanh` function](#athena-duckdb-functions-numeric-tanh).

### Syntax
<a name="athena-duckdb-functions-numeric-atanh-syntax"></a>

```sql
atanh({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-atanh-arguments"></a>

The `atanh` function takes the following argument:

**{{x}}**  
The hyperbolic tangent of the value that the function returns, as a `DOUBLE` value greater than `-1` and less than `1`. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-atanh-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-atanh-examples"></a>

The following SQL query returns the inverse hyperbolic tangent of `0.5`.

```sql
SELECT atanh(0.5) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.5493061443340548` | 

The following SQL query uses `isinf` and `isnan` to show the results at the edge of the range and outside it. `atanh(1)` is infinity, and `atanh(2)` is `NaN`.

```sql
SELECT
    isinf(atanh(1)) AS is_infinite,
    isnan(atanh(2)) AS is_nan
```

The query returns the following result.


| is\_infinite | is\_nan | 
| --- | --- | 
| `true` | `true` | 

### Considerations
<a name="athena-duckdb-functions-numeric-atanh-considerations"></a>

If `x` is `1` or `-1`, the result is positive or negative infinity. If `x` is outside the range from `-1` to `1`, the result is `NaN` (not a number). The query does not fail in either case. To find such results, test them with `isinf` and `isnan`.

## `cos` function
<a name="athena-duckdb-functions-numeric-cos"></a>

Returns the cosine of `x`, where `x` is an angle in radians. The result is between `-1` and `1`. If `x` is `NULL`, the result is `NULL`.

To pass an angle in degrees, convert it with `radians` first.

### Syntax
<a name="athena-duckdb-functions-numeric-cos-syntax"></a>

```sql
cos({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-cos-arguments"></a>

The `cos` function takes the following argument:

**{{x}}**  
The angle in radians, as a `DOUBLE` value. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-cos-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-cos-examples"></a>

The following SQL query returns the cosine of `90` radians. Because the argument is in radians, not degrees, the result is not `0`.

```sql
SELECT cos(90) AS result
```

The query returns the following result.


| result | 
| --- | 
| `-0.4480736161291701` | 

The following SQL query converts `60` degrees to radians, returns the cosine, and rounds the result to ten decimal places.

```sql
SELECT round(cos(radians(60)), 10) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.5` | 

### Considerations
<a name="athena-duckdb-functions-numeric-cos-considerations"></a>

The result is a floating-point approximation. For example, `cos(radians(60))` can differ slightly from `0.5`. Round the result before you compare it with a constant.

## `cosh` function
<a name="athena-duckdb-functions-numeric-cosh"></a>

Returns the hyperbolic cosine of `x`, which is `(exp({{x}}) + exp(-{{x}})) / 2`. The result is always at least `1`, and `cosh(-{{x}})` equals `cosh({{x}})`. If `x` is `NULL`, the result is `NULL`.

### Syntax
<a name="athena-duckdb-functions-numeric-cosh-syntax"></a>

```sql
cosh({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-cosh-arguments"></a>

The `cosh` function takes the following argument:

**{{x}}**  
The number to take the hyperbolic cosine of, as a `DOUBLE` value. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-cosh-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-cosh-examples"></a>

The following SQL query returns the hyperbolic cosine of `1`.

```sql
SELECT cosh(1) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.5430806348152437` | 

The following SQL query shows that the hyperbolic cosine of `1000` is infinity.

```sql
SELECT isinf(cosh(1000)) AS is_infinite
```

The query returns the following result.


| is\_infinite | 
| --- | 
| `true` | 

### Considerations
<a name="athena-duckdb-functions-numeric-cosh-considerations"></a>

When the result is too large for `DOUBLE`, as it is for `cosh(1000)`, the function returns infinity, and the query does not fail.

## `cot` function
<a name="athena-duckdb-functions-numeric-cot"></a>

Returns the cotangent of `x`, where `x` is an angle in radians. The cotangent is `1 / tan({{x}})`. If `x` is `NULL`, the result is `NULL`.

### Syntax
<a name="athena-duckdb-functions-numeric-cot-syntax"></a>

```sql
cot({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-cot-arguments"></a>

The `cot` function takes the following argument:

**{{x}}**  
The angle in radians, as a `DOUBLE` value. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-cot-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-cot-examples"></a>

The following SQL query returns the cotangent of `0.5` radians.

```sql
SELECT cot(0.5) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.830487721712452` | 

The following SQL query returns the cotangent of 45 degrees, which is `pi() / 4` radians, and rounds the result to ten decimal places.

```sql
SELECT round(cot(pi() / 4), 10) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.0` | 

The following SQL query shows that the cotangent of `0` is infinity.

```sql
SELECT isinf(cot(0)) AS is_infinite
```

The query returns the following result.


| is\_infinite | 
| --- | 
| `true` | 

### Considerations
<a name="athena-duckdb-functions-numeric-cot-considerations"></a>

`cot(0)` returns infinity, and the query does not fail. To find such results, test them with `isinf`.

## `degrees` function
<a name="athena-duckdb-functions-numeric-degrees"></a>

Returns `x`, an angle in radians, converted to degrees. The result is `x` multiplied by `180 / pi()`. If `x` is `NULL`, the result is `NULL`.

To convert an angle from degrees to radians, use the [`radians` function](#athena-duckdb-functions-numeric-radians).

### Syntax
<a name="athena-duckdb-functions-numeric-degrees-syntax"></a>

```sql
degrees({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-degrees-arguments"></a>

The `degrees` function takes the following argument:

**{{x}}**  
The angle in radians, as a `DOUBLE` value. Values of other numeric types are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-degrees-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-degrees-examples"></a>

The following SQL query converts `pi()` radians to degrees.

```sql
SELECT degrees(pi()) AS result
```

The query returns the following result.


| result | 
| --- | 
| `180.0` | 

The following SQL query returns the number of degrees in one radian.

```sql
SELECT degrees(1) AS result
```

The query returns the following result.


| result | 
| --- | 
| `57.29577951308232` | 

## `pi` function
<a name="athena-duckdb-functions-numeric-pi"></a>

Returns pi, the ratio of a circle's circumference to its diameter, as a `DOUBLE` value.

To convert an angle between radians and degrees, use the [`degrees` function](#athena-duckdb-functions-numeric-degrees) and the [`radians` function](#athena-duckdb-functions-numeric-radians).

### Syntax
<a name="athena-duckdb-functions-numeric-pi-syntax"></a>

```sql
pi()
```

### Return type
<a name="athena-duckdb-functions-numeric-pi-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-pi-examples"></a>

The following SQL query returns pi.

```sql
SELECT pi() AS result
```

The query returns the following result.


| result | 
| --- | 
| `3.141592653589793` | 

The following SQL query computes the area of a circle with a radius of `2`, rounded to four decimal places.

```sql
SELECT round(pi() * power(2, 2), 4) AS circle_area
```

The query returns the following result.


| circle\_area | 
| --- | 
| `12.5664` | 

### Considerations
<a name="athena-duckdb-functions-numeric-pi-considerations"></a>

Write the parentheses, as in `pi()`. Without them, the query reads `pi` as a column name and fails.

## `radians` function
<a name="athena-duckdb-functions-numeric-radians"></a>

Returns the angle `x`, given in degrees, converted to radians. The result is `x` multiplied by pi and divided by 180. If `x` is `NULL`, the result is `NULL`.

The trigonometric functions, such as `sin`, `cos`, and `tan`, take their argument in radians. Use `radians` to pass them an angle in degrees. To convert radians to degrees, use the [`degrees` function](#athena-duckdb-functions-numeric-degrees).

### Syntax
<a name="athena-duckdb-functions-numeric-radians-syntax"></a>

```sql
radians({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-radians-arguments"></a>

The `radians` function takes the following argument:

**{{x}}**  
The angle in degrees, as a `DOUBLE` value. Integer, `DECIMAL`, and `FLOAT` values are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-radians-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-radians-examples"></a>

The following SQL query converts 90 degrees to radians. The result is pi divided by 2.

```sql
SELECT radians(90) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.5707963267948966` | 

The following SQL query shows that 180 degrees equals pi radians.

```sql
SELECT radians(180) = pi() AS is_pi
```

The query returns the following result.


| is\_pi | 
| --- | 
| `true` | 

## `sin` function
<a name="athena-duckdb-functions-numeric-sin"></a>

Returns the sine of `x`, where `x` is an angle in radians. The result is from `-1` to `1`. If `x` is `NULL`, the result is `NULL`.

To pass an angle in degrees, convert it with `radians` first.

### Syntax
<a name="athena-duckdb-functions-numeric-sin-syntax"></a>

```sql
sin({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-sin-arguments"></a>

The `sin` function takes the following argument:

**{{x}}**  
The angle in radians, as a `DOUBLE` value. Integer, `DECIMAL`, and `FLOAT` values are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-sin-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-sin-examples"></a>

The following SQL query returns the sine of pi divided by 2, which is a right angle.

```sql
SELECT sin(pi() / 2) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.0` | 

The following SQL query passes `90`. The argument is in radians, so the result is the sine of 90 radians, not of 90 degrees.

```sql
SELECT sin(90) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.8939966636005579` | 

The following SQL query returns the sine of 30 degrees. It converts the angle with `radians` and rounds the result to 10 decimal places.

```sql
SELECT round(sin(radians(30)), 10) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.5` | 

### Considerations
<a name="athena-duckdb-functions-numeric-sin-considerations"></a>

The result is a floating-point approximation. For example, `sin(radians(30))` returns `0.49999999999999994`, not `0.5`. To compare or show a fixed number of digits, round the result.

## `sinh` function
<a name="athena-duckdb-functions-numeric-sinh"></a>

Returns the hyperbolic sine of `x`, which equals `(exp({{x}}) - exp(-{{x}})) / 2`. If `x` is `NULL`, the result is `NULL`.

### Syntax
<a name="athena-duckdb-functions-numeric-sinh-syntax"></a>

```sql
sinh({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-sinh-arguments"></a>

The `sinh` function takes the following argument:

**{{x}}**  
The number to take the hyperbolic sine of, as a `DOUBLE` value. Integer, `DECIMAL`, and `FLOAT` values are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-sinh-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-sinh-examples"></a>

The following SQL query returns the hyperbolic sine of 1.

```sql
SELECT sinh(1) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.1752011936438014` | 

The following SQL query shows that a large argument returns infinity instead of an error.

```sql
SELECT isinf(sinh(1000)) AS is_infinite
```

The query returns the following result.


| is\_infinite | 
| --- | 
| `true` | 

### Considerations
<a name="athena-duckdb-functions-numeric-sinh-considerations"></a>

The result grows quickly. For a large `x`, such as `1000`, it is too large for a `DOUBLE`, and the function returns infinity (negative infinity for a large negative `x`) instead of an error. To check for this, use the [`isinf` function](duckdb-functions-numeric-sign-and-floating-point.md#athena-duckdb-functions-numeric-isinf).

## `tan` function
<a name="athena-duckdb-functions-numeric-tan"></a>

Returns the tangent of `x`, where `x` is an angle in radians. If `x` is `NULL`, the result is `NULL`.

To pass an angle in degrees, convert it with `radians` first.

### Syntax
<a name="athena-duckdb-functions-numeric-tan-syntax"></a>

```sql
tan({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-tan-arguments"></a>

The `tan` function takes the following argument:

**{{x}}**  
The angle in radians, as a `DOUBLE` value. Integer, `DECIMAL`, and `FLOAT` values are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-tan-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-tan-examples"></a>

The following SQL query passes `90`. The argument is in radians, so the result is the tangent of 90 radians, not of 90 degrees.

```sql
SELECT tan(90) AS result
```

The query returns the following result.


| result | 
| --- | 
| `-1.995200412208242` | 

The following SQL query returns the tangent of pi divided by 4 radians, which is 45 degrees. It rounds the result to 10 decimal places.

```sql
SELECT round(tan(pi() / 4), 10) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.0` | 

The following SQL query shows that the tangent of pi divided by 2 is a very large number, not an error.

```sql
SELECT tan(pi() / 2) > 1e15 AS is_large
```

The query returns the following result.


| is\_large | 
| --- | 
| `true` | 

### Considerations
<a name="athena-duckdb-functions-numeric-tan-considerations"></a>

The tangent is undefined at pi divided by 2 and at every odd multiple of it, but `tan` does not fail or return infinity there. Because `pi() / 2` is not exact in floating point, `tan(pi() / 2)` returns a very large finite number. The result is about 1.6 times 10 to the power of 16.

## `tanh` function
<a name="athena-duckdb-functions-numeric-tanh"></a>

Returns the hyperbolic tangent of `x`, which equals `sinh({{x}}) / cosh({{x}})`. The result is between `-1` and `1`. For an `x` far from zero, the result is so close to `1` or `-1` that a `DOUBLE` holds it as exactly `1` or `-1`. If `x` is `NULL`, the result is `NULL`.

### Syntax
<a name="athena-duckdb-functions-numeric-tanh-syntax"></a>

```sql
tanh({{x}})
```

### Arguments
<a name="athena-duckdb-functions-numeric-tanh-arguments"></a>

The `tanh` function takes the following argument:

**{{x}}**  
The number to take the hyperbolic tangent of, as a `DOUBLE` value. Integer, `DECIMAL`, and `FLOAT` values are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-numeric-tanh-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-numeric-tanh-examples"></a>

The following SQL query returns the hyperbolic tangent of 1.

```sql
SELECT tanh(1) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.7615941559557649` | 

The following SQL query passes a large argument. The result is exactly 1.

```sql
SELECT tanh(100) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.0` | 