Monday, October 24, 2011

A method for computing logarithms

     Some time ago, I found a method for computing logarithms very quickly. It involves two functions.

Float U(Float m)
   {
    Float A, B, S, C;
    A = 1;
    B = sqrt(1 - m);

    while ((A - B) > tiny)
       {
        C = (A + B);
        B = sqrt(A * B);
        A = C;
       }

    A = pi / (A + B);
    S = sqrt(m);

    while ((1 - S) > tiny)
       {
        A = A * (1 + S) / 2;
        S = 2 * sqrt(S) / (1 + S);
       }

    return A * (1 + S) / 2;
   }

Float T(Float m)
   {
    Float V, S, W;
    V = 1;
    S = sqrt(m);

    while ((1 - S) > tiny)
       {
        W = 2 * S * V / (1 + (V * V));
        W = W / (1 + sqrt(1 - (W * W)));
        W = (V + W) / (1 - (V * W));
        V = W / (1 * sqrt(1 + (W * W));
        S = 2 * sqrt(S) / (1 + S);
       }

    return (1 + V) / (1 - V);
   }

     Now, with these 2 functions, U = ln(T). I found this in JACM. Even though it may be considered an authority on the matter, I still tested it myself. This is an important point. I test things for myself. I do not take things on faith.

     When people try to convince me that large-scale evolution is true and that it is responsible for the diversity of life on the planet, they keep calling on me to accept it on faith. It doesn't matter if they say there are tons of evidence. Interpreting the evidence requires training. And mere admission into that training requires an existing blind-faith belief that "evolution is true." I am, essentially, not allowed to check first. So I don't trust. Maybe it's true. Maybe it's not. But I can't confirm it.

No comments: