Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -0,0 +1,25 @@
|
|||
%begin
|
||||
%external %real %fn %spec sqrt %alias "sqrtf" (%real n) {should be in prims. Using Linux/C's external here.}
|
||||
|
||||
%routine TPK(%real %array %name a, b)
|
||||
! given 11 input values a(0),...,a(10), this routine
|
||||
! produces 22 output values b(0),...b(21), according
|
||||
! to the classical TPK algorithm
|
||||
%real %fn f(%real t)
|
||||
%result = sqrt(|t|) + 5 * t^3
|
||||
%end
|
||||
%real y
|
||||
%integer i
|
||||
%cycle i = 10, -1, 0
|
||||
y = f(a(i))
|
||||
y = 999 %if y > 400
|
||||
b(20-2*i) = i
|
||||
b(21-2*i) = y
|
||||
%repeat
|
||||
%end; ! TPK
|
||||
|
||||
%real %array a(0:10), b(0:21)
|
||||
|
||||
TPK(a,b)
|
||||
|
||||
%endofprogram
|
||||
Loading…
Add table
Add a link
Reference in a new issue