\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.85 \cdot 10^{-93}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{elif}\;b_2 \leq 2.7 \cdot 10^{-40}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{b_2}{a}, -\frac{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\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
(if (<= b_2 -1.85e-93)
(/ (* -0.5 c) b_2)
(if (<= b_2 2.7e-40)
(fma -1.0 (/ b_2 a) (- (/ (hypot b_2 (sqrt (* c (- a)))) a)))
(/ (* b_2 -2.0) a))))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 tmp;
if (b_2 <= -1.85e-93) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 2.7e-40) {
tmp = fma(-1.0, (b_2 / a), -(hypot(b_2, sqrt((c * -a))) / a));
} else {
tmp = (b_2 * -2.0) / a;
}
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)
tmp = 0.0
if (b_2 <= -1.85e-93)
tmp = Float64(Float64(-0.5 * c) / b_2);
elseif (b_2 <= 2.7e-40)
tmp = fma(-1.0, Float64(b_2 / a), Float64(-Float64(hypot(b_2, sqrt(Float64(c * Float64(-a)))) / a)));
else
tmp = Float64(Float64(b_2 * -2.0) / a);
end
return 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_] := If[LessEqual[b$95$2, -1.85e-93], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 2.7e-40], N[(-1.0 * N[(b$95$2 / a), $MachinePrecision] + (-N[(N[Sqrt[b$95$2 ^ 2 + N[Sqrt[N[(c * (-a)), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision] / a), $MachinePrecision])), $MachinePrecision], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision]]]
\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
↓
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.85 \cdot 10^{-93}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{elif}\;b_2 \leq 2.7 \cdot 10^{-40}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{b_2}{a}, -\frac{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 11.1 |
|---|
| Cost | 7432 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.85 \cdot 10^{-93}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{elif}\;b_2 \leq 7.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 13.4 |
|---|
| Cost | 7240 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.85 \cdot 10^{-93}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{elif}\;b_2 \leq 2.7 \cdot 10^{-48}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{c \cdot \left(-a\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 13.7 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.85 \cdot 10^{-93}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{elif}\;b_2 \leq 2.7 \cdot 10^{-48}:\\
\;\;\;\;\frac{-\sqrt{c \cdot \left(-a\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 39.4 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -4 \cdot 10^{-308}:\\
\;\;\;\;\frac{0}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{\frac{a}{b_2}}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 23.0 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.04 \cdot 10^{-190}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{\frac{a}{b_2}}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 23.0 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.04 \cdot 10^{-190}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{else}:\\
\;\;\;\;b_2 \cdot \frac{-2}{a}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 22.9 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.04 \cdot 10^{-190}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 53.2 |
|---|
| Cost | 388 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b_2 \leq -4 \cdot 10^{-308}:\\
\;\;\;\;\frac{0}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-b_2}{a}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 56.2 |
|---|
| Cost | 192 |
|---|
\[\frac{0}{a}
\]