Back to Influxdb

math.erfcinv() function

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

latest5.7 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#L682-L682 Contributing to Flux: https://github.com/influxdata/flux#contributing Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md ------------------------------------------------------------------------------->

math.erfcinv() returns the inverse of math.erfc().

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 0 and less than 2. Otherwise the operation will return NaN.

Examples

Return the inverse complimentary error function

js
import "math"

math.erfcinv(x: 0.42345)// 0.5660037715858239


Use math.erfcinv in map

js
import "math"

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

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

Input data

_time_value*tag
2021-01-01T00:00:00Z1.9979506490526588t1
2021-01-01T00:00:10Z0.000000000000000000000000000000000000000000000000000008381980138107252t1
2021-01-01T00:00:20Z0.000000000000000000000000262744434287864t1
2021-01-01T00:00:30Z0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011164884065025777t1
2021-01-01T00:00:40Z0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006790933091004747t1
2021-01-01T00:00:50Z0.0000000003729065687554446t1
_time_value*tag
2021-01-01T00:00:00Z0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002144458719979885t2
2021-01-01T00:00:10Z0.0000000000020855419929990413t2
2021-01-01T00:00:20Z1.9999998862727435t2
2021-01-01T00:00:30Z0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005123973574678553t2
2021-01-01T00:00:40Z0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000015161509817813512t2
2021-01-01T00:00:50Z0.008527511664360422t2

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.7500000000779927t2
2021-01-01T00:00:30Z+Inft2
2021-01-01T00:00:40Z+Inft2
2021-01-01T00:00:50Z1.860000000000001t2

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