summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/Special/Gamma.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/GSL/Special/Gamma.hs')
-rw-r--r--lib/Numeric/GSL/Special/Gamma.hs362
1 files changed, 362 insertions, 0 deletions
diff --git a/lib/Numeric/GSL/Special/Gamma.hs b/lib/Numeric/GSL/Special/Gamma.hs
new file mode 100644
index 0000000..aa03892
--- /dev/null
+++ b/lib/Numeric/GSL/Special/Gamma.hs
@@ -0,0 +1,362 @@
1------------------------------------------------------------
2{- |
3Module : Numeric.GSL.Special.Gamma
4Copyright : (c) Alberto Ruiz 2006
5License : GPL-style
6Maintainer : Alberto Ruiz (aruiz at um dot es)
7Stability : provisional
8Portability : uses ffi
9
10Wrappers for selected functions described at:
11
12<http://www.google.com/search?q=gsl_sf_gamma.h&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
13
14-}
15------------------------------------------------------------
16
17module Numeric.GSL.Special.Gamma(
18 lngamma_e
19, lngamma
20, gamma_e
21, gamma
22, gammastar_e
23, gammastar
24, gammainv_e
25, gammainv
26, taylorcoeff_e
27, taylorcoeff
28, fact_e
29, fact
30, doublefact_e
31, doublefact
32, lnfact_e
33, lnfact
34, lndoublefact_e
35, lndoublefact
36, lnchoose_e
37, lnchoose
38, choose_e
39, choose
40, lnpoch_e
41, lnpoch
42, poch_e
43, poch
44, pochrel_e
45, pochrel
46, gamma_inc_Q_e
47, gamma_inc_Q
48, gamma_inc_P_e
49, gamma_inc_P
50, gamma_inc_e
51, gamma_inc
52, lnbeta_e
53, lnbeta
54, beta_e
55, beta
56, beta_inc_e
57, beta_inc
58) where
59
60import Foreign(Ptr)
61import Numeric.GSL.Special.Internal
62
63-- | wrapper for int gsl_sf_lngamma_e(double x,gsl_sf_result* result);
64--
65-- <http://www.google.com/search?q=gsl_sf_lngamma_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
66lngamma_e :: Double -> (Double,Double)
67lngamma_e x = createSFR "lngamma_e" $ gsl_sf_lngamma_e x
68foreign import ccall "gamma.h gsl_sf_lngamma_e" gsl_sf_lngamma_e :: Double -> Ptr Double -> IO(Int)
69
70-- | wrapper for double gsl_sf_lngamma(double x);
71--
72-- <http://www.google.com/search?q=gsl_sf_lngamma&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
73lngamma :: Double -> Double
74lngamma = gsl_sf_lngamma
75foreign import ccall "gamma.h gsl_sf_lngamma" gsl_sf_lngamma :: Double -> Double
76
77-- | wrapper for int gsl_sf_lngamma_sgn_e(double x,gsl_sf_result* result_lg,double* sgn);
78--
79-- <http://www.google.com/search?q=gsl_sf_lngamma_sgn_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
80lngamma_sgn_e :: Double -> Ptr Double -> Ptr Double -> Int
81lngamma_sgn_e = gsl_sf_lngamma_sgn_e
82foreign import ccall "gamma.h gsl_sf_lngamma_sgn_e" gsl_sf_lngamma_sgn_e :: Double -> Ptr Double -> Ptr Double -> Int
83
84-- | wrapper for int gsl_sf_gamma_e(double x,gsl_sf_result* result);
85--
86-- <http://www.google.com/search?q=gsl_sf_gamma_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
87gamma_e :: Double -> (Double,Double)
88gamma_e x = createSFR "gamma_e" $ gsl_sf_gamma_e x
89foreign import ccall "gamma.h gsl_sf_gamma_e" gsl_sf_gamma_e :: Double -> Ptr Double -> IO(Int)
90
91-- | wrapper for double gsl_sf_gamma(double x);
92--
93-- <http://www.google.com/search?q=gsl_sf_gamma&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
94gamma :: Double -> Double
95gamma = gsl_sf_gamma
96foreign import ccall "gamma.h gsl_sf_gamma" gsl_sf_gamma :: Double -> Double
97
98-- | wrapper for int gsl_sf_gammastar_e(double x,gsl_sf_result* result);
99--
100-- <http://www.google.com/search?q=gsl_sf_gammastar_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
101gammastar_e :: Double -> (Double,Double)
102gammastar_e x = createSFR "gammastar_e" $ gsl_sf_gammastar_e x
103foreign import ccall "gamma.h gsl_sf_gammastar_e" gsl_sf_gammastar_e :: Double -> Ptr Double -> IO(Int)
104
105-- | wrapper for double gsl_sf_gammastar(double x);
106--
107-- <http://www.google.com/search?q=gsl_sf_gammastar&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
108gammastar :: Double -> Double
109gammastar = gsl_sf_gammastar
110foreign import ccall "gamma.h gsl_sf_gammastar" gsl_sf_gammastar :: Double -> Double
111
112-- | wrapper for int gsl_sf_gammainv_e(double x,gsl_sf_result* result);
113--
114-- <http://www.google.com/search?q=gsl_sf_gammainv_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
115gammainv_e :: Double -> (Double,Double)
116gammainv_e x = createSFR "gammainv_e" $ gsl_sf_gammainv_e x
117foreign import ccall "gamma.h gsl_sf_gammainv_e" gsl_sf_gammainv_e :: Double -> Ptr Double -> IO(Int)
118
119-- | wrapper for double gsl_sf_gammainv(double x);
120--
121-- <http://www.google.com/search?q=gsl_sf_gammainv&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
122gammainv :: Double -> Double
123gammainv = gsl_sf_gammainv
124foreign import ccall "gamma.h gsl_sf_gammainv" gsl_sf_gammainv :: Double -> Double
125
126-- | wrapper for int gsl_sf_lngamma_complex_e(double zr,double zi,gsl_sf_result* lnr,gsl_sf_result* arg);
127--
128-- <http://www.google.com/search?q=gsl_sf_lngamma_complex_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
129lngamma_complex_e :: Double -> Double -> Ptr Double -> (Double,Double)
130lngamma_complex_e zr zi lnr = createSFR "lngamma_complex_e" $ gsl_sf_lngamma_complex_e zr zi lnr
131foreign import ccall "gamma.h gsl_sf_lngamma_complex_e" gsl_sf_lngamma_complex_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int)
132
133-- | wrapper for int gsl_sf_taylorcoeff_e(int n,double x,gsl_sf_result* result);
134--
135-- <http://www.google.com/search?q=gsl_sf_taylorcoeff_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
136taylorcoeff_e :: Int -> Double -> (Double,Double)
137taylorcoeff_e n x = createSFR "taylorcoeff_e" $ gsl_sf_taylorcoeff_e n x
138foreign import ccall "gamma.h gsl_sf_taylorcoeff_e" gsl_sf_taylorcoeff_e :: Int -> Double -> Ptr Double -> IO(Int)
139
140-- | wrapper for double gsl_sf_taylorcoeff(int n,double x);
141--
142-- <http://www.google.com/search?q=gsl_sf_taylorcoeff&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
143taylorcoeff :: Int -> Double -> Double
144taylorcoeff = gsl_sf_taylorcoeff
145foreign import ccall "gamma.h gsl_sf_taylorcoeff" gsl_sf_taylorcoeff :: Int -> Double -> Double
146
147-- | wrapper for int gsl_sf_fact_e(int n,gsl_sf_result* result);
148--
149-- <http://www.google.com/search?q=gsl_sf_fact_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
150fact_e :: Int -> (Double,Double)
151fact_e n = createSFR "fact_e" $ gsl_sf_fact_e n
152foreign import ccall "gamma.h gsl_sf_fact_e" gsl_sf_fact_e :: Int -> Ptr Double -> IO(Int)
153
154-- | wrapper for double gsl_sf_fact(int n);
155--
156-- <http://www.google.com/search?q=gsl_sf_fact&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
157fact :: Int -> Double
158fact = gsl_sf_fact
159foreign import ccall "gamma.h gsl_sf_fact" gsl_sf_fact :: Int -> Double
160
161-- | wrapper for int gsl_sf_doublefact_e(int n,gsl_sf_result* result);
162--
163-- <http://www.google.com/search?q=gsl_sf_doublefact_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
164doublefact_e :: Int -> (Double,Double)
165doublefact_e n = createSFR "doublefact_e" $ gsl_sf_doublefact_e n
166foreign import ccall "gamma.h gsl_sf_doublefact_e" gsl_sf_doublefact_e :: Int -> Ptr Double -> IO(Int)
167
168-- | wrapper for double gsl_sf_doublefact(int n);
169--
170-- <http://www.google.com/search?q=gsl_sf_doublefact&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
171doublefact :: Int -> Double
172doublefact = gsl_sf_doublefact
173foreign import ccall "gamma.h gsl_sf_doublefact" gsl_sf_doublefact :: Int -> Double
174
175-- | wrapper for int gsl_sf_lnfact_e(int n,gsl_sf_result* result);
176--
177-- <http://www.google.com/search?q=gsl_sf_lnfact_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
178lnfact_e :: Int -> (Double,Double)
179lnfact_e n = createSFR "lnfact_e" $ gsl_sf_lnfact_e n
180foreign import ccall "gamma.h gsl_sf_lnfact_e" gsl_sf_lnfact_e :: Int -> Ptr Double -> IO(Int)
181
182-- | wrapper for double gsl_sf_lnfact(int n);
183--
184-- <http://www.google.com/search?q=gsl_sf_lnfact&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
185lnfact :: Int -> Double
186lnfact = gsl_sf_lnfact
187foreign import ccall "gamma.h gsl_sf_lnfact" gsl_sf_lnfact :: Int -> Double
188
189-- | wrapper for int gsl_sf_lndoublefact_e(int n,gsl_sf_result* result);
190--
191-- <http://www.google.com/search?q=gsl_sf_lndoublefact_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
192lndoublefact_e :: Int -> (Double,Double)
193lndoublefact_e n = createSFR "lndoublefact_e" $ gsl_sf_lndoublefact_e n
194foreign import ccall "gamma.h gsl_sf_lndoublefact_e" gsl_sf_lndoublefact_e :: Int -> Ptr Double -> IO(Int)
195
196-- | wrapper for double gsl_sf_lndoublefact(int n);
197--
198-- <http://www.google.com/search?q=gsl_sf_lndoublefact&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
199lndoublefact :: Int -> Double
200lndoublefact = gsl_sf_lndoublefact
201foreign import ccall "gamma.h gsl_sf_lndoublefact" gsl_sf_lndoublefact :: Int -> Double
202
203-- | wrapper for int gsl_sf_lnchoose_e(int n,int m,gsl_sf_result* result);
204--
205-- <http://www.google.com/search?q=gsl_sf_lnchoose_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
206lnchoose_e :: Int -> Int -> (Double,Double)
207lnchoose_e n m = createSFR "lnchoose_e" $ gsl_sf_lnchoose_e n m
208foreign import ccall "gamma.h gsl_sf_lnchoose_e" gsl_sf_lnchoose_e :: Int -> Int -> Ptr Double -> IO(Int)
209
210-- | wrapper for double gsl_sf_lnchoose(int n,int m);
211--
212-- <http://www.google.com/search?q=gsl_sf_lnchoose&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
213lnchoose :: Int -> Int -> Double
214lnchoose = gsl_sf_lnchoose
215foreign import ccall "gamma.h gsl_sf_lnchoose" gsl_sf_lnchoose :: Int -> Int -> Double
216
217-- | wrapper for int gsl_sf_choose_e(int n,int m,gsl_sf_result* result);
218--
219-- <http://www.google.com/search?q=gsl_sf_choose_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
220choose_e :: Int -> Int -> (Double,Double)
221choose_e n m = createSFR "choose_e" $ gsl_sf_choose_e n m
222foreign import ccall "gamma.h gsl_sf_choose_e" gsl_sf_choose_e :: Int -> Int -> Ptr Double -> IO(Int)
223
224-- | wrapper for double gsl_sf_choose(int n,int m);
225--
226-- <http://www.google.com/search?q=gsl_sf_choose&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
227choose :: Int -> Int -> Double
228choose = gsl_sf_choose
229foreign import ccall "gamma.h gsl_sf_choose" gsl_sf_choose :: Int -> Int -> Double
230
231-- | wrapper for int gsl_sf_lnpoch_e(double a,double x,gsl_sf_result* result);
232--
233-- <http://www.google.com/search?q=gsl_sf_lnpoch_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
234lnpoch_e :: Double -> Double -> (Double,Double)
235lnpoch_e a x = createSFR "lnpoch_e" $ gsl_sf_lnpoch_e a x
236foreign import ccall "gamma.h gsl_sf_lnpoch_e" gsl_sf_lnpoch_e :: Double -> Double -> Ptr Double -> IO(Int)
237
238-- | wrapper for double gsl_sf_lnpoch(double a,double x);
239--
240-- <http://www.google.com/search?q=gsl_sf_lnpoch&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
241lnpoch :: Double -> Double -> Double
242lnpoch = gsl_sf_lnpoch
243foreign import ccall "gamma.h gsl_sf_lnpoch" gsl_sf_lnpoch :: Double -> Double -> Double
244
245-- | wrapper for int gsl_sf_lnpoch_sgn_e(double a,double x,gsl_sf_result* result,double* sgn);
246--
247-- <http://www.google.com/search?q=gsl_sf_lnpoch_sgn_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
248lnpoch_sgn_e :: Double -> Double -> Ptr Double -> Ptr Double -> Int
249lnpoch_sgn_e = gsl_sf_lnpoch_sgn_e
250foreign import ccall "gamma.h gsl_sf_lnpoch_sgn_e" gsl_sf_lnpoch_sgn_e :: Double -> Double -> Ptr Double -> Ptr Double -> Int
251
252-- | wrapper for int gsl_sf_poch_e(double a,double x,gsl_sf_result* result);
253--
254-- <http://www.google.com/search?q=gsl_sf_poch_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
255poch_e :: Double -> Double -> (Double,Double)
256poch_e a x = createSFR "poch_e" $ gsl_sf_poch_e a x
257foreign import ccall "gamma.h gsl_sf_poch_e" gsl_sf_poch_e :: Double -> Double -> Ptr Double -> IO(Int)
258
259-- | wrapper for double gsl_sf_poch(double a,double x);
260--
261-- <http://www.google.com/search?q=gsl_sf_poch&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
262poch :: Double -> Double -> Double
263poch = gsl_sf_poch
264foreign import ccall "gamma.h gsl_sf_poch" gsl_sf_poch :: Double -> Double -> Double
265
266-- | wrapper for int gsl_sf_pochrel_e(double a,double x,gsl_sf_result* result);
267--
268-- <http://www.google.com/search?q=gsl_sf_pochrel_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
269pochrel_e :: Double -> Double -> (Double,Double)
270pochrel_e a x = createSFR "pochrel_e" $ gsl_sf_pochrel_e a x
271foreign import ccall "gamma.h gsl_sf_pochrel_e" gsl_sf_pochrel_e :: Double -> Double -> Ptr Double -> IO(Int)
272
273-- | wrapper for double gsl_sf_pochrel(double a,double x);
274--
275-- <http://www.google.com/search?q=gsl_sf_pochrel&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
276pochrel :: Double -> Double -> Double
277pochrel = gsl_sf_pochrel
278foreign import ccall "gamma.h gsl_sf_pochrel" gsl_sf_pochrel :: Double -> Double -> Double
279
280-- | wrapper for int gsl_sf_gamma_inc_Q_e(double a,double x,gsl_sf_result* result);
281--
282-- <http://www.google.com/search?q=gsl_sf_gamma_inc_Q_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
283gamma_inc_Q_e :: Double -> Double -> (Double,Double)
284gamma_inc_Q_e a x = createSFR "gamma_inc_Q_e" $ gsl_sf_gamma_inc_Q_e a x
285foreign import ccall "gamma.h gsl_sf_gamma_inc_Q_e" gsl_sf_gamma_inc_Q_e :: Double -> Double -> Ptr Double -> IO(Int)
286
287-- | wrapper for double gsl_sf_gamma_inc_Q(double a,double x);
288--
289-- <http://www.google.com/search?q=gsl_sf_gamma_inc_Q&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
290gamma_inc_Q :: Double -> Double -> Double
291gamma_inc_Q = gsl_sf_gamma_inc_Q
292foreign import ccall "gamma.h gsl_sf_gamma_inc_Q" gsl_sf_gamma_inc_Q :: Double -> Double -> Double
293
294-- | wrapper for int gsl_sf_gamma_inc_P_e(double a,double x,gsl_sf_result* result);
295--
296-- <http://www.google.com/search?q=gsl_sf_gamma_inc_P_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
297gamma_inc_P_e :: Double -> Double -> (Double,Double)
298gamma_inc_P_e a x = createSFR "gamma_inc_P_e" $ gsl_sf_gamma_inc_P_e a x
299foreign import ccall "gamma.h gsl_sf_gamma_inc_P_e" gsl_sf_gamma_inc_P_e :: Double -> Double -> Ptr Double -> IO(Int)
300
301-- | wrapper for double gsl_sf_gamma_inc_P(double a,double x);
302--
303-- <http://www.google.com/search?q=gsl_sf_gamma_inc_P&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
304gamma_inc_P :: Double -> Double -> Double
305gamma_inc_P = gsl_sf_gamma_inc_P
306foreign import ccall "gamma.h gsl_sf_gamma_inc_P" gsl_sf_gamma_inc_P :: Double -> Double -> Double
307
308-- | wrapper for int gsl_sf_gamma_inc_e(double a,double x,gsl_sf_result* result);
309--
310-- <http://www.google.com/search?q=gsl_sf_gamma_inc_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
311gamma_inc_e :: Double -> Double -> (Double,Double)
312gamma_inc_e a x = createSFR "gamma_inc_e" $ gsl_sf_gamma_inc_e a x
313foreign import ccall "gamma.h gsl_sf_gamma_inc_e" gsl_sf_gamma_inc_e :: Double -> Double -> Ptr Double -> IO(Int)
314
315-- | wrapper for double gsl_sf_gamma_inc(double a,double x);
316--
317-- <http://www.google.com/search?q=gsl_sf_gamma_inc&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
318gamma_inc :: Double -> Double -> Double
319gamma_inc = gsl_sf_gamma_inc
320foreign import ccall "gamma.h gsl_sf_gamma_inc" gsl_sf_gamma_inc :: Double -> Double -> Double
321
322-- | wrapper for int gsl_sf_lnbeta_e(double a,double b,gsl_sf_result* result);
323--
324-- <http://www.google.com/search?q=gsl_sf_lnbeta_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
325lnbeta_e :: Double -> Double -> (Double,Double)
326lnbeta_e a b = createSFR "lnbeta_e" $ gsl_sf_lnbeta_e a b
327foreign import ccall "gamma.h gsl_sf_lnbeta_e" gsl_sf_lnbeta_e :: Double -> Double -> Ptr Double -> IO(Int)
328
329-- | wrapper for double gsl_sf_lnbeta(double a,double b);
330--
331-- <http://www.google.com/search?q=gsl_sf_lnbeta&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
332lnbeta :: Double -> Double -> Double
333lnbeta = gsl_sf_lnbeta
334foreign import ccall "gamma.h gsl_sf_lnbeta" gsl_sf_lnbeta :: Double -> Double -> Double
335
336-- | wrapper for int gsl_sf_beta_e(double a,double b,gsl_sf_result* result);
337--
338-- <http://www.google.com/search?q=gsl_sf_beta_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
339beta_e :: Double -> Double -> (Double,Double)
340beta_e a b = createSFR "beta_e" $ gsl_sf_beta_e a b
341foreign import ccall "gamma.h gsl_sf_beta_e" gsl_sf_beta_e :: Double -> Double -> Ptr Double -> IO(Int)
342
343-- | wrapper for double gsl_sf_beta(double a,double b);
344--
345-- <http://www.google.com/search?q=gsl_sf_beta&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
346beta :: Double -> Double -> Double
347beta = gsl_sf_beta
348foreign import ccall "gamma.h gsl_sf_beta" gsl_sf_beta :: Double -> Double -> Double
349
350-- | wrapper for int gsl_sf_beta_inc_e(double a,double b,double x,gsl_sf_result* result);
351--
352-- <http://www.google.com/search?q=gsl_sf_beta_inc_e&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
353beta_inc_e :: Double -> Double -> Double -> (Double,Double)
354beta_inc_e a b x = createSFR "beta_inc_e" $ gsl_sf_beta_inc_e a b x
355foreign import ccall "gamma.h gsl_sf_beta_inc_e" gsl_sf_beta_inc_e :: Double -> Double -> Double -> Ptr Double -> IO(Int)
356
357-- | wrapper for double gsl_sf_beta_inc(double a,double b,double x);
358--
359-- <http://www.google.com/search?q=gsl_sf_beta_inc&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
360beta_inc :: Double -> Double -> Double -> Double
361beta_inc = gsl_sf_beta_inc
362foreign import ccall "gamma.h gsl_sf_beta_inc" gsl_sf_beta_inc :: Double -> Double -> Double -> Double