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


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