Math FPCore C Java Python Julia MATLAB Wolfram TeX \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;b \leq -2.6 \cdot 10^{-33}:\\
\;\;\;\;\frac{-c}{b}\\
\mathbf{elif}\;b \leq -1 \cdot 10^{-95}:\\
\;\;\;\;\frac{c \cdot -2}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\
\mathbf{elif}\;b \leq 3 \cdot 10^{+135}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-b}{a}\\
\end{array}
\]
(FPCore (a b c)
:precision binary64
(/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a))) ↓
(FPCore (a b c)
:precision binary64
(if (<= b -2.6e-33)
(/ (- c) b)
(if (<= b -1e-95)
(/ (* c -2.0) (- b (hypot b (sqrt (* a (* c -4.0))))))
(if (<= b 3e+135)
(/ (- (- b) (sqrt (- (* b b) (* 4.0 (* c a))))) (* a 2.0))
(/ (- b) a))))) double code(double a, double b, double c) {
return (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
↓
double code(double a, double b, double c) {
double tmp;
if (b <= -2.6e-33) {
tmp = -c / b;
} else if (b <= -1e-95) {
tmp = (c * -2.0) / (b - hypot(b, sqrt((a * (c * -4.0)))));
} else if (b <= 3e+135) {
tmp = (-b - sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0);
} else {
tmp = -b / a;
}
return tmp;
}
public static double code(double a, double b, double c) {
return (-b - Math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
↓
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.6e-33) {
tmp = -c / b;
} else if (b <= -1e-95) {
tmp = (c * -2.0) / (b - Math.hypot(b, Math.sqrt((a * (c * -4.0)))));
} else if (b <= 3e+135) {
tmp = (-b - Math.sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0);
} else {
tmp = -b / a;
}
return tmp;
}
def code(a, b, c):
return (-b - math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a)
↓
def code(a, b, c):
tmp = 0
if b <= -2.6e-33:
tmp = -c / b
elif b <= -1e-95:
tmp = (c * -2.0) / (b - math.hypot(b, math.sqrt((a * (c * -4.0)))))
elif b <= 3e+135:
tmp = (-b - math.sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0)
else:
tmp = -b / a
return tmp
function code(a, b, c)
return Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))) / Float64(2.0 * a))
end
↓
function code(a, b, c)
tmp = 0.0
if (b <= -2.6e-33)
tmp = Float64(Float64(-c) / b);
elseif (b <= -1e-95)
tmp = Float64(Float64(c * -2.0) / Float64(b - hypot(b, sqrt(Float64(a * Float64(c * -4.0))))));
elseif (b <= 3e+135)
tmp = Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(c * a))))) / Float64(a * 2.0));
else
tmp = Float64(Float64(-b) / a);
end
return tmp
end
function tmp = code(a, b, c)
tmp = (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
end
↓
function tmp_2 = code(a, b, c)
tmp = 0.0;
if (b <= -2.6e-33)
tmp = -c / b;
elseif (b <= -1e-95)
tmp = (c * -2.0) / (b - hypot(b, sqrt((a * (c * -4.0)))));
elseif (b <= 3e+135)
tmp = (-b - sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0);
else
tmp = -b / a;
end
tmp_2 = tmp;
end
code[a_, b_, c_] := N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
↓
code[a_, b_, c_] := If[LessEqual[b, -2.6e-33], N[((-c) / b), $MachinePrecision], If[LessEqual[b, -1e-95], N[(N[(c * -2.0), $MachinePrecision] / N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e+135], N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[((-b) / a), $MachinePrecision]]]]
\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}
↓
\begin{array}{l}
\mathbf{if}\;b \leq -2.6 \cdot 10^{-33}:\\
\;\;\;\;\frac{-c}{b}\\
\mathbf{elif}\;b \leq -1 \cdot 10^{-95}:\\
\;\;\;\;\frac{c \cdot -2}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\
\mathbf{elif}\;b \leq 3 \cdot 10^{+135}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-b}{a}\\
\end{array}