ssdiff: fix check for inserted or removed names.
[gnumeric.git] / plugins / fn-r / functions.c
blob27c658965168baaf2af28baffa74d1e7e0c9c755
1 /* This code was generated by generate. Do not edit. */
3 #include <gnumeric-config.h>
4 #include <gnumeric.h>
5 #include <goffice/goffice.h>
6 #include <gnm-plugin.h>
7 #include <func.h>
8 #include <gnm-i18n.h>
9 #include <value.h>
10 #include <mathfunc.h>
11 #include <sf-dpq.h>
12 #include "extra.h"
14 GNM_PLUGIN_MODULE_HEADER;
16 /* ------------------------------------------------------------------------- */
18 static GnmFuncHelp const help_r_dbeta[] = {
19 { GNM_FUNC_HELP_NAME, F_("R.DBETA:probability density function of the beta distribution") },
20 { GNM_FUNC_HELP_ARG, F_("x:observation") },
21 { GNM_FUNC_HELP_ARG, F_("a:the first shape parameter of the distribution") },
22 { GNM_FUNC_HELP_ARG, F_("b:the second scale parameter of the distribution") },
23 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
24 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the beta distribution.") },
25 { GNM_FUNC_HELP_EXAMPLES, "=r.dbeta(0.4,1,4)" },
26 { GNM_FUNC_HELP_SEEALSO, "R.PBETA,R.QBETA" },
27 { GNM_FUNC_HELP_END }
30 static GnmValue *
31 gnumeric_r_dbeta (GnmFuncEvalInfo *ei, GnmValue const * const *args)
33 gnm_float x = value_get_as_float (args[0]);
34 gnm_float a = value_get_as_float (args[1]);
35 gnm_float b = value_get_as_float (args[2]);
36 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
38 return value_new_float (dbeta (x, a, b, give_log));
41 /* ------------------------------------------------------------------------- */
43 static GnmFuncHelp const help_r_pbeta[] = {
44 { GNM_FUNC_HELP_NAME, F_("R.PBETA:cumulative distribution function of the beta distribution") },
45 { GNM_FUNC_HELP_ARG, F_("x:observation") },
46 { GNM_FUNC_HELP_ARG, F_("a:the first shape parameter of the distribution") },
47 { GNM_FUNC_HELP_ARG, F_("b:the second scale parameter of the distribution") },
48 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
49 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
50 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the beta distribution.") },
51 { GNM_FUNC_HELP_EXAMPLES, "=r.pbeta(0.4,1,4)" },
52 { GNM_FUNC_HELP_SEEALSO, "R.DBETA,R.QBETA" },
53 { GNM_FUNC_HELP_END }
56 static GnmValue *
57 gnumeric_r_pbeta (GnmFuncEvalInfo *ei, GnmValue const * const *args)
59 gnm_float x = value_get_as_float (args[0]);
60 gnm_float a = value_get_as_float (args[1]);
61 gnm_float b = value_get_as_float (args[2]);
62 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
63 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
65 return value_new_float (pbeta (x, a, b, lower_tail, log_p));
68 /* ------------------------------------------------------------------------- */
70 static GnmFuncHelp const help_r_qbeta[] = {
71 { GNM_FUNC_HELP_NAME, F_("R.QBETA:probability quantile function of the beta distribution") },
72 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
73 { GNM_FUNC_HELP_ARG, F_("a:the first shape parameter of the distribution") },
74 { GNM_FUNC_HELP_ARG, F_("b:the second scale parameter of the distribution") },
75 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
76 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
77 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the beta distribution.") },
78 { GNM_FUNC_HELP_EXAMPLES, "=r.qbeta(0.3,1,4)" },
79 { GNM_FUNC_HELP_SEEALSO, "R.DBETA,R.PBETA" },
80 { GNM_FUNC_HELP_END }
83 static GnmValue *
84 gnumeric_r_qbeta (GnmFuncEvalInfo *ei, GnmValue const * const *args)
86 gnm_float p = value_get_as_float (args[0]);
87 gnm_float a = value_get_as_float (args[1]);
88 gnm_float b = value_get_as_float (args[2]);
89 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
90 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
92 return value_new_float (qbeta (p, a, b, lower_tail, log_p));
95 /* ------------------------------------------------------------------------- */
97 static GnmFuncHelp const help_r_dbinom[] = {
98 { GNM_FUNC_HELP_NAME, F_("R.DBINOM:probability density function of the binomial distribution") },
99 { GNM_FUNC_HELP_ARG, F_("x:observation") },
100 { GNM_FUNC_HELP_ARG, F_("n:the number of trials") },
101 { GNM_FUNC_HELP_ARG, F_("psuc:the probability of success in each trial") },
102 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
103 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the binomial distribution.") },
104 { GNM_FUNC_HELP_EXAMPLES, "=r.dbinom(4,10,0.4)" },
105 { GNM_FUNC_HELP_SEEALSO, "R.PBINOM,R.QBINOM" },
106 { GNM_FUNC_HELP_END }
109 static GnmValue *
110 gnumeric_r_dbinom (GnmFuncEvalInfo *ei, GnmValue const * const *args)
112 gnm_float x = value_get_as_float (args[0]);
113 gnm_float n = value_get_as_float (args[1]);
114 gnm_float psuc = value_get_as_float (args[2]);
115 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
117 return value_new_float (dbinom (x, n, psuc, give_log));
120 /* ------------------------------------------------------------------------- */
122 static GnmFuncHelp const help_r_pbinom[] = {
123 { GNM_FUNC_HELP_NAME, F_("R.PBINOM:cumulative distribution function of the binomial distribution") },
124 { GNM_FUNC_HELP_ARG, F_("x:observation") },
125 { GNM_FUNC_HELP_ARG, F_("n:the number of trials") },
126 { GNM_FUNC_HELP_ARG, F_("psuc:the probability of success in each trial") },
127 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
128 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
129 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the binomial distribution.") },
130 { GNM_FUNC_HELP_EXAMPLES, "=r.pbinom(4,10,0.4)" },
131 { GNM_FUNC_HELP_SEEALSO, "R.DBINOM,R.QBINOM" },
132 { GNM_FUNC_HELP_END }
135 static GnmValue *
136 gnumeric_r_pbinom (GnmFuncEvalInfo *ei, GnmValue const * const *args)
138 gnm_float x = value_get_as_float (args[0]);
139 gnm_float n = value_get_as_float (args[1]);
140 gnm_float psuc = value_get_as_float (args[2]);
141 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
142 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
144 return value_new_float (pbinom (x, n, psuc, lower_tail, log_p));
147 /* ------------------------------------------------------------------------- */
149 static GnmFuncHelp const help_r_qbinom[] = {
150 { GNM_FUNC_HELP_NAME, F_("R.QBINOM:probability quantile function of the binomial distribution") },
151 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
152 { GNM_FUNC_HELP_ARG, F_("n:the number of trials") },
153 { GNM_FUNC_HELP_ARG, F_("psuc:the probability of success in each trial") },
154 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
155 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
156 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the binomial distribution.") },
157 { GNM_FUNC_HELP_EXAMPLES, "=r.qbinom(0.3,10,0.4)" },
158 { GNM_FUNC_HELP_SEEALSO, "R.DBINOM,R.PBINOM" },
159 { GNM_FUNC_HELP_END }
162 static GnmValue *
163 gnumeric_r_qbinom (GnmFuncEvalInfo *ei, GnmValue const * const *args)
165 gnm_float p = value_get_as_float (args[0]);
166 gnm_float n = value_get_as_float (args[1]);
167 gnm_float psuc = value_get_as_float (args[2]);
168 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
169 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
171 return value_new_float (qbinom (p, n, psuc, lower_tail, log_p));
174 /* ------------------------------------------------------------------------- */
176 static GnmFuncHelp const help_r_dcauchy[] = {
177 { GNM_FUNC_HELP_NAME, F_("R.DCAUCHY:probability density function of the Cauchy distribution") },
178 { GNM_FUNC_HELP_ARG, F_("x:observation") },
179 { GNM_FUNC_HELP_ARG, F_("location:the center of the distribution") },
180 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
181 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
182 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the Cauchy distribution.") },
183 { GNM_FUNC_HELP_EXAMPLES, "=r.dcauchy(1.5,1,4)" },
184 { GNM_FUNC_HELP_SEEALSO, "R.PCAUCHY,R.QCAUCHY" },
185 { GNM_FUNC_HELP_END }
188 static GnmValue *
189 gnumeric_r_dcauchy (GnmFuncEvalInfo *ei, GnmValue const * const *args)
191 gnm_float x = value_get_as_float (args[0]);
192 gnm_float location = value_get_as_float (args[1]);
193 gnm_float scale = value_get_as_float (args[2]);
194 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
196 return value_new_float (dcauchy (x, location, scale, give_log));
199 /* ------------------------------------------------------------------------- */
201 static GnmFuncHelp const help_r_pcauchy[] = {
202 { GNM_FUNC_HELP_NAME, F_("R.PCAUCHY:cumulative distribution function of the Cauchy distribution") },
203 { GNM_FUNC_HELP_ARG, F_("x:observation") },
204 { GNM_FUNC_HELP_ARG, F_("location:the center of the distribution") },
205 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
206 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
207 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
208 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the Cauchy distribution.") },
209 { GNM_FUNC_HELP_EXAMPLES, "=r.pcauchy(1.5,1,4)" },
210 { GNM_FUNC_HELP_SEEALSO, "R.DCAUCHY,R.QCAUCHY" },
211 { GNM_FUNC_HELP_END }
214 static GnmValue *
215 gnumeric_r_pcauchy (GnmFuncEvalInfo *ei, GnmValue const * const *args)
217 gnm_float x = value_get_as_float (args[0]);
218 gnm_float location = value_get_as_float (args[1]);
219 gnm_float scale = value_get_as_float (args[2]);
220 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
221 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
223 return value_new_float (pcauchy (x, location, scale, lower_tail, log_p));
226 /* ------------------------------------------------------------------------- */
228 static GnmFuncHelp const help_r_qcauchy[] = {
229 { GNM_FUNC_HELP_NAME, F_("R.QCAUCHY:probability quantile function of the Cauchy distribution") },
230 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
231 { GNM_FUNC_HELP_ARG, F_("location:the center of the distribution") },
232 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
233 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
234 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
235 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the Cauchy distribution.") },
236 { GNM_FUNC_HELP_EXAMPLES, "=r.qcauchy(0.3,1,4)" },
237 { GNM_FUNC_HELP_SEEALSO, "R.DCAUCHY,R.PCAUCHY" },
238 { GNM_FUNC_HELP_END }
241 static GnmValue *
242 gnumeric_r_qcauchy (GnmFuncEvalInfo *ei, GnmValue const * const *args)
244 gnm_float p = value_get_as_float (args[0]);
245 gnm_float location = value_get_as_float (args[1]);
246 gnm_float scale = value_get_as_float (args[2]);
247 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
248 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
250 return value_new_float (qcauchy (p, location, scale, lower_tail, log_p));
253 /* ------------------------------------------------------------------------- */
255 static GnmFuncHelp const help_r_dchisq[] = {
256 { GNM_FUNC_HELP_NAME, F_("R.DCHISQ:probability density function of the chi-square distribution") },
257 { GNM_FUNC_HELP_ARG, F_("x:observation") },
258 { GNM_FUNC_HELP_ARG, F_("df:the number of degrees of freedom of the distribution") },
259 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
260 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the chi-square distribution.") },
261 { GNM_FUNC_HELP_ODF, F_("A two argument invocation R.DCHISQ(@{x},@{df}) is exported to OpenFormula as CHISQDIST(@{x},@{df},FALSE()).") },
262 { GNM_FUNC_HELP_EXAMPLES, "=r.dchisq(2.5,4)" },
263 { GNM_FUNC_HELP_SEEALSO, "R.PCHISQ,R.QCHISQ" },
264 { GNM_FUNC_HELP_END }
267 static GnmValue *
268 gnumeric_r_dchisq (GnmFuncEvalInfo *ei, GnmValue const * const *args)
270 gnm_float x = value_get_as_float (args[0]);
271 gnm_float df = value_get_as_float (args[1]);
272 gboolean give_log = args[2] ? value_get_as_checked_bool (args[2]) : FALSE;
274 return value_new_float (dchisq (x, df, give_log));
277 /* ------------------------------------------------------------------------- */
279 static GnmFuncHelp const help_r_pchisq[] = {
280 { GNM_FUNC_HELP_NAME, F_("R.PCHISQ:cumulative distribution function of the chi-square distribution") },
281 { GNM_FUNC_HELP_ARG, F_("x:observation") },
282 { GNM_FUNC_HELP_ARG, F_("df:the number of degrees of freedom of the distribution") },
283 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
284 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
285 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the chi-square distribution.") },
286 { GNM_FUNC_HELP_ODF, F_("A two argument invocation R.PCHISQ(@{x},@{df}) is exported to OpenFormula as CHISQDIST(@{x},@{df}).") },
287 { GNM_FUNC_HELP_EXAMPLES, "=r.pchisq(2.5,4)" },
288 { GNM_FUNC_HELP_SEEALSO, "R.DCHISQ,R.QCHISQ" },
289 { GNM_FUNC_HELP_END }
292 static GnmValue *
293 gnumeric_r_pchisq (GnmFuncEvalInfo *ei, GnmValue const * const *args)
295 gnm_float x = value_get_as_float (args[0]);
296 gnm_float df = value_get_as_float (args[1]);
297 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
298 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
300 return value_new_float (pchisq (x, df, lower_tail, log_p));
303 /* ------------------------------------------------------------------------- */
305 static GnmFuncHelp const help_r_qchisq[] = {
306 { GNM_FUNC_HELP_NAME, F_("R.QCHISQ:probability quantile function of the chi-square distribution") },
307 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
308 { GNM_FUNC_HELP_ARG, F_("df:the number of degrees of freedom of the distribution") },
309 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
310 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
311 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the chi-square distribution.") },
312 { GNM_FUNC_HELP_ODF, F_("A two argument invocation R.QCHISQ(@{p},@{df}) is exported to OpenFormula as CHISQINV(@{p},@{df}).") },
313 { GNM_FUNC_HELP_EXAMPLES, "=r.qchisq(0.3,4)" },
314 { GNM_FUNC_HELP_SEEALSO, "R.DCHISQ,R.PCHISQ" },
315 { GNM_FUNC_HELP_END }
318 static GnmValue *
319 gnumeric_r_qchisq (GnmFuncEvalInfo *ei, GnmValue const * const *args)
321 gnm_float p = value_get_as_float (args[0]);
322 gnm_float df = value_get_as_float (args[1]);
323 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
324 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
326 return value_new_float (qchisq (p, df, lower_tail, log_p));
329 /* ------------------------------------------------------------------------- */
331 static GnmFuncHelp const help_r_dexp[] = {
332 { GNM_FUNC_HELP_NAME, F_("R.DEXP:probability density function of the exponential distribution") },
333 { GNM_FUNC_HELP_ARG, F_("x:observation") },
334 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
335 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
336 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the exponential distribution.") },
337 { GNM_FUNC_HELP_EXAMPLES, "=r.dexp(1.5,4)" },
338 { GNM_FUNC_HELP_SEEALSO, "R.PEXP,R.QEXP" },
339 { GNM_FUNC_HELP_END }
342 static GnmValue *
343 gnumeric_r_dexp (GnmFuncEvalInfo *ei, GnmValue const * const *args)
345 gnm_float x = value_get_as_float (args[0]);
346 gnm_float scale = value_get_as_float (args[1]);
347 gboolean give_log = args[2] ? value_get_as_checked_bool (args[2]) : FALSE;
349 return value_new_float (dexp (x, scale, give_log));
352 /* ------------------------------------------------------------------------- */
354 static GnmFuncHelp const help_r_pexp[] = {
355 { GNM_FUNC_HELP_NAME, F_("R.PEXP:cumulative distribution function of the exponential distribution") },
356 { GNM_FUNC_HELP_ARG, F_("x:observation") },
357 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
358 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
359 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
360 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the exponential distribution.") },
361 { GNM_FUNC_HELP_EXAMPLES, "=r.pexp(1.5,4)" },
362 { GNM_FUNC_HELP_SEEALSO, "R.DEXP,R.QEXP" },
363 { GNM_FUNC_HELP_END }
366 static GnmValue *
367 gnumeric_r_pexp (GnmFuncEvalInfo *ei, GnmValue const * const *args)
369 gnm_float x = value_get_as_float (args[0]);
370 gnm_float scale = value_get_as_float (args[1]);
371 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
372 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
374 return value_new_float (pexp (x, scale, lower_tail, log_p));
377 /* ------------------------------------------------------------------------- */
379 static GnmFuncHelp const help_r_qexp[] = {
380 { GNM_FUNC_HELP_NAME, F_("R.QEXP:probability quantile function of the exponential distribution") },
381 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
382 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
383 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
384 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
385 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the exponential distribution.") },
386 { GNM_FUNC_HELP_EXAMPLES, "=r.qexp(0.3,4)" },
387 { GNM_FUNC_HELP_SEEALSO, "R.DEXP,R.PEXP" },
388 { GNM_FUNC_HELP_END }
391 static GnmValue *
392 gnumeric_r_qexp (GnmFuncEvalInfo *ei, GnmValue const * const *args)
394 gnm_float p = value_get_as_float (args[0]);
395 gnm_float scale = value_get_as_float (args[1]);
396 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
397 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
399 return value_new_float (qexp (p, scale, lower_tail, log_p));
402 /* ------------------------------------------------------------------------- */
404 static GnmFuncHelp const help_r_df[] = {
405 { GNM_FUNC_HELP_NAME, F_("R.DF:probability density function of the F distribution") },
406 { GNM_FUNC_HELP_ARG, F_("x:observation") },
407 { GNM_FUNC_HELP_ARG, F_("n1:the first number of degrees of freedom of the distribution") },
408 { GNM_FUNC_HELP_ARG, F_("n2:the second number of degrees of freedom of the distribution") },
409 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
410 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the F distribution.") },
411 { GNM_FUNC_HELP_EXAMPLES, "=r.df(1.5,2,3)" },
412 { GNM_FUNC_HELP_SEEALSO, "R.PF,R.QF" },
413 { GNM_FUNC_HELP_END }
416 static GnmValue *
417 gnumeric_r_df (GnmFuncEvalInfo *ei, GnmValue const * const *args)
419 gnm_float x = value_get_as_float (args[0]);
420 gnm_float n1 = value_get_as_float (args[1]);
421 gnm_float n2 = value_get_as_float (args[2]);
422 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
424 return value_new_float (df (x, n1, n2, give_log));
427 /* ------------------------------------------------------------------------- */
429 static GnmFuncHelp const help_r_pf[] = {
430 { GNM_FUNC_HELP_NAME, F_("R.PF:cumulative distribution function of the F distribution") },
431 { GNM_FUNC_HELP_ARG, F_("x:observation") },
432 { GNM_FUNC_HELP_ARG, F_("n1:the first number of degrees of freedom of the distribution") },
433 { GNM_FUNC_HELP_ARG, F_("n2:the second number of degrees of freedom of the distribution") },
434 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
435 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
436 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the F distribution.") },
437 { GNM_FUNC_HELP_EXAMPLES, "=r.pf(1.5,2,3)" },
438 { GNM_FUNC_HELP_SEEALSO, "R.DF,R.QF" },
439 { GNM_FUNC_HELP_END }
442 static GnmValue *
443 gnumeric_r_pf (GnmFuncEvalInfo *ei, GnmValue const * const *args)
445 gnm_float x = value_get_as_float (args[0]);
446 gnm_float n1 = value_get_as_float (args[1]);
447 gnm_float n2 = value_get_as_float (args[2]);
448 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
449 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
451 return value_new_float (pf (x, n1, n2, lower_tail, log_p));
454 /* ------------------------------------------------------------------------- */
456 static GnmFuncHelp const help_r_qf[] = {
457 { GNM_FUNC_HELP_NAME, F_("R.QF:probability quantile function of the F distribution") },
458 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
459 { GNM_FUNC_HELP_ARG, F_("n1:the first number of degrees of freedom of the distribution") },
460 { GNM_FUNC_HELP_ARG, F_("n2:the second number of degrees of freedom of the distribution") },
461 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
462 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
463 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the F distribution.") },
464 { GNM_FUNC_HELP_EXAMPLES, "=r.qf(0.3,2,3)" },
465 { GNM_FUNC_HELP_SEEALSO, "R.DF,R.PF" },
466 { GNM_FUNC_HELP_END }
469 static GnmValue *
470 gnumeric_r_qf (GnmFuncEvalInfo *ei, GnmValue const * const *args)
472 gnm_float p = value_get_as_float (args[0]);
473 gnm_float n1 = value_get_as_float (args[1]);
474 gnm_float n2 = value_get_as_float (args[2]);
475 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
476 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
478 return value_new_float (qf (p, n1, n2, lower_tail, log_p));
481 /* ------------------------------------------------------------------------- */
483 static GnmFuncHelp const help_r_dgamma[] = {
484 { GNM_FUNC_HELP_NAME, F_("R.DGAMMA:probability density function of the gamma distribution") },
485 { GNM_FUNC_HELP_ARG, F_("x:observation") },
486 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
487 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
488 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
489 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the gamma distribution.") },
490 { GNM_FUNC_HELP_EXAMPLES, "=r.dgamma(3,5,1)" },
491 { GNM_FUNC_HELP_SEEALSO, "R.PGAMMA,R.QGAMMA" },
492 { GNM_FUNC_HELP_END }
495 static GnmValue *
496 gnumeric_r_dgamma (GnmFuncEvalInfo *ei, GnmValue const * const *args)
498 gnm_float x = value_get_as_float (args[0]);
499 gnm_float shape = value_get_as_float (args[1]);
500 gnm_float scale = value_get_as_float (args[2]);
501 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
503 return value_new_float (dgamma (x, shape, scale, give_log));
506 /* ------------------------------------------------------------------------- */
508 static GnmFuncHelp const help_r_pgamma[] = {
509 { GNM_FUNC_HELP_NAME, F_("R.PGAMMA:cumulative distribution function of the gamma distribution") },
510 { GNM_FUNC_HELP_ARG, F_("x:observation") },
511 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
512 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
513 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
514 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
515 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the gamma distribution.") },
516 { GNM_FUNC_HELP_EXAMPLES, "=r.pgamma(3,5,1)" },
517 { GNM_FUNC_HELP_SEEALSO, "R.DGAMMA,R.QGAMMA" },
518 { GNM_FUNC_HELP_END }
521 static GnmValue *
522 gnumeric_r_pgamma (GnmFuncEvalInfo *ei, GnmValue const * const *args)
524 gnm_float x = value_get_as_float (args[0]);
525 gnm_float shape = value_get_as_float (args[1]);
526 gnm_float scale = value_get_as_float (args[2]);
527 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
528 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
530 return value_new_float (pgamma (x, shape, scale, lower_tail, log_p));
533 /* ------------------------------------------------------------------------- */
535 static GnmFuncHelp const help_r_qgamma[] = {
536 { GNM_FUNC_HELP_NAME, F_("R.QGAMMA:probability quantile function of the gamma distribution") },
537 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
538 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
539 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
540 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
541 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
542 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the gamma distribution.") },
543 { GNM_FUNC_HELP_EXAMPLES, "=r.qgamma(0.3,5,1)" },
544 { GNM_FUNC_HELP_SEEALSO, "R.DGAMMA,R.PGAMMA" },
545 { GNM_FUNC_HELP_END }
548 static GnmValue *
549 gnumeric_r_qgamma (GnmFuncEvalInfo *ei, GnmValue const * const *args)
551 gnm_float p = value_get_as_float (args[0]);
552 gnm_float shape = value_get_as_float (args[1]);
553 gnm_float scale = value_get_as_float (args[2]);
554 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
555 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
557 return value_new_float (qgamma (p, shape, scale, lower_tail, log_p));
560 /* ------------------------------------------------------------------------- */
562 static GnmFuncHelp const help_r_dgeom[] = {
563 { GNM_FUNC_HELP_NAME, F_("R.DGEOM:probability density function of the geometric distribution") },
564 { GNM_FUNC_HELP_ARG, F_("x:observation") },
565 { GNM_FUNC_HELP_ARG, F_("psuc:the probability of success in each trial") },
566 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
567 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the geometric distribution.") },
568 { GNM_FUNC_HELP_EXAMPLES, "=r.dgeom(3,0.2)" },
569 { GNM_FUNC_HELP_SEEALSO, "R.PGEOM,R.QGEOM" },
570 { GNM_FUNC_HELP_END }
573 static GnmValue *
574 gnumeric_r_dgeom (GnmFuncEvalInfo *ei, GnmValue const * const *args)
576 gnm_float x = value_get_as_float (args[0]);
577 gnm_float psuc = value_get_as_float (args[1]);
578 gboolean give_log = args[2] ? value_get_as_checked_bool (args[2]) : FALSE;
580 return value_new_float (dgeom (x, psuc, give_log));
583 /* ------------------------------------------------------------------------- */
585 static GnmFuncHelp const help_r_pgeom[] = {
586 { GNM_FUNC_HELP_NAME, F_("R.PGEOM:cumulative distribution function of the geometric distribution") },
587 { GNM_FUNC_HELP_ARG, F_("x:observation") },
588 { GNM_FUNC_HELP_ARG, F_("psuc:the probability of success in each trial") },
589 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
590 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
591 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the geometric distribution.") },
592 { GNM_FUNC_HELP_EXAMPLES, "=r.pgeom(3,0.2)" },
593 { GNM_FUNC_HELP_SEEALSO, "R.DGEOM,R.QGEOM" },
594 { GNM_FUNC_HELP_END }
597 static GnmValue *
598 gnumeric_r_pgeom (GnmFuncEvalInfo *ei, GnmValue const * const *args)
600 gnm_float x = value_get_as_float (args[0]);
601 gnm_float psuc = value_get_as_float (args[1]);
602 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
603 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
605 return value_new_float (pgeom (x, psuc, lower_tail, log_p));
608 /* ------------------------------------------------------------------------- */
610 static GnmFuncHelp const help_r_qgeom[] = {
611 { GNM_FUNC_HELP_NAME, F_("R.QGEOM:probability quantile function of the geometric distribution") },
612 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
613 { GNM_FUNC_HELP_ARG, F_("psuc:the probability of success in each trial") },
614 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
615 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
616 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the geometric distribution.") },
617 { GNM_FUNC_HELP_EXAMPLES, "=r.qgeom(0.3,0.2)" },
618 { GNM_FUNC_HELP_SEEALSO, "R.DGEOM,R.PGEOM" },
619 { GNM_FUNC_HELP_END }
622 static GnmValue *
623 gnumeric_r_qgeom (GnmFuncEvalInfo *ei, GnmValue const * const *args)
625 gnm_float p = value_get_as_float (args[0]);
626 gnm_float psuc = value_get_as_float (args[1]);
627 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
628 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
630 return value_new_float (qgeom (p, psuc, lower_tail, log_p));
633 /* ------------------------------------------------------------------------- */
635 static GnmFuncHelp const help_r_dgumbel[] = {
636 { GNM_FUNC_HELP_NAME, F_("R.DGUMBEL:probability density function of the Gumbel distribution") },
637 { GNM_FUNC_HELP_ARG, F_("x:observation") },
638 { GNM_FUNC_HELP_ARG, F_("mu:the location parameter of freedom of the distribution") },
639 { GNM_FUNC_HELP_ARG, F_("beta:the scale parameter of freedom of the distribution") },
640 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
641 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the Gumbel distribution.") },
642 { GNM_FUNC_HELP_EXAMPLES, "=r.dgumbel(2.5,2,1)" },
643 { GNM_FUNC_HELP_SEEALSO, "R.PGUMBEL,R.QGUMBEL" },
644 { GNM_FUNC_HELP_END }
647 static GnmValue *
648 gnumeric_r_dgumbel (GnmFuncEvalInfo *ei, GnmValue const * const *args)
650 gnm_float x = value_get_as_float (args[0]);
651 gnm_float mu = value_get_as_float (args[1]);
652 gnm_float beta = value_get_as_float (args[2]);
653 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
655 return value_new_float (dgumbel (x, mu, beta, give_log));
658 /* ------------------------------------------------------------------------- */
660 static GnmFuncHelp const help_r_pgumbel[] = {
661 { GNM_FUNC_HELP_NAME, F_("R.PGUMBEL:cumulative distribution function of the Gumbel distribution") },
662 { GNM_FUNC_HELP_ARG, F_("x:observation") },
663 { GNM_FUNC_HELP_ARG, F_("mu:the location parameter of freedom of the distribution") },
664 { GNM_FUNC_HELP_ARG, F_("beta:the scale parameter of freedom of the distribution") },
665 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
666 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
667 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the Gumbel distribution.") },
668 { GNM_FUNC_HELP_EXAMPLES, "=r.pgumbel(2.5,2,1)" },
669 { GNM_FUNC_HELP_SEEALSO, "R.DGUMBEL,R.QGUMBEL" },
670 { GNM_FUNC_HELP_END }
673 static GnmValue *
674 gnumeric_r_pgumbel (GnmFuncEvalInfo *ei, GnmValue const * const *args)
676 gnm_float x = value_get_as_float (args[0]);
677 gnm_float mu = value_get_as_float (args[1]);
678 gnm_float beta = value_get_as_float (args[2]);
679 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
680 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
682 return value_new_float (pgumbel (x, mu, beta, lower_tail, log_p));
685 /* ------------------------------------------------------------------------- */
687 static GnmFuncHelp const help_r_qgumbel[] = {
688 { GNM_FUNC_HELP_NAME, F_("R.QGUMBEL:probability quantile function of the Gumbel distribution") },
689 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
690 { GNM_FUNC_HELP_ARG, F_("mu:the location parameter of freedom of the distribution") },
691 { GNM_FUNC_HELP_ARG, F_("beta:the scale parameter of freedom of the distribution") },
692 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
693 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
694 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the Gumbel distribution.") },
695 { GNM_FUNC_HELP_EXAMPLES, "=r.qgumbel(0.3,2,1)" },
696 { GNM_FUNC_HELP_SEEALSO, "R.DGUMBEL,R.PGUMBEL" },
697 { GNM_FUNC_HELP_END }
700 static GnmValue *
701 gnumeric_r_qgumbel (GnmFuncEvalInfo *ei, GnmValue const * const *args)
703 gnm_float p = value_get_as_float (args[0]);
704 gnm_float mu = value_get_as_float (args[1]);
705 gnm_float beta = value_get_as_float (args[2]);
706 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
707 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
709 return value_new_float (qgumbel (p, mu, beta, lower_tail, log_p));
712 /* ------------------------------------------------------------------------- */
714 static GnmFuncHelp const help_r_dhyper[] = {
715 { GNM_FUNC_HELP_NAME, F_("R.DHYPER:probability density function of the hypergeometric distribution") },
716 { GNM_FUNC_HELP_ARG, F_("x:observation") },
717 { GNM_FUNC_HELP_ARG, F_("r:the number of red balls") },
718 { GNM_FUNC_HELP_ARG, F_("b:the number of black balls") },
719 { GNM_FUNC_HELP_ARG, F_("n:the number of balls drawn") },
720 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
721 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the hypergeometric distribution.") },
722 { GNM_FUNC_HELP_EXAMPLES, "=r.dhyper(12,50,450,100)" },
723 { GNM_FUNC_HELP_SEEALSO, "R.PHYPER,R.QHYPER" },
724 { GNM_FUNC_HELP_END }
727 static GnmValue *
728 gnumeric_r_dhyper (GnmFuncEvalInfo *ei, GnmValue const * const *args)
730 gnm_float x = value_get_as_float (args[0]);
731 gnm_float r = value_get_as_float (args[1]);
732 gnm_float b = value_get_as_float (args[2]);
733 gnm_float n = value_get_as_float (args[3]);
734 gboolean give_log = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
736 return value_new_float (dhyper (x, r, b, n, give_log));
739 /* ------------------------------------------------------------------------- */
741 static GnmFuncHelp const help_r_phyper[] = {
742 { GNM_FUNC_HELP_NAME, F_("R.PHYPER:cumulative distribution function of the hypergeometric distribution") },
743 { GNM_FUNC_HELP_ARG, F_("x:observation") },
744 { GNM_FUNC_HELP_ARG, F_("r:the number of red balls") },
745 { GNM_FUNC_HELP_ARG, F_("b:the number of black balls") },
746 { GNM_FUNC_HELP_ARG, F_("n:the number of balls drawn") },
747 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
748 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
749 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the hypergeometric distribution.") },
750 { GNM_FUNC_HELP_EXAMPLES, "=r.phyper(12,50,450,100)" },
751 { GNM_FUNC_HELP_SEEALSO, "R.DHYPER,R.QHYPER" },
752 { GNM_FUNC_HELP_END }
755 static GnmValue *
756 gnumeric_r_phyper (GnmFuncEvalInfo *ei, GnmValue const * const *args)
758 gnm_float x = value_get_as_float (args[0]);
759 gnm_float r = value_get_as_float (args[1]);
760 gnm_float b = value_get_as_float (args[2]);
761 gnm_float n = value_get_as_float (args[3]);
762 gboolean lower_tail = args[4] ? value_get_as_checked_bool (args[4]) : TRUE;
763 gboolean log_p = args[5] ? value_get_as_checked_bool (args[5]) : FALSE;
765 return value_new_float (phyper (x, r, b, n, lower_tail, log_p));
768 /* ------------------------------------------------------------------------- */
770 static GnmFuncHelp const help_r_qhyper[] = {
771 { GNM_FUNC_HELP_NAME, F_("R.QHYPER:probability quantile function of the hypergeometric distribution") },
772 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
773 { GNM_FUNC_HELP_ARG, F_("r:the number of red balls") },
774 { GNM_FUNC_HELP_ARG, F_("b:the number of black balls") },
775 { GNM_FUNC_HELP_ARG, F_("n:the number of balls drawn") },
776 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
777 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
778 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the hypergeometric distribution.") },
779 { GNM_FUNC_HELP_EXAMPLES, "=r.qhyper(0.3,50,450,100)" },
780 { GNM_FUNC_HELP_SEEALSO, "R.DHYPER,R.PHYPER" },
781 { GNM_FUNC_HELP_END }
784 static GnmValue *
785 gnumeric_r_qhyper (GnmFuncEvalInfo *ei, GnmValue const * const *args)
787 gnm_float p = value_get_as_float (args[0]);
788 gnm_float r = value_get_as_float (args[1]);
789 gnm_float b = value_get_as_float (args[2]);
790 gnm_float n = value_get_as_float (args[3]);
791 gboolean lower_tail = args[4] ? value_get_as_checked_bool (args[4]) : TRUE;
792 gboolean log_p = args[5] ? value_get_as_checked_bool (args[5]) : FALSE;
794 return value_new_float (qhyper (p, r, b, n, lower_tail, log_p));
797 /* ------------------------------------------------------------------------- */
799 static GnmFuncHelp const help_r_dlnorm[] = {
800 { GNM_FUNC_HELP_NAME, F_("R.DLNORM:probability density function of the log-normal distribution") },
801 { GNM_FUNC_HELP_ARG, F_("x:observation") },
802 { GNM_FUNC_HELP_ARG, F_("logmean:mean of the underlying normal distribution") },
803 { GNM_FUNC_HELP_ARG, F_("logsd:standard deviation of the underlying normal distribution") },
804 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
805 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the log-normal distribution.") },
806 { GNM_FUNC_HELP_EXAMPLES, "=r.dlnorm(2.5,1,2)" },
807 { GNM_FUNC_HELP_SEEALSO, "R.PLNORM,R.QLNORM" },
808 { GNM_FUNC_HELP_END }
811 static GnmValue *
812 gnumeric_r_dlnorm (GnmFuncEvalInfo *ei, GnmValue const * const *args)
814 gnm_float x = value_get_as_float (args[0]);
815 gnm_float logmean = value_get_as_float (args[1]);
816 gnm_float logsd = value_get_as_float (args[2]);
817 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
819 return value_new_float (dlnorm (x, logmean, logsd, give_log));
822 /* ------------------------------------------------------------------------- */
824 static GnmFuncHelp const help_r_plnorm[] = {
825 { GNM_FUNC_HELP_NAME, F_("R.PLNORM:cumulative distribution function of the log-normal distribution") },
826 { GNM_FUNC_HELP_ARG, F_("x:observation") },
827 { GNM_FUNC_HELP_ARG, F_("logmean:mean of the underlying normal distribution") },
828 { GNM_FUNC_HELP_ARG, F_("logsd:standard deviation of the underlying normal distribution") },
829 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
830 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
831 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the log-normal distribution.") },
832 { GNM_FUNC_HELP_EXAMPLES, "=r.plnorm(2.5,1,2)" },
833 { GNM_FUNC_HELP_SEEALSO, "R.DLNORM,R.QLNORM" },
834 { GNM_FUNC_HELP_END }
837 static GnmValue *
838 gnumeric_r_plnorm (GnmFuncEvalInfo *ei, GnmValue const * const *args)
840 gnm_float x = value_get_as_float (args[0]);
841 gnm_float logmean = value_get_as_float (args[1]);
842 gnm_float logsd = value_get_as_float (args[2]);
843 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
844 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
846 return value_new_float (plnorm (x, logmean, logsd, lower_tail, log_p));
849 /* ------------------------------------------------------------------------- */
851 static GnmFuncHelp const help_r_qlnorm[] = {
852 { GNM_FUNC_HELP_NAME, F_("R.QLNORM:probability quantile function of the log-normal distribution") },
853 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
854 { GNM_FUNC_HELP_ARG, F_("logmean:mean of the underlying normal distribution") },
855 { GNM_FUNC_HELP_ARG, F_("logsd:standard deviation of the underlying normal distribution") },
856 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
857 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
858 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the log-normal distribution.") },
859 { GNM_FUNC_HELP_EXAMPLES, "=r.qlnorm(0.3,1,2)" },
860 { GNM_FUNC_HELP_SEEALSO, "R.DLNORM,R.PLNORM" },
861 { GNM_FUNC_HELP_END }
864 static GnmValue *
865 gnumeric_r_qlnorm (GnmFuncEvalInfo *ei, GnmValue const * const *args)
867 gnm_float p = value_get_as_float (args[0]);
868 gnm_float logmean = value_get_as_float (args[1]);
869 gnm_float logsd = value_get_as_float (args[2]);
870 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
871 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
873 return value_new_float (qlnorm (p, logmean, logsd, lower_tail, log_p));
876 /* ------------------------------------------------------------------------- */
878 static GnmFuncHelp const help_r_dnbinom[] = {
879 { GNM_FUNC_HELP_NAME, F_("R.DNBINOM:probability density function of the negative binomial distribution") },
880 { GNM_FUNC_HELP_ARG, F_("x:observation (number of failures)") },
881 { GNM_FUNC_HELP_ARG, F_("n:required number of successes") },
882 { GNM_FUNC_HELP_ARG, F_("psuc:the probability of success in each trial") },
883 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
884 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the negative binomial distribution.") },
885 { GNM_FUNC_HELP_EXAMPLES, "=r.dnbinom(8,10,0.45)" },
886 { GNM_FUNC_HELP_SEEALSO, "R.PNBINOM,R.QNBINOM" },
887 { GNM_FUNC_HELP_END }
890 static GnmValue *
891 gnumeric_r_dnbinom (GnmFuncEvalInfo *ei, GnmValue const * const *args)
893 gnm_float x = value_get_as_float (args[0]);
894 gnm_float n = value_get_as_float (args[1]);
895 gnm_float psuc = value_get_as_float (args[2]);
896 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
898 return value_new_float (dnbinom (x, n, psuc, give_log));
901 /* ------------------------------------------------------------------------- */
903 static GnmFuncHelp const help_r_pnbinom[] = {
904 { GNM_FUNC_HELP_NAME, F_("R.PNBINOM:cumulative distribution function of the negative binomial distribution") },
905 { GNM_FUNC_HELP_ARG, F_("x:observation (number of failures)") },
906 { GNM_FUNC_HELP_ARG, F_("n:required number of successes") },
907 { GNM_FUNC_HELP_ARG, F_("psuc:the probability of success in each trial") },
908 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
909 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
910 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the negative binomial distribution.") },
911 { GNM_FUNC_HELP_EXAMPLES, "=r.pnbinom(8,10,0.45)" },
912 { GNM_FUNC_HELP_SEEALSO, "R.DNBINOM,R.QNBINOM" },
913 { GNM_FUNC_HELP_END }
916 static GnmValue *
917 gnumeric_r_pnbinom (GnmFuncEvalInfo *ei, GnmValue const * const *args)
919 gnm_float x = value_get_as_float (args[0]);
920 gnm_float n = value_get_as_float (args[1]);
921 gnm_float psuc = value_get_as_float (args[2]);
922 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
923 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
925 return value_new_float (pnbinom (x, n, psuc, lower_tail, log_p));
928 /* ------------------------------------------------------------------------- */
930 static GnmFuncHelp const help_r_qnbinom[] = {
931 { GNM_FUNC_HELP_NAME, F_("R.QNBINOM:probability quantile function of the negative binomial distribution") },
932 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
933 { GNM_FUNC_HELP_ARG, F_("n:required number of successes") },
934 { GNM_FUNC_HELP_ARG, F_("psuc:the probability of success in each trial") },
935 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
936 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
937 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the negative binomial distribution.") },
938 { GNM_FUNC_HELP_EXAMPLES, "=r.qnbinom(0.3,10,0.45)" },
939 { GNM_FUNC_HELP_SEEALSO, "R.DNBINOM,R.PNBINOM" },
940 { GNM_FUNC_HELP_END }
943 static GnmValue *
944 gnumeric_r_qnbinom (GnmFuncEvalInfo *ei, GnmValue const * const *args)
946 gnm_float p = value_get_as_float (args[0]);
947 gnm_float n = value_get_as_float (args[1]);
948 gnm_float psuc = value_get_as_float (args[2]);
949 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
950 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
952 return value_new_float (qnbinom (p, n, psuc, lower_tail, log_p));
955 /* ------------------------------------------------------------------------- */
957 static GnmFuncHelp const help_r_dnorm[] = {
958 { GNM_FUNC_HELP_NAME, F_("R.DNORM:probability density function of the normal distribution") },
959 { GNM_FUNC_HELP_ARG, F_("x:observation") },
960 { GNM_FUNC_HELP_ARG, F_("mu:mean of the distribution") },
961 { GNM_FUNC_HELP_ARG, F_("sigma:standard deviation of the distribution") },
962 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
963 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the normal distribution.") },
964 { GNM_FUNC_HELP_EXAMPLES, "=r.dnorm(1,0,1)" },
965 { GNM_FUNC_HELP_EXAMPLES, "=r.dnorm(2,0,1)" },
966 { GNM_FUNC_HELP_EXAMPLES, "=r.dnorm(3,0,1)" },
967 { GNM_FUNC_HELP_SEEALSO, "R.PNORM,R.QNORM" },
968 { GNM_FUNC_HELP_END }
971 static GnmValue *
972 gnumeric_r_dnorm (GnmFuncEvalInfo *ei, GnmValue const * const *args)
974 gnm_float x = value_get_as_float (args[0]);
975 gnm_float mu = value_get_as_float (args[1]);
976 gnm_float sigma = value_get_as_float (args[2]);
977 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
979 return value_new_float (dnorm (x, mu, sigma, give_log));
982 /* ------------------------------------------------------------------------- */
984 static GnmFuncHelp const help_r_pnorm[] = {
985 { GNM_FUNC_HELP_NAME, F_("R.PNORM:cumulative distribution function of the normal distribution") },
986 { GNM_FUNC_HELP_ARG, F_("x:observation") },
987 { GNM_FUNC_HELP_ARG, F_("mu:mean of the distribution") },
988 { GNM_FUNC_HELP_ARG, F_("sigma:standard deviation of the distribution") },
989 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
990 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
991 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the normal distribution.") },
992 { GNM_FUNC_HELP_EXAMPLES, "=r.pnorm(1,0,1)" },
993 { GNM_FUNC_HELP_EXAMPLES, "=r.pnorm(2,0,1)" },
994 { GNM_FUNC_HELP_EXAMPLES, "=r.pnorm(3,0,1)" },
995 { GNM_FUNC_HELP_SEEALSO, "R.DNORM,R.QNORM" },
996 { GNM_FUNC_HELP_END }
999 static GnmValue *
1000 gnumeric_r_pnorm (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1002 gnm_float x = value_get_as_float (args[0]);
1003 gnm_float mu = value_get_as_float (args[1]);
1004 gnm_float sigma = value_get_as_float (args[2]);
1005 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
1006 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
1008 return value_new_float (pnorm (x, mu, sigma, lower_tail, log_p));
1011 /* ------------------------------------------------------------------------- */
1013 static GnmFuncHelp const help_r_qnorm[] = {
1014 { GNM_FUNC_HELP_NAME, F_("R.QNORM:probability quantile function of the normal distribution") },
1015 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
1016 { GNM_FUNC_HELP_ARG, F_("mu:mean of the distribution") },
1017 { GNM_FUNC_HELP_ARG, F_("sigma:standard deviation of the distribution") },
1018 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1019 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1020 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the normal distribution.") },
1021 { GNM_FUNC_HELP_EXAMPLES, "=r.qnorm(0.3,0,1)" },
1022 { GNM_FUNC_HELP_EXAMPLES, "=r.qnorm(0.3,0,1)" },
1023 { GNM_FUNC_HELP_EXAMPLES, "=r.qnorm(0.3,0,1)" },
1024 { GNM_FUNC_HELP_SEEALSO, "R.DNORM,R.PNORM" },
1025 { GNM_FUNC_HELP_END }
1028 static GnmValue *
1029 gnumeric_r_qnorm (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1031 gnm_float p = value_get_as_float (args[0]);
1032 gnm_float mu = value_get_as_float (args[1]);
1033 gnm_float sigma = value_get_as_float (args[2]);
1034 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
1035 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
1037 return value_new_float (qnorm (p, mu, sigma, lower_tail, log_p));
1040 /* ------------------------------------------------------------------------- */
1042 static GnmFuncHelp const help_r_dpois[] = {
1043 { GNM_FUNC_HELP_NAME, F_("R.DPOIS:probability density function of the Poisson distribution") },
1044 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1045 { GNM_FUNC_HELP_ARG, F_("lambda:the mean of the distribution") },
1046 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
1047 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the Poisson distribution.") },
1048 { GNM_FUNC_HELP_EXAMPLES, "=r.dpois(4,4)" },
1049 { GNM_FUNC_HELP_SEEALSO, "R.PPOIS,R.QPOIS" },
1050 { GNM_FUNC_HELP_END }
1053 static GnmValue *
1054 gnumeric_r_dpois (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1056 gnm_float x = value_get_as_float (args[0]);
1057 gnm_float lambda = value_get_as_float (args[1]);
1058 gboolean give_log = args[2] ? value_get_as_checked_bool (args[2]) : FALSE;
1060 return value_new_float (dpois (x, lambda, give_log));
1063 /* ------------------------------------------------------------------------- */
1065 static GnmFuncHelp const help_r_ppois[] = {
1066 { GNM_FUNC_HELP_NAME, F_("R.PPOIS:cumulative distribution function of the Poisson distribution") },
1067 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1068 { GNM_FUNC_HELP_ARG, F_("lambda:the mean of the distribution") },
1069 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1070 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1071 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the Poisson distribution.") },
1072 { GNM_FUNC_HELP_EXAMPLES, "=r.ppois(4,4)" },
1073 { GNM_FUNC_HELP_SEEALSO, "R.DPOIS,R.QPOIS" },
1074 { GNM_FUNC_HELP_END }
1077 static GnmValue *
1078 gnumeric_r_ppois (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1080 gnm_float x = value_get_as_float (args[0]);
1081 gnm_float lambda = value_get_as_float (args[1]);
1082 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
1083 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
1085 return value_new_float (ppois (x, lambda, lower_tail, log_p));
1088 /* ------------------------------------------------------------------------- */
1090 static GnmFuncHelp const help_r_qpois[] = {
1091 { GNM_FUNC_HELP_NAME, F_("R.QPOIS:probability quantile function of the Poisson distribution") },
1092 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
1093 { GNM_FUNC_HELP_ARG, F_("lambda:the mean of the distribution") },
1094 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1095 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1096 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the Poisson distribution.") },
1097 { GNM_FUNC_HELP_EXAMPLES, "=r.qpois(0.3,4)" },
1098 { GNM_FUNC_HELP_SEEALSO, "R.DPOIS,R.PPOIS" },
1099 { GNM_FUNC_HELP_END }
1102 static GnmValue *
1103 gnumeric_r_qpois (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1105 gnm_float p = value_get_as_float (args[0]);
1106 gnm_float lambda = value_get_as_float (args[1]);
1107 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
1108 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
1110 return value_new_float (qpois (p, lambda, lower_tail, log_p));
1113 /* ------------------------------------------------------------------------- */
1115 static GnmFuncHelp const help_r_drayleigh[] = {
1116 { GNM_FUNC_HELP_NAME, F_("R.DRAYLEIGH:probability density function of the Rayleigh distribution") },
1117 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1118 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
1119 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
1120 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the Rayleigh distribution.") },
1121 { GNM_FUNC_HELP_EXAMPLES, "=r.drayleigh(2,1)" },
1122 { GNM_FUNC_HELP_SEEALSO, "R.PRAYLEIGH,R.QRAYLEIGH" },
1123 { GNM_FUNC_HELP_END }
1126 static GnmValue *
1127 gnumeric_r_drayleigh (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1129 gnm_float x = value_get_as_float (args[0]);
1130 gnm_float scale = value_get_as_float (args[1]);
1131 gboolean give_log = args[2] ? value_get_as_checked_bool (args[2]) : FALSE;
1133 return value_new_float (drayleigh (x, scale, give_log));
1136 /* ------------------------------------------------------------------------- */
1138 static GnmFuncHelp const help_r_prayleigh[] = {
1139 { GNM_FUNC_HELP_NAME, F_("R.PRAYLEIGH:cumulative distribution function of the Rayleigh distribution") },
1140 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1141 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
1142 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1143 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1144 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the Rayleigh distribution.") },
1145 { GNM_FUNC_HELP_EXAMPLES, "=r.prayleigh(2,1)" },
1146 { GNM_FUNC_HELP_SEEALSO, "R.DRAYLEIGH,R.QRAYLEIGH" },
1147 { GNM_FUNC_HELP_END }
1150 static GnmValue *
1151 gnumeric_r_prayleigh (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1153 gnm_float x = value_get_as_float (args[0]);
1154 gnm_float scale = value_get_as_float (args[1]);
1155 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
1156 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
1158 return value_new_float (prayleigh (x, scale, lower_tail, log_p));
1161 /* ------------------------------------------------------------------------- */
1163 static GnmFuncHelp const help_r_qrayleigh[] = {
1164 { GNM_FUNC_HELP_NAME, F_("R.QRAYLEIGH:probability quantile function of the Rayleigh distribution") },
1165 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
1166 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
1167 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1168 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1169 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the Rayleigh distribution.") },
1170 { GNM_FUNC_HELP_EXAMPLES, "=r.qrayleigh(0.3,1)" },
1171 { GNM_FUNC_HELP_SEEALSO, "R.DRAYLEIGH,R.PRAYLEIGH" },
1172 { GNM_FUNC_HELP_END }
1175 static GnmValue *
1176 gnumeric_r_qrayleigh (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1178 gnm_float p = value_get_as_float (args[0]);
1179 gnm_float scale = value_get_as_float (args[1]);
1180 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
1181 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
1183 return value_new_float (qrayleigh (p, scale, lower_tail, log_p));
1186 /* ------------------------------------------------------------------------- */
1188 static GnmFuncHelp const help_r_dsnorm[] = {
1189 { GNM_FUNC_HELP_NAME, F_("R.DSNORM:probability density function of the skew-normal distribution") },
1190 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1191 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
1192 { GNM_FUNC_HELP_ARG, F_("location:the location parameter of the distribution") },
1193 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
1194 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
1195 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the skew-normal distribution.") },
1196 { GNM_FUNC_HELP_EXAMPLES, "=r.dsnorm(3,2,0,1)" },
1197 { GNM_FUNC_HELP_SEEALSO, "R.PSNORM,R.QSNORM" },
1198 { GNM_FUNC_HELP_END }
1201 static GnmValue *
1202 gnumeric_r_dsnorm (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1204 gnm_float x = value_get_as_float (args[0]);
1205 gnm_float shape = value_get_as_float (args[1]);
1206 gnm_float location = value_get_as_float (args[2]);
1207 gnm_float scale = value_get_as_float (args[3]);
1208 gboolean give_log = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
1210 return value_new_float (dsnorm (x, shape, location, scale, give_log));
1213 /* ------------------------------------------------------------------------- */
1215 static GnmFuncHelp const help_r_psnorm[] = {
1216 { GNM_FUNC_HELP_NAME, F_("R.PSNORM:cumulative distribution function of the skew-normal distribution") },
1217 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1218 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
1219 { GNM_FUNC_HELP_ARG, F_("location:the location parameter of the distribution") },
1220 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
1221 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1222 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1223 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the skew-normal distribution.") },
1224 { GNM_FUNC_HELP_EXAMPLES, "=r.psnorm(3,2,0,1)" },
1225 { GNM_FUNC_HELP_SEEALSO, "R.DSNORM,R.QSNORM" },
1226 { GNM_FUNC_HELP_END }
1229 static GnmValue *
1230 gnumeric_r_psnorm (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1232 gnm_float x = value_get_as_float (args[0]);
1233 gnm_float shape = value_get_as_float (args[1]);
1234 gnm_float location = value_get_as_float (args[2]);
1235 gnm_float scale = value_get_as_float (args[3]);
1236 gboolean lower_tail = args[4] ? value_get_as_checked_bool (args[4]) : TRUE;
1237 gboolean log_p = args[5] ? value_get_as_checked_bool (args[5]) : FALSE;
1239 return value_new_float (psnorm (x, shape, location, scale, lower_tail, log_p));
1242 /* ------------------------------------------------------------------------- */
1244 static GnmFuncHelp const help_r_qsnorm[] = {
1245 { GNM_FUNC_HELP_NAME, F_("R.QSNORM:probability quantile function of the skew-normal distribution") },
1246 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
1247 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
1248 { GNM_FUNC_HELP_ARG, F_("location:the location parameter of the distribution") },
1249 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
1250 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1251 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1252 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the skew-normal distribution.") },
1253 { GNM_FUNC_HELP_EXAMPLES, "=r.qsnorm(0.3,2,0,1)" },
1254 { GNM_FUNC_HELP_SEEALSO, "R.DSNORM,R.PSNORM" },
1255 { GNM_FUNC_HELP_END }
1258 static GnmValue *
1259 gnumeric_r_qsnorm (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1261 gnm_float p = value_get_as_float (args[0]);
1262 gnm_float shape = value_get_as_float (args[1]);
1263 gnm_float location = value_get_as_float (args[2]);
1264 gnm_float scale = value_get_as_float (args[3]);
1265 gboolean lower_tail = args[4] ? value_get_as_checked_bool (args[4]) : TRUE;
1266 gboolean log_p = args[5] ? value_get_as_checked_bool (args[5]) : FALSE;
1268 return value_new_float (qsnorm (p, shape, location, scale, lower_tail, log_p));
1271 /* ------------------------------------------------------------------------- */
1273 static GnmFuncHelp const help_r_dst[] = {
1274 { GNM_FUNC_HELP_NAME, F_("R.DST:probability density function of the skew-t distribution") },
1275 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1276 { GNM_FUNC_HELP_ARG, F_("n:the number of degrees of freedom of the distribution") },
1277 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
1278 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
1279 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the skew-t distribution.") },
1280 { GNM_FUNC_HELP_EXAMPLES, "=r.dst(2,5,2)" },
1281 { GNM_FUNC_HELP_SEEALSO, "R.PST,R.QST" },
1282 { GNM_FUNC_HELP_END }
1285 static GnmValue *
1286 gnumeric_r_dst (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1288 gnm_float x = value_get_as_float (args[0]);
1289 gnm_float n = value_get_as_float (args[1]);
1290 gnm_float shape = value_get_as_float (args[2]);
1291 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
1293 return value_new_float (dst (x, n, shape, give_log));
1296 /* ------------------------------------------------------------------------- */
1298 static GnmFuncHelp const help_r_pst[] = {
1299 { GNM_FUNC_HELP_NAME, F_("R.PST:cumulative distribution function of the skew-t distribution") },
1300 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1301 { GNM_FUNC_HELP_ARG, F_("n:the number of degrees of freedom of the distribution") },
1302 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
1303 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1304 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1305 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the skew-t distribution.") },
1306 { GNM_FUNC_HELP_EXAMPLES, "=r.pst(2,5,2)" },
1307 { GNM_FUNC_HELP_SEEALSO, "R.DST,R.QST" },
1308 { GNM_FUNC_HELP_END }
1311 static GnmValue *
1312 gnumeric_r_pst (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1314 gnm_float x = value_get_as_float (args[0]);
1315 gnm_float n = value_get_as_float (args[1]);
1316 gnm_float shape = value_get_as_float (args[2]);
1317 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
1318 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
1320 return value_new_float (pst (x, n, shape, lower_tail, log_p));
1323 /* ------------------------------------------------------------------------- */
1325 static GnmFuncHelp const help_r_qst[] = {
1326 { GNM_FUNC_HELP_NAME, F_("R.QST:probability quantile function of the skew-t distribution") },
1327 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
1328 { GNM_FUNC_HELP_ARG, F_("n:the number of degrees of freedom of the distribution") },
1329 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
1330 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1331 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1332 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the skew-t distribution.") },
1333 { GNM_FUNC_HELP_EXAMPLES, "=r.qst(0.3,5,2)" },
1334 { GNM_FUNC_HELP_SEEALSO, "R.DST,R.PST" },
1335 { GNM_FUNC_HELP_END }
1338 static GnmValue *
1339 gnumeric_r_qst (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1341 gnm_float p = value_get_as_float (args[0]);
1342 gnm_float n = value_get_as_float (args[1]);
1343 gnm_float shape = value_get_as_float (args[2]);
1344 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
1345 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
1347 return value_new_float (qst (p, n, shape, lower_tail, log_p));
1350 /* ------------------------------------------------------------------------- */
1352 static GnmFuncHelp const help_r_dt[] = {
1353 { GNM_FUNC_HELP_NAME, F_("R.DT:probability density function of the Student t distribution") },
1354 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1355 { GNM_FUNC_HELP_ARG, F_("n:the number of degrees of freedom of the distribution") },
1356 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
1357 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the Student t distribution.") },
1358 { GNM_FUNC_HELP_EXAMPLES, "=r.dt(1.5,5)" },
1359 { GNM_FUNC_HELP_SEEALSO, "R.PT,R.QT" },
1360 { GNM_FUNC_HELP_END }
1363 static GnmValue *
1364 gnumeric_r_dt (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1366 gnm_float x = value_get_as_float (args[0]);
1367 gnm_float n = value_get_as_float (args[1]);
1368 gboolean give_log = args[2] ? value_get_as_checked_bool (args[2]) : FALSE;
1370 return value_new_float (dt (x, n, give_log));
1373 /* ------------------------------------------------------------------------- */
1375 static GnmFuncHelp const help_r_pt[] = {
1376 { GNM_FUNC_HELP_NAME, F_("R.PT:cumulative distribution function of the Student t distribution") },
1377 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1378 { GNM_FUNC_HELP_ARG, F_("n:the number of degrees of freedom of the distribution") },
1379 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1380 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1381 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the Student t distribution.") },
1382 { GNM_FUNC_HELP_EXAMPLES, "=r.pt(1.5,5)" },
1383 { GNM_FUNC_HELP_SEEALSO, "R.DT,R.QT" },
1384 { GNM_FUNC_HELP_END }
1387 static GnmValue *
1388 gnumeric_r_pt (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1390 gnm_float x = value_get_as_float (args[0]);
1391 gnm_float n = value_get_as_float (args[1]);
1392 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
1393 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
1395 return value_new_float (pt (x, n, lower_tail, log_p));
1398 /* ------------------------------------------------------------------------- */
1400 static GnmFuncHelp const help_r_qt[] = {
1401 { GNM_FUNC_HELP_NAME, F_("R.QT:probability quantile function of the Student t distribution") },
1402 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
1403 { GNM_FUNC_HELP_ARG, F_("n:the number of degrees of freedom of the distribution") },
1404 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1405 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1406 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the Student t distribution.") },
1407 { GNM_FUNC_HELP_EXAMPLES, "=r.qt(0.3,5)" },
1408 { GNM_FUNC_HELP_SEEALSO, "R.DT,R.PT" },
1409 { GNM_FUNC_HELP_END }
1412 static GnmValue *
1413 gnumeric_r_qt (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1415 gnm_float p = value_get_as_float (args[0]);
1416 gnm_float n = value_get_as_float (args[1]);
1417 gboolean lower_tail = args[2] ? value_get_as_checked_bool (args[2]) : TRUE;
1418 gboolean log_p = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
1420 return value_new_float (qt (p, n, lower_tail, log_p));
1423 /* ------------------------------------------------------------------------- */
1425 static GnmFuncHelp const help_r_ptukey[] = {
1426 { GNM_FUNC_HELP_NAME, F_("R.PTUKEY:cumulative distribution function of the Studentized range distribution") },
1427 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1428 { GNM_FUNC_HELP_ARG, F_("nmeans:the number of means") },
1429 { GNM_FUNC_HELP_ARG, F_("df:the number of degrees of freedom of the distribution") },
1430 { GNM_FUNC_HELP_ARG, F_("nranges:the number of ranges; default is 1") },
1431 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1432 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1433 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the Studentized range distribution.") },
1434 { GNM_FUNC_HELP_SEEALSO, "R.QTUKEY" },
1435 { GNM_FUNC_HELP_END }
1438 static GnmValue *
1439 gnumeric_r_ptukey (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1441 gnm_float x = value_get_as_float (args[0]);
1442 gnm_float nmeans = value_get_as_float (args[1]);
1443 gnm_float df = value_get_as_float (args[2]);
1444 gnm_float nranges = args[3] ? value_get_as_float (args[3]) : 1;
1445 gboolean lower_tail = args[4] ? value_get_as_checked_bool (args[4]) : TRUE;
1446 gboolean log_p = args[5] ? value_get_as_checked_bool (args[5]) : FALSE;
1448 return value_new_float (ptukey (x, nmeans, df, nranges, lower_tail, log_p));
1451 /* ------------------------------------------------------------------------- */
1453 static GnmFuncHelp const help_r_qtukey[] = {
1454 { GNM_FUNC_HELP_NAME, F_("R.QTUKEY:probability quantile function of the Studentized range distribution") },
1455 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
1456 { GNM_FUNC_HELP_ARG, F_("nmeans:the number of means") },
1457 { GNM_FUNC_HELP_ARG, F_("df:the number of degrees of freedom of the distribution") },
1458 { GNM_FUNC_HELP_ARG, F_("nranges:the number of ranges; default is 1") },
1459 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1460 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1461 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the Studentized range distribution.") },
1462 { GNM_FUNC_HELP_SEEALSO, "R.PTUKEY" },
1463 { GNM_FUNC_HELP_END }
1466 static GnmValue *
1467 gnumeric_r_qtukey (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1469 gnm_float p = value_get_as_float (args[0]);
1470 gnm_float nmeans = value_get_as_float (args[1]);
1471 gnm_float df = value_get_as_float (args[2]);
1472 gnm_float nranges = args[3] ? value_get_as_float (args[3]) : 1;
1473 gboolean lower_tail = args[4] ? value_get_as_checked_bool (args[4]) : TRUE;
1474 gboolean log_p = args[5] ? value_get_as_checked_bool (args[5]) : FALSE;
1476 return value_new_float (qtukey (p, nmeans, df, nranges, lower_tail, log_p));
1479 /* ------------------------------------------------------------------------- */
1481 static GnmFuncHelp const help_r_dweibull[] = {
1482 { GNM_FUNC_HELP_NAME, F_("R.DWEIBULL:probability density function of the Weibull distribution") },
1483 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1484 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
1485 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
1486 { GNM_FUNC_HELP_ARG, F_("give_log:if true, log of the result will be returned instead") },
1487 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability density function of the Weibull distribution.") },
1488 { GNM_FUNC_HELP_EXAMPLES, "=r.dweibull(2.1,1.5,1)" },
1489 { GNM_FUNC_HELP_SEEALSO, "R.PWEIBULL,R.QWEIBULL" },
1490 { GNM_FUNC_HELP_END }
1493 static GnmValue *
1494 gnumeric_r_dweibull (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1496 gnm_float x = value_get_as_float (args[0]);
1497 gnm_float shape = value_get_as_float (args[1]);
1498 gnm_float scale = value_get_as_float (args[2]);
1499 gboolean give_log = args[3] ? value_get_as_checked_bool (args[3]) : FALSE;
1501 return value_new_float (dweibull (x, shape, scale, give_log));
1504 /* ------------------------------------------------------------------------- */
1506 static GnmFuncHelp const help_r_pweibull[] = {
1507 { GNM_FUNC_HELP_NAME, F_("R.PWEIBULL:cumulative distribution function of the Weibull distribution") },
1508 { GNM_FUNC_HELP_ARG, F_("x:observation") },
1509 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
1510 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
1511 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1512 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1513 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the cumulative distribution function of the Weibull distribution.") },
1514 { GNM_FUNC_HELP_EXAMPLES, "=r.pweibull(2.1,1.5,1)" },
1515 { GNM_FUNC_HELP_SEEALSO, "R.DWEIBULL,R.QWEIBULL" },
1516 { GNM_FUNC_HELP_END }
1519 static GnmValue *
1520 gnumeric_r_pweibull (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1522 gnm_float x = value_get_as_float (args[0]);
1523 gnm_float shape = value_get_as_float (args[1]);
1524 gnm_float scale = value_get_as_float (args[2]);
1525 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
1526 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
1528 return value_new_float (pweibull (x, shape, scale, lower_tail, log_p));
1531 /* ------------------------------------------------------------------------- */
1533 static GnmFuncHelp const help_r_qweibull[] = {
1534 { GNM_FUNC_HELP_NAME, F_("R.QWEIBULL:probability quantile function of the Weibull distribution") },
1535 { GNM_FUNC_HELP_ARG, F_("p:probability or natural logarithm of the probability") },
1536 { GNM_FUNC_HELP_ARG, F_("shape:the shape parameter of the distribution") },
1537 { GNM_FUNC_HELP_ARG, F_("scale:the scale parameter of the distribution") },
1538 { GNM_FUNC_HELP_ARG, F_("lower_tail:if true (the default), the lower tail of the distribution is considered") },
1539 { GNM_FUNC_HELP_ARG, F_("log_p:if true, the natural logarithm of the probability is given or returned; defaults to false") },
1540 { GNM_FUNC_HELP_DESCRIPTION, F_("This function returns the probability quantile function, i.e., the inverse of the cumulative distribution function, of the Weibull distribution.") },
1541 { GNM_FUNC_HELP_EXAMPLES, "=r.qweibull(0.3,1.5,1)" },
1542 { GNM_FUNC_HELP_SEEALSO, "R.DWEIBULL,R.PWEIBULL" },
1543 { GNM_FUNC_HELP_END }
1546 static GnmValue *
1547 gnumeric_r_qweibull (GnmFuncEvalInfo *ei, GnmValue const * const *args)
1549 gnm_float p = value_get_as_float (args[0]);
1550 gnm_float shape = value_get_as_float (args[1]);
1551 gnm_float scale = value_get_as_float (args[2]);
1552 gboolean lower_tail = args[3] ? value_get_as_checked_bool (args[3]) : TRUE;
1553 gboolean log_p = args[4] ? value_get_as_checked_bool (args[4]) : FALSE;
1555 return value_new_float (qweibull (p, shape, scale, lower_tail, log_p));
1558 /* ------------------------------------------------------------------------- */
1560 G_MODULE_EXPORT void
1561 go_plugin_init (GOPlugin *plugin, GOCmdContext *cc)
1565 G_MODULE_EXPORT void
1566 go_plugin_shutdown (GOPlugin *plugin, GOCmdContext *cc)
1570 /* ------------------------------------------------------------------------- */
1572 GnmFuncDescriptor const rstat_functions[] = {
1574 "r.dbeta",
1575 "fff|b",
1576 help_r_dbeta,
1577 gnumeric_r_dbeta, NULL, NULL, NULL,
1578 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1581 "r.pbeta",
1582 "fff|bb",
1583 help_r_pbeta,
1584 gnumeric_r_pbeta, NULL, NULL, NULL,
1585 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1588 "r.qbeta",
1589 "fff|bb",
1590 help_r_qbeta,
1591 gnumeric_r_qbeta, NULL, NULL, NULL,
1592 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1595 "r.dbinom",
1596 "fff|b",
1597 help_r_dbinom,
1598 gnumeric_r_dbinom, NULL, NULL, NULL,
1599 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1602 "r.pbinom",
1603 "fff|bb",
1604 help_r_pbinom,
1605 gnumeric_r_pbinom, NULL, NULL, NULL,
1606 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1609 "r.qbinom",
1610 "fff|bb",
1611 help_r_qbinom,
1612 gnumeric_r_qbinom, NULL, NULL, NULL,
1613 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1616 "r.dcauchy",
1617 "fff|b",
1618 help_r_dcauchy,
1619 gnumeric_r_dcauchy, NULL, NULL, NULL,
1620 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1623 "r.pcauchy",
1624 "fff|bb",
1625 help_r_pcauchy,
1626 gnumeric_r_pcauchy, NULL, NULL, NULL,
1627 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1630 "r.qcauchy",
1631 "fff|bb",
1632 help_r_qcauchy,
1633 gnumeric_r_qcauchy, NULL, NULL, NULL,
1634 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1637 "r.dchisq",
1638 "ff|b",
1639 help_r_dchisq,
1640 gnumeric_r_dchisq, NULL, NULL, NULL,
1641 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1644 "r.pchisq",
1645 "ff|bb",
1646 help_r_pchisq,
1647 gnumeric_r_pchisq, NULL, NULL, NULL,
1648 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1651 "r.qchisq",
1652 "ff|bb",
1653 help_r_qchisq,
1654 gnumeric_r_qchisq, NULL, NULL, NULL,
1655 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1658 "r.dexp",
1659 "ff|b",
1660 help_r_dexp,
1661 gnumeric_r_dexp, NULL, NULL, NULL,
1662 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1665 "r.pexp",
1666 "ff|bb",
1667 help_r_pexp,
1668 gnumeric_r_pexp, NULL, NULL, NULL,
1669 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1672 "r.qexp",
1673 "ff|bb",
1674 help_r_qexp,
1675 gnumeric_r_qexp, NULL, NULL, NULL,
1676 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1679 "r.df",
1680 "fff|b",
1681 help_r_df,
1682 gnumeric_r_df, NULL, NULL, NULL,
1683 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1686 "r.pf",
1687 "fff|bb",
1688 help_r_pf,
1689 gnumeric_r_pf, NULL, NULL, NULL,
1690 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1693 "r.qf",
1694 "fff|bb",
1695 help_r_qf,
1696 gnumeric_r_qf, NULL, NULL, NULL,
1697 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1700 "r.dgamma",
1701 "fff|b",
1702 help_r_dgamma,
1703 gnumeric_r_dgamma, NULL, NULL, NULL,
1704 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1707 "r.pgamma",
1708 "fff|bb",
1709 help_r_pgamma,
1710 gnumeric_r_pgamma, NULL, NULL, NULL,
1711 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1714 "r.qgamma",
1715 "fff|bb",
1716 help_r_qgamma,
1717 gnumeric_r_qgamma, NULL, NULL, NULL,
1718 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1721 "r.dgeom",
1722 "ff|b",
1723 help_r_dgeom,
1724 gnumeric_r_dgeom, NULL, NULL, NULL,
1725 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1728 "r.pgeom",
1729 "ff|bb",
1730 help_r_pgeom,
1731 gnumeric_r_pgeom, NULL, NULL, NULL,
1732 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1735 "r.qgeom",
1736 "ff|bb",
1737 help_r_qgeom,
1738 gnumeric_r_qgeom, NULL, NULL, NULL,
1739 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1742 "r.dgumbel",
1743 "fff|b",
1744 help_r_dgumbel,
1745 gnumeric_r_dgumbel, NULL, NULL, NULL,
1746 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1749 "r.pgumbel",
1750 "fff|bb",
1751 help_r_pgumbel,
1752 gnumeric_r_pgumbel, NULL, NULL, NULL,
1753 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1756 "r.qgumbel",
1757 "fff|bb",
1758 help_r_qgumbel,
1759 gnumeric_r_qgumbel, NULL, NULL, NULL,
1760 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1763 "r.dhyper",
1764 "ffff|b",
1765 help_r_dhyper,
1766 gnumeric_r_dhyper, NULL, NULL, NULL,
1767 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1770 "r.phyper",
1771 "ffff|bb",
1772 help_r_phyper,
1773 gnumeric_r_phyper, NULL, NULL, NULL,
1774 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1777 "r.qhyper",
1778 "ffff|bb",
1779 help_r_qhyper,
1780 gnumeric_r_qhyper, NULL, NULL, NULL,
1781 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1784 "r.dlnorm",
1785 "fff|b",
1786 help_r_dlnorm,
1787 gnumeric_r_dlnorm, NULL, NULL, NULL,
1788 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1791 "r.plnorm",
1792 "fff|bb",
1793 help_r_plnorm,
1794 gnumeric_r_plnorm, NULL, NULL, NULL,
1795 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1798 "r.qlnorm",
1799 "fff|bb",
1800 help_r_qlnorm,
1801 gnumeric_r_qlnorm, NULL, NULL, NULL,
1802 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1805 "r.dnbinom",
1806 "fff|b",
1807 help_r_dnbinom,
1808 gnumeric_r_dnbinom, NULL, NULL, NULL,
1809 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1812 "r.pnbinom",
1813 "fff|bb",
1814 help_r_pnbinom,
1815 gnumeric_r_pnbinom, NULL, NULL, NULL,
1816 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1819 "r.qnbinom",
1820 "fff|bb",
1821 help_r_qnbinom,
1822 gnumeric_r_qnbinom, NULL, NULL, NULL,
1823 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1826 "r.dnorm",
1827 "fff|b",
1828 help_r_dnorm,
1829 gnumeric_r_dnorm, NULL, NULL, NULL,
1830 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1833 "r.pnorm",
1834 "fff|bb",
1835 help_r_pnorm,
1836 gnumeric_r_pnorm, NULL, NULL, NULL,
1837 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1840 "r.qnorm",
1841 "fff|bb",
1842 help_r_qnorm,
1843 gnumeric_r_qnorm, NULL, NULL, NULL,
1844 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1847 "r.dpois",
1848 "ff|b",
1849 help_r_dpois,
1850 gnumeric_r_dpois, NULL, NULL, NULL,
1851 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1854 "r.ppois",
1855 "ff|bb",
1856 help_r_ppois,
1857 gnumeric_r_ppois, NULL, NULL, NULL,
1858 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1861 "r.qpois",
1862 "ff|bb",
1863 help_r_qpois,
1864 gnumeric_r_qpois, NULL, NULL, NULL,
1865 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1868 "r.drayleigh",
1869 "ff|b",
1870 help_r_drayleigh,
1871 gnumeric_r_drayleigh, NULL, NULL, NULL,
1872 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1875 "r.prayleigh",
1876 "ff|bb",
1877 help_r_prayleigh,
1878 gnumeric_r_prayleigh, NULL, NULL, NULL,
1879 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1882 "r.qrayleigh",
1883 "ff|bb",
1884 help_r_qrayleigh,
1885 gnumeric_r_qrayleigh, NULL, NULL, NULL,
1886 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1889 "r.dsnorm",
1890 "ffff|b",
1891 help_r_dsnorm,
1892 gnumeric_r_dsnorm, NULL, NULL, NULL,
1893 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1896 "r.psnorm",
1897 "ffff|bb",
1898 help_r_psnorm,
1899 gnumeric_r_psnorm, NULL, NULL, NULL,
1900 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1903 "r.qsnorm",
1904 "ffff|bb",
1905 help_r_qsnorm,
1906 gnumeric_r_qsnorm, NULL, NULL, NULL,
1907 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1910 "r.dst",
1911 "fff|b",
1912 help_r_dst,
1913 gnumeric_r_dst, NULL, NULL, NULL,
1914 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1917 "r.pst",
1918 "fff|bb",
1919 help_r_pst,
1920 gnumeric_r_pst, NULL, NULL, NULL,
1921 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1924 "r.qst",
1925 "fff|bb",
1926 help_r_qst,
1927 gnumeric_r_qst, NULL, NULL, NULL,
1928 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1931 "r.dt",
1932 "ff|b",
1933 help_r_dt,
1934 gnumeric_r_dt, NULL, NULL, NULL,
1935 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1938 "r.pt",
1939 "ff|bb",
1940 help_r_pt,
1941 gnumeric_r_pt, NULL, NULL, NULL,
1942 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1945 "r.qt",
1946 "ff|bb",
1947 help_r_qt,
1948 gnumeric_r_qt, NULL, NULL, NULL,
1949 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1952 "r.ptukey",
1953 "fff|fbb",
1954 help_r_ptukey,
1955 gnumeric_r_ptukey, NULL, NULL, NULL,
1956 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1959 "r.qtukey",
1960 "fff|fbb",
1961 help_r_qtukey,
1962 gnumeric_r_qtukey, NULL, NULL, NULL,
1963 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE,
1966 "r.dweibull",
1967 "fff|b",
1968 help_r_dweibull,
1969 gnumeric_r_dweibull, NULL, NULL, NULL,
1970 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1973 "r.pweibull",
1974 "fff|bb",
1975 help_r_pweibull,
1976 gnumeric_r_pweibull, NULL, NULL, NULL,
1977 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1980 "r.qweibull",
1981 "fff|bb",
1982 help_r_qweibull,
1983 gnumeric_r_qweibull, NULL, NULL, NULL,
1984 GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_EXHAUSTIVE,
1986 { NULL }