This Java Script solves the Diophantine equation ax + by + cz = d in integers.

Method

Let p = GCD(a,b), a' = a/p, b' = b/p
Let u_{0} and v_{0} any solution of a'u + b'v = c
z_{0}, t_{0} any solution of cz + pt = d
x_{0}, y_{0} any solution of a'x + b'y = t_{0} The general solution of ax + by + cz = d is :
x = x_{0} + b'k - u_{0}m
y = y_{0} - a'k - v_{0}m
z = z_{0} + pm
with k and m any integer in Z

Of course GCD(a,b,c) must divide d, which is checked when solving cz + pt = d.