1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4
5 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
6 # include "pycore_gc.h" // PyGC_Head
7 # include "pycore_runtime.h" // _Py_ID()
8 #endif
9
10
11 PyDoc_STRVAR(_statistics__normal_dist_inv_cdf__doc__,
12 "_normal_dist_inv_cdf($module, p, mu, sigma, /)\n"
13 "--\n"
14 "\n");
15
16 #define _STATISTICS__NORMAL_DIST_INV_CDF_METHODDEF \
17 {"_normal_dist_inv_cdf", _PyCFunction_CAST(_statistics__normal_dist_inv_cdf), METH_FASTCALL, _statistics__normal_dist_inv_cdf__doc__},
18
19 static double
20 _statistics__normal_dist_inv_cdf_impl(PyObject *module, double p, double mu,
21 double sigma);
22
23 static PyObject *
24 _statistics__normal_dist_inv_cdf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
25 {
26 PyObject *return_value = NULL;
27 double p;
28 double mu;
29 double sigma;
30 double _return_value;
31
32 if (!_PyArg_CheckPositional("_normal_dist_inv_cdf", nargs, 3, 3)) {
33 goto exit;
34 }
35 if (PyFloat_CheckExact(args[0])) {
36 p = PyFloat_AS_DOUBLE(args[0]);
37 }
38 else
39 {
40 p = PyFloat_AsDouble(args[0]);
41 if (p == -1.0 && PyErr_Occurred()) {
42 goto exit;
43 }
44 }
45 if (PyFloat_CheckExact(args[1])) {
46 mu = PyFloat_AS_DOUBLE(args[1]);
47 }
48 else
49 {
50 mu = PyFloat_AsDouble(args[1]);
51 if (mu == -1.0 && PyErr_Occurred()) {
52 goto exit;
53 }
54 }
55 if (PyFloat_CheckExact(args[2])) {
56 sigma = PyFloat_AS_DOUBLE(args[2]);
57 }
58 else
59 {
60 sigma = PyFloat_AsDouble(args[2]);
61 if (sigma == -1.0 && PyErr_Occurred()) {
62 goto exit;
63 }
64 }
65 _return_value = _statistics__normal_dist_inv_cdf_impl(module, p, mu, sigma);
66 if ((_return_value == -1.0) && PyErr_Occurred()) {
67 goto exit;
68 }
69 return_value = PyFloat_FromDouble(_return_value);
70
71 exit:
72 return return_value;
73 }
74 /*[clinic end generated code: output=6899dc752cc6b457 input=a9049054013a1b77]*/