+1  A: 

Unless you mean something else you can solve exactly if you know y and z (or to the tolerance of your numerical representaion for e.g. float)

x = -(y+z)

if you don't know y and z then there are infinite possible answers

i'm guessing the question is missing something?

jk
see edit, sorry for the confusion
geejay
no problem, MikeT's answer has some good looking options, glad to see this didnt turn out to be a floating point representation misunderstanding
jk
+2  A: 

I don't write much Java myself, but it sounds like you want a nonlinear solver. Java Numerics has links to many different numerical Java libraries. I think you could also call C libraries from Java, so you could use GNU Scientific Library. Just search for nonlinear solver/optimization in those pages.

MikeT
thanks. Turns out its the Bisection algorithm I was looking for. Already implemented it countless times :) http://en.wikipedia.org/wiki/Bisection_method. Here is the link to the library that has it:http://opsresearch.com/OR-Objects/api/drasys/or/nonlinear/Bisection.html
geejay
A: 

As you stated in a comment, the Bisection algorithm is one way of solving this problem. Problems of this type are generally referred to as root-finding algorithms, of which there are many. Probably the most powerful(Or at least, the most popular) is the Newton-Raphson method, if you know that your function is differentiable. However, you can find pretty good implementations of many different solvers (including a Bisection and Newton solver) in the Apache Commons Math package.

Scott Fines
A: 

I like the JScience library for such things. This example implements the Durand-Kerner-Weierstrass method to find the roots of a univariate polynomial with complex coefficients.

trashgod