FANDOM


Alpha Function

The Alpha Function has been defined using program code shown below.

This blog has been replaced by Program Code Version 4 which greatly simplifies and corrects this code.

Program Code Version 3

This VBA visual basic code replaces Version 2 and will run as a macro in Microsoft Excel. This function creates a string literal of a \(J_8\) Function equal to the Alpha function with any Real number input. The program does not attempt to evaluate the function and the run time is therefore very fast.

Option Explicit
Dim aReal As Double, aMax As Integer, gCount As Integer, vCount As Integer, aAudit As String
Const gSize = 100, vSize = 10
Dim gArray(0 To gSize, 0 To 7) As Integer
Dim vArray(1 To vSize, 0 To 9) As Integer

Function Alpha(r As Double, b As Boolean) As String
Dim i As Integer, j As Integer, k As Integer, s As String

aMax = 0
gCount = 0
vCount = 1

aReal = Log(r) / Log(10)
i = Int(aReal)

aReal = aReal - i
aAudit = i
aMax = i - 1

j = gInit(0, 0)
gArray(j, 0) = i
If i > 1 Then gArray(j, 1) = vLambda(i, j, 0, False)

If i > 0 Then
    gArray(j, 2) = vM(vGet(6) + 1)
    aSetG j, 0
    k = -1
Else
    k = vGet(6)
    gArray(j, 5) = k
    End If

j = aMax
If k = 0 Then i = vM(vGetIJ(0, 3)) Else i = vGet(6) + 2
If b Then
    Alpha = "f_{" & rVeblen(0) & "}^{" & i & "}("
Else
    Alpha = "J_8(" & vRead(0) & "," & i & ","
    End If

s = ""
If k = 0 Then
    j = vGetIJ(i, i + 1)
    If b Then s = " = " & (j + i)
Else
    If k = 1 And i < 3 Then
        j = vGetIJ(i, i * 2 + 1)
        If b Then s = " = " & (j * 2 ^ i)
    Else
        If j + 1 > i Then j = vGet(6) + j + 1 Else j = vGet(6) + i
        End If
    End If
    
Alpha = "\(" & Alpha & j & ")" & s & "\)"
On Error Resume Next
Alpha = Alpha & " == <" & aAudit & ">"
On Error GoTo 0
End Function

Function aGamma(agG As Integer, agC As Integer, agQ As Integer, agMin As Integer, agShadow As Integer) As Integer
Dim q As Integer, i As Integer, b As Boolean, m As Integer

aGamma = gInit(agG, agC)

If agQ = -1 Then q = aSetQ(agG, agC) Else q = agQ
b = (q = gArray(IIf(agShadow = 0, agG, -agShadow), 0))
gArray(aGamma, 0) = q

m = gArray(IIf(agShadow = 0, agG, -agShadow), 2)
If q > 1 Then gArray(aGamma, 1) = vLambda(q, aGamma, gArray(agG, 1), (m = 1))

If q > 0 Then
    Select Case agC
    Case Is < 0
        If agShadow = 0 Then
            gArray(aGamma, 2) = vM(vGet(6) + 1)
        Else
            If m < 2 Then gArray(aGamma, 2) = 1 Else gArray(aGamma, 2) = vM(vGetIJ(1, m))
            End If
        b = False
    Case 3
        If b Then gArray(aGamma, 2) = 1 Else gArray(aGamma, 2) = vM(vGet(6) + 1)
        b = False
    Case 4
        If b Then i = m - 1
        If Not b Then i = vM(vGet(6) + 1) Else If i > 1 Then i = vM(vGetIJ(1, i))
        gArray(aGamma, 2) = i
        b = False
    Case 5
        If b Then If gEqual(agG, 3, 1) Then i = m - 1 Else i = m
        If Not b Then i = vM(vGet(6) + 1) Else If i > 1 Then i = vM(vGetIJ(1, i))
        gArray(aGamma, 2) = i
        b = (i = gArray(agG, 2))
        End Select
    
    aSetG aGamma, IIf(b, gArray(agG, 3), 0)
Else
    If agShadow < 0 And b Then
        i = gArray(-agShadow, 5)
        If i < agMin + 2 Then
            gArray(aGamma, 5) = agMin
            b = (agMin = i)
        Else
            gArray(aGamma, 5) = vM(vGetIJ(agMin, i - 1))
            b = False
            End If
    Else
        gArray(aGamma, 5) = vM(vGet(6) + agMin)
        End If
    End If
End Function

Sub aSetG(asG As Integer, asShadow As Integer)
Dim i As Integer

If asShadow = 0 Then i = -1 Else i = aSetQ(-asShadow, 3)

aGamma asG, 3, i, 1, asShadow
aGamma asG, 4, -1, 1, 0
aGamma asG, 5, -1, 0, 0

End Sub

Function aSetQ(asG As Integer, asC As Integer) As Integer
Dim b As Boolean, i As Integer

i = gArray(asG, 0)

If asC < 5 Then b = True Else b = gEqual(asG, 3, 1)
If b Then If i = 0 Then b = False Else b = (gArray(asG, 2) = 1)
    
aSetQ = i
If b Then If i < 2 Then aSetQ = 0 Else If vMin(gArray(asG, 1)) Then aSetQ = i - 1
    
If aSetQ > 0 Then aSetQ = vGetIJ(0, aSetQ)
End Function

Function vLambda(q As Integer, vlR As Integer, vShadow As Integer, vForce As Boolean) As Integer
Dim k As Integer, m As Integer, n As Integer, p As Integer

vLambda = vInit(vlR, 1)
vArray(vLambda, 0) = q

For k = 1 To q
    If vShadow = 0 Then
        m = 0
        n = vGetIJ(0, 1)
    Else
        m = -vArray(vShadow, k)
        
        If m > 0 Then
           m = 0
           n = vGetIJ(0, 1)
        Else
            p = gArray(-m, 0)
            n = vGetIJ(0, p)
            If n < p Then m = 0
            End If
        End If
        
    vArray(vLambda, k) = aGamma(vLambda, -k, n, IIf(k = 1, 1, 0), m)
    
    If k = 1 Then
        If vShadow = 0 Then m = 0 Else m = vArray(vShadow, 8)
        If m = 0 Then m = vM(vGet(1) + 1) Else If m < 2 Then m = 1 Else m = vGetIJ(1, m)
        vArray(vLambda, 8) = m
        vArray(vLambda, 9) = 2
        End If
    Next k
    
k = vLambda

p = q
m = vArray(k, 1)
n = gArray(m, 0)
If n = 0 Then If gArray(m, 5) = 1 Then p = p - 1
If p > 1 Then p = vM(vGetIJ(1, p))
While p >= 2
    vLambda = vInit(vlR, 1)
    vArray(vLambda, 0) = p
    
    vArray(k, 6) = -vLambda
    vArray(k, 7) = 2

    If n > 0 Then n = vGetIJ(0, n)
    vArray(vLambda, 1) = aGamma(vLambda, -1, n, 1, -m)
    vArray(vLambda, 9) = 2
    vArray(vLambda, 8) = vM(vGet(1) + 1)
    
    vArray(vLambda, 2) = -k
    
    p = 1
    Wend
End Function

Function vGetIJ(i As Integer, j As Integer) As Integer

aReal = aReal * (j - i + 1)
vGetIJ = Int(aReal)
aReal = aReal - vGetIJ

vGetIJ = vGetIJ + i
aAudit = aAudit & " " & vGetIJ & "/" & i & "/" & j
End Function

Function vGet(j As Integer) As Integer
Dim k As Integer

vGet = 0
Do: k = vGetIJ(0, j)
    vGet = vGet + k
    Loop Until k < j
vM vGet
End Function
Function vM(i As Integer) As Integer

If i > aMax Then aMax = i

vM = i
End Function

Function gInit(vgR As Integer, vgC As Integer) As Integer

gInit = gCount
gCount = gCount + 1

If gInit > 0 Then If vgC < 0 Then vArray(vgR, -vgC) = gInit Else gArray(vgR, vgC) = -gInit

gArray(gInit, 6) = vgR
gArray(gInit, 7) = vgC
End Function

Function vInit(viR As Integer, viC As Integer) As Integer

vInit = vCount
vCount = vCount + 1

vArray(vInit, 6) = viR
vArray(vInit, 7) = viC
End Function

Function vMin(vmV As Integer) As Boolean
Dim i As Integer, j As Integer

vMin = False
If vArray(vmV, 0) < 2 Then Exit Function
If vArray(vmV, 8) > 1 Then Exit Function

j = vArray(vmV, 1)
If Not gEqual(j, 0, 0) Then Exit Function
If Not gEqual(j, 5, 1) Then Exit Function

For i = 2 To vArray(vmV, 0)
    j = vArray(vmV, i)
    If Not gEqual(j, 0, 0) Then Exit Function
    If Not gEqual(j, 5, 0) Then Exit Function
    Next i

vMin = True
End Function

Function gEqual(geG As Integer, geC As Integer, geV As Integer) As Boolean
Dim i As Integer

i = gArray(geG, geC)

If i < 0 Then gEqual = (gArray(-i, 0) = 0) And (gArray(-i, 5) = geV) Else gEqual = (i = geV)
End Function

Function vRead(vrRow As Integer) As String
Dim i As Integer, j As Integer, k As Integer

i = gArray(vrRow, 0)

vRead = "<" & gArray(vrRow, 0) & ","

Select Case i
Case 0
    vRead = vRead & gArray(vrRow, 5) & ">"
    Exit Function
Case Is > 1
    i = gArray(vrRow, 1)
    
    vRead = vRead & "<"
    For j = 1 To vArray(i, 0)
        k = vArray(i, j)
        If k < 0 Then
            vRead = vRead & "<" & vRead(vArray(-k, 1)) & "," & vRead(vArray(-k, 2)) & ",1," & vArray(-k, 8) & ">"
        Else
            vRead = vRead & vRead(k)
            End If
        
        If j = vArray(i, 0) Then vRead = vRead & "," & vArray(i, 9) & "," & vArray(i, 8) & ">," Else vRead = vRead & ","
        Next j
    End Select

vRead = vRead & gArray(vrRow, 2) & "," & vCells(vrRow) & ">"
End Function

Function vCells(vcRow As Integer) As String
vCells = vCell(gArray(vcRow, 3)) & "," & vCell(gArray(vcRow, 4)) & "," & vCell(gArray(vcRow, 5))
End Function

Function vCell(vcI As Integer) As String
If vcI >= 0 Then vCell = "<0," & vcI & ">" Else vCell = vRead(-vcI)
End Function

Function rVeblen(vvRow As Integer) As String
Dim i As Integer, j As Integer, s As String

If vvRow < 0 Then i = vvRow Else i = gArray(vvRow, 0)
Select Case i
Case 0
    rVeblen = gArray(vvRow, 5)
    Exit Function
Case 1
    rVeblen = "\omega"
Case Else
    If i < 0 Then i = -i Else i = gArray(vvRow, 1)
    
    rVeblen = "\varphi" & IIf(vArray(i, 8) > 1, "^" & vArray(i, 8), "") & "("
    For j = 1 To vArray(i, 0)
        s = rVeblen(vArray(i, j))
        If j = vArray(i, 9) Then
            If Len(s) > 4 Then s = s & " + 1"
            If vArray(i, 8) > 1 Then
                If InStr(" ", s) > 0 Then s = "(" & s & ")"
                s = s & "_*"
                End If
            End If
        rVeblen = rVeblen & s & IIf(j = vArray(i, 0), ")", ",")
        Next j
        
    If vvRow < 0 Then Exit Function
    End Select

If gArray(vvRow, 2) > 1 Then rVeblen = "(" & rVeblen & "\uparrow\uparrow " & gArray(vvRow, 2) & ")"

For j = 3 To 5
    i = gArray(vvRow, j)
    If i >= 0 Then s = i Else s = rVeblen(-i)
    
    Select Case j
    Case 3
        If s <> "1" Then rVeblen = rVeblen & "^{" & s & "}"
    Case 4
        If s <> "1" Then
            If Len(s) > 2 Then s = "(" & s & ")"
            rVeblen = rVeblen & "." & s
            End If
    Case 5
        If s <> "0" Then rVeblen = rVeblen & " + " & s
        End Select
    Next j
End Function


How the Function Works

A description of how the code works will be provided here ... Work in Progress.

  • VBA Constants
  • VBA Data Structures
  • VBA Functions
    • Alpha Function
    • Work In Progress


Test Bed for Version 3

Version 2 contains quite a few errors which will be fixed. Below is the test bed for version 3.

\(\alpha(100.1) = f_{(\varphi(1,0)\uparrow\uparrow 2)^{5} + 5}^{7}(25)\)

\(\alpha(100.2) = f_{(\varphi(1,0)\uparrow\uparrow 3)^{(\omega\uparrow\uparrow 2) + 4}.(\omega^{3}.4 + \omega^{2}.3) + \varphi(1,0)^{8}.6}^{6}(11)\)

\(\alpha(100.3) = f_{(\varphi(1,0)\uparrow\uparrow 4)^{(\omega\uparrow\uparrow 5)^{\omega^{10}.4 + \omega^{9}.3 + \omega^{3}.4 + \omega^{2}.6 + 3}.((\omega\uparrow\uparrow 2)^{\omega^{2}.10 + \omega.2 + 2}.(\omega^{9}.3 + \omega^{2}.4) + \omega^{5}.12 + \omega.2 + 4) + (\omega\uparrow\uparrow 4)^{\omega^{5}.3 + \omega^{2}.5 + \omega.3 + 2}.4 + \omega^{10}.5 + 9}.((\varphi(1,0)\uparrow\uparrow 3)^{(\omega\uparrow\uparrow 11)^{\omega^{10}.5 + \omega^{7}.12 + \omega^{6}.3 + \omega.5 + 9}.3 + 5}.(\varphi(1,0)^{2}.((\omega\uparrow\uparrow 4)^{\omega})))}^{2}(13)\)

\(\alpha(100.4) = f_{(\varphi(1,0)\uparrow\uparrow 5)^{\varphi(1,0)^{4}.((\omega\uparrow\uparrow 5)^{5}.3 + 3) + 3}.((\omega\uparrow\uparrow 5)^{\omega^{3}.3 + 2} + 4) + 2}^{3}(6)\)

\(\alpha(101) = f_{(\varphi(1,1)\uparrow\uparrow 5)^{\varphi(1,0)^{(\omega\uparrow\uparrow 2).6 + \omega^{5}.4 + 2}.((\omega\uparrow\uparrow 5)^{\omega^{4}.10 + \omega.4 + 9} + 3) + 11}.12 + (\varphi(1,0)\uparrow\uparrow 2)^{(\omega\uparrow\uparrow 2)^{\omega^{5}.8 + \omega + 4}.(\omega^{4} + \omega.24) + 3}.3 + (\varphi(1,0)\uparrow\uparrow 2)^{\omega^{3}.2 + \omega^{2}.9 + 1}.((\omega\uparrow\uparrow 5)^{3}.12 + (\omega\uparrow\uparrow 3)^{6}.3 + \omega^{4}.4 + \omega^{3}.3 + \omega^{2}.4) + \varphi(1,0)^{(\omega\uparrow\uparrow 13).2 + \omega^{2}.2 + \omega.2 + 4}.2 + (\omega\uparrow\uparrow 2)^{\omega^{6} + 3} + (\omega\uparrow\uparrow 2)^{4}.(\omega)}^{2}(25)\)

\(\alpha(102) = f_{(\varphi(1,3)\uparrow\uparrow 3)^{(\omega\uparrow\uparrow 6)^{\omega^{2} + 10}.((\omega\uparrow\uparrow 3)^{\omega^{2}.5 + \omega.12 + 10}.((\omega\uparrow\uparrow 2)^{\omega^{4}.2 + 5}.2 + \omega^{4}.3) + (\omega\uparrow\uparrow 2)^{3}.11) + (\omega\uparrow\uparrow 6)^{4}.((\omega\uparrow\uparrow 5)^{6}.((\omega\uparrow\uparrow 3)^{\omega.7 + 1}.3 + 2) + (\omega\uparrow\uparrow 3)^{4}.(\omega^{6}.3 + 3) + 11) + 3}.2 + (\varphi(1,1)\uparrow\uparrow 2)^{(\omega\uparrow\uparrow 4)^{4}.8 + (\omega\uparrow\uparrow 3)^{10}.(\omega^{2}.4 + \omega.4) + 6}.(\varphi(1,0)^{(\omega\uparrow\uparrow 2)^{\omega^{4}.4 + \omega}})}^{2}(13)\)

\(\alpha(103) = f_{\varphi(1,5)^{5}.(\varphi(1,0)^{\varphi(1,0)^{(\omega\uparrow\uparrow 9)^{3}.4 + (\omega\uparrow\uparrow 7)^{\omega.6 + 1}.4 + 1}.((\omega\uparrow\uparrow 5)^{3}.((\omega\uparrow\uparrow 2)^{\omega^{7}.6 + \omega.5 + 3}.(\omega.9 + 3) + 2) + (\omega\uparrow\uparrow 3)^{\omega^{4}.6 + 5}.6) + \varphi(1,0)^{\omega^{5}.11 + \omega.5}.4}.((\omega\uparrow\uparrow 2)^{3}.(\omega.3 + 10) + (\omega\uparrow\uparrow 2) + \omega.4 + 5) + (\omega\uparrow\uparrow 3)^{4}.(\omega^{5} + \omega^{4}.6 + \omega.3) + (\omega\uparrow\uparrow 3)^{2}.(\omega^{10}.10 + \omega^{8}.7 + \omega^{6}.2 + \omega^{3}.4 + \omega))}^{2}(12)\)

\(\alpha(104) = f_{(\varphi(1,10)\uparrow\uparrow 6)^{4}.(\varphi(1,1)^{(\omega\uparrow\uparrow 6)^{\omega^{2}.5 + \omega.4 + 2}.2 + 4}.(\varphi(1,0)^{10}.(\varphi(1,0)^{4}.(\varphi(1,0)^{2}.(\omega^{5}.4 + \omega.5 + 1) + (\omega\uparrow\uparrow 5)^{4} + \omega^{20}.5 + \omega^{7} + \omega^{2}) + 2) + \varphi(1,0)^{5}.(\varphi(1,0)^{\varphi(1,0)^{2}.2 + (\omega\uparrow\uparrow 4)^{5}.(\omega^{4}.4 + \omega^{3}.5 + \omega^{2}.5 + \omega.5 + 3) + 1}.((\omega\uparrow\uparrow 2)^{\omega^{6}.3 + 2}.7 + \omega^{4}.5 + \omega.6) + (\omega\uparrow\uparrow 5)^{4}.4 + 5) + 3) + \omega^{3}.12 + 3) + 3}^{6}(21)\)

\(\alpha(110) = f_{(\varphi^2(1,4_*)\uparrow\uparrow 4)^{4}.((\omega\uparrow\uparrow 2)^{\omega^{6}.5 + \omega^{5}.5 + 3}.6 + \omega^{6}.3 + 2) + (\omega\uparrow\uparrow 4).(\omega^{3}.11 + \omega^{2}.5 + 9) + (\omega\uparrow\uparrow 2)^{\omega^{4}.5 + \omega^{2} + 3}.(\omega.5) + \omega^{5}.5 + 5}^{2}(14)\)

\(\alpha(120) = f_{\varphi(2,3)^{(\omega\uparrow\uparrow 5)^{12} + (\omega\uparrow\uparrow 4)^{\omega^{9}.4 + \omega^{5}.4 + \omega^{2}.4 + 3}.(\omega^{5}.2 + \omega^{4}.6 + \omega^{3}.5 + 5)}.(\omega^{4}.12 + 3) + \varphi(1,1)^{\omega^{2}.6 + \omega + 1}.2}^{7}(18)\)

\(\alpha(130) = f_{(\varphi^2(2,5_*)\uparrow\uparrow 5)^{(\omega\uparrow\uparrow 10)^{6}.((\omega\uparrow\uparrow 4)^{\omega^{9} + \omega^{8}.2 + \omega^{6} + \omega.5 + 5}.(\omega^{2}.5 + 2) + \omega^{3}.12 + 3) + 6}.((\varphi(1,2)\uparrow\uparrow 2)^{(\omega\uparrow\uparrow 2)^{\omega^{3}.3 + 2}.(\omega^{6}.10 + \omega.3) + \omega^{5}.2}.(\varphi(1,0).4 + (\omega\uparrow\uparrow 2)^{6}.(\omega^{3}.5 + \omega.2 + 5) + 6) + 1) + (\varphi(1,3)\uparrow\uparrow 5)^{3}.10 + (\omega\uparrow\uparrow 11)^{\omega^{2}.4 + \omega + 2}.((\omega\uparrow\uparrow 4)^{\omega^{2}.3 + 2}.(\omega^{6}.2 + \omega^{3}.4 + \omega))}^{2}(13)\)

\(\alpha(800) = f_{(\varphi^3((\omega\uparrow\uparrow 6)^{\omega^{3}}.(\omega^{4}.5 + \omega^{2}.2 + \omega.5 + 4) + (\omega\uparrow\uparrow 5)^{\omega.6 + 3}.10 + (\omega\uparrow\uparrow 5)^{2}.4 + 1,(\omega\uparrow\uparrow 10).((\omega\uparrow\uparrow 4)^{3}.(\omega^{2} + \omega.3 + 4) + (\omega\uparrow\uparrow 2)^{\omega^{12}.9 + 4}.7 + 3) + \omega^{2}.3 + \omega.15 + 3 + 1_*)\uparrow\uparrow 4)^{4}.3 + 2}^{5}(25)\)

\(\alpha(900) = f_{(\varphi(9,\varphi((\omega\uparrow\uparrow 9)^{\omega.2 + 3}.((\omega\uparrow\uparrow 6).((\omega\uparrow\uparrow 2)^{\omega.6} + \omega.5 + 1) + \omega^{4} + 2) + \omega^{7}.4 + 12,(\omega\uparrow\uparrow 4)^{\omega^{5}.6 + \omega^{4}.4 + \omega^{2}.5 + \omega.6 + 1}.((\omega\uparrow\uparrow 3)^{3}.10 + (\omega\uparrow\uparrow 2)^{8}.(\omega^{4}.4 + 3) + \omega^{6}.7 + \omega.5 + 5) + 3 + 1) + 1)\uparrow\uparrow 6)^{(\omega\uparrow\uparrow 10)^{\omega^{6}.5 + \omega^{5}.4 + 1}.3 + (\omega\uparrow\uparrow 9)^{\omega^{5} + 4}.((\omega\uparrow\uparrow 2)^{\omega})}}^{2}(13)\)

\(\alpha(1000) = f_{\varphi(1,0,0)}^{2}(3)\)

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.