WeixiangYan/CodeTransOcean huggingface dataset:
Task: Humble numbers







Python: 

from itertools import groupby, islice
from functools import reduce



def humbles():
    
    hs = set([1])
    while True:
        nxt = min(hs)
        yield nxt
        hs.remove(nxt)
        hs.update(nxt * x for x in [2, 3, 5, 7])




def main():
    

    print('First 50 Humble numbers:\n')
    for row in chunksOf(10)(
            take(50)(humbles())
    ):
        print(' '.join(map(
            lambda x: str(x).rjust(3),
            row
        )))

    print('\nCounts of Humble numbers with n digits:\n')
    for tpl in take(10)(
            (k, len(list(g))) for k, g in
            groupby(len(str(x)) for x in humbles())
    ):
        print(tpl)





def chunksOf(n):
    
    return lambda xs: reduce(
        lambda a, i: a + [xs[i:n + i]],
        range(0, len(xs), n), []
    ) if 0 < n else []




def take(n):
    
    return lambda xs: (
        list(islice(xs, n))
    )



if __name__ == '__main__':
    main()





Ada: with Ada.Text_IO;

procedure Show_Humble is

   type Positive is range 1 .. 2**63 - 1;
   First : constant Positive := Positive'First;
   Last  : constant Positive := 999_999_999;

   function Is_Humble (I : in Positive) return Boolean is
   begin
      if    I <= 1      then  return True;
      elsif I mod 2 = 0 then  return Is_Humble (I / 2);
      elsif I mod 3 = 0 then  return Is_Humble (I / 3);
      elsif I mod 5 = 0 then  return Is_Humble (I / 5);
      elsif I mod 7 = 0 then  return Is_Humble (I / 7);
      else                    return False;
      end if;
   end Is_Humble;

   subtype Digit_Range is Natural range First'Image'Length - 1 .. Last'Image'Length - 1;
   Digit_Count  : array (Digit_Range) of Natural := (others => 0);

   procedure Count_Humble_Digits is
      use Ada.Text_IO;
      Humble_Count : Natural := 0;
      Len : Natural;
   begin
      Put_Line ("The first 50 humble numbers:");
      for N in First .. Last loop
         if Is_Humble (N) then
            Len := N'Image'Length - 1;
            Digit_Count (Len) := Digit_Count (Len) + 1;

            if Humble_Count < 50 then
               Put (N'Image);
               Put (" ");
            end if;
            Humble_Count := Humble_Count + 1;
         end if;
      end loop;
      New_Line (2);
   end Count_Humble_Digits;

   procedure Show_Digit_Counts is
      package Natural_IO is
         new Ada.Text_IO.Integer_IO (Natural);
      use Ada.Text_IO;
      use Natural_IO;

      Placeholder : String := "Digits Count";
      Image_Digit : String renames Placeholder (1 .. 6);
      Image_Count : String renames Placeholder (8 .. Placeholder'Last);
   begin
      Put_Line ("The digit counts of humble numbers:");
      Put_Line (Placeholder);
      for Digit in Digit_Count'Range loop
         Put (Image_Digit, Digit);
         Put (Image_Count, Digit_Count (Digit));
         Put_Line (Placeholder);
      end loop;
   end Show_Digit_Counts;

begin
   Count_Humble_Digits;
   Show_Digit_Counts;
end Show_Humble;
Task: Humble numbers

C: #include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>

bool isHumble(int i) {
    if (i <= 1) return true;
    if (i % 2 == 0) return isHumble(i / 2);
    if (i % 3 == 0) return isHumble(i / 3);
    if (i % 5 == 0) return isHumble(i / 5);
    if (i % 7 == 0) return isHumble(i / 7);
    return false;
}

int main() {
    int limit = SHRT_MAX;
    int humble[16];
    int count = 0;
    int num = 1;
    char buffer[16];

    memset(humble, 0, sizeof(humble));

    for (; count < limit; num++) {
        if (isHumble(num)) {
            size_t len;
            sprintf_s(buffer, sizeof(buffer), "%d", num);
            len = strlen(buffer);
            if (len >= 16) {
                break;
            }
            humble[len]++;

            if (count < 50) {
                printf("%d ", num);
            }
            count++;
        }
    }
    printf("\n\n");

    printf("Of the first %d humble numbers:\n", count);
    for (num = 1; num < 10; num++) {
        printf("%5d have %d digits\n", humble[num], num);
    }

    return 0;
}
Task: Humble numbers



C#: using System;
using System.Collections.Generic;

namespace HumbleNumbers {
    class Program {
        static bool IsHumble(int i) {
            if (i <= 1) return true;
            if (i % 2 == 0) return IsHumble(i / 2);
            if (i % 3 == 0) return IsHumble(i / 3);
            if (i % 5 == 0) return IsHumble(i / 5);
            if (i % 7 == 0) return IsHumble(i / 7);
            return false;
        }

        static void Main() {
            var limit = short.MaxValue;
            Dictionary<int, int> humble = new Dictionary<int, int>();
            var count = 0;
            var num = 1;

            while (count < limit) {
                if (IsHumble(num)) {
                    var str = num.ToString();
                    var len = str.Length;
                    if (humble.ContainsKey(len)) {
                        humble[len]++;
                    } else {
                        humble[len] = 1;
                    }
                    if (count < 50) Console.Write("{0} ", num);
                    count++;
                }
                num++;
            }
            Console.WriteLine("\n");

            Console.WriteLine("Of the first {0} humble numbers:", count);
            num = 1;
            while (num < humble.Count - 1) {
                if (humble.ContainsKey(num)) {
                    var c = humble[num];
                    Console.WriteLine("{0,5} have {1,2} digits", c, num);
                    num++;
                } else {
                    break;
                }
            }
        }
    }
}
Task: Humble numbers


C++: #include <iomanip>
#include <iostream>
#include <map>
#include <sstream>

bool isHumble(int i) {
    if (i <= 1) return true;
    if (i % 2 == 0) return isHumble(i / 2);
    if (i % 3 == 0) return isHumble(i / 3);
    if (i % 5 == 0) return isHumble(i / 5);
    if (i % 7 == 0) return isHumble(i / 7);
    return false;
}

auto toString(int n) {
    std::stringstream ss;
    ss << n;
    return ss.str();
}

int main() {
    auto limit = SHRT_MAX;
    std::map<int, int> humble;
    auto count = 0;
    auto num = 1;

    while (count < limit) {
        if (isHumble(num)) {
            auto str = toString(num);
            auto len = str.length();
            auto it = humble.find(len);

            if (it != humble.end()) {
                it->second++;
            } else {
                humble[len] = 1;
            }

            if (count < 50) std::cout << num << ' ';
            count++;
        }
        num++;
    }
    std::cout << "\n\n";

    std::cout << "Of the first " << count << " humble numbers:\n";
    num = 1;
    while (num < humble.size() - 1) {
        auto it = humble.find(num);
        if (it != humble.end()) {
            auto c = *it;
            std::cout << std::setw(5) << c.second << " have " << std::setw(2) << num << " digits\n";
            num++;
        } else {
            break;
        }
    }

    return 0;
}
Task: Humble numbers





Java: import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class HumbleNumbers {

    public static void main(String[] args) {
        System.out.println("First 50 humble numbers:");
        System.out.println(Arrays.toString(humble(50)));
        Map<Integer,Integer> lengthCountMap = new HashMap<>();
        BigInteger[] seq = humble(1_000_000);
        for ( int i = 0 ; i < seq.length ; i++ ) {
            BigInteger humbleNumber = seq[i];
            int len = humbleNumber.toString().length();
            lengthCountMap.merge(len, 1, (v1, v2) -> v1 + v2);
        }
        List<Integer> sorted = new ArrayList<>(lengthCountMap.keySet());
        Collections.sort(sorted);
        System.out.printf("Length  Count%n");
        for ( Integer len : sorted ) {
            System.out.printf("    %2s  %5s%n", len, lengthCountMap.get(len));
        }
    }
    
    private static BigInteger[] humble(int n) {
        BigInteger two = BigInteger.valueOf(2);
        BigInteger twoTest = two;
        BigInteger three = BigInteger.valueOf(3);
        BigInteger threeTest = three;
        BigInteger five = BigInteger.valueOf(5);
        BigInteger fiveTest = five;
        BigInteger seven = BigInteger.valueOf(7);
        BigInteger sevenTest = seven;
        BigInteger[] results = new BigInteger[n];
        results[0] = BigInteger.ONE;
        int twoIndex = 0, threeIndex = 0, fiveIndex = 0, sevenIndex = 0;
        for ( int index = 1 ; index < n ; index++ ) {
            results[index] = twoTest.min(threeTest).min(fiveTest).min(sevenTest);
            if ( results[index].compareTo(twoTest) == 0 ) {
                twoIndex++;
                twoTest = two.multiply(results[twoIndex]);
            }
            if (results[index].compareTo(threeTest) == 0 ) {
                threeIndex++;
                threeTest = three.multiply(results[threeIndex]);
            }
            if (results[index].compareTo(fiveTest) == 0 ) {
                fiveIndex++;
                fiveTest = five.multiply(results[fiveIndex]);
            }
            if (results[index].compareTo(sevenTest) == 0 ) {
                sevenIndex++;
                sevenTest = seven.multiply(results[sevenIndex]);
            }
        }
        return results;
    }

}
Task: Humble numbers







Python: 

from itertools import groupby, islice
from functools import reduce



def humbles():
    
    hs = set([1])
    while True:
        nxt = min(hs)
        yield nxt
        hs.remove(nxt)
        hs.update(nxt * x for x in [2, 3, 5, 7])




def main():
    

    print('First 50 Humble numbers:\n')
    for row in chunksOf(10)(
            take(50)(humbles())
    ):
        print(' '.join(map(
            lambda x: str(x).rjust(3),
            row
        )))

    print('\nCounts of Humble numbers with n digits:\n')
    for tpl in take(10)(
            (k, len(list(g))) for k, g in
            groupby(len(str(x)) for x in humbles())
    ):
        print(tpl)





def chunksOf(n):
    
    return lambda xs: reduce(
        lambda a, i: a + [xs[i:n + i]],
        range(0, len(xs), n), []
    ) if 0 < n else []




def take(n):
    
    return lambda xs: (
        list(islice(xs, n))
    )



if __name__ == '__main__':
    main()
Task: Humble numbers








VB: Module Module1

    Function IsHumble(i As Long) As Boolean
        If i <= 1 Then
            Return True
        End If
        If i Mod 2 = 0 Then
            Return IsHumble(i \ 2)
        End If
        If i Mod 3 = 0 Then
            Return IsHumble(i \ 3)
        End If
        If i Mod 5 = 0 Then
            Return IsHumble(i \ 5)
        End If
        If i Mod 7 = 0 Then
            Return IsHumble(i \ 7)
        End If
        Return False
    End Function

    Sub Main()
        Dim LIMIT = Short.MaxValue
        Dim humble As New Dictionary(Of Integer, Integer)
        Dim count = 0L
        Dim num = 1L

        While count < LIMIT
            If (IsHumble(num)) Then
                Dim str = num.ToString
                Dim len = str.Length
                If len > 10 Then
                    Exit While
                End If
                If humble.ContainsKey(len) Then
                    humble(len) += 1
                Else
                    humble(len) = 1
                End If
                If count < 50 Then
                    Console.Write("{0} ", num)
                End If
                count += 1
            End If
            num += 1
        End While
        Console.WriteLine(vbNewLine)

        Console.WriteLine("Of the first {0} humble numbers:", count)
        num = 1
        While num < humble.Count
            If humble.ContainsKey(num) Then
                Dim c = humble(num)
                Console.WriteLine("{0,5} have {1,2} digits", c, num)
                num += 1
            Else
                Exit While
            End If
        End While
    End Sub

End Module
Task: Humble numbers




Go: package main

import (
    "fmt"
    "math/big"
)

var (
    one   = new(big.Int).SetUint64(1)
    two   = new(big.Int).SetUint64(2)
    three = new(big.Int).SetUint64(3)
    five  = new(big.Int).SetUint64(5)
    seven = new(big.Int).SetUint64(7)
    ten   = new(big.Int).SetUint64(10)
)

func min(a, b *big.Int) *big.Int {
    if a.Cmp(b) < 0 {
        return a
    }
    return b
}

func humble(n int) []*big.Int {
    h := make([]*big.Int, n)
    h[0] = new(big.Int).Set(one)
    next2, next3 := new(big.Int).Set(two), new(big.Int).Set(three)
    next5, next7 := new(big.Int).Set(five), new(big.Int).Set(seven)
    var i, j, k, l int
    for m := 1; m < len(h); m++ {
        h[m] = new(big.Int).Set(min(next2, min(next3, min(next5, next7))))
        if h[m].Cmp(next2) == 0 {
            i++
            next2.Mul(two, h[i])
        }
        if h[m].Cmp(next3) == 0 {
            j++
            next3.Mul(three, h[j])
        }
        if h[m].Cmp(next5) == 0 {
            k++
            next5.Mul(five, h[k])
        }
        if h[m].Cmp(next7) == 0 {
            l++
            next7.Mul(seven, h[l])
        }
    }
    return h
}

func commatize(n int) string {
    s := fmt.Sprintf("%d", n)
    le := len(s)
    for i := le - 3; i >= 1; i -= 3 {
        s = s[0:i] + "," + s[i:]
    }
    return s
}

func main() {
    const n = 13 * 1e6  
    h := humble(n) 
    fmt.Println("The first 50 humble numbers are:")
    fmt.Println(h[0:50])

    maxDigits := len(h[len(h)-1].String()) - 1
    counts := make([]int, maxDigits+1)
    var maxUsed int
    digits := 1
    pow10 := new(big.Int).Set(ten)
    for i := 0; i < len(h); i++ {
        for {
            if h[i].Cmp(pow10) >= 0 {
                pow10.Mul(pow10, ten)
                digits++
            } else {
                break
            }
        }  
        if digits > maxDigits {
            maxUsed = i
            break
        }
        counts[digits]++
    }
    fmt.Printf("\nOf the first %s humble numbers:\n", commatize(maxUsed))
    for i := 1; i <= maxDigits; i++ {
        s := "s"
        if i == 1 {
            s = ""
        }
        fmt.Printf("%9s have %2d digit%s\n", commatize(counts[i]), i, s)
    }       
}
Task: Gamma function



C#: using System;
using System.Numerics;

static int g = 7;
static double[] p = {0.99999999999980993, 676.5203681218851, -1259.1392167224028,
	     771.32342877765313, -176.61502916214059, 12.507343278686905,
	     -0.13857109526572012, 9.9843695780195716e-6, 1.5056327351493116e-7};
		 
Complex Gamma(Complex z)
{
    
    if (z.Real < 0.5)
	{
        return Math.PI / (Complex.Sin( Math.PI * z) * Gamma(1 - z));
	}
    else
	{
        z -= 1;
        Complex x = p[0];
        for (var i = 1; i < g + 2; i++)
		{
            x += p[i]/(z+i);
		}
        Complex t = z + g + 0.5;
        return Complex.Sqrt(2 * Math.PI) * (Complex.Pow(t, z + 0.5)) * Complex.Exp(-t) * x;
	}
}









Ada: function Gamma (X : Long_Float) return Long_Float is
   A : constant array (0..29) of Long_Float :=
       (  1.00000_00000_00000_00000,
          0.57721_56649_01532_86061,
         -0.65587_80715_20253_88108,
         -0.04200_26350_34095_23553,
          0.16653_86113_82291_48950,
         -0.04219_77345_55544_33675,
         -0.00962_19715_27876_97356,
          0.00721_89432_46663_09954,
         -0.00116_51675_91859_06511,
         -0.00021_52416_74114_95097,
          0.00012_80502_82388_11619,
         -0.00002_01348_54780_78824,
         -0.00000_12504_93482_14267,
          0.00000_11330_27231_98170,
         -0.00000_02056_33841_69776,
          0.00000_00061_16095_10448,
          0.00000_00050_02007_64447,
         -0.00000_00011_81274_57049,
          0.00000_00001_04342_67117,
          0.00000_00000_07782_26344,
         -0.00000_00000_03696_80562,
          0.00000_00000_00510_03703,
         -0.00000_00000_00020_58326,
         -0.00000_00000_00005_34812,
          0.00000_00000_00001_22678,
         -0.00000_00000_00000_11813,
          0.00000_00000_00000_00119,
          0.00000_00000_00000_00141,
         -0.00000_00000_00000_00023,
          0.00000_00000_00000_00002
       );
   Y   : constant Long_Float := X - 1.0;
   Sum : Long_Float := A (A'Last);
begin
   for N in reverse A'First..A'Last - 1 loop
      Sum := Sum * Y + A (N);
   end loop;
   return 1.0 / Sum;
end Gamma;
Task: Gamma function

C: #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <gsl/gsl_sf_gamma.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif


double st_gamma(double x)
{
  return sqrt(2.0*M_PI/x)*pow(x/M_E, x);
}

#define A 12
double sp_gamma(double z)
{
  const int a = A;
  static double c_space[A];
  static double *c = NULL;
  int k;
  double accm;
 
  if ( c == NULL ) {
    double k1_factrl = 1.0; 
    c = c_space;
    c[0] = sqrt(2.0*M_PI);
    for(k=1; k < a; k++) {
      c[k] = exp(a-k) * pow(a-k, k-0.5) / k1_factrl;
	  k1_factrl *= -k;
    }
  }
  accm = c[0];
  for(k=1; k < a; k++) {
    accm += c[k] / ( z + k );
  }
  accm *= exp(-(z+a)) * pow(z+a, z+0.5); 
  return accm/z;
}

int main()
{
  double x;


  printf("%15s%15s%15s%15s\n", "Stirling", "Spouge", "GSL", "libm");
  for(x=1.0; x <= 10.0; x+=1.0) {
    printf("%15.8lf%15.8lf%15.8lf%15.8lf\n", st_gamma(x/3.0), sp_gamma(x/3.0), 
	   gsl_sf_gamma(x/3.0), tgamma(x/3.0));
  }
  return 0;
}











Ada: function Gamma (X : Long_Float) return Long_Float is
   A : constant array (0..29) of Long_Float :=
       (  1.00000_00000_00000_00000,
          0.57721_56649_01532_86061,
         -0.65587_80715_20253_88108,
         -0.04200_26350_34095_23553,
          0.16653_86113_82291_48950,
         -0.04219_77345_55544_33675,
         -0.00962_19715_27876_97356,
          0.00721_89432_46663_09954,
         -0.00116_51675_91859_06511,
         -0.00021_52416_74114_95097,
          0.00012_80502_82388_11619,
         -0.00002_01348_54780_78824,
         -0.00000_12504_93482_14267,
          0.00000_11330_27231_98170,
         -0.00000_02056_33841_69776,
          0.00000_00061_16095_10448,
          0.00000_00050_02007_64447,
         -0.00000_00011_81274_57049,
          0.00000_00001_04342_67117,
          0.00000_00000_07782_26344,
         -0.00000_00000_03696_80562,
          0.00000_00000_00510_03703,
         -0.00000_00000_00020_58326,
         -0.00000_00000_00005_34812,
          0.00000_00000_00001_22678,
         -0.00000_00000_00000_11813,
          0.00000_00000_00000_00119,
          0.00000_00000_00000_00141,
         -0.00000_00000_00000_00023,
          0.00000_00000_00000_00002
       );
   Y   : constant Long_Float := X - 1.0;
   Sum : Long_Float := A (A'Last);
begin
   for N in reverse A'First..A'Last - 1 loop
      Sum := Sum * Y + A (N);
   end loop;
   return 1.0 / Sum;
end Gamma;
Task: Gamma function


C++: #include <math.h>
#include <numbers>
#include <stdio.h>
#include <vector>



std::vector<double> CalculateCoefficients(int numCoeff)
{
    std::vector<double> c(numCoeff);
    double k1_factrl = 1.0;
    c[0] = sqrt(2.0 * std::numbers::pi);
    for(size_t k=1; k < numCoeff; k++)
    {
        c[k] = exp(numCoeff-k) * pow(numCoeff-k, k-0.5) / k1_factrl;
        k1_factrl *= -(double)k;
    }
    return c;
}


double Gamma(const std::vector<double>& coeffs, double x)
{
        const size_t numCoeff = coeffs.size();
        double accm = coeffs[0];
        for(size_t k=1; k < numCoeff; k++)
        {
            accm += coeffs[k] / ( x + k );
        }
        accm *= exp(-(x+numCoeff)) * pow(x+numCoeff, x+0.5);
        return accm/x;
}

int main()
{
    
    const auto coeff1 = CalculateCoefficients(1);
    const auto coeff4 = CalculateCoefficients(4);
    const auto coeff10 = CalculateCoefficients(10);

    const auto inputs = std::vector<double>{
        0.001, 0.01, 0.1, 0.5, 1.0,
        1.461632145, 
        2, 2.5, 3, 4, 5, 6, 7, 8, 9, 10, 50, 100, 
        150 
        };
    
    printf("%16s%16s%16s%16s%16s\n", "gamma( x ) =", "Spouge 1", "Spouge 4", "Spouge 10", "built-in");
    for(auto x : inputs) 
    {
        printf("gamma(%7.3f) = %16.10g %16.10g %16.10g %16.10g\n", 
            x,
            Gamma(coeff1, x),
            Gamma(coeff4, x), 
            Gamma(coeff10, x), 
            std::tgamma(x)); 
    }
}










Ada: function Gamma (X : Long_Float) return Long_Float is
   A : constant array (0..29) of Long_Float :=
       (  1.00000_00000_00000_00000,
          0.57721_56649_01532_86061,
         -0.65587_80715_20253_88108,
         -0.04200_26350_34095_23553,
          0.16653_86113_82291_48950,
         -0.04219_77345_55544_33675,
         -0.00962_19715_27876_97356,
          0.00721_89432_46663_09954,
         -0.00116_51675_91859_06511,
         -0.00021_52416_74114_95097,
          0.00012_80502_82388_11619,
         -0.00002_01348_54780_78824,
         -0.00000_12504_93482_14267,
          0.00000_11330_27231_98170,
         -0.00000_02056_33841_69776,
          0.00000_00061_16095_10448,
          0.00000_00050_02007_64447,
         -0.00000_00011_81274_57049,
          0.00000_00001_04342_67117,
          0.00000_00000_07782_26344,
         -0.00000_00000_03696_80562,
          0.00000_00000_00510_03703,
         -0.00000_00000_00020_58326,
         -0.00000_00000_00005_34812,
          0.00000_00000_00001_22678,
         -0.00000_00000_00000_11813,
          0.00000_00000_00000_00119,
          0.00000_00000_00000_00141,
         -0.00000_00000_00000_00023,
          0.00000_00000_00000_00002
       );
   Y   : constant Long_Float := X - 1.0;
   Sum : Long_Float := A (A'Last);
begin
   for N in reverse A'First..A'Last - 1 loop
      Sum := Sum * Y + A (N);
   end loop;
   return 1.0 / Sum;
end Gamma;
Task: Gamma function




Go: package main

import (
    "fmt"
    "math"
)

func main() {
    fmt.Println("    x               math.Gamma                 Lanczos7")
    for _, x := range []float64{-.5, .1, .5, 1, 1.5, 2, 3, 10, 140, 170} {
        fmt.Printf("%5.1f %24.16g %24.16g\n", x, math.Gamma(x), lanczos7(x))
    }
}

func lanczos7(z float64) float64 {
    t := z + 6.5
    x := .99999999999980993 +
        676.5203681218851/z -
        1259.1392167224028/(z+1) +
        771.32342877765313/(z+2) -
        176.61502916214059/(z+3) +
        12.507343278686905/(z+4) -
        .13857109526572012/(z+5) +
        9.9843695780195716e-6/(z+6) +
        1.5056327351493116e-7/(z+7)
    return math.Sqrt2 * math.SqrtPi * math.Pow(t, z-.5) * math.Exp(-t) * x
}








Ada: function Gamma (X : Long_Float) return Long_Float is
   A : constant array (0..29) of Long_Float :=
       (  1.00000_00000_00000_00000,
          0.57721_56649_01532_86061,
         -0.65587_80715_20253_88108,
         -0.04200_26350_34095_23553,
          0.16653_86113_82291_48950,
         -0.04219_77345_55544_33675,
         -0.00962_19715_27876_97356,
          0.00721_89432_46663_09954,
         -0.00116_51675_91859_06511,
         -0.00021_52416_74114_95097,
          0.00012_80502_82388_11619,
         -0.00002_01348_54780_78824,
         -0.00000_12504_93482_14267,
          0.00000_11330_27231_98170,
         -0.00000_02056_33841_69776,
          0.00000_00061_16095_10448,
          0.00000_00050_02007_64447,
         -0.00000_00011_81274_57049,
          0.00000_00001_04342_67117,
          0.00000_00000_07782_26344,
         -0.00000_00000_03696_80562,
          0.00000_00000_00510_03703,
         -0.00000_00000_00020_58326,
         -0.00000_00000_00005_34812,
          0.00000_00000_00001_22678,
         -0.00000_00000_00000_11813,
          0.00000_00000_00000_00119,
          0.00000_00000_00000_00141,
         -0.00000_00000_00000_00023,
          0.00000_00000_00000_00002
       );
   Y   : constant Long_Float := X - 1.0;
   Sum : Long_Float := A (A'Last);
begin
   for N in reverse A'First..A'Last - 1 loop
      Sum := Sum * Y + A (N);
   end loop;
   return 1.0 / Sum;
end Gamma;