Back to Influxdb

math.erfinv() function

content/flux/v0/stdlib/math/erfinv.md

latest3.3 KB
Original Source
<!------------------------------------------------------------------------------ IMPORTANT: This page was generated from comments in the Flux source code. Any edits made directly to this page will be overwritten the next time the documentation is generated. To make updates to this documentation, update the function comments above the function definition in the Flux source code: https://github.com/influxdata/flux/blob/master/stdlib/math/math.flux#L723-L723 Contributing to Flux: https://github.com/influxdata/flux#contributing Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md ------------------------------------------------------------------------------->

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

Function type signature
js
(x: float) => float

{{% caption %}} For more information, see Function type signatures. {{% /caption %}}

Parameters

x

({{< req >}}) 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

js
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)}))

{{< expand-wrapper >}} {{% expand "View example input and output" %}}

Input data

_time_value*tag
2021-01-01T00:00:00Z-0.9979506490526588t1
2021-01-01T00:00:10Z1t1
2021-01-01T00:00:20Z1t1
2021-01-01T00:00:30Z1t1
2021-01-01T00:00:40Z1t1
2021-01-01T00:00:50Z0.9999999996270934t1
_time_value*tag
2021-01-01T00:00:00Z1t2
2021-01-01T00:00:10Z0.9999999999979144t2
2021-01-01T00:00:20Z-0.9999998862727434t2
2021-01-01T00:00:30Z1t2
2021-01-01T00:00:40Z1t2
2021-01-01T00:00:50Z0.9914724883356396t2

Output data

_time_value*tag
2021-01-01T00:00:00Z-2.1800000000000006t1
2021-01-01T00:00:10Z+Inft1
2021-01-01T00:00:20Z+Inft1
2021-01-01T00:00:30Z+Inft1
2021-01-01T00:00:40Z+Inft1
2021-01-01T00:00:50Z4.429999992395194t1
_time_value*tag
2021-01-01T00:00:00Z+Inft2
2021-01-01T00:00:10Z4.969999434158999t2
2021-01-01T00:00:20Z-3.7499999999520366t2
2021-01-01T00:00:30Z+Inft2
2021-01-01T00:00:40Z+Inft2
2021-01-01T00:00:50Z1.860000000000001t2

{{% /expand %}} {{< /expand-wrapper >}}