ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_polynomial::getPolyDiff Interface Reference

Generate and return the vector of coefficients of the polynomial resulting from the \(k\)th-order differentiation of a univariate polynomial of arbitrary degree. More...

Detailed Description

Generate and return the vector of coefficients of the polynomial resulting from the \(k\)th-order differentiation of a univariate polynomial of arbitrary degree.

See the documentation of pm_polynomial for details of the implementation.

Parameters
[in]coef: The input contiguous vector of non-zero size of,
  • type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128), or
  • type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
containing the coefficients (in the order of increasing power) of the univariate polynomial whose \(k\)th-order derivative must be returned.
By definition, the degree of the coef polynomial is size(coef) - 1.
This means that the condition coef(size(coef)) /= 0. is expected to hold (although not enforced).
[in]order: The input scalar nonnegative integer of default kind IK containing the order of the derivative to compute.
(optional, default = 1)
Returns
diff : The output contiguous vector of the same type and kind as the input coef, of size size(coef) - order, containing the coefficients (in the order of increasing power) of the resulting polynomial from the \(k\)th-order differentiation of the input polynomial with coefficients coef of arbitrary degree.
By definition, the degree of the diff polynomial is size(diff) - order.


Possible calling interfaces

diff(1 : size(coef) - 1) = getPolyDiff(coef(:))
diff(1 : size(coef) - order) = getPolyDiff(coef(:), order)
Generate and return the vector of coefficients of the polynomial resulting from the th-order differen...
This module contains procedures and generic interfaces for performing various mathematical operations...
Warning
The condition 0 <= order must hold for the corresponding input arguments.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
The pure procedure(s) documented herein become impure when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1.
By default, these procedures are pure in release build and impure in debug and testing builds.
See also
getPolyDiff
setPolyDiff


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
5 use pm_distUnif, only: getUnifRand
8
9 implicit none
10
11 integer(IK) :: order
12 integer(IK) :: degree
13 type(display_type) :: disp
14 integer(IK) :: itry, ntry = 20
15 disp = display_type(file = "main.out.F90")
16
17 block
18 use pm_kind, only: TKG => RKS ! all processor real and complex kinds are supported.
19 real(TKG), allocatable :: coef(:), diff(:)
20 do itry = 1, ntry
21 call disp%show("degree = getUnifRand(0, 9_IK)")
22 degree = getUnifRand(0, 9_IK)
23 call disp%show("degree")
24 call disp%show( degree )
25 call disp%show("coef = getUnifRand(-9, 9, degree)")
26 coef = getUnifRand(-9, 9, degree)
27 call disp%show("coef")
28 call disp%show( coef )
29 call disp%show("getPolyStr(coef)")
30 call disp%show( getPolyStr(coef) )
31 call disp%show("order = getUnifRand(0, size(coef) + 1)")
32 order = getUnifRand(0, size(coef) + 1)
33 call disp%show("order")
34 call disp%show( order )
35 call disp%skip()
36 call disp%show("diff = getPolyDiff(coef, order)")
37 diff = getPolyDiff(coef, order)
38 call disp%show("diff ! derivative coefficients.")
39 call disp%show( diff )
40 call disp%show("getPolyStr(diff)")
41 call disp%show( getPolyStr(diff) )
42 call disp%skip()
43 end do
44 end block
45
46 block
47 use pm_kind, only: TKG => RKS ! all processor real and complex kinds are supported.
48 complex(TKG), allocatable :: coef(:), diff(:)
49 do itry = 1, ntry
50 call disp%show("degree = getUnifRand(0, 9_IK)")
51 degree = getUnifRand(0, 9_IK)
52 call disp%show("degree")
53 call disp%show( degree )
54 call disp%show("coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)")
55 coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
56 call disp%show("coef")
57 call disp%show( coef )
58 call disp%show("getPolyStr(coef)")
59 call disp%show( getPolyStr(coef) )
60 call disp%show("order = getUnifRand(0, size(coef) + 1)")
61 order = getUnifRand(0, size(coef) + 1)
62 call disp%show("order")
63 call disp%show( order )
64 call disp%skip()
65 call disp%show("diff = getPolyDiff(coef, order)")
66 diff = getPolyDiff(coef, order)
67 call disp%show("diff ! derivative coefficients.")
68 call disp%show( diff )
69 call disp%show("getPolyStr(diff)")
70 call disp%show( getPolyStr(diff) )
71 call disp%skip()
72 end do
73 end block
74
75end program example
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
Generate and return a string containing the polynomial expression corresponding to the input polynomi...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
Definition: pm_kind.F90:567
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1degree = getUnifRand(0, 9_IK)
2degree
3+7
4coef = getUnifRand(-9, 9, degree)
5coef
6-9.00000000, +1.00000000, +2.00000000, -1.00000000, +0.00000000, +3.00000000, -2.00000000
7getPolyStr(coef)
8-9.x^0 + 1.x^1 + 2.x^2 - 1.x^3 + 0.x^4 + 3.x^5 - 2.x^6
9order = getUnifRand(0, size(coef) + 1)
10order
11+5
12
13diff = getPolyDiff(coef, order)
14diff ! derivative coefficients.
15+15.0000000, -12.0000000
16getPolyStr(diff)
1715.x^0 - 12.x^1
18
19degree = getUnifRand(0, 9_IK)
20degree
21+1
22coef = getUnifRand(-9, 9, degree)
23coef
24-1.00000000
25getPolyStr(coef)
26-1.x^0
27order = getUnifRand(0, size(coef) + 1)
28order
29+0
30
31diff = getPolyDiff(coef, order)
32diff ! derivative coefficients.
33-1.00000000
34getPolyStr(diff)
35-1.x^0
36
37degree = getUnifRand(0, 9_IK)
38degree
39+1
40coef = getUnifRand(-9, 9, degree)
41coef
42+5.00000000
43getPolyStr(coef)
445.x^0
45order = getUnifRand(0, size(coef) + 1)
46order
47+0
48
49diff = getPolyDiff(coef, order)
50diff ! derivative coefficients.
51+5.00000000
52getPolyStr(diff)
535.x^0
54
55degree = getUnifRand(0, 9_IK)
56degree
57+2
58coef = getUnifRand(-9, 9, degree)
59coef
60-9.00000000, -5.00000000
61getPolyStr(coef)
62-9.x^0 - 5.x^1
63order = getUnifRand(0, size(coef) + 1)
64order
65+1
66
67diff = getPolyDiff(coef, order)
68diff ! derivative coefficients.
69-5.00000000
70getPolyStr(diff)
71-5.x^0
72
73degree = getUnifRand(0, 9_IK)
74degree
75+7
76coef = getUnifRand(-9, 9, degree)
77coef
78-4.00000000, -3.00000000, +5.00000000, -9.00000000, -7.00000000, +7.00000000, -3.00000000
79getPolyStr(coef)
80-4.x^0 - 3.x^1 + 5.x^2 - 9.x^3 - 7.x^4 + 7.x^5 - 3.x^6
81order = getUnifRand(0, size(coef) + 1)
82order
83+8
84
85diff = getPolyDiff(coef, order)
86diff ! derivative coefficients.
87
88getPolyStr(diff)
89
90
91degree = getUnifRand(0, 9_IK)
92degree
93+5
94coef = getUnifRand(-9, 9, degree)
95coef
96-1.00000000, -6.00000000, +8.00000000, +6.00000000, +6.00000000
97getPolyStr(coef)
98-1.x^0 - 6.x^1 + 8.x^2 + 6.x^3 + 6.x^4
99order = getUnifRand(0, size(coef) + 1)
100order
101+6
102
103diff = getPolyDiff(coef, order)
104diff ! derivative coefficients.
105
106getPolyStr(diff)
107
108
109degree = getUnifRand(0, 9_IK)
110degree
111+4
112coef = getUnifRand(-9, 9, degree)
113coef
114+1.00000000, +4.00000000, -3.00000000, +9.00000000
115getPolyStr(coef)
1161.x^0 + 4.x^1 - 3.x^2 + 9.x^3
117order = getUnifRand(0, size(coef) + 1)
118order
119+5
120
121diff = getPolyDiff(coef, order)
122diff ! derivative coefficients.
123
124getPolyStr(diff)
125
126
127degree = getUnifRand(0, 9_IK)
128degree
129+8
130coef = getUnifRand(-9, 9, degree)
131coef
132+4.00000000, -2.00000000, +1.00000000, +4.00000000, +3.00000000, -5.00000000, +6.00000000, +0.00000000
133getPolyStr(coef)
1344.x^0 - 2.x^1 + 1.x^2 + 4.x^3 + 3.x^4 - 5.x^5 + 6.x^6 + 0.x^7
135order = getUnifRand(0, size(coef) + 1)
136order
137+6
138
139diff = getPolyDiff(coef, order)
140diff ! derivative coefficients.
141+36.0000000, +0.00000000
142getPolyStr(diff)
14336.x^0 + 0.x^1
144
145degree = getUnifRand(0, 9_IK)
146degree
147+4
148coef = getUnifRand(-9, 9, degree)
149coef
150-2.00000000, -4.00000000, -9.00000000, +5.00000000
151getPolyStr(coef)
152-2.x^0 - 4.x^1 - 9.x^2 + 5.x^3
153order = getUnifRand(0, size(coef) + 1)
154order
155+1
156
157diff = getPolyDiff(coef, order)
158diff ! derivative coefficients.
159-4.00000000, -18.0000000, +15.0000000
160getPolyStr(diff)
161-4.x^0 - 18.x^1 + 15.x^2
162
163degree = getUnifRand(0, 9_IK)
164degree
165+0
166coef = getUnifRand(-9, 9, degree)
167coef
168
169getPolyStr(coef)
170
171order = getUnifRand(0, size(coef) + 1)
172order
173+0
174
175diff = getPolyDiff(coef, order)
176diff ! derivative coefficients.
177
178getPolyStr(diff)
179
180
181degree = getUnifRand(0, 9_IK)
182degree
183+9
184coef = getUnifRand(-9, 9, degree)
185coef
186-1.00000000, +3.00000000, -6.00000000, -1.00000000, -6.00000000, -8.00000000, +0.00000000, -7.00000000, -3.00000000
187getPolyStr(coef)
188-1.x^0 + 3.x^1 - 6.x^2 - 1.x^3 - 6.x^4 - 8.x^5 + 0.x^6 - 7.x^7 - 3.x^8
189order = getUnifRand(0, size(coef) + 1)
190order
191+4
192
193diff = getPolyDiff(coef, order)
194diff ! derivative coefficients.
195-24.0000000, -40.0000000, +0.00000000, -49.0000000, -24.0000000
196getPolyStr(diff)
197-24.x^0 - 40.x^1 + 0.x^2 - 49.x^3 - 24.x^4
198
199degree = getUnifRand(0, 9_IK)
200degree
201+1
202coef = getUnifRand(-9, 9, degree)
203coef
204+1.00000000
205getPolyStr(coef)
2061.x^0
207order = getUnifRand(0, size(coef) + 1)
208order
209+2
210
211diff = getPolyDiff(coef, order)
212diff ! derivative coefficients.
213
214getPolyStr(diff)
215
216
217degree = getUnifRand(0, 9_IK)
218degree
219+5
220coef = getUnifRand(-9, 9, degree)
221coef
222-8.00000000, -7.00000000, -9.00000000, +4.00000000, +9.00000000
223getPolyStr(coef)
224-8.x^0 - 7.x^1 - 9.x^2 + 4.x^3 + 9.x^4
225order = getUnifRand(0, size(coef) + 1)
226order
227+5
228
229diff = getPolyDiff(coef, order)
230diff ! derivative coefficients.
231
232getPolyStr(diff)
233
234
235degree = getUnifRand(0, 9_IK)
236degree
237+3
238coef = getUnifRand(-9, 9, degree)
239coef
240-8.00000000, -9.00000000, -4.00000000
241getPolyStr(coef)
242-8.x^0 - 9.x^1 - 4.x^2
243order = getUnifRand(0, size(coef) + 1)
244order
245+2
246
247diff = getPolyDiff(coef, order)
248diff ! derivative coefficients.
249-8.00000000
250getPolyStr(diff)
251-8.x^0
252
253degree = getUnifRand(0, 9_IK)
254degree
255+5
256coef = getUnifRand(-9, 9, degree)
257coef
258+8.00000000, +6.00000000, +2.00000000, +7.00000000, +4.00000000
259getPolyStr(coef)
2608.x^0 + 6.x^1 + 2.x^2 + 7.x^3 + 4.x^4
261order = getUnifRand(0, size(coef) + 1)
262order
263+0
264
265diff = getPolyDiff(coef, order)
266diff ! derivative coefficients.
267+8.00000000, +6.00000000, +2.00000000, +7.00000000, +4.00000000
268getPolyStr(diff)
2698.x^0 + 6.x^1 + 2.x^2 + 7.x^3 + 4.x^4
270
271degree = getUnifRand(0, 9_IK)
272degree
273+1
274coef = getUnifRand(-9, 9, degree)
275coef
276+3.00000000
277getPolyStr(coef)
2783.x^0
279order = getUnifRand(0, size(coef) + 1)
280order
281+2
282
283diff = getPolyDiff(coef, order)
284diff ! derivative coefficients.
285
286getPolyStr(diff)
287
288
289degree = getUnifRand(0, 9_IK)
290degree
291+8
292coef = getUnifRand(-9, 9, degree)
293coef
294+7.00000000, +0.00000000, +0.00000000, +5.00000000, -8.00000000, +7.00000000, +2.00000000, -9.00000000
295getPolyStr(coef)
2967.x^0 + 0.x^1 + 0.x^2 + 5.x^3 - 8.x^4 + 7.x^5 + 2.x^6 - 9.x^7
297order = getUnifRand(0, size(coef) + 1)
298order
299+5
300
301diff = getPolyDiff(coef, order)
302diff ! derivative coefficients.
303+35.0000000, +12.0000000, -63.0000000
304getPolyStr(diff)
30535.x^0 + 12.x^1 - 63.x^2
306
307degree = getUnifRand(0, 9_IK)
308degree
309+8
310coef = getUnifRand(-9, 9, degree)
311coef
312+2.00000000, -7.00000000, +8.00000000, -3.00000000, -3.00000000, +3.00000000, +4.00000000, +6.00000000
313getPolyStr(coef)
3142.x^0 - 7.x^1 + 8.x^2 - 3.x^3 - 3.x^4 + 3.x^5 + 4.x^6 + 6.x^7
315order = getUnifRand(0, size(coef) + 1)
316order
317+0
318
319diff = getPolyDiff(coef, order)
320diff ! derivative coefficients.
321+2.00000000, -7.00000000, +8.00000000, -3.00000000, -3.00000000, +3.00000000, +4.00000000, +6.00000000
322getPolyStr(diff)
3232.x^0 - 7.x^1 + 8.x^2 - 3.x^3 - 3.x^4 + 3.x^5 + 4.x^6 + 6.x^7
324
325degree = getUnifRand(0, 9_IK)
326degree
327+6
328coef = getUnifRand(-9, 9, degree)
329coef
330+5.00000000, +1.00000000, -7.00000000, +3.00000000, -6.00000000, -7.00000000
331getPolyStr(coef)
3325.x^0 + 1.x^1 - 7.x^2 + 3.x^3 - 6.x^4 - 7.x^5
333order = getUnifRand(0, size(coef) + 1)
334order
335+1
336
337diff = getPolyDiff(coef, order)
338diff ! derivative coefficients.
339+1.00000000, -14.0000000, +9.00000000, -24.0000000, -35.0000000
340getPolyStr(diff)
3411.x^0 - 14.x^1 + 9.x^2 - 24.x^3 - 35.x^4
342
343degree = getUnifRand(0, 9_IK)
344degree
345+1
346coef = getUnifRand(-9, 9, degree)
347coef
348+7.00000000
349getPolyStr(coef)
3507.x^0
351order = getUnifRand(0, size(coef) + 1)
352order
353+1
354
355diff = getPolyDiff(coef, order)
356diff ! derivative coefficients.
357
358getPolyStr(diff)
359
360
361degree = getUnifRand(0, 9_IK)
362degree
363+3
364coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
365coef
366(+7.00000000, -9.00000000), (+9.00000000, +5.00000000), (-2.00000000, +9.00000000)
367getPolyStr(coef)
368(7.,-9.)x^0 + (9.,5.)x^1 + (-2.,9.)x^2
369order = getUnifRand(0, size(coef) + 1)
370order
371+4
372
373diff = getPolyDiff(coef, order)
374diff ! derivative coefficients.
375
376getPolyStr(diff)
377
378
379degree = getUnifRand(0, 9_IK)
380degree
381+5
382coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
383coef
384(+3.00000000, +7.00000000), (+7.00000000, +2.00000000), (-7.00000000, -3.00000000), (-9.00000000, -5.00000000), (+1.00000000, +0.00000000)
385getPolyStr(coef)
386(3.,7.)x^0 + (7.,2.)x^1 + (-7.,-3.)x^2 + (-9.,-5.)x^3 + (1.,0.)x^4
387order = getUnifRand(0, size(coef) + 1)
388order
389+1
390
391diff = getPolyDiff(coef, order)
392diff ! derivative coefficients.
393(+7.00000000, +2.00000000), (-14.0000000, -6.00000000), (-27.0000000, -15.0000000), (+4.00000000, +0.00000000)
394getPolyStr(diff)
395(7.,2.)x^0 + (-14.,-6.)x^1 + (-27.,-15.)x^2 + (4.,0.)x^3
396
397degree = getUnifRand(0, 9_IK)
398degree
399+9
400coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
401coef
402(+0.00000000, +4.00000000), (+8.00000000, -8.00000000), (+3.00000000, -2.00000000), (-3.00000000, -2.00000000), (+7.00000000, +7.00000000), (+7.00000000, -9.00000000), (+9.00000000, -7.00000000), (+2.00000000, -1.00000000), (+7.00000000, +9.00000000)
403getPolyStr(coef)
404(0.,4.)x^0 + (8.,-8.)x^1 + (3.,-2.)x^2 + (-3.,-2.)x^3 + (7.,7.)x^4 + (7.,-9.)x^5 + (9.,-7.)x^6 + (2.,-1.)x^7 + (7.,9.)x^8
405order = getUnifRand(0, size(coef) + 1)
406order
407+3
408
409diff = getPolyDiff(coef, order)
410diff ! derivative coefficients.
411(-9.00000000, -6.00000000), (+28.0000000, +28.0000000), (+35.0000000, -45.0000000), (+54.0000000, -42.0000000), (+14.0000000, -7.00000000), (+56.0000000, +72.0000000)
412getPolyStr(diff)
413(-9.,-6.)x^0 + (28.,28.)x^1 + (35.,-45.)x^2 + (54.,-42.)x^3 + (14.,-7.)x^4 + (56.,72.)x^5
414
415degree = getUnifRand(0, 9_IK)
416degree
417+4
418coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
419coef
420(+3.00000000, -1.00000000), (+0.00000000, +4.00000000), (-3.00000000, +2.00000000), (-9.00000000, +4.00000000)
421getPolyStr(coef)
422(3.,-1.)x^0 + (0.,4.)x^1 + (-3.,2.)x^2 + (-9.,4.)x^3
423order = getUnifRand(0, size(coef) + 1)
424order
425+3
426
427diff = getPolyDiff(coef, order)
428diff ! derivative coefficients.
429(-27.0000000, +12.0000000)
430getPolyStr(diff)
431(-27.,12.)x^0
432
433degree = getUnifRand(0, 9_IK)
434degree
435+7
436coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
437coef
438(+6.00000000, +7.00000000), (+6.00000000, +6.00000000), (-2.00000000, -5.00000000), (-2.00000000, +1.00000000), (-4.00000000, -5.00000000), (+1.00000000, +4.00000000), (-3.00000000, -6.00000000)
439getPolyStr(coef)
440(6.,7.)x^0 + (6.,6.)x^1 + (-2.,-5.)x^2 + (-2.,1.)x^3 + (-4.,-5.)x^4 + (1.,4.)x^5 + (-3.,-6.)x^6
441order = getUnifRand(0, size(coef) + 1)
442order
443+7
444
445diff = getPolyDiff(coef, order)
446diff ! derivative coefficients.
447
448getPolyStr(diff)
449
450
451degree = getUnifRand(0, 9_IK)
452degree
453+9
454coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
455coef
456(+6.00000000, +5.00000000), (-2.00000000, +5.00000000), (+4.00000000, -7.00000000), (+7.00000000, +8.00000000), (+0.00000000, -8.00000000), (+6.00000000, -2.00000000), (-3.00000000, -9.00000000), (-9.00000000, -4.00000000), (-4.00000000, -3.00000000)
457getPolyStr(coef)
458(6.,5.)x^0 + (-2.,5.)x^1 + (4.,-7.)x^2 + (7.,8.)x^3 + (0.,-8.)x^4 + (6.,-2.)x^5 + (-3.,-9.)x^6 + (-9.,-4.)x^7 + (-4.,-3.)x^8
459order = getUnifRand(0, size(coef) + 1)
460order
461+1
462
463diff = getPolyDiff(coef, order)
464diff ! derivative coefficients.
465(-2.00000000, +5.00000000), (+8.00000000, -14.0000000), (+21.0000000, +24.0000000), (+0.00000000, -32.0000000), (+30.0000000, -10.0000000), (-18.0000000, -54.0000000), (-63.0000000, -28.0000000), (-32.0000000, -24.0000000)
466getPolyStr(diff)
467(-2.,5.)x^0 + (8.,-14.)x^1 + (21.,24.)x^2 + (0.,-32.)x^3 + (30.,-10.)x^4 + (-18.,-54.)x^5 + (-63.,-28.)x^6 + (-32.,-24.)x^7
468
469degree = getUnifRand(0, 9_IK)
470degree
471+9
472coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
473coef
474(+3.00000000, -8.00000000), (-2.00000000, +1.00000000), (-5.00000000, +5.00000000), (+1.00000000, -1.00000000), (+2.00000000, -9.00000000), (+6.00000000, +0.00000000), (-2.00000000, -3.00000000), (+6.00000000, -7.00000000), (+6.00000000, +5.00000000)
475getPolyStr(coef)
476(3.,-8.)x^0 + (-2.,1.)x^1 + (-5.,5.)x^2 + (1.,-1.)x^3 + (2.,-9.)x^4 + (6.,0.)x^5 + (-2.,-3.)x^6 + (6.,-7.)x^7 + (6.,5.)x^8
477order = getUnifRand(0, size(coef) + 1)
478order
479+2
480
481diff = getPolyDiff(coef, order)
482diff ! derivative coefficients.
483(-10.0000000, +10.0000000), (+3.00000000, -3.00000000), (+8.00000000, -36.0000000), (+30.0000000, +0.00000000), (-12.0000000, -18.0000000), (+42.0000000, -49.0000000), (+48.0000000, +40.0000000)
484getPolyStr(diff)
485(-10.,10.)x^0 + (3.,-3.)x^1 + (8.,-36.)x^2 + (30.,0.)x^3 + (-12.,-18.)x^4 + (42.,-49.)x^5 + (48.,40.)x^6
486
487degree = getUnifRand(0, 9_IK)
488degree
489+5
490coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
491coef
492(+3.00000000, +1.00000000), (-7.00000000, +4.00000000), (-1.00000000, +2.00000000), (+3.00000000, -1.00000000), (+2.00000000, +8.00000000)
493getPolyStr(coef)
494(3.,1.)x^0 + (-7.,4.)x^1 + (-1.,2.)x^2 + (3.,-1.)x^3 + (2.,8.)x^4
495order = getUnifRand(0, size(coef) + 1)
496order
497+2
498
499diff = getPolyDiff(coef, order)
500diff ! derivative coefficients.
501(-2.00000000, +4.00000000), (+9.00000000, -3.00000000), (+8.00000000, +32.0000000)
502getPolyStr(diff)
503(-2.,4.)x^0 + (9.,-3.)x^1 + (8.,32.)x^2
504
505degree = getUnifRand(0, 9_IK)
506degree
507+5
508coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
509coef
510(+7.00000000, +4.00000000), (+2.00000000, -8.00000000), (+0.00000000, +5.00000000), (+6.00000000, +2.00000000), (-4.00000000, -6.00000000)
511getPolyStr(coef)
512(7.,4.)x^0 + (2.,-8.)x^1 + (0.,5.)x^2 + (6.,2.)x^3 + (-4.,-6.)x^4
513order = getUnifRand(0, size(coef) + 1)
514order
515+1
516
517diff = getPolyDiff(coef, order)
518diff ! derivative coefficients.
519(+2.00000000, -8.00000000), (+0.00000000, +10.0000000), (+18.0000000, +6.00000000), (-16.0000000, -24.0000000)
520getPolyStr(diff)
521(2.,-8.)x^0 + (0.,10.)x^1 + (18.,6.)x^2 + (-16.,-24.)x^3
522
523degree = getUnifRand(0, 9_IK)
524degree
525+4
526coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
527coef
528(-6.00000000, +8.00000000), (-9.00000000, +5.00000000), (+6.00000000, +4.00000000), (+5.00000000, -1.00000000)
529getPolyStr(coef)
530(-6.,8.)x^0 + (-9.,5.)x^1 + (6.,4.)x^2 + (5.,-1.)x^3
531order = getUnifRand(0, size(coef) + 1)
532order
533+2
534
535diff = getPolyDiff(coef, order)
536diff ! derivative coefficients.
537(+12.0000000, +8.00000000), (+15.0000000, -3.00000000)
538getPolyStr(diff)
539(12.,8.)x^0 + (15.,-3.)x^1
540
541degree = getUnifRand(0, 9_IK)
542degree
543+2
544coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
545coef
546(-3.00000000, +1.00000000), (+5.00000000, +8.00000000)
547getPolyStr(coef)
548(-3.,1.)x^0 + (5.,8.)x^1
549order = getUnifRand(0, size(coef) + 1)
550order
551+0
552
553diff = getPolyDiff(coef, order)
554diff ! derivative coefficients.
555(-3.00000000, +1.00000000), (+5.00000000, +8.00000000)
556getPolyStr(diff)
557(-3.,1.)x^0 + (5.,8.)x^1
558
559degree = getUnifRand(0, 9_IK)
560degree
561+8
562coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
563coef
564(+0.00000000, +8.00000000), (-4.00000000, -8.00000000), (+0.00000000, -8.00000000), (-3.00000000, +4.00000000), (-2.00000000, -2.00000000), (+1.00000000, +9.00000000), (-8.00000000, +5.00000000), (+5.00000000, +1.00000000)
565getPolyStr(coef)
566(0.,8.)x^0 + (-4.,-8.)x^1 + (0.,-8.)x^2 + (-3.,4.)x^3 + (-2.,-2.)x^4 + (1.,9.)x^5 + (-8.,5.)x^6 + (5.,1.)x^7
567order = getUnifRand(0, size(coef) + 1)
568order
569+0
570
571diff = getPolyDiff(coef, order)
572diff ! derivative coefficients.
573(+0.00000000, +8.00000000), (-4.00000000, -8.00000000), (+0.00000000, -8.00000000), (-3.00000000, +4.00000000), (-2.00000000, -2.00000000), (+1.00000000, +9.00000000), (-8.00000000, +5.00000000), (+5.00000000, +1.00000000)
574getPolyStr(diff)
575(0.,8.)x^0 + (-4.,-8.)x^1 + (0.,-8.)x^2 + (-3.,4.)x^3 + (-2.,-2.)x^4 + (1.,9.)x^5 + (-8.,5.)x^6 + (5.,1.)x^7
576
577degree = getUnifRand(0, 9_IK)
578degree
579+3
580coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
581coef
582(-8.00000000, +5.00000000), (-2.00000000, -7.00000000), (-4.00000000, +0.00000000)
583getPolyStr(coef)
584(-8.,5.)x^0 + (-2.,-7.)x^1 + (-4.,0.)x^2
585order = getUnifRand(0, size(coef) + 1)
586order
587+4
588
589diff = getPolyDiff(coef, order)
590diff ! derivative coefficients.
591
592getPolyStr(diff)
593
594
595degree = getUnifRand(0, 9_IK)
596degree
597+2
598coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
599coef
600(-9.00000000, -7.00000000), (+0.00000000, +6.00000000)
601getPolyStr(coef)
602(-9.,-7.)x^0 + (0.,6.)x^1
603order = getUnifRand(0, size(coef) + 1)
604order
605+0
606
607diff = getPolyDiff(coef, order)
608diff ! derivative coefficients.
609(-9.00000000, -7.00000000), (+0.00000000, +6.00000000)
610getPolyStr(diff)
611(-9.,-7.)x^0 + (0.,6.)x^1
612
613degree = getUnifRand(0, 9_IK)
614degree
615+0
616coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
617coef
618
619getPolyStr(coef)
620
621order = getUnifRand(0, size(coef) + 1)
622order
623+1
624
625diff = getPolyDiff(coef, order)
626diff ! derivative coefficients.
627
628getPolyStr(diff)
629
630
631degree = getUnifRand(0, 9_IK)
632degree
633+9
634coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
635coef
636(+9.00000000, +1.00000000), (+7.00000000, +3.00000000), (+1.00000000, -8.00000000), (+7.00000000, -1.00000000), (+6.00000000, -7.00000000), (+7.00000000, -6.00000000), (-5.00000000, -4.00000000), (-3.00000000, +5.00000000), (-1.00000000, +0.00000000)
637getPolyStr(coef)
638(9.,1.)x^0 + (7.,3.)x^1 + (1.,-8.)x^2 + (7.,-1.)x^3 + (6.,-7.)x^4 + (7.,-6.)x^5 + (-5.,-4.)x^6 + (-3.,5.)x^7 + (-1.,0.)x^8
639order = getUnifRand(0, size(coef) + 1)
640order
641+3
642
643diff = getPolyDiff(coef, order)
644diff ! derivative coefficients.
645(+21.0000000, -3.00000000), (+24.0000000, -28.0000000), (+35.0000000, -30.0000000), (-30.0000000, -24.0000000), (-21.0000000, +35.0000000), (-8.00000000, +0.00000000)
646getPolyStr(diff)
647(21.,-3.)x^0 + (24.,-28.)x^1 + (35.,-30.)x^2 + (-30.,-24.)x^3 + (-21.,35.)x^4 + (-8.,0.)x^5
648
649degree = getUnifRand(0, 9_IK)
650degree
651+4
652coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
653coef
654(+1.00000000, -2.00000000), (-8.00000000, +5.00000000), (-3.00000000, +1.00000000), (-7.00000000, -3.00000000)
655getPolyStr(coef)
656(1.,-2.)x^0 + (-8.,5.)x^1 + (-3.,1.)x^2 + (-7.,-3.)x^3
657order = getUnifRand(0, size(coef) + 1)
658order
659+0
660
661diff = getPolyDiff(coef, order)
662diff ! derivative coefficients.
663(+1.00000000, -2.00000000), (-8.00000000, +5.00000000), (-3.00000000, +1.00000000), (-7.00000000, -3.00000000)
664getPolyStr(diff)
665(1.,-2.)x^0 + (-8.,5.)x^1 + (-3.,1.)x^2 + (-7.,-3.)x^3
666
667degree = getUnifRand(0, 9_IK)
668degree
669+4
670coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
671coef
672(+6.00000000, +5.00000000), (+6.00000000, -8.00000000), (-2.00000000, -1.00000000), (-8.00000000, -7.00000000)
673getPolyStr(coef)
674(6.,5.)x^0 + (6.,-8.)x^1 + (-2.,-1.)x^2 + (-8.,-7.)x^3
675order = getUnifRand(0, size(coef) + 1)
676order
677+5
678
679diff = getPolyDiff(coef, order)
680diff ! derivative coefficients.
681
682getPolyStr(diff)
683
684
685degree = getUnifRand(0, 9_IK)
686degree
687+6
688coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
689coef
690(-6.00000000, +1.00000000), (+7.00000000, -2.00000000), (+4.00000000, +9.00000000), (-8.00000000, -6.00000000), (+4.00000000, -4.00000000), (+5.00000000, -9.00000000)
691getPolyStr(coef)
692(-6.,1.)x^0 + (7.,-2.)x^1 + (4.,9.)x^2 + (-8.,-6.)x^3 + (4.,-4.)x^4 + (5.,-9.)x^5
693order = getUnifRand(0, size(coef) + 1)
694order
695+6
696
697diff = getPolyDiff(coef, order)
698diff ! derivative coefficients.
699
700getPolyStr(diff)
701
702
703degree = getUnifRand(0, 9_IK)
704degree
705+3
706coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)
707coef
708(+9.00000000, -5.00000000), (-5.00000000, -2.00000000), (+3.00000000, +5.00000000)
709getPolyStr(coef)
710(9.,-5.)x^0 + (-5.,-2.)x^1 + (3.,5.)x^2
711order = getUnifRand(0, size(coef) + 1)
712order
713+1
714
715diff = getPolyDiff(coef, order)
716diff ! derivative coefficients.
717(-5.00000000, -2.00000000), (+6.00000000, +10.0000000)
718getPolyStr(diff)
719(-5.,-2.)x^0 + (6.,10.)x^1
720
721
Test:
test_pm_polynomial


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Fatemeh Bagheri, Tuesday 11:34 PM, August 10, 2021, Dallas, TX

Definition at line 2415 of file pm_polynomial.F90.


The documentation for this interface was generated from the following file: