A Generated Fortran Program for an 8 x 8 DCT

Go back to Automatic Implementation of an 8 x 8 DCT.
! +-----------------------------------------------+
! | Generated by SPL Compiler 3.20 |
! +-----------------------------------------------+
! Command-line options: -R
!
C This file is generated from GAP by the
C function ExportSPL
! The SPL Program: (compose (permutation (2 6 7 3 4 8 5 1))(compose (tensor (..)(..))(compose (..)(..))))
! node size: 8 X 8

subroutine sub(y,x)

implicit double precision(f)
implicit integer(r)
double precision y(8),x(8)

f0 = 0.3535533905932738d0 * x(1)
f1 = 0.3535533905932738d0 * x(5)
f2 = x(3) + x(7)
f3 = 1.3065629648763766d0 * x(3)
f4 = (-0.9238795325112866d0) * f2
f5 = (-0.5411961001461967d0) * x(7)
f6 = f3 + f4
f7 = f5 - f4
f8 = 0.5000000000000000d0 * f6
f9 = 0.5000000000000000d0 * f7
f10 = x(2) + x(8)
f11 = (-0.7856949583871020d0) * x(2)
f12 = (-0.1950903220161284d0) * f10
f13 = (-1.1758756024193588d0) * x(8)
f14 = f11 + f12
f15 = f13 - f12
f16 = 0.5000000000000000d0 * f14
f17 = 0.5000000000000000d0 * f15
f18 = x(4) + x(6)
f19 = (-1.3870398453221475d0) * x(4)
f20 = 0.8314696123025455d0 * f18
f21 = 0.2758993792829435d0 * x(6)
f22 = f19 + f20
f23 = f21 - f20
f24 = 0.5000000000000000d0 * f22
f25 = 0.5000000000000000d0 * f23
f26 = f0 + f1
f27 = f0 - f1
f28 = f25 + f16
f29 = f25 - f16
f30 = f24 + f17
f31 = f24 - f17
f32 = f31 + f29
f33 = f31 - f29
f34 = 0.7071067811865476d0 * f32
f35 = 0.7071067811865476d0 * f33
f36 = f26 + f9
f37 = f26 - f9
y(8) = f36 + f28
y(1) = f36 - f28
y(4) = f37 + f30
y(5) = f37 - f30
f42 = f27 + f8
f43 = f27 - f8
y(7) = f42 + f35
y(2) = f42 - f35
y(3) = f43 + f34
y(6) = f43 - f34

end