[Question]
  [
# The challenge
Quite simple, given an input `x`, calculate it's infinite power tower!
```
x^x^x^x^x^x...
```
*For you math-lovers out there, this is `x`'s infinite [tetration](https://en.wikipedia.org/wiki/Tetration).*
Keep in mind the following:
```
x^x^x^x^x^x... = x^(x^(x^(x^(x...)))) != (((((x)^x)^x)^x)^x...)
```
Surprised we haven't had a "simple" math challenge involving this!\*
# Assumptions
* `x` will **always** converge.
* **Negative and complex** numbers should be able to be handled
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so **lowest bytes** wins!
* Your answers should be correct to at least **5** decimal places
# Examples
```
Input >> Output
1.4 >> 1.8866633062463325
1.414 >> 1.9980364085457847
[Square root of 2] >> 2
-1 >> -1
i >> 0.4382829367270323 + 0.3605924718713857i
1 >> 1
0.5 >> 0.641185744504986
0.333... >> 0.5478086216540975
1 + i >> 0.6410264788204891 + 0.5236284612571633i
-i >> 0.4382829367270323 -0.3605924718713857i
[4th root of 2] >> 1.239627729522762
```
---
*\*(Other than a more complicated challenge [here](https://codegolf.stackexchange.com/questions/124391/evaluate-modular-power-towers))*
  
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 4 bytes
```
*⍣≡⍨
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R2wStR72LH3UufNS7AshXMNQzAWFDEwUNI63D2400FQ6tN1Qw8DJUAJJ6pgoah7cbayoYeoHEQDJgVSaaAA "APL (Dyalog Unicode) – Try It Online")
`*` power
`⍣` until
`≡` stable
`⍨` selfie
[Answer]
# Pyth, ~~4~~ 3 bytes
[crossed out 4 is still regular 4 ;(](https://codegolf.stackexchange.com/a/133541/39242)
```
u^Q
```
[Try it online](https://pyth.herokuapp.com/?code=u%5EQG&input=1.414&test_suite=1&test_suite_input=1.4%0A1.414%0A1.4142135623730951%0A-1%0A1j%0A1%0A0.5%0A0.3333333333333333%0A1%2B1j%0A-1j%0A1.189207115002721)
### How it works
```
u       first repeated value under repeated application of G ↦
 ^QG        input ** G
    Q   starting at input
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~100~~ 63 bytes
For inputs that don't converge (eg. `-2`) this won't terminate:
```
import Data.Complex
f x=until(\a->magnitude(a-x**a)<1e-6)(x**)x
```
Thanks a lot @ØrjanJohansen for teaching me about `until` and saving me `37` bytes!
[Try it online!](https://tio.run/##LY3NDsIgEITvPsUePEAtKP4djPWiV59AjdlEqkSg2NKEt8fVcJlvMpPJvHB4a2tzNi50fYQTRpTHzgWr06SF1Iw@GsuuKA4On97E8aEZilRVyPdKiy1n5HnKDo2HBhyG8x1Y6I2PsuVwUXJdA4kiDB96WNYgVA0L2M2A@LNyQ5yvSEr4L5lQvGymZXrLXw "Haskell – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), ~~40 39~~ 35 bytes
* Thanks @Ørjan Johansen for a byte: `d>99` instead of `d==99`: 1 more iteration for a lesser byte-count
* Thanks @Uriel for 4 bytes: wise utilization of the fact that `x**True` evaluates to x in `x**(d>99or g(x,d+1))`. The expression in the term evaluates to True for depth greater than 99 and thus returns the passed value.
Recursive lambda with a max-depth 100 i.e. for a depth 100 returns the same value. Actually is convergency-agnostic, so expect the unexpected for numbers with non-converging values for the function. 
```
g=lambda x,d=0:x**(d>99or g(x,d+1))
```
[Try it online!](https://tio.run/##K6gsycjPM/7/P902JzE3KSVRoUInxdbAqkJLSyPFztIyv0ghXQMopG2oqfm/oCgzr0QjXcNQzwTIAwA "Python 3 – Try It Online")
[Answer]
# Python 3, ~~37~~ ~~30~~ 27 bytes
-7 bytes from @FelipeNardiBatista.  
-3 bytes from from @xnor
I don't remember much of Python anymore, but I managed to port my Ruby answer and beat the other Python 3 answer :D
```
lambda x:eval('x**'*99+'1')
```
[Try it online!](https://tio.run/##K6gsycjPM/6fbhvzPycxNyklUaHCKrUsMUdDvUJLS13L0lJb3VBd839BUWZeiUa6hqGeiaYmF4yna4jEMczS1PwPAA "Python 3 – Try It Online")
[Answer]
# Mathematica, 12 bytes
```
#//.x_:>#^x&
```
Takes a floating‐point number as input.
[Answer]
# [J](http://jsoftware.com/), 5 bytes
```
^^:_~
```
[Try it online!](https://tio.run/##y/r/P03B1kohLs4qvo6LKzU5I19BQ0cvTclAU8FQzwSEDU0UdBQ0VK0UjDSBjHhDBYMsQwUgqWcKFlcwBgkbZoHEgZJAIRMFsOL//wE "J – Try It Online")
## Explanation
First, I'll show what command is being executed after parsing the `~` at the end, and the walk-through will be for the new verb.
```
(^^:_~) x = ((x&^)^:_) x
((x&^)^:_) x  |  Input: x
      ^:_     |  Execute starting with y = x until the result converges
  x&^         |    Compute y = x^y
```
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 79 78 bytes
```
x=>{var a=x;for(int i=0;i++<999;)a=System.Numerics.Complex.Pow(x,a);return a;}
```
[Try it online!](https://tio.run/##rVFNTwIxEL3zK3rcDbj0a9tuluVC4kkMiQcPxkOzFmzCttoWWEP47euyEjFRBBPfoZ3MdN7rmyn9VWmdakCLcim9BzNnF05WvX1m2517@CCDLsHa6icwldpEPjhtFg@PQLqFjz/fHTv2uHvzQVXJ9cqUo0N8u6qU06VPJrZ6Wap6AE4UxmAOih5o6mK8XUsHZFHnc@sibQLQBcx1vz/KsiyPZXGCIZnZTVQPZJw7FVbOAJnvmrz30w8n1ni7VMm900HdaKOieYQSGsc5@BXDIUCJEIwxQiDDtL1w@gcBdE6iE8gyAQmjUKQ05YLySwUOpakMz8ndqwsRjr/JtQL4Uj6jNqe2FcEB6shbPphQIrDAGWEcc0gwAf02SRhMM0w5EhwRkXJ98ZzOruFjTv9hA321wSiCmFEuBIZUZKizkWLCsKAM4ZSjdt9HG7su2jXv "C# (.NET Core) – Try It Online")
I chose to iterate until `i`=999 because if I iterated until 99 some examples did not reach the required precision. Example:
```
Input:                      (0, 1)
Expected output:            (0.4382829367270323, 0.3605924718713857)
Output after 99 iterations: (0.438288569331222,  0.360588154553794)
Output after 999 iter.:     (0.438282936727032,  0.360592471871385)
```
As you can see, after 99 iterations the imaginary part failed in the 5th decimal place.
```
Input:                      (1, 1)
Expected output:            (0.6410264788204891, 0.5236284612571633)
Output after 99 iterations: (0.64102647882049,   0.523628461257164)
Output after 999 iter.:     (0.641026478820489,  0.523628461257163)
```
In this case after 99 iterations we get the expected precision. In fact, I could iterate until `i`=1e9 with the same byte count, but that would make the code considerably slower
* 1 byte saved thanks to an anonymous user.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes
```
³*$ÐL
```
[Try it online!](https://tio.run/##y0rNyan8///QZi2VwxN8/v//b6htmAUA "Jelly – Try It Online")
[Answer]
# Ruby, ~~21~~ 20 bytes
```
->n{eval'n**'*99+?1}
```
~~**Disclaimer**: It [seems](https://en.wikibooks.org/wiki/Mathematics_with_Python_and_Ruby/Complex_numbers_in_Ruby#Exponentiation) that Ruby returns some weird values when raising a complex number to a power. I assume it's out of scope for this challenge to fix Ruby's entire math module, but otherwise the results of this function should be correct.~~ **Edit**: Applied the latest changes from my [Python 3 answer](https://codegolf.stackexchange.com/a/135656/4372) and suddenly it somehow gives the same, expected results :)
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6vOrUsMUc9T0tLXcvSUtvesPZ/gUJatKGeSSwXlGEIZfomlmToFRcWlWgYaUJEdA2hiiCUc35uQU5qhYaBjqFm7H8A "Ruby – Try It Online")
[Answer]
# TI-BASIC, 16 bytes
The input and output are stored in `Ans`.
```
Ans→X
While Ans≠X^Ans
X^Ans
End
```
[Answer]
# [R](https://www.r-project.org/), ~~36~~ 33 bytes
-*3 bytes thanks to Jarko Dubbeldam*
```
Reduce(`^`,rep(scan(,1i),999),,T)
```
Reads from stdin. `Reduce`s from the right to get the exponents applied in the correct order.
[Try it (function)](https://tio.run/##K/qfX1CSmZ9XrKGekpmeWVKsbmtoqsmVZvs/rTQvGSSjUaEZlJpSmpyqkRCXoFOUWqBRoWNpaampoxOi@T9No7iwqETDSFPzPwA)
[Try it (stdin)](https://tio.run/##K/qfX1CSmZ9XrKGekpmeWVKsbmtoqvk/KDWlNDlVIyEuQacotUCjODkxT0PHMFNTx9LSUlNHJ0Tzv6G2YeZ/AA "R – Try It Online")
[Answer]
# Javascript, 33 bytes
```
f=(x,y=x)=>(x**y===y)?y:f(x,x**y)
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~20~~ 10 bytes
cut down to half thanks to @LuisMendo
```
t^`Gw^t5M-
```
[Try it online!](https://tio.run/##y00syfn/vyQuwb08rsTUV/f/f0M9EwA "MATL – Try It Online")
This is my first [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") and my first time using MATL so i'm sure it could be easily outgolfed.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `r`, 4 bytes
```
‡?eẊ
```
[Try it Online!](https://lyxal.pythonanywhere.com?flags=r&code=%E2%80%A1%3Fe%E1%BA%8A&inputs=1.4&header=&footer=)
[Answer]
# [PowerShell Core](https://github.com/PowerShell/PowerShell), ~~165~~ 140 bytes
```
param($a)$u=1;for($r=$a;$u-join'+'|iex){$r=[Numerics.Complex]::Pow($a,($p=$r))
$u=($p.Real,($p|% I*),-$r.Real,-($r|% I*))|% *g '.0000000'}$r
```
[Try it online!](https://tio.run/##nVRbb9owFH7nV/jBW@IuyXyL7RQhISFN6sO2qvQNoSlLzaUihDqJaAX8dmaTwvaAtKR58fF3Lt@5xZtiq0250KtVmBVGH@FssDtuUpPmPkwRrAekPyuMD80Apn1Yh8/Fcu198fZL/Yp2Fp38qHNtllkZjYp8s9Kv09vb@2JrnQMfbgbQINSzUawcPeh05cD9J3B3g4IQmgYKbfQGQ/a4mQMvws3nHaA5Hnq9od8DIABDfzJ@KyudR1dI13rrk4gHAKMA/NdOKSEEY1hQbg8aOzfUmoS0pUkShZngWMU8lorLDjST72m1sPL4xVQ@Ra0IaYf4IWkV0pmFOGrfnXad6ZAojuJWMXEkOCEqlpzHmCdKfKDZbnNtEwn4CjhqOWPKEkGlpElMqRRdRmCdsWViEUYtK4y5VFgJSkTMcSI7ra0tq2UTMRWWR1HMVeImFcWUCaq4IDSWxP4vrUdnd6cVKWeKKpowIanEjLLTzjGB44RySZQkzM61A@sHSa9yIrAH3@zTmGaL8OfvZ51VYGcTgZUuq1Fa6gBA/bqxsH4CAwB/OZ3RZb2q7PUznP21dJragv67vnn@ztbRXZ7Ol@vUvP0T8WxyuV@MrqVl2aPHYlyZ5Xrue7h5Rj0EDpZ5cj8e1WVV5I3xdOiKAGBcZ5kuS@BSryd4CkL94iRqpXT95ERyAdm0f3J6fC/IOZ2LazQPTeGncE1ZDj/0Dr3j8Q8 "PowerShell Core – Try It Online")
*-7 bytes* thanks to [mazzy](https://codegolf.stackexchange.com/users/80745/mazzy)!
[55 bytes without complex numbers](https://tio.run/##VZBfa8IwFMWf208RXBgNtDVJ869KQRjb25jMvYmMrovIUFrTigPnZ@9uVyvuKbn3nPu7h1uVR@vqjd1uo6J0tsXr7NRWuct3Ac7JunQBdhnOp9hFuCInKJbPebNZTSbz8giWMMBVhh0hZ@zas@/PAt8LZwGLRYhYbIxSKkmo4gIeLskgsj85TQ1NlKBGCqmN0L08LFjsXRNwEqIRH/VKxEIUsQsEAP2PxjJENFaCMSO1EJKK1Kj/rC4sh4mxIN1inqSKa81TyblWHLx3YIZgdJzElHQ4KbShRnGmpKCphugE/aAnuFFebKKXjy9bNOjke7ixdfOQ1zZE2H5X0LWfKEP4HSRn68O2geoer9HV6HvL@eLhUDflrsesZsDxFoeisHXdzV45kd2jC2UKlrcLofMMtK7/Ouy58T7eZBl40D/757b9BQ)
[Answer]
# [Perl 6](http://perl6.org/), 17 bytes
```
{[R**] $_ xx 999}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/OjpISytWQSVeoaJCwdLSsva/tUJxYqWCElDE1k6hOg0oVaukkJZfpGCoZ6KjkKmjYKBnCiKMQUBHwVA70/o/AA "Perl 6 – Try It Online")
`R**` is the reverse-exponentiation operator; `x R** y` is equal to `y ** x`. `[R**]` reduces a list of 999 copies of the input argument with reverse exponentiation.
]