Почему не хочет работать этот код?
function dis() {
var a = document.getElementById("input_a").value;
var b = document.getElementById("input_b").value;
var c = document.getElementById("input_c").value;
var d = Math.pow(b,2)-4*a*c;
document.write("Д= "+ Math.pow(b,2) +"-4*"+ a +"*" + c +" = "+ d);
if (d<0){
document.write(" - Корней нет!");
}else{
var x1 = (-b+Sqrt(d))/(2*a);
var x2 = (-b-Sqrt(d))/(2*a);
var x12_b = -b;
var x1_Sqrtd = Sqrt(d);
var x1_bSqrtd = -b+Sqrt(d);
var x2_Sqrtd = -Sqrt(d);
var x2_bSqrtd = -b-Sqrt(d);
document.write("<table style='text-align: center;' border='0' cellpadding='0' cellspacing='0'><tbody><tr><td colspan='1' rowspan='2' style='padding: 5px;'>x1 <b>=</b></td><td style='border-bottom: 1px solid #000000; padding-bottom: 2px;'>"+x12_b+"+"+x1_Sqrtd +"</td><td colspan='1' rowspan='2' style='padding: 5px;'><b>=</b></td><td style='border-bottom: 1px solid #000000; padding-bottom: 2px;'>"+x1_bSqrtd+"</td><td colspan='1' rowspan='2' style='padding: 5px;'><b>=</b> "+x1+"</td></tr><tr><td>2*"+a+"</td><td>"+2*a+"</td></tr></tbody></table>");
document.write("<table style='text-align: center;' border='0' cellpadding='0' cellspacing='0'><tbody><tr><td colspan='1' rowspan='2' style='padding: 5px;'>x2 <b>=</b></td><td style='border-bottom: 1px solid #000000; padding-bottom: 2px;'>"+x12_b+"-"+x2_Sqrtd+"</td><td colspan='1' rowspan='2' style='padding: 5px;'><b>=</b></td><td style='border-bottom: 1px solid #000000; padding-bottom: 2px;'>"+x2_bSqrtd+"</td><td colspan='1' rowspan='2' style='padding: 5px;'><b>=</b> "+x2+"</td></tr><tr><td>2*"+a+"</td><td>"+2*a+"</td></tr></tbody></table>");
}}