Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Does there exist a Jar that solves Math Equation?

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Does there exist a Jar that solves Math Equation?

    Hi Guys

    I am recently working on a project that involves intensive math calculation, I want to be able to output numbers from a equation. Is there a Java library that support this function right now?

    for example:

    input:
    y = 2x + 5
    y = x

    output:
    y = -5
    x = -5

    Any comment or thoughts are appreciated.

    Thank you


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,307
    Thanks
    181
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

    Default Re: Does there exist a Jar that solves Math Equation?

    Have a look at the Apache commons math library. I haven't used it for this in particular, but probably has something in there worth trying.
    Commons Math: The Apache Commons Mathematics Library

  3. #3
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    939
    Thanks
    6
    Thanked 202 Times in 178 Posts

    Default Re: Does there exist a Jar that solves Math Equation?

    I would imagine that a lot depends on the sort of equations you are trying to solve. What characteristics do they have?

    The example you gave is an example of a pair of simultaneous linear equations. Wikipedia discusses them and the article may shed light on the Apache library (and similar). The devil - even with such "simple" equations - lies in the details: in this case the way the implementation handles efficiency and numerical accuracy. The beginning programmer is little interested in these subtleties and could probably write their own code more quickly than master the library usage. If, however, you are after serious mathematical horsepower then using the library and testing your code will require thinking about the mathematics behind the library.

  4. #4
    Junior Member
    Join Date
    Jun 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Does there exist a Jar that solves Math Equation?

    Quote Originally Posted by copeg View Post
    Have a look at the Apache commons math library. I haven't used it for this in particular, but probably has something in there worth trying.
    Commons Math: The Apache Commons Mathematics Library
    Thanks for commenting, I've tried this from the Common Math library. The Commons Math User Guide - Linear Algebra and it works for linear equations. I wonder if they have a way for quadratic equations. Gonna look into it a bit more.

Similar Threads

  1. quadratic equation solver help!
    By overlord in forum Algorithms & Recursion
    Replies: 2
    Last Post: October 20th, 2011, 11:39 AM
  2. Confusion with Math.toDegrees() and Math.toRadians(). Please help.
    By marksquall in forum Java Theory & Questions
    Replies: 3
    Last Post: June 23rd, 2011, 01:28 AM
  3. PROBLEM CHECKING IF RECORDS EXIST OR DO NOT EXIST IN DATABASE
    By jimmyb0206 in forum JDBC & Databases
    Replies: 1
    Last Post: April 10th, 2011, 09:18 AM
  4. Testing equation of a line
    By TimoElPrimo in forum Object Oriented Programming
    Replies: 8
    Last Post: February 22nd, 2011, 11:40 PM
  5. Linear Equation Help !!!
    By thangavel in forum Algorithms & Recursion
    Replies: 1
    Last Post: January 13th, 2011, 05:32 AM