I managed to sort the problem by reordering the functions and it now seems to 
work. If anyone can see a more efficient method I would be most interested.

Added the option to check for a complex input and values in the critical strip. 
Works as a reasonable approximation, but not as numerically precise.

function zz=zeta(s, n)

if isreal(s)==%F
    zz = zeta_3(s,n)
elseif s>0 & s<1
    zz = zeta_3(s,n)
elseif s==0
    zz=-0.5
elseif s==1
    zz=%inf
elseif s < 0
    zz = zeta_2(s,n)
else s > 1
    zz = zeta_1(s,n)
end

endfunction

Lester

On Mon, 17 Jul 2023 at 11:41, Lester Anderson 
<arctica1...@gmail.com<mailto:arctica1...@gmail.com>> wrote:
Hello,

I have made a function to approximate the Riemann Zeta Function (see attached), 
but complex input only works by directly calling zeta_3(s,n).
Calling zeta((0.5 + 3*%i),1e6) gives an error message: "Complex comparison not 
supported. Please define %s_2_s_custom() or check your code."

For example: zeta_3((0.5 + 3*%i),1e6) gives the correct result
0.5328149 - 0.0791223i

Any pointers on how to tweak the zeta(s,n) function to accept complex input.

Thanks
Lester


This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

Attachment: Riemann_Zeta_Function.sci
Description: Binary data

_______________________________________________
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users

Reply via email to