---
title: math.erfinv() function
description: math.erfinv() returns the inverse error function of x.
url: https://docs.influxdata.com/flux/v0/stdlib/math/erfinv/
estimated_tokens: 951
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/math/erfinv/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.22.0+

InfluxDB support

`math.erfinv()` returns the inverse error function of `x`.

##### Function type signature

```js
(x: float) => float
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### x

(Required)
Value to operate on.

`x` should be greater than -1 and less than 1. Otherwise, the operation will
return `NaN`.

## Examples

* [Return the inverse error function of a value](#return-the-inverse-error-function-of-a-value)
* [Use math.erfinv in map](#use-matherfinv-in-map)

### Return the inverse error function of a value

```
import "math"

math.erfinv(x: 0.22)// 0.19750838337227364

```

### Use math.erfinv in map

```js
import "math"

data
    |> map(fn: (r) => ({r with _value: math.erfinv(x: r._value)}))
```

[](#view-example-input-and-output)

View example input and output

#### Input data

|       \_time       |      \_value       |\*tag|
|--------------------|--------------------|-----|
|2021-01-01T00:00:00Z|\-0.9979506490526588| t1  |
|2021-01-01T00:00:10Z|         1          | t1  |
|2021-01-01T00:00:20Z|         1          | t1  |
|2021-01-01T00:00:30Z|         1          | t1  |
|2021-01-01T00:00:40Z|         1          | t1  |
|2021-01-01T00:00:50Z| 0.9999999996270934 | t1  |

|       \_time       |      \_value       |\*tag|
|--------------------|--------------------|-----|
|2021-01-01T00:00:00Z|         1          | t2  |
|2021-01-01T00:00:10Z| 0.9999999999979144 | t2  |
|2021-01-01T00:00:20Z|\-0.9999998862727434| t2  |
|2021-01-01T00:00:30Z|         1          | t2  |
|2021-01-01T00:00:40Z|         1          | t2  |
|2021-01-01T00:00:50Z| 0.9914724883356396 | t2  |

#### Output data

|       \_time       |      \_value       |\*tag|
|--------------------|--------------------|-----|
|2021-01-01T00:00:00Z|\-2.1800000000000006| t1  |
|2021-01-01T00:00:10Z|       \+Inf        | t1  |
|2021-01-01T00:00:20Z|       \+Inf        | t1  |
|2021-01-01T00:00:30Z|       \+Inf        | t1  |
|2021-01-01T00:00:40Z|       \+Inf        | t1  |
|2021-01-01T00:00:50Z| 4.429999992395194  | t1  |

|       \_time       |      \_value       |\*tag|
|--------------------|--------------------|-----|
|2021-01-01T00:00:00Z|       \+Inf        | t2  |
|2021-01-01T00:00:10Z| 4.969999434158999  | t2  |
|2021-01-01T00:00:20Z|\-3.7499999999520366| t2  |
|2021-01-01T00:00:30Z|       \+Inf        | t2  |
|2021-01-01T00:00:40Z|       \+Inf        | t2  |
|2021-01-01T00:00:50Z| 1.860000000000001  | t2  |
| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:00Z | -0.9979506490526588 | t1 |
| 2021-01-01T00:00:10Z | 1 | t1 |
| 2021-01-01T00:00:20Z | 1 | t1 |
| 2021-01-01T00:00:30Z | 1 | t1 |
| 2021-01-01T00:00:40Z | 1 | t1 |
| 2021-01-01T00:00:50Z | 0.9999999996270934 | t1 |

| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:00Z | 1 | t2 |
| 2021-01-01T00:00:10Z | 0.9999999999979144 | t2 |
| 2021-01-01T00:00:20Z | -0.9999998862727434 | t2 |
| 2021-01-01T00:00:30Z | 1 | t2 |
| 2021-01-01T00:00:40Z | 1 | t2 |
| 2021-01-01T00:00:50Z | 0.9914724883356396 | t2 |

| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:00Z | -2.1800000000000006 | t1 |
| 2021-01-01T00:00:10Z | +Inf | t1 |
| 2021-01-01T00:00:20Z | +Inf | t1 |
| 2021-01-01T00:00:30Z | +Inf | t1 |
| 2021-01-01T00:00:40Z | +Inf | t1 |
| 2021-01-01T00:00:50Z | 4.429999992395194 | t1 |

| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:00Z | +Inf | t2 |
| 2021-01-01T00:00:10Z | 4.969999434158999 | t2 |
| 2021-01-01T00:00:20Z | -3.7499999999520366 | t2 |
| 2021-01-01T00:00:30Z | +Inf | t2 |
| 2021-01-01T00:00:40Z | +Inf | t2 |
| 2021-01-01T00:00:50Z | 1.860000000000001 | t2 |
