Multiplies to _ and adds to _ calculator

Given that two real numbers multiply to one number and add to another, this program outputs the two numbers.

HTML

<form name="form1" method="post" action="" >
<table>
<tr><td>X*Y=-70</td>-70<td><input type="text" name="num1" id="num1" /></td></tr>
<tr><td>X+Y=3</td>3<td><input type="text" name="num2" id="num2" /></td></tr>
<tr><td>X=</td><td><input type="text" name="xres" id="xres" readonly /></td></tr>
<tr><td>Y=</td><td><input type="text" name="yres" id="yres" readonly /></td></tr>
</table>
</form>

JavaScript

$(document).ready(function() {
    //this calculates values automatically 
    func();
    $("#num1, #num2").on("keydown keyup", function() {
        func();
    });
});

function func() {
            var num1 = document.getElementById('num1').value;
            var num2 = document.getElementById('num2').value;
			var result = -2 * parseInt(num1) / (parseInt(num2) + Math.sqrt(parseInt(num2) * parseInt(num2) - 4 * parseInt(num1)));
			var result1 = -2 * parseInt(num1) / (parseInt(num2) - Math.sqrt(parseInt(num2) * parseInt(num2) - 4 * parseInt(num1)));
            if (!isNaN(result)) {
                document.getElementById('xres').value = result;
				document.getElementById('yres').value = result1;
            }
        }