\[ \begin{array}{c}[A, C] = \mathsf{sort}([A, C])\\ \end{array} \]
Math FPCore C Julia Wolfram TeX \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\]
↓
\[\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
\mathbf{if}\;B \leq -3.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)}\\
\mathbf{elif}\;B \leq 54:\\
\;\;\;\;\sqrt{\left(2 \cdot t_0\right) \cdot \left(F \cdot \left(A + A\right)\right)} \cdot \frac{1}{-t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\]
(FPCore (A B C F)
:precision binary64
(/
(-
(sqrt
(*
(* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(- (pow B 2.0) (* (* 4.0 A) C)))) ↓
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* C (* A -4.0)))))
(if (<= B -3.5e-67)
(* (/ (sqrt 2.0) B) (sqrt (* F (- A (hypot A B)))))
(if (<= B 54.0)
(* (sqrt (* (* 2.0 t_0) (* F (+ A A)))) (/ 1.0 (- t_0)))
(* (sqrt (* F (- A (hypot B A)))) (/ (- (sqrt 2.0)) B)))))) double code(double A, double B, double C, double F) {
return -sqrt(((2.0 * ((pow(B, 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / (pow(B, 2.0) - ((4.0 * A) * C));
}
↓
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (C * (A * -4.0)));
double tmp;
if (B <= -3.5e-67) {
tmp = (sqrt(2.0) / B) * sqrt((F * (A - hypot(A, B))));
} else if (B <= 54.0) {
tmp = sqrt(((2.0 * t_0) * (F * (A + A)))) * (1.0 / -t_0);
} else {
tmp = sqrt((F * (A - hypot(B, A)))) * (-sqrt(2.0) / B);
}
return tmp;
}
function code(A, B, C, F)
return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)))
end
↓
function code(A, B, C, F)
t_0 = fma(B, B, Float64(C * Float64(A * -4.0)))
tmp = 0.0
if (B <= -3.5e-67)
tmp = Float64(Float64(sqrt(2.0) / B) * sqrt(Float64(F * Float64(A - hypot(A, B)))));
elseif (B <= 54.0)
tmp = Float64(sqrt(Float64(Float64(2.0 * t_0) * Float64(F * Float64(A + A)))) * Float64(1.0 / Float64(-t_0)));
else
tmp = Float64(sqrt(Float64(F * Float64(A - hypot(B, A)))) * Float64(Float64(-sqrt(2.0)) / B));
end
return tmp
end
code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -3.5e-67], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[Sqrt[N[(F * N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 54.0], N[(N[Sqrt[N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / (-t$95$0)), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]]
\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
↓
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
\mathbf{if}\;B \leq -3.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)}\\
\mathbf{elif}\;B \leq 54:\\
\;\;\;\;\sqrt{\left(2 \cdot t_0\right) \cdot \left(F \cdot \left(A + A\right)\right)} \cdot \frac{1}{-t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
Alternatives Alternative 1 Error 34.6 Cost 21000
\[\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
\mathbf{if}\;B \leq -3.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)}\\
\mathbf{elif}\;B \leq 5 \cdot 10^{+15}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\]
Alternative 2 Error 38.2 Cost 20300
\[\begin{array}{l}
\mathbf{if}\;B \leq -2.4 \cdot 10^{-107}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{-\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(F \cdot C\right)\right)}\\
\mathbf{elif}\;B \leq 10^{+135}:\\
\;\;\;\;\frac{\sqrt{\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot \left(2 \cdot F\right)} \cdot \left(-B\right)}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\]
Alternative 3 Error 37.9 Cost 20168
\[\begin{array}{l}
\mathbf{if}\;B \leq -2.4 \cdot 10^{-107}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)}\\
\mathbf{elif}\;B \leq 8.2 \cdot 10^{-95}:\\
\;\;\;\;\frac{1}{-\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(F \cdot C\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\]
Alternative 4 Error 41.7 Cost 19972
\[\begin{array}{l}
\mathbf{if}\;B \leq -2.4 \cdot 10^{-107}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{-\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(F \cdot C\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot \left(2 \cdot F\right)} \cdot \left(-B\right)}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\
\end{array}
\]
Alternative 5 Error 45.6 Cost 14472
\[\begin{array}{l}
t_0 := \sqrt{\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot \left(2 \cdot F\right)}\\
\mathbf{if}\;B \leq -2.4 \cdot 10^{-107}:\\
\;\;\;\;\left(B \cdot t_0\right) \cdot \frac{1}{B \cdot B}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{-\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(F \cdot C\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 \cdot \left(-B\right)}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\
\end{array}
\]
Alternative 6 Error 47.4 Cost 14408
\[\begin{array}{l}
t_0 := \sqrt{\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot \left(2 \cdot F\right)}\\
\mathbf{if}\;B \leq -2.4 \cdot 10^{-107}:\\
\;\;\;\;\left(B \cdot t_0\right) \cdot \frac{1}{B \cdot B}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{-\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 \cdot \left(-B\right)}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\
\end{array}
\]
Alternative 7 Error 47.5 Cost 14344
\[\begin{array}{l}
t_0 := \sqrt{\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot \left(2 \cdot F\right)}\\
\mathbf{if}\;B \leq -2.4 \cdot 10^{-107}:\\
\;\;\;\;\left(B \cdot t_0\right) \cdot \frac{1}{B \cdot B}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{-\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 \cdot \left(-B\right)}{B \cdot B}\\
\end{array}
\]
Alternative 8 Error 53.0 Cost 13956
\[\begin{array}{l}
t_0 := \sqrt{\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot \left(2 \cdot F\right)}\\
\mathbf{if}\;B \leq -4.5 \cdot 10^{-146}:\\
\;\;\;\;\left(B \cdot t_0\right) \cdot \frac{1}{B \cdot B}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 \cdot \left(-B\right)}{B \cdot B}\\
\end{array}
\]
Alternative 9 Error 58.0 Cost 13760
\[\frac{\sqrt{\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot \left(2 \cdot F\right)} \cdot \left(-B\right)}{B \cdot B}
\]
Alternative 10 Error 61.6 Cost 64
\[0
\]