topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 2:08 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: programming language for math  (Read 6312 times)

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,823
    • View Profile
    • Donate to Member
programming language for math
« on: August 11, 2012, 04:28 PM »
hello!

which programming language is more fast at calculating math?

maybe machine language?

thanks!

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: programming language for math
« Reply #1 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 :-)
- carpe noctem

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: programming language for math
« Reply #2 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.

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,288
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: programming language for math
« Reply #3 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.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: programming language for math
« Reply #4 on: August 11, 2012, 05:18 PM »
I've read very good things about python with numpy. In particular, I found this article interesting: 10 Reasons Python Rocks for Research (And a Few Reasons it Doesn’t). I've never used it with that intent, though. And I agree with f0dder: you need to clarify a bit better your question :)

mahesh2k

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,426
    • View Profile
    • Donate to Member
Re: programming language for math
« Reply #5 on: August 11, 2012, 08:14 PM »
Julia

Check the performance.

http://julialang.org/

superboyac

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,347
    • View Profile
    • Donate to Member
Re: programming language for math
« Reply #6 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.

xtabber

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 618
    • View Profile
    • Donate to Member
Re: programming language for math
« Reply #7 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.

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: programming language for math
« Reply #9 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]

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,823
    • View Profile
    • Donate to Member
Re: programming language for math
« Reply #10 on: August 21, 2012, 04:41 PM »