\[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\]
↓
\[\begin{array}{l}
t_0 := a \cdot \left(-c\right)\\
\mathbf{if}\;b_2 \leq -2.7 \cdot 10^{+148}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 1.12 \cdot 10^{-205}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 3.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{t_0}{b_2 + \mathsf{hypot}\left(b_2, \sqrt{t_0}\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\
\end{array}
\]
(FPCore (a b_2 c)
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
↓
(FPCore (a b_2 c)
:precision binary64
(let* ((t_0 (* a (- c))))
(if (<= b_2 -2.7e+148)
(+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2)))
(if (<= b_2 1.12e-205)
(/ (- (sqrt (- (* b_2 b_2) (* a c))) b_2) a)
(if (<= b_2 3.5e-43)
(/ (/ t_0 (+ b_2 (hypot b_2 (sqrt t_0)))) a)
(* (/ c b_2) -0.5))))))double code(double a, double b_2, double c) {
return (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
}
↓
double code(double a, double b_2, double c) {
double t_0 = a * -c;
double tmp;
if (b_2 <= -2.7e+148) {
tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
} else if (b_2 <= 1.12e-205) {
tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a;
} else if (b_2 <= 3.5e-43) {
tmp = (t_0 / (b_2 + hypot(b_2, sqrt(t_0)))) / a;
} else {
tmp = (c / b_2) * -0.5;
}
return tmp;
}
public static double code(double a, double b_2, double c) {
return (-b_2 + Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
}
↓
public static double code(double a, double b_2, double c) {
double t_0 = a * -c;
double tmp;
if (b_2 <= -2.7e+148) {
tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
} else if (b_2 <= 1.12e-205) {
tmp = (Math.sqrt(((b_2 * b_2) - (a * c))) - b_2) / a;
} else if (b_2 <= 3.5e-43) {
tmp = (t_0 / (b_2 + Math.hypot(b_2, Math.sqrt(t_0)))) / a;
} else {
tmp = (c / b_2) * -0.5;
}
return tmp;
}
def code(a, b_2, c):
return (-b_2 + math.sqrt(((b_2 * b_2) - (a * c)))) / a
↓
def code(a, b_2, c):
t_0 = a * -c
tmp = 0
if b_2 <= -2.7e+148:
tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2))
elif b_2 <= 1.12e-205:
tmp = (math.sqrt(((b_2 * b_2) - (a * c))) - b_2) / a
elif b_2 <= 3.5e-43:
tmp = (t_0 / (b_2 + math.hypot(b_2, math.sqrt(t_0)))) / a
else:
tmp = (c / b_2) * -0.5
return tmp
function code(a, b_2, c)
return Float64(Float64(Float64(-b_2) + sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a)
end
↓
function code(a, b_2, c)
t_0 = Float64(a * Float64(-c))
tmp = 0.0
if (b_2 <= -2.7e+148)
tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + Float64(0.5 * Float64(c / b_2)));
elseif (b_2 <= 1.12e-205)
tmp = Float64(Float64(sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c))) - b_2) / a);
elseif (b_2 <= 3.5e-43)
tmp = Float64(Float64(t_0 / Float64(b_2 + hypot(b_2, sqrt(t_0)))) / a);
else
tmp = Float64(Float64(c / b_2) * -0.5);
end
return tmp
end
function tmp = code(a, b_2, c)
tmp = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
end
↓
function tmp_2 = code(a, b_2, c)
t_0 = a * -c;
tmp = 0.0;
if (b_2 <= -2.7e+148)
tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
elseif (b_2 <= 1.12e-205)
tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a;
elseif (b_2 <= 3.5e-43)
tmp = (t_0 / (b_2 + hypot(b_2, sqrt(t_0)))) / a;
else
tmp = (c / b_2) * -0.5;
end
tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := N[(N[((-b$95$2) + N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
↓
code[a_, b$95$2_, c_] := Block[{t$95$0 = N[(a * (-c)), $MachinePrecision]}, If[LessEqual[b$95$2, -2.7e+148], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 1.12e-205], N[(N[(N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b$95$2), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, 3.5e-43], N[(N[(t$95$0 / N[(b$95$2 + N[Sqrt[b$95$2 ^ 2 + N[Sqrt[t$95$0], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(c / b$95$2), $MachinePrecision] * -0.5), $MachinePrecision]]]]]
\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
↓
\begin{array}{l}
t_0 := a \cdot \left(-c\right)\\
\mathbf{if}\;b_2 \leq -2.7 \cdot 10^{+148}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 1.12 \cdot 10^{-205}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 3.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{t_0}{b_2 + \mathsf{hypot}\left(b_2, \sqrt{t_0}\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 13.6 |
|---|
| Cost | 35792 |
|---|
\[\begin{array}{l}
t_0 := \frac{c}{b_2} \cdot -0.5\\
t_1 := \frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-280}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 13.5 |
|---|
| Cost | 7176 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -2.55 \cdot 10^{-80}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 4.8 \cdot 10^{-52}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(-c\right)} - b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 22.4 |
|---|
| Cost | 836 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq 0:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} + b_2 \cdot \frac{-2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 22.3 |
|---|
| Cost | 836 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq 0:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 39.1 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -2.55 \cdot 10^{-263}:\\
\;\;\;\;b_2 \cdot \frac{-2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{a}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 22.7 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq 4.5 \cdot 10^{-281}:\\
\;\;\;\;b_2 \cdot \frac{-2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5}{\frac{b_2}{c}}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 22.6 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq 4.5 \cdot 10^{-281}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.5}{\frac{b_2}{c}}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 22.4 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq 4.5 \cdot 10^{-281}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b_2}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 22.4 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq 4.5 \cdot 10^{-281}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 53.2 |
|---|
| Cost | 388 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -2.55 \cdot 10^{-263}:\\
\;\;\;\;\frac{-b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{a}\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 56.3 |
|---|
| Cost | 192 |
|---|
\[\frac{0}{a}
\]