C# (.NET Core),(削除) 79 (削除ここまで) 78 bytes
x=>{var a=x;for(int i=0;i++<999;)a=System.Numerics.Complex.Pow(x,a);return a;}
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.
C# (.NET Core), 78 bytes
x=>{var a=x;for(int i=0;i++<999;)a=System.Numerics.Complex.Pow(x,a);return a;}
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
C# (.NET Core),(削除) 79 (削除ここまで) 78 bytes
x=>{var a=x;for(int i=0;i++<999;)a=System.Numerics.Complex.Pow(x,a);return a;}
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.
C# (.NET Core), 7978 bytes
x=>{var a=x;int i=0;whilea=x;for(i++<999int i=0;i++<999;)a=System.Numerics.Complex.Pow(x,a);return a;}
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
C# (.NET Core), 79 bytes
x=>{var a=x;int i=0;while(i++<999)a=System.Numerics.Complex.Pow(x,a);return a;}
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
C# (.NET Core), 78 bytes
x=>{var a=x;for(int i=0;i++<999;)a=System.Numerics.Complex.Pow(x,a);return a;}
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
C# (.NET Core), 79 bytes
x=>{var a=x;int i=0;while(i++<999)a=System.Numerics.Complex.Pow(x,a);return a;}
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