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