4
0
Calculate the Riemann zeta function to the maximum primitive precision in your language (for C-family, that would be double or long double, var in JS, etc.) No need for BigDecimal or the like unless you need it to use a double-equivalent precision.
- Efficiency (be sane) doesn't matter.
- If it's not in a common language, I can't test it, but I hope somebody does.
- No libraries or built-in math functions.
- Recursion is cool!
See my JS entry for a sample program.
3Judging by your example implementation it only needs to work for real inputs greater 1? – Martin Ender – 2014-08-04T18:13:24.887
@MartinBüttner Yes. – Simon Kuang – 2014-08-04T19:23:08.590
2And what about those math functions? You're using the power function yourself. Which math functions are allowed and which aren't? – Martin Ender – 2014-08-04T19:24:45.273
How is input/output to be handled? Examples? – Kyle Kanos – 2014-08-04T19:37:20.187
@MartinBüttner Okay. Only basic math functions equivalent to Java/JS's
Math. – Simon Kuang – 2014-08-04T19:46:13.767I think without power function you will be pretty lost, and many programming languages do not require a math library for calculating powers! The next thing that is unclear: how dos
doubleapply to complex arguments? (Since the zeta function is defined for Re(z)>0 where z is complex.) – flawr – 2014-08-04T19:54:23.677@SimonKuang You may want to list those functions in your question. – The Guy with The Hat – 2014-08-04T20:16:46.627
2I was hovering over the submit post button right when it got closed. That's life I guess :P – Qwix – 2014-08-04T20:18:35.097