Skip to main content
. 2021 Apr 19;21(8):2859. doi: 10.3390/s21082859
Algorithm 3 Fixed-Q precomputation.
Input: s=6t+2, m= the bit length of s, QG2
Output: Q=(GDBL,GADD,πQ,π2Q)
  • 1:

    Write s in signed binary form, s=i=0m1s[i]2i with s[i]{1,0,1}

  • 2:

    TQ,GDBL{},GADD{}

  • 3:

    forim2down to 0 do

  • 4:

        Compute λandc, such that yQ+λxQ+c is the line tangent to T

  • 5:

        T[2]T

  • 6:

        Append (λ,c) to GDBL

  • 7:

        if s[i]=1 then

  • 8:

             Compute λandc, such that yQ+λxQ+c is the line joining T and Q

  • 9:

             TT+Q

  • 10:

            Append (λ,c) to GADD

  • 11:

        else if s[i]=1 then

  • 12:

            Compute λandc, such that yQ+λxQ+c is the line joining T and Q

  • 13:

            TTQ

  • 14:

            Append (λ,c) to GADD

  • 15:

        end if

  • 16:

    end for

  • 17:

    Rπ(Q)

  • 18:

    Compute λandc, such that yR+λxR+c is the line joining T and R

  • 19:

    πQ(λ,c)

  • 20:

    Rπ2(Q)

  • 21:

    Compute λandc, such that yR+λxR+c is the line joining T and R

  • 22:

    π2Q(λ,c)

  • 23:

    Q(GDBL,GADD,πQ,π2Q)

  • 24:

    returnQ