Tak or TAK may refer to:
Invader Zim is an American animated television series created by Jhonen Vasquez and originally aired on Nickelodeon. The recurring cast includes long-term Nickelodeon voice actors Richard Steven Horvitz and Rodger Bumpass, with live-action television actors Kevin McDonald (The Kids in the Hall) and John de Lancie (Star Trek: The Next Generation). Vasquez voices parts in the show. The show was cancelled early in its run and some episodes were unfinished. The show ran for two seasons before its cancellation.
Zim (voiced by Richard Steven Horvitz,Billy West in the pilot and Melissa Fahn as a smeet in "Parent Teacher Night") is an incompetent Irken invader who is foul-tempered, overzealous, impulsive, megalomaniac, and convinced of his own greatness. He dreams of regaining his leaders' trust by taking part in Operation Impending Doom II, so Zim is assigned to Earth, a planet which the Almighty Tallest believe has little to no chance of existing. However, against all odds, Zim makes it to Earth and establishes a base on a fake conquest mission. Because of his very small stature, Zim disguises himself as a human child using a hairpiece to cover his antennae and contact lenses to make his eyes look normal.
In computer science, the Tak function is a recursive function, named after Ikuo Takeuchi (竹内郁雄). It is defined as follows:
This function is often used as a benchmark for languages with optimization for recursion.
The original definition by Takeuchi was as follows:
tarai is short for tarai mawashi, "to pass around" in Japanese.
John McCarthy named this function tak() after Takeuchi.
However, in certain later references, the y somehow got turned into the z. This is a small, but significant difference because the original version benefits significantly by lazy evaluation. Though written in exactly the same manner as others, the Haskell code below runs much faster.
You can easily accelerate this function via memoization yet lazy evaluation still wins.
The best known way to optimize tarai is to use mutually recursive helper function as follows.
Here is an efficient implementation of tarai() in C:
Note the additional check for (x <= y) before z (the third argument) is evaluated, avoiding unnecessary recursive evaluation.
Everything I do Is all done for you
Lady I'm yours
And everywhere I go
You're always on my mind
You're all I adore
And I'll go
Outta my way
Just to assure
That our love endures I'm yours
Girl I'm never far away I'll be right there (right there)
To keep you nice and warm I'm rushing right home
Girl I'm never far away I'll be right there (right there)
To protect you from the storm I'm rushing right home
Girl I'll be there I'll be right there
I don't need you say
That I love you
A million times a day
Just the little things I do
All done for you
That's how I display
Love
And I'll go
Out of my way
Just to assure you baby
That our love endures I'm yours
Girl I'm never far away I'll be right there (right there)
To keep you nice and warm
(Girl I'll keep you nice and warm,
You know I'll keep you nice and warm
You know I'll keep you nice and warm)
Girl I'm never far away I'll be right there (I'll be right there)
To protect you from the storm I'm rushing right home
Girl I'll be there I'll be right there
You don't have to go and check my pager
Check my phone and search my pants to figure me out (ha)
Cause I'm an honest man
Don't need a plan, a stronger man
Cause girl there is no doubt
My love's real (as real as it comes)
Even though we are a million miles away from each other
I'm still right here, right here for you
(Here for you, here for you) I could search a million years
And still I wouldn't find anyone as beautiful as you
So rest assured our love endures I'm never far away...
(I'm rushing home baby, I'm coming home baby) I'm never far away...
(I'm rushing home baby, home baby, home baby) I'm never far away...
(I'm rushing home baby, I'm coming home baby) I'm never far away...
(I'm rushing home baby, home baby, home baby) I'm never far away...
(I'm rushing home baby, I'm coming home baby) I'm never far away...
(I'm rushing home baby, home baby, home baby) I'm never, never, never, never far Never, never, never, never far
Never far, never far I'm never far away I'm never far away...
(I'm rushing home baby, I'm coming home baby) I'm never far away...
(I'm rushing home baby, home baby, home baby) I'm never far away...
(I'm rushing home baby, I'm coming home baby) I'm never far away...
(I'm rushing home baby, home baby, home baby) I'm never far away...
(I'm rushing home baby, I'm coming home baby) I'm never far away...
(I'm rushing home baby, home baby, home baby) I'm never, never, never, never far Never, never, never, never far