Wolfgang Ehrhard's lib: hypergeometric https://github.com/chadilukito/www.wolfga lazarus / 21-General ---------------------------------------------------------------------- sedsil · 2025-08-04 08:10 I am interested in the Hypergeometric2F1 functions(unit sfHyperG) of "Wolfgang Ehrhard's lib: hypergeometric https://github.com/chadilukito/www.wolfgang- ehrhardt.de/blob/master/src/misc/amath/sfhyperg.pas". I have downloaded it, but it could not be compiled by Lazarus 4.0 Pascal. So, I tried to compile it step by step to overcome some lines, and saved ( save as) it. Today, I see that it is the same as the previous, not saved. Here, The Unit "sfHyperG" uses Amath unit.  It is the Amath unit that I can not compile. This is my principal problem. Is there anyone to help me?. If you want to know what happened, please download the unit sfHyperG from the concerned website and try to compile it. I hope someone is interested in it ---------------------------------------------------------------------- marcov · 2025-08-04 08:43 QuoteFree Pascal Compiler version 3.2.2 [2021/05/15] for i386 Copyright (c) 1993-2021 by Florian Klaempfl and others Target OS: Win32 for i386 Compiling sfhyperg.pas Compiling amath.pas amath.pas(2863,14) Note: Call to subroutine "function copysign(x:Extended;y:Extended):Extended;" marked as inline is not inlined amath.pas(3841,6) Note: Call to subroutine "function IsNaNorInf(x:Extended):Boolean;" marked as inline is not inlined amath.pas(3841,23) Note: Call to subroutine "function IsNaNorInf(x:Extended):Boolean;" marked as inline is not inlined amath.pas(3857,21) Note: Call to subroutine "function copysign(x:Extended;y:Extended):Extended;" marked as inline is not inlined amath.pas(3869,21) Note: Call to subroutine "function copysign(x:Extended;y:Extended):Extended;" marked as inline is not inlined amath.pas(4066,5) Note: Call to subroutine "procedure xxto2x(a:Extended;b:Extended;var x:ext2);" marked as inline is not inlined amath.pas(4136,3) Note: Call to subroutine "procedure xxto2x(a:Extended;b:Extended;var x:ext2);" marked as inline is not inlined amath.pas(4151,5) Note: Call to subroutine "procedure xxto2x(a:Extended;b:Extended;var x:ext2);" marked as inline is not inlined amath.pas(4155,5) Note: Call to subroutine "procedure sub2x(const a:ext2;const b:ext2;var x:ext2);" marked as inline is not inlined amath.pas(4750,10) Note: Call to subroutine "function copysign(x:Extended;y:Extended):Extended;" marked as inline is not inlined amath.pas(4886,10) Note: Call to subroutine "function copysign(x:Extended;y:Extended):Extended;" marked as inline is not inlined Compiling sfbasic.pas Compiling amtools.pas Compiling memh.pas Compiling sfgamma.pas Compiling sfzeta.pas Compiling sfpoly.pas Compiling sfellint.pas Compiling sfmisc.pas Compiling sfgamma2.pas Compiling sfexpint.pas Compiling sferf.pas Compiling sfbessel.pas 49957 lines compiled, 0.3 sec 11 note(s) issued Compiles fine.  Probably needs default mode, because lazarus forces -S2. Set the mode in the compiler options, or adds {$mode fpc} to the {$ifdef fpc} in std.inc ---------------------------------------------------------------------- tetrastes · 2025-08-04 08:57 First of all it needs i386/387: QuoteAMath is designed for the 80-bit extended data type, and therefore cannot be used with 64-bit code on 64-bit system (for these use the corresponding DAMath package).I suppose that OP compiles for other arch. ---------------------------------------------------------------------- sedsil · 2025-08-04 09:33 Quote from: marcov on August 04, 2025, 10:43:46 amQuoteFree Pascal Compiler version 3.2.2 [2021/05/15] for i386 Copyright (c) 1993-2021 by Florian Klaempfl and others Target OS: Win32 for i386 Compiling sfhyperg.pas Compiling amath.pas amath.pas(2863,14) Note: Call to subroutine "function copysign(x:Extended;y:Extended):Extended;" marked as inline is not inlined amath.pas(3841,6) Note: Call to subroutine "function IsNaNorInf(x:Extended):Boolean;" marked as inline is not inlined amath.pas(3841,23) Note: Call to subroutine "function IsNaNorInf(x:Extended):Boolean;" marked as inline is not inlined amath.pas(3857,21) Note: Call to subroutine "function copysign(x:Extended;y:Extended):Extended;" marked as inline is not inlined amath.pas(3869,21) Note: Call to subroutine "function copysign(x:Extended;y:Extended):Extended;" marked as inline is not inlined amath.pas(4066,5) Note: Call to subroutine "procedure xxto2x(a:Extended;b:Extended;var x:ext2);" marked as inline is not inlined amath.pas(4136,3) Note: Call to subroutine "procedure xxto2x(a:Extended;b:Extended;var x:ext2);" marked as inline is not inlined amath.pas(4151,5) Note: Call to subroutine "procedure xxto2x(a:Extended;b:Extended;var x:ext2);" marked as inline is not inlined amath.pas(4155,5) Note: Call to subroutine "procedure sub2x(const a:ext2;const b:ext2;var x:ext2);" marked as inline is not inlined amath.pas(4750,10) Note: Call to subroutine "function copysign(x:Extended;y:Extended):Extended;" marked as inline is not inlined amath.pas(4886,10) Note: Call to subroutine "function copysign(x:Extended;y:Extended):Extended;" marked as inline is not inlined Compiling sfbasic.pas Compiling amtools.pas Compiling memh.pas Compiling sfgamma.pas Compiling sfzeta.pas Compiling sfpoly.pas Compiling sfellint.pas Compiling sfmisc.pas Compiling sfgamma2.pas Compiling sfexpint.pas Compiling sferf.pas Compiling sfbessel.pas 49957 lines compiled, 0.3 sec 11 note(s) issued Compiles fine.  Probably needs default mode, because lazarus forces -S2. Set the mode in the compiler options, or adds {$mode fpc} to the {$ifdef fpc} in std.inc I did what you said me in the std.inc : {$ifdef FPC}   {$mode fpc}   {$define FPC_ProcVar}   {$define ABSTRACT}   {$define HAS_XTYPES}   {$define HAS_OVERLOAD}   {$define HAS_FP_CAST}   {$undef N_OPT}   {$ifdef VER1}     {$undef  J_OPT}     {$define HAS_INT64}     {$define HAS_CARD32}     {$define HAS_MSG}     {$define HAS_ASSERT}     {$ifndef VER1_0}       {FPC 1.9.x}       {$define StrictLong}     {$else}       {$define LoadArgs}     {$endif} when compiling, it gives me the error message for the Amath.pas (unit file) :Compile Project, Target: C:\PASCAL\hfr2025MKL_V1.exe: Exit code 1, Errors: 50, Warnings: 6 amath.pas(1610,7) Error: Assembler syntax error in operand amath.pas(1610,9) Error: Assembler syntax error in operand amath.pas(1620,11) Error: Assembler syntax error in operand amath.pas(1620,13) Error: Assembler syntax error in operand amath.pas(1716,11) Error: Assembler syntax error in operand amath.pas(1716,13) Error: Assembler syntax error in operand amath.pas(1718,11) Error: Unknown identifier "ST" amath.pas(1718,14) Error: Unknown identifier "ST" amath.pas(1718,18) Warning: No size specified and unable to determine the size of the operands, using DWORD as default amath.pas(1720,11) Error: Unknown identifier "QWORD" amath.pas(1720,21) Error: Assembler syntax error in operand amath.pas(1720,28) Error: Assembler syntax error in operand amath.pas(1721,11) Error: Unknown identifier "ST" amath.pas(1721,14) Error: Unknown identifier "ST" amath.pas(1721,18) Warning: No size specified and unable to determine the size of the operands, using DWORD as default amath.pas(1722,11) Error: Unknown identifier "ST" amath.pas(1722,17) Error: Unknown identifier "ST" amath.pas(1722,17) Warning: No size specified and unable to determine the size of the operands, using DWORD as default amath.pas(1723,11) Error: Unknown identifier "QWORD" amath.pas(1723,21) Error: Assembler syntax error in operand amath.pas(1723,28) Error: Assembler syntax error in operand amath.pas(1724,11) Error: Unknown identifier "ST" amath.pas(1724,15) Error: Unknown identifier "ST" amath.pas(1724,19) Warning: No size specified and unable to determine the size of the operands, using DWORD as default amath.pas(1725,11) Error: Unknown identifier "ST" amath.pas(1725,17) Error: Unknown identifier "ST" amath.pas(1725,17) Warning: No size specified and unable to determine the size of the operands, using DWORD as default amath.pas(1726,11) Error: Unknown identifier "ST" amath.pas(1728,11) Error: Unknown identifier "ST" amath.pas(1728,17) Error: Unknown identifier "ST" amath.pas(1728,17) Warning: No size specified and unable to determine the size of the operands, using DWORD as default amath.pas(1736,11) Error: Unknown identifier "ST" amath.pas(1740,11) Error: Unknown identifier "AX" amath.pas(1742,11) Error: Assembler syntax error in operand amath.pas(1742,12) Error: Assembler syntax error in operand amath.pas(1742,13) Error: Invalid reference syntax amath.pas(1743,11) Error: Unknown identifier "ST" amath.pas(1745,11) Error: Assembler syntax error in operand amath.pas(1745,16) Error: Assembler syntax error in operand amath.pas(1746,11) Error: Unknown identifier "AX" amath.pas(1748,11) Error: Assembler syntax error in operand amath.pas(1748,12) Error: Assembler syntax error in operand amath.pas(1748,13) Error: Invalid reference syntax amath.pas(1749,11) Error: Unknown identifier "ST" amath.pas(1749,14) Error: Unknown identifier "ST" amath.pas(1750,11) Error: Assembler syntax error in operand amath.pas(1750,12) Error: Assembler syntax error in operand amath.pas(1750,13) Error: Invalid reference syntax amath.pas(1751,1) Error: Unrecognized opcode amath.pas(1751,1) Error: Assembler syntax error amath.pas(1754,11) Error: Unknown identifier "DWORD" amath.pas(1754,21) Error: Assembler syntax error in operand amath.pas(1754,26) Error: Assembler syntax error in operand amath.pas(1756,11) Error: Unknown identifier "ST" amath.pas(1757,11) Error: Unknown identifier "DWORD" amath.pas(1757,21) Error: Assembler syntax error in operand Probably, I am making an important mistake, but I will not find it in case you don't direct meI am making a mistake, but I can not find it in case you dont direct me ---------------------------------------------------------------------- tetrastes · 2025-08-04 09:49 You compile for x86_64. Once more: Quote from: tetrastes on August 04, 2025, 10:57:38 amFirst of all it needs i386/387: QuoteAMath is designed for the 80-bit extended data type, and therefore cannot be used with 64-bit code on 64-bit system (for these use the corresponding DAMath package).I suppose that OP compiles for other arch. ---------------------------------------------------------------------- wp · 2025-08-04 11:55 Looking at the folder structure in the repository I see that there is a folder damath parallel zu amath. While amath contains "high- precision" routines, double-precision routines are contained in dmath. And there is also a hypergeometric unit, named sdhyperg.pas containing Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function sfd_1f1(a,b,x: double): double;  {-Return the confluent hypergeometric function 1F1(a,b,x); Kummer's function M(a,b,x)} function sfd_1f1r(a,b,x: double): double;  {-Return the regularized Kummer hypergeometric function 1F1(a,b,x)/Gamma(b)} function sfd_2f1(a,b,c,x: double): double;  {-Return the Gauss hypergeometric function 2F1(a,b;c;x)} function sfd_2f1r(a,b,c,x: double): double;  {-Return the regularized Gauss hypergeometric function 2F1(a,b,c,x)/Gamma(c)} function sfd_chu(a,b,x: double): double;  {-Return Tricomi's confluent hypergeometric function U(a,b,x). If}  { x<0, then a must be an integer and a<0 or 1+a-b an integer < 0.} function sfd_whitm(k,m,x: double): double;  {-Return the Whittaker M function = exp(-x/2)*x^(0.5+m) * 1F1(m-k-0.5,2m+1,x)} function sfd_whitw(k,m,x: double): double;  {-Return the Whittaker W function = exp(-x/2)*x^(0.5+m) * U(m-k-0.5,2m+1,x)} function sfd_0f1(b,x: double): double;  {-Return the confluent hypergeometric limit function 0F1(;b;x)} function sfd_0f1r(b,x: double): double;  {-Return the regularized confluent hypergeometric limit function 0F1(;b;x)/Gamma(b)} function sfd_2f0(a,b,x: double): double;  {-Return 2F0(a,b,x), if x>0 then a or b must be a negative integer} function sfd_pcfd(v,x: double): double;  {-Return Whittaker's parabolic cylinder function D_v(x)} function sfd_pcfu(a,x: double): double;  {-Return the parabolic cylinder function U(a,x)} function sfd_pcfv(a,x: double): double;  {-Return the parabolic cylinder function V(a,x) with 2a integer} function sfd_pcfhh(v,x: double): double;  {-Return the Hermite function H_v(x) of degree v} This should compile an 32bit and 64bit. (At least, I was able to compile and run the t_tamall demo test in src/misc/damath/tests in a 32-bit and a 64-bit IDE on Windows 11). ---------------------------------------------------------------------- LV · 2025-08-04 12:34 Simply unzip the attached project, compile, and run (32-bit or 64-bit). Enjoy  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program TestHyperG; uses  SysUtils, sdHyperG; var  a, b, c, z, res: double; begin  a := 1.0;  b := 1.0;  c := 2.0;  z := 0.5;   res := sfd_2f1(a, b, c, z);   Writeln('2F1(', a:0:2, ', ', b:0:2, '; ', c:0:2, '; ', z:0:2, ') = ', res:0:10);  Readln;end.  Output: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 2F1(1.00, 1.00; 2.00; 0.50) = 1.3862943611