
(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 -2e+148)
(/ b (- a))
(if (<= b 2.1e-65)
(/ (- (sqrt (fma b b (* c (* a -4.0)))) b) (* a 2.0))
(/ c (- b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e+148) {
tmp = b / -a;
} else if (b <= 2.1e-65) {
tmp = (sqrt(fma(b, b, (c * (a * -4.0)))) - b) / (a * 2.0);
} else {
tmp = c / -b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -2e+148) tmp = Float64(b / Float64(-a)); elseif (b <= 2.1e-65) tmp = Float64(Float64(sqrt(fma(b, b, Float64(c * Float64(a * -4.0)))) - b) / Float64(a * 2.0)); else tmp = Float64(c / Float64(-b)); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -2e+148], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 2.1e-65], N[(N[(N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $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 -2 \cdot 10^{+148}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-65}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < -2.0000000000000001e148Initial program 43.8%
*-commutative43.8%
Simplified43.8%
Taylor expanded in b around -inf 97.9%
associate-*r/97.9%
mul-1-neg97.9%
Simplified97.9%
if -2.0000000000000001e148 < b < 2.10000000000000003e-65Initial program 79.7%
*-commutative79.7%
+-commutative79.7%
sqr-neg79.7%
unsub-neg79.7%
sqr-neg79.7%
fma-neg79.8%
distribute-lft-neg-in79.8%
*-commutative79.8%
*-commutative79.8%
distribute-rgt-neg-in79.8%
metadata-eval79.8%
Simplified79.8%
if 2.10000000000000003e-65 < b Initial program 9.8%
*-commutative9.8%
Simplified9.8%
Taylor expanded in b around inf 87.3%
associate-*r/87.3%
mul-1-neg87.3%
Simplified87.3%
Final simplification85.5%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e+144)
(/ b (- a))
(if (<= b 8.5e-65)
(/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))
(/ c (- b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e+144) {
tmp = b / -a;
} else if (b <= 8.5e-65) {
tmp = (sqrt(((b * b) - (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 <= (-8.2d+144)) then
tmp = b / -a
else if (b <= 8.5d-65) then
tmp = (sqrt(((b * b) - (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 <= -8.2e+144) {
tmp = b / -a;
} else if (b <= 8.5e-65) {
tmp = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.2e+144: tmp = b / -a elif b <= 8.5e-65: tmp = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0) else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.2e+144) tmp = Float64(b / Float64(-a)); elseif (b <= 8.5e-65) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - 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 <= -8.2e+144) tmp = b / -a; elseif (b <= 8.5e-65) tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0); else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.2e+144], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 8.5e-65], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $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 -8.2 \cdot 10^{+144}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{-65}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < -8.20000000000000002e144Initial program 43.8%
*-commutative43.8%
Simplified43.8%
Taylor expanded in b around -inf 97.9%
associate-*r/97.9%
mul-1-neg97.9%
Simplified97.9%
if -8.20000000000000002e144 < b < 8.5000000000000003e-65Initial program 79.7%
if 8.5000000000000003e-65 < b Initial program 9.8%
*-commutative9.8%
Simplified9.8%
Taylor expanded in b around inf 87.3%
associate-*r/87.3%
mul-1-neg87.3%
Simplified87.3%
Final simplification85.5%
(FPCore (a b c)
:precision binary64
(if (<= b -8e-35)
(/ b (- a))
(if (<= b 4.4e-145)
(/ (- (sqrt (* a (* c -4.0))) b) (* a 2.0))
(/ c (- b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8e-35) {
tmp = b / -a;
} else if (b <= 4.4e-145) {
tmp = (sqrt((a * (c * -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 <= (-8d-35)) then
tmp = b / -a
else if (b <= 4.4d-145) then
tmp = (sqrt((a * (c * (-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 <= -8e-35) {
tmp = b / -a;
} else if (b <= 4.4e-145) {
tmp = (Math.sqrt((a * (c * -4.0))) - b) / (a * 2.0);
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8e-35: tmp = b / -a elif b <= 4.4e-145: tmp = (math.sqrt((a * (c * -4.0))) - b) / (a * 2.0) else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8e-35) tmp = Float64(b / Float64(-a)); elseif (b <= 4.4e-145) tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -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 <= -8e-35) tmp = b / -a; elseif (b <= 4.4e-145) tmp = (sqrt((a * (c * -4.0))) - b) / (a * 2.0); else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8e-35], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 4.4e-145], N[(N[(N[Sqrt[N[(a * N[(c * -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 -8 \cdot 10^{-35}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{-145}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < -8.00000000000000006e-35Initial program 65.6%
*-commutative65.6%
Simplified65.6%
Taylor expanded in b around -inf 87.5%
associate-*r/87.5%
mul-1-neg87.5%
Simplified87.5%
if -8.00000000000000006e-35 < b < 4.39999999999999998e-145Initial program 80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in b around 0 69.2%
*-commutative69.2%
associate-*r*69.2%
Simplified69.2%
if 4.39999999999999998e-145 < b Initial program 14.3%
*-commutative14.3%
Simplified14.3%
Taylor expanded in b around inf 82.0%
associate-*r/82.0%
mul-1-neg82.0%
Simplified82.0%
Final simplification80.6%
(FPCore (a b c) :precision binary64 (if (<= b 2.7e-247) (/ b (- a)) (/ c (- b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 2.7e-247) {
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 <= 2.7d-247) 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 <= 2.7e-247) {
tmp = b / -a;
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 2.7e-247: tmp = b / -a else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 2.7e-247) 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 <= 2.7e-247) tmp = b / -a; else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 2.7e-247], N[(b / (-a)), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.7 \cdot 10^{-247}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < 2.70000000000000008e-247Initial program 71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in b around -inf 62.0%
associate-*r/62.0%
mul-1-neg62.0%
Simplified62.0%
if 2.70000000000000008e-247 < b Initial program 21.5%
*-commutative21.5%
Simplified21.5%
Taylor expanded in b around inf 74.0%
associate-*r/74.0%
mul-1-neg74.0%
Simplified74.0%
Final simplification67.4%
(FPCore (a b c) :precision binary64 (if (<= b 3.95e+127) (/ b (- a)) (/ c b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.95e+127) {
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.95d+127) 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.95e+127) {
tmp = b / -a;
} else {
tmp = c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.95e+127: tmp = b / -a else: tmp = c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.95e+127) 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.95e+127) tmp = b / -a; else tmp = c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.95e+127], N[(b / (-a)), $MachinePrecision], N[(c / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.95 \cdot 10^{+127}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b}\\
\end{array}
\end{array}
if b < 3.9499999999999998e127Initial program 58.6%
*-commutative58.6%
Simplified58.6%
Taylor expanded in b around -inf 42.9%
associate-*r/42.9%
mul-1-neg42.9%
Simplified42.9%
if 3.9499999999999998e127 < b Initial program 6.4%
*-commutative6.4%
Simplified6.4%
Taylor expanded in b around inf 76.9%
div-inv76.9%
associate-/l*85.6%
associate-*r*85.6%
*-commutative85.6%
add-sqr-sqrt41.8%
sqrt-unprod44.0%
swap-sqr43.9%
metadata-eval43.9%
metadata-eval43.9%
swap-sqr44.0%
sqrt-unprod18.4%
add-sqr-sqrt35.0%
*-commutative35.0%
associate-/r*35.0%
metadata-eval35.0%
Applied egg-rr35.0%
*-commutative35.0%
associate-*r/34.8%
associate-*l*34.8%
Simplified34.8%
Taylor expanded in a around 0 34.9%
Final simplification41.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 49.2%
*-commutative49.2%
Simplified49.2%
Taylor expanded in b around inf 25.8%
div-inv25.8%
associate-/l*28.6%
associate-*r*28.6%
*-commutative28.6%
add-sqr-sqrt14.7%
sqrt-unprod14.7%
swap-sqr14.7%
metadata-eval14.7%
metadata-eval14.7%
swap-sqr14.7%
sqrt-unprod4.4%
add-sqr-sqrt8.8%
*-commutative8.8%
associate-/r*8.8%
metadata-eval8.8%
Applied egg-rr8.8%
*-commutative8.8%
associate-*r/8.7%
associate-*l*8.7%
Simplified8.7%
Taylor expanded in a around 0 8.8%
(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 49.2%
*-commutative49.2%
Simplified49.2%
clear-num49.2%
inv-pow49.2%
Applied egg-rr23.1%
unpow-123.1%
Simplified23.1%
Taylor expanded in a around 0 2.4%
(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 2024088
(FPCore (a b c)
:name "The quadratic formula (r1)"
:precision binary64
:alt
(if (< b 0.0) (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)) (/ c (* a (/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))