
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\end{array}
(FPCore (a b c)
:precision binary64
(if (<= b -4.4e+121)
(/ b (- a))
(if (<= b 2.5e-10)
(/ (- (sqrt (- (* b b) (* (* a 4.0) c))) b) (* a 2.0))
(/ c (- b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.4e+121) {
tmp = b / -a;
} else if (b <= 2.5e-10) {
tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
} else {
tmp = c / -b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-4.4d+121)) then
tmp = b / -a
else if (b <= 2.5d-10) then
tmp = (sqrt(((b * b) - ((a * 4.0d0) * c))) - b) / (a * 2.0d0)
else
tmp = c / -b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.4e+121) {
tmp = b / -a;
} else if (b <= 2.5e-10) {
tmp = (Math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.4e+121: tmp = b / -a elif b <= 2.5e-10: tmp = (math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0) else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.4e+121) tmp = Float64(b / Float64(-a)); elseif (b <= 2.5e-10) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 4.0) * c))) - b) / Float64(a * 2.0)); else tmp = Float64(c / Float64(-b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.4e+121) tmp = b / -a; elseif (b <= 2.5e-10) tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0); else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.4e+121], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 2.5e-10], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{+121}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < -4.40000000000000003e121Initial program 48.9%
*-commutative48.9%
Simplified49.1%
Taylor expanded in b around -inf 98.4%
associate-*r/98.4%
mul-1-neg98.4%
Simplified98.4%
if -4.40000000000000003e121 < b < 2.50000000000000016e-10Initial program 81.3%
if 2.50000000000000016e-10 < b Initial program 15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in a around 0 92.9%
associate-*r/92.9%
mul-1-neg92.9%
Simplified92.9%
Final simplification88.7%
(FPCore (a b c)
:precision binary64
(if (<= b -9.8e-116)
(/ b (- a))
(if (<= b 1.05e-25)
(/ (- (sqrt (* c (* a -4.0))) b) (* a 2.0))
(/ c (- b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -9.8e-116) {
tmp = b / -a;
} else if (b <= 1.05e-25) {
tmp = (sqrt((c * (a * -4.0))) - b) / (a * 2.0);
} else {
tmp = c / -b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-9.8d-116)) then
tmp = b / -a
else if (b <= 1.05d-25) then
tmp = (sqrt((c * (a * (-4.0d0)))) - b) / (a * 2.0d0)
else
tmp = c / -b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -9.8e-116) {
tmp = b / -a;
} else if (b <= 1.05e-25) {
tmp = (Math.sqrt((c * (a * -4.0))) - b) / (a * 2.0);
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -9.8e-116: tmp = b / -a elif b <= 1.05e-25: tmp = (math.sqrt((c * (a * -4.0))) - b) / (a * 2.0) else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -9.8e-116) tmp = Float64(b / Float64(-a)); elseif (b <= 1.05e-25) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -4.0))) - b) / Float64(a * 2.0)); else tmp = Float64(c / Float64(-b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -9.8e-116) tmp = b / -a; elseif (b <= 1.05e-25) tmp = (sqrt((c * (a * -4.0))) - b) / (a * 2.0); else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -9.8e-116], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 1.05e-25], N[(N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.8 \cdot 10^{-116}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{-25}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < -9.79999999999999955e-116Initial program 70.8%
*-commutative70.8%
Simplified70.9%
Taylor expanded in b around -inf 86.0%
associate-*r/86.0%
mul-1-neg86.0%
Simplified86.0%
if -9.79999999999999955e-116 < b < 1.05000000000000001e-25Initial program 70.8%
*-commutative70.8%
Simplified70.8%
Taylor expanded in a around inf 68.9%
associate-*r*69.0%
*-commutative69.0%
Simplified69.0%
if 1.05000000000000001e-25 < b Initial program 16.5%
*-commutative16.5%
Simplified16.5%
Taylor expanded in a around 0 91.8%
associate-*r/91.8%
mul-1-neg91.8%
Simplified91.8%
Final simplification83.5%
(FPCore (a b c) :precision binary64 (if (<= b -2.9e-121) (/ b (- a)) (if (<= b 2.4e-33) (* -0.5 (- (sqrt (* c (/ -4.0 a))))) (/ c (- b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.9e-121) {
tmp = b / -a;
} else if (b <= 2.4e-33) {
tmp = -0.5 * -sqrt((c * (-4.0 / a)));
} else {
tmp = c / -b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-2.9d-121)) then
tmp = b / -a
else if (b <= 2.4d-33) then
tmp = (-0.5d0) * -sqrt((c * ((-4.0d0) / a)))
else
tmp = c / -b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.9e-121) {
tmp = b / -a;
} else if (b <= 2.4e-33) {
tmp = -0.5 * -Math.sqrt((c * (-4.0 / a)));
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.9e-121: tmp = b / -a elif b <= 2.4e-33: tmp = -0.5 * -math.sqrt((c * (-4.0 / a))) else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.9e-121) tmp = Float64(b / Float64(-a)); elseif (b <= 2.4e-33) tmp = Float64(-0.5 * Float64(-sqrt(Float64(c * Float64(-4.0 / a))))); else tmp = Float64(c / Float64(-b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.9e-121) tmp = b / -a; elseif (b <= 2.4e-33) tmp = -0.5 * -sqrt((c * (-4.0 / a))); else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.9e-121], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 2.4e-33], N[(-0.5 * (-N[Sqrt[N[(c * N[(-4.0 / a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.9 \cdot 10^{-121}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-33}:\\
\;\;\;\;-0.5 \cdot \left(-\sqrt{c \cdot \frac{-4}{a}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < -2.9e-121Initial program 70.8%
*-commutative70.8%
Simplified70.9%
Taylor expanded in b around -inf 86.0%
associate-*r/86.0%
mul-1-neg86.0%
Simplified86.0%
if -2.9e-121 < b < 2.4e-33Initial program 70.8%
*-commutative70.8%
Simplified70.8%
add-cube-cbrt70.3%
pow370.3%
associate-*l*70.1%
Applied egg-rr70.1%
Taylor expanded in a around -inf 0.0%
rem-cube-cbrt0.0%
associate-/l*0.0%
unpow20.0%
rem-square-sqrt36.3%
Simplified36.3%
if 2.4e-33 < b Initial program 16.5%
*-commutative16.5%
Simplified16.5%
Taylor expanded in a around 0 91.8%
associate-*r/91.8%
mul-1-neg91.8%
Simplified91.8%
Final simplification75.3%
(FPCore (a b c) :precision binary64 (if (<= b 1.35e-304) (/ b (- a)) (/ c (- b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.35e-304) {
tmp = b / -a;
} else {
tmp = c / -b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 1.35d-304) then
tmp = b / -a
else
tmp = c / -b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 1.35e-304) {
tmp = b / -a;
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.35e-304: tmp = b / -a else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.35e-304) tmp = Float64(b / Float64(-a)); else tmp = Float64(c / Float64(-b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.35e-304) tmp = b / -a; else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.35e-304], N[(b / (-a)), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.35 \cdot 10^{-304}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < 1.35000000000000005e-304Initial program 70.9%
*-commutative70.9%
Simplified71.0%
Taylor expanded in b around -inf 75.0%
associate-*r/75.0%
mul-1-neg75.0%
Simplified75.0%
if 1.35000000000000005e-304 < b Initial program 35.5%
*-commutative35.5%
Simplified35.5%
Taylor expanded in a around 0 65.2%
associate-*r/65.2%
mul-1-neg65.2%
Simplified65.2%
Final simplification70.4%
(FPCore (a b c) :precision binary64 (if (<= b 3.05e-30) (/ b (- a)) (/ c b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.05e-30) {
tmp = b / -a;
} else {
tmp = c / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 3.05d-30) then
tmp = b / -a
else
tmp = c / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 3.05e-30) {
tmp = b / -a;
} else {
tmp = c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.05e-30: tmp = b / -a else: tmp = c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.05e-30) tmp = Float64(b / Float64(-a)); else tmp = Float64(c / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3.05e-30) tmp = b / -a; else tmp = c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.05e-30], N[(b / (-a)), $MachinePrecision], N[(c / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.05 \cdot 10^{-30}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b}\\
\end{array}
\end{array}
if b < 3.0499999999999999e-30Initial program 70.8%
*-commutative70.8%
Simplified70.8%
Taylor expanded in b around -inf 58.0%
associate-*r/58.0%
mul-1-neg58.0%
Simplified58.0%
if 3.0499999999999999e-30 < b Initial program 16.5%
*-commutative16.5%
Simplified16.5%
Applied egg-rr6.7%
unpow-16.7%
associate-/l*6.7%
Simplified6.7%
Taylor expanded in b around -inf 33.1%
Final simplification50.5%
(FPCore (a b c) :precision binary64 (/ c b))
double code(double a, double b, double c) {
return c / b;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c / b
end function
public static double code(double a, double b, double c) {
return c / b;
}
def code(a, b, c): return c / b
function code(a, b, c) return Float64(c / b) end
function tmp = code(a, b, c) tmp = c / b; end
code[a_, b_, c_] := N[(c / b), $MachinePrecision]
\begin{array}{l}
\\
\frac{c}{b}
\end{array}
Initial program 54.4%
*-commutative54.4%
Simplified54.5%
Applied egg-rr32.1%
unpow-132.1%
associate-/l*32.1%
Simplified32.1%
Taylor expanded in b around -inf 11.9%
(FPCore (a b c) :precision binary64 (/ b a))
double code(double a, double b, double c) {
return b / a;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b / a
end function
public static double code(double a, double b, double c) {
return b / a;
}
def code(a, b, c): return b / a
function code(a, b, c) return Float64(b / a) end
function tmp = code(a, b, c) tmp = b / a; end
code[a_, b_, c_] := N[(b / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{a}
\end{array}
Initial program 54.4%
*-commutative54.4%
Simplified54.5%
Applied egg-rr32.1%
unpow-132.1%
associate-/l*32.1%
Simplified32.1%
Taylor expanded in a around 0 2.3%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
(if (< b 0.0)
(/ (+ (- b) t_0) (* 2.0 a))
(/ c (* a (/ (- (- b) t_0) (* 2.0 a)))))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
double tmp;
if (b < 0.0) {
tmp = (-b + t_0) / (2.0 * a);
} else {
tmp = c / (a * ((-b - t_0) / (2.0 * a)));
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(((b * b) - ((4.0d0 * a) * c)))
if (b < 0.0d0) then
tmp = (-b + t_0) / (2.0d0 * a)
else
tmp = c / (a * ((-b - t_0) / (2.0d0 * a)))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt(((b * b) - ((4.0 * a) * c)));
double tmp;
if (b < 0.0) {
tmp = (-b + t_0) / (2.0 * a);
} else {
tmp = c / (a * ((-b - t_0) / (2.0 * a)));
}
return tmp;
}
def code(a, b, c): t_0 = math.sqrt(((b * b) - ((4.0 * a) * c))) tmp = 0 if b < 0.0: tmp = (-b + t_0) / (2.0 * a) else: tmp = c / (a * ((-b - t_0) / (2.0 * a))) return tmp
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) tmp = 0.0 if (b < 0.0) tmp = Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a)); else tmp = Float64(c / Float64(a * Float64(Float64(Float64(-b) - t_0) / Float64(2.0 * a)))); end return tmp end
function tmp_2 = code(a, b, c) t_0 = sqrt(((b * b) - ((4.0 * a) * c))); tmp = 0.0; if (b < 0.0) tmp = (-b + t_0) / (2.0 * a); else tmp = c / (a * ((-b - t_0) / (2.0 * a))); end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Less[b, 0.0], N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(c / N[(a * N[(N[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\
\mathbf{if}\;b < 0:\\
\;\;\;\;\frac{\left(-b\right) + t\_0}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) - t\_0}{2 \cdot a}}\\
\end{array}
\end{array}
herbie shell --seed 2024186
(FPCore (a b c)
:name "The quadratic formula (r1)"
:precision binary64
:alt
(! :herbie-platform default (let ((d (- (* b b) (* (* 4 a) c)))) (let ((r1 (/ (+ (- b) (sqrt d)) (* 2 a)))) (let ((r2 (/ (- (- b) (sqrt d)) (* 2 a)))) (if (< b 0) r1 (/ c (* a r2)))))))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))