f[0] = 0; f[1] = 1; f[x_] := f[x-1] + f[x-2]
这个功能在Mathematica中运行缓慢,我需要提高速度.我必须使用函数式编程和递归.我不确定为什么这么慢,甚至最轻微的想法如何改善这将是有帮助的.
performance wolfram-mathematica fibonacci
fibonacci ×1
performance ×1
wolfram-mathematica ×1