DonationCoder.com Forum

Main Area and Open Discussion => General Software Discussion => Topic started by: kalos on August 11, 2012, 04:28 PM

Title: programming language for math
Post by: kalos on August 11, 2012, 04:28 PM
hello!

which programming language is more fast at calculating math?

maybe machine language?

thanks!
Title: Re: programming language for math
Post by: f0dder on August 11, 2012, 04:44 PM
Define "fast".
Define "math".

Nothing beats assembly code hand-tuned for a specific CPU... but that might take prohibitively much longer time to write than some higher-level language, and sometimes for marginal gains. You're best off using some language that's math-friendly and has optimized standard (math) libraries, then perhaps hand-tuning your code once you've got your algorithms working correctly.

But all the above is hand-waving as long as your question is so general :-)
Title: Re: programming language for math
Post by: Shades on August 11, 2012, 04:50 PM
'R' is a (and for some, THE) programming language for math. Maybe that could be the answer to the question.
Title: Re: programming language for math
Post by: Renegade on August 11, 2012, 05:10 PM
I suppose some options are:

R (mostly for stats from what I've heard people talk about - not sure about performance)
C
Fortran (this is a Ferrari for performance)
Matlab (think of this as for prototyping)

The entire class of functional languages are well suited to math:

F#
Erlang
etc. etc.

Lisp is highly performant, and a darling in academia. Might be worth looking at.

But as f0dder said, the lowest level languages are going to take forever to program in. ASM (etc.) probably isn't worth even looking at. You can just buy more computing power, and it will likely be cheaper than your development time.
Title: Re: programming language for math
Post by: jgpaiva on August 11, 2012, 05:18 PM
I've read very good things about python with numpy (http://numpy.scipy.org/). In particular, I found this article interesting: 10 Reasons Python Rocks for Research (And a Few Reasons it Doesn’t) (http://www.stat.washington.edu/~hoytak/blog/whypython.html). I've never used it with that intent, though. And I agree with f0dder: you need to clarify a bit better your question :)
Title: Re: programming language for math
Post by: mahesh2k on August 11, 2012, 08:14 PM
Julia

Check the performance.

http://julialang.org/
Title: Re: programming language for math
Post by: superboyac on August 12, 2012, 02:50 AM
I suppose some options are:

R (mostly for stats from what I've heard people talk about - not sure about performance)
C
Fortran (this is a Ferrari for performance)
Matlab (think of this as for prototyping)

The entire class of functional languages are well suited to math:

F#
Erlang
etc. etc.

Lisp is highly performant, and a darling in academia. Might be worth looking at.

But as f0dder said, the lowest level languages are going to take forever to program in. ASM (etc.) probably isn't worth even looking at. You can just buy more computing power, and it will likely be cheaper than your development time.

juicy post!  good stuff.
Title: Re: programming language for math
Post by: xtabber on August 14, 2012, 08:57 AM
That depends on what you mean by "calculating math."

If you are talking about writing high-performance software, most high speed math libraries are written in C, and most C compilers provide optimization choices to help speed up math routines. Depending on whether or not you will be working in floating point also makes a difference -- there are libraries optimized for math co-processors and parallel processing, and for nearly any math functions you might desire.  Fortran is still widely used because it is easier to program (for mathematicians) but not as efficient or flexible as C/C++.

If you are talking about the need to quickly implement a variety of math calculations, processing speed is not as important a factor as the ability to use existing routines that are known to do the job properly. There are many specialized math programming systems, most of them pricey, favored by different folks in different fields: Mathematica, Matlab, Gauss, etc..  R is a good choice for statistics, but is inefficient on large data sets.
Title: Re: programming language for math
Post by: Curt on August 21, 2012, 07:39 AM
http://www.giveawayoftheday.com/doronix-math-toolbox/
Title: Re: programming language for math
Post by: Shades on August 21, 2012, 12:47 PM
@Curt:
I am interested in this piece of software, but...

[Off-topic]
Does anyone else experience trouble accessing the giveawayoftheday website? It is now already about a month I cannot access any content from anywhere in Paraguay, I just get blank pages.
[/Off-topic]
Title: Re: programming language for math
Post by: kalos on August 21, 2012, 04:41 PM
http://www.giveawayoftheday.com/doronix-math-toolbox/


this is great, thanks!