ABCF->ab-angle a

Percentage Accurate: 18.8% → 52.4%
Time: 28.0s
Alternatives: 14
Speedup: 6.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0} \end{array} \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
   (/
    (-
     (sqrt
      (*
       (* 2.0 (* t_0 F))
       (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
    t_0)))
double code(double A, double B, double C, double F) {
	double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
	return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
    code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
	return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F):
	t_0 = math.pow(B, 2.0) - ((4.0 * A) * C)
	return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F)
	t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0)
end
function tmp = code(A, B, C, F)
	t_0 = (B ^ 2.0) - ((4.0 * A) * C);
	tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0;
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * 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]) / t$95$0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 18.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0} \end{array} \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
   (/
    (-
     (sqrt
      (*
       (* 2.0 (* t_0 F))
       (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
    t_0)))
double code(double A, double B, double C, double F) {
	double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
	return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
    code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
	return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F):
	t_0 = math.pow(B, 2.0) - ((4.0 * A) * C)
	return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F)
	t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0)
end
function tmp = code(A, B, C, F)
	t_0 = (B ^ 2.0) - ((4.0 * A) * C);
	tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0;
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * 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]) / t$95$0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}

Alternative 1: 52.4% accurate, 1.2× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 10^{+139}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= (pow B 2.0) 1e+139)
   (/
    (*
     (sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
     (- (sqrt (+ A (+ C (hypot B (- A C)))))))
    (- (* B B) (* (* A C) 4.0)))
   (* (* (sqrt (+ C (hypot C B))) (sqrt F)) (/ (- (sqrt 2.0)) B))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 1e+139) {
		tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	} else {
		tmp = (sqrt((C + hypot(C, B))) * sqrt(F)) * (-sqrt(2.0) / B);
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (Math.pow(B, 2.0) <= 1e+139) {
		tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -Math.sqrt((A + (C + Math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	} else {
		tmp = (Math.sqrt((C + Math.hypot(C, B))) * Math.sqrt(F)) * (-Math.sqrt(2.0) / B);
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if math.pow(B, 2.0) <= 1e+139:
		tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -math.sqrt((A + (C + math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0))
	else:
		tmp = (math.sqrt((C + math.hypot(C, B))) * math.sqrt(F)) * (-math.sqrt(2.0) / B)
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 1e+139)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)));
	else
		tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if ((B ^ 2.0) <= 1e+139)
		tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	else
		tmp = (sqrt((C + hypot(C, B))) * sqrt(F)) * (-sqrt(2.0) / B);
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+139], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 10^{+139}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 1.00000000000000003e139

    1. Initial program 25.9%

      \[\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} \]
    2. Simplified25.9%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Step-by-step derivation
      1. sqrt-prod28.2%

        \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. *-commutative28.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)}} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv28.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \color{blue}{\left(B \cdot B + \left(-4\right) \cdot \left(A \cdot C\right)\right)}\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. metadata-eval28.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. associate-+l+28.5%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{\color{blue}{A + \left(C + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      6. unpow228.5%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{A + \left(C + \sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      7. hypot-udef41.5%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{A + \left(C + \color{blue}{\mathsf{hypot}\left(B, A - C\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr41.5%

      \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 1.00000000000000003e139 < (pow.f64 B 2)

    1. Initial program 12.1%

      \[\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} \]
    2. Simplified12.1%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in A around 0 7.3%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg7.3%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. distribute-rgt-neg-in7.3%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
      3. +-commutative7.3%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}\right)}\right) \]
      4. unpow27.3%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \sqrt{\color{blue}{C \cdot C} + {B}^{2}}\right)}\right) \]
      5. unpow27.3%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \sqrt{C \cdot C + \color{blue}{B \cdot B}}\right)}\right) \]
      6. hypot-def24.5%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(C, B\right)}\right)}\right) \]
    5. Simplified24.5%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. pow1/224.5%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{{\left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}^{0.5}}\right) \]
      2. *-commutative24.5%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{\color{blue}{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot F\right)}}^{0.5}\right) \]
      3. unpow-prod-down34.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{{\left(C + \mathsf{hypot}\left(C, B\right)\right)}^{0.5} \cdot {F}^{0.5}}\right) \]
      4. pow1/234.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{C + \mathsf{hypot}\left(C, B\right)}} \cdot {F}^{0.5}\right) \]
      5. pow1/234.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(C, B\right)} \cdot \color{blue}{\sqrt{F}}\right) \]
    7. Applied egg-rr34.9%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{C + \mathsf{hypot}\left(C, B\right)} \cdot \sqrt{F}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification38.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 10^{+139}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]

Alternative 2: 52.6% accurate, 1.5× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 1.75 \cdot 10^{+55}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= B 1.75e+55)
   (/
    (*
     (sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
     (- (sqrt (+ A (+ C (hypot B (- A C)))))))
    (- (* B B) (* (* A C) 4.0)))
   (* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ A (hypot B A))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 1.75e+55) {
		tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((A + hypot(B, A))));
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 1.75e+55) {
		tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -Math.sqrt((A + (C + Math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	} else {
		tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(F) * -Math.sqrt((A + Math.hypot(B, A))));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if B <= 1.75e+55:
		tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -math.sqrt((A + (C + math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0))
	else:
		tmp = (math.sqrt(2.0) / B) * (math.sqrt(F) * -math.sqrt((A + math.hypot(B, A))))
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 1.75e+55)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(Float64(A + hypot(B, A))))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (B <= 1.75e+55)
		tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	else
		tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((A + hypot(B, A))));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[B, 1.75e+55], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.75 \cdot 10^{+55}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.75000000000000005e55

    1. Initial program 23.0%

      \[\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} \]
    2. Simplified23.0%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Step-by-step derivation
      1. sqrt-prod26.0%

        \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. *-commutative26.0%

        \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)}} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv26.0%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \color{blue}{\left(B \cdot B + \left(-4\right) \cdot \left(A \cdot C\right)\right)}\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. metadata-eval26.0%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. associate-+l+26.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{\color{blue}{A + \left(C + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      6. unpow226.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{A + \left(C + \sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      7. hypot-udef35.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{A + \left(C + \color{blue}{\mathsf{hypot}\left(B, A - C\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr35.2%

      \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 1.75000000000000005e55 < B

    1. Initial program 6.6%

      \[\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} \]
    2. Simplified6.6%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 13.9%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg13.9%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in13.9%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative13.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow213.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow213.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def55.0%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified55.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. sqrt-prod74.8%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}}\right) \]
    7. Applied egg-rr74.8%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.75 \cdot 10^{+55}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right)\\ \end{array} \]

Alternative 3: 50.1% accurate, 1.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 1.02 \cdot 10^{+71}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B}\right)\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= B 1.02e+71)
   (/
    (*
     (sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
     (- (sqrt (+ A (+ C (hypot B (- A C)))))))
    (- (* B B) (* (* A C) 4.0)))
   (* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt B))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 1.02e+71) {
		tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt(B));
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 1.02e+71) {
		tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -Math.sqrt((A + (C + Math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	} else {
		tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(F) * -Math.sqrt(B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if B <= 1.02e+71:
		tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -math.sqrt((A + (C + math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0))
	else:
		tmp = (math.sqrt(2.0) / B) * (math.sqrt(F) * -math.sqrt(B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 1.02e+71)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (B <= 1.02e+71)
		tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	else
		tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt(B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[B, 1.02e+71], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.02 \cdot 10^{+71}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.02000000000000003e71

    1. Initial program 23.0%

      \[\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} \]
    2. Simplified23.0%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Step-by-step derivation
      1. sqrt-prod26.0%

        \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. *-commutative26.0%

        \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)}} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv26.0%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \color{blue}{\left(B \cdot B + \left(-4\right) \cdot \left(A \cdot C\right)\right)}\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. metadata-eval26.0%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. associate-+l+26.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{\color{blue}{A + \left(C + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      6. unpow226.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{A + \left(C + \sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      7. hypot-udef35.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{A + \left(C + \color{blue}{\mathsf{hypot}\left(B, A - C\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr35.2%

      \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 1.02000000000000003e71 < B

    1. Initial program 6.6%

      \[\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} \]
    2. Simplified6.6%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 13.9%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg13.9%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in13.9%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative13.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow213.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow213.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def55.0%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified55.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. sqrt-prod74.8%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}}\right) \]
    7. Applied egg-rr74.8%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}}\right) \]
    8. Taylor expanded in A around 0 67.1%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F} \cdot \color{blue}{\sqrt{B}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.02 \cdot 10^{+71}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B}\right)\right)\\ \end{array} \]

Alternative 4: 46.0% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 2 \cdot 10^{+46}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B}\right)\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 2e+46)
     (/ (- (sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))) t_0)
     (* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt B)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 2e+46) {
		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt(B));
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 2e+46) {
		tmp = -Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) / t_0;
	} else {
		tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(F) * -Math.sqrt(B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if B <= 2e+46:
		tmp = -math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) / t_0
	else:
		tmp = (math.sqrt(2.0) / B) * (math.sqrt(F) * -math.sqrt(B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 2e+46)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (B <= 2e+46)
		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
	else
		tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt(B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 2e+46], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 2 \cdot 10^{+46}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 2e46

    1. Initial program 22.4%

      \[\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} \]
    2. Simplified22.4%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg22.4%

        \[\leadsto \color{blue}{-\frac{\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    4. Applied egg-rr29.7%

      \[\leadsto \color{blue}{-\frac{\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}} \]

    if 2e46 < B

    1. Initial program 10.0%

      \[\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} \]
    2. Simplified10.0%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 16.7%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg16.7%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in16.7%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative16.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow216.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow216.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def54.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified54.7%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. sqrt-prod73.1%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}}\right) \]
    7. Applied egg-rr73.1%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}}\right) \]
    8. Taylor expanded in A around 0 66.0%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F} \cdot \color{blue}{\sqrt{B}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2 \cdot 10^{+46}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B}\right)\right)\\ \end{array} \]

Alternative 5: 46.0% accurate, 2.1× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 2.25 \cdot 10^{+46}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{-\sqrt{F}}{\sqrt{B}}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 2.25e+46)
     (/ (- (sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))) t_0)
     (* (sqrt 2.0) (/ (- (sqrt F)) (sqrt B))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 2.25e+46) {
		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
	} else {
		tmp = sqrt(2.0) * (-sqrt(F) / sqrt(B));
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 2.25e+46) {
		tmp = -Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) / t_0;
	} else {
		tmp = Math.sqrt(2.0) * (-Math.sqrt(F) / Math.sqrt(B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if B <= 2.25e+46:
		tmp = -math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) / t_0
	else:
		tmp = math.sqrt(2.0) * (-math.sqrt(F) / math.sqrt(B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 2.25e+46)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0);
	else
		tmp = Float64(sqrt(2.0) * Float64(Float64(-sqrt(F)) / sqrt(B)));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (B <= 2.25e+46)
		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
	else
		tmp = sqrt(2.0) * (-sqrt(F) / sqrt(B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 2.25e+46], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[((-N[Sqrt[F], $MachinePrecision]) / N[Sqrt[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 2.25 \cdot 10^{+46}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{-\sqrt{F}}{\sqrt{B}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 2.25000000000000005e46

    1. Initial program 22.4%

      \[\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} \]
    2. Simplified22.4%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg22.4%

        \[\leadsto \color{blue}{-\frac{\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    4. Applied egg-rr29.7%

      \[\leadsto \color{blue}{-\frac{\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}} \]

    if 2.25000000000000005e46 < B

    1. Initial program 10.0%

      \[\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} \]
    2. Simplified10.0%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 16.7%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg16.7%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in16.7%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative16.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow216.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow216.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def54.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified54.7%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 48.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg48.4%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    8. Simplified48.4%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    9. Step-by-step derivation
      1. sqrt-div65.9%

        \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    10. Applied egg-rr65.9%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.25 \cdot 10^{+46}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{-\sqrt{F}}{\sqrt{B}}\\ \end{array} \]

Alternative 6: 37.8% accurate, 2.7× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 3.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 2.15 \cdot 10^{+145}:\\ \;\;\;\;\sqrt{B \cdot F} \cdot \frac{-\sqrt{2}}{B}\\ \mathbf{elif}\;B \leq 2.95 \cdot 10^{+178}:\\ \;\;\;\;-\sqrt{2 \cdot \frac{F}{B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 3.8e+45)
     (/ (- (sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))) t_0)
     (if (<= B 2.15e+145)
       (* (sqrt (* B F)) (/ (- (sqrt 2.0)) B))
       (if (<= B 2.95e+178)
         (- (sqrt (* 2.0 (/ F B))))
         (/ (- (pow (* 2.0 (* F (+ B C))) 0.5)) B))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 3.8e+45) {
		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
	} else if (B <= 2.15e+145) {
		tmp = sqrt((B * F)) * (-sqrt(2.0) / B);
	} else if (B <= 2.95e+178) {
		tmp = -sqrt((2.0 * (F / B)));
	} else {
		tmp = -pow((2.0 * (F * (B + C))), 0.5) / B;
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 3.8e+45) {
		tmp = -Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) / t_0;
	} else if (B <= 2.15e+145) {
		tmp = Math.sqrt((B * F)) * (-Math.sqrt(2.0) / B);
	} else if (B <= 2.95e+178) {
		tmp = -Math.sqrt((2.0 * (F / B)));
	} else {
		tmp = -Math.pow((2.0 * (F * (B + C))), 0.5) / B;
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if B <= 3.8e+45:
		tmp = -math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) / t_0
	elif B <= 2.15e+145:
		tmp = math.sqrt((B * F)) * (-math.sqrt(2.0) / B)
	elif B <= 2.95e+178:
		tmp = -math.sqrt((2.0 * (F / B)))
	else:
		tmp = -math.pow((2.0 * (F * (B + C))), 0.5) / B
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 3.8e+45)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0);
	elseif (B <= 2.15e+145)
		tmp = Float64(sqrt(Float64(B * F)) * Float64(Float64(-sqrt(2.0)) / B));
	elseif (B <= 2.95e+178)
		tmp = Float64(-sqrt(Float64(2.0 * Float64(F / B))));
	else
		tmp = Float64(Float64(-(Float64(2.0 * Float64(F * Float64(B + C))) ^ 0.5)) / B);
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (B <= 3.8e+45)
		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
	elseif (B <= 2.15e+145)
		tmp = sqrt((B * F)) * (-sqrt(2.0) / B);
	elseif (B <= 2.95e+178)
		tmp = -sqrt((2.0 * (F / B)));
	else
		tmp = -((2.0 * (F * (B + C))) ^ 0.5) / B;
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 3.8e+45], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 2.15e+145], N[(N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.95e+178], (-N[Sqrt[N[(2.0 * N[(F / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), N[((-N[Power[N[(2.0 * N[(F * N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]) / B), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 3.8 \cdot 10^{+45}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\

\mathbf{elif}\;B \leq 2.15 \cdot 10^{+145}:\\
\;\;\;\;\sqrt{B \cdot F} \cdot \frac{-\sqrt{2}}{B}\\

\mathbf{elif}\;B \leq 2.95 \cdot 10^{+178}:\\
\;\;\;\;-\sqrt{2 \cdot \frac{F}{B}}\\

\mathbf{else}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 3.8000000000000002e45

    1. Initial program 22.5%

      \[\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} \]
    2. Simplified22.5%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg22.5%

        \[\leadsto \color{blue}{-\frac{\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    4. Applied egg-rr29.8%

      \[\leadsto \color{blue}{-\frac{\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}} \]

    if 3.8000000000000002e45 < B < 2.14999999999999999e145

    1. Initial program 28.5%

      \[\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} \]
    2. Simplified28.5%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 42.9%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg42.9%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in42.9%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative42.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow242.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow242.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def47.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 43.5%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \color{blue}{B}}\right) \]

    if 2.14999999999999999e145 < B < 2.94999999999999992e178

    1. Initial program 0.2%

      \[\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} \]
    2. Simplified0.2%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 3.0%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg3.0%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in3.0%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative3.0%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow23.0%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow23.0%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def61.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified61.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 62.6%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg62.6%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    8. Simplified62.6%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    9. Step-by-step derivation
      1. sqrt-unprod63.1%

        \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    10. Applied egg-rr63.1%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]

    if 2.94999999999999992e178 < B

    1. Initial program 0.0%

      \[\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} \]
    2. Simplified0.0%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 0.0%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\sqrt{{A}^{2} + {B}^{2}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. +-commutative0.0%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. unpow20.0%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. unpow20.0%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. hypot-def0.0%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified0.0%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in A around 0 47.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg47.4%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}} \]
    8. Simplified47.4%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}} \]
    9. Step-by-step derivation
      1. associate-*l/47.4%

        \[\leadsto -\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}} \]
      2. pow1/247.4%

        \[\leadsto -\frac{\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(B + C\right)}}{B} \]
      3. pow1/247.5%

        \[\leadsto -\frac{{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(B + C\right)\right)}^{0.5}}}{B} \]
      4. pow-prod-down47.6%

        \[\leadsto -\frac{\color{blue}{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}}{B} \]
    10. Applied egg-rr47.6%

      \[\leadsto -\color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification33.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 2.15 \cdot 10^{+145}:\\ \;\;\;\;\sqrt{B \cdot F} \cdot \frac{-\sqrt{2}}{B}\\ \mathbf{elif}\;B \leq 2.95 \cdot 10^{+178}:\\ \;\;\;\;-\sqrt{2 \cdot \frac{F}{B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\\ \end{array} \]

Alternative 7: 35.2% accurate, 2.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \frac{-\sqrt{2}}{B}\\ \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+34}:\\ \;\;\;\;\sqrt{B \cdot F} \cdot t_0\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{+262}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+303}:\\ \;\;\;\;\sqrt{-0.5 \cdot \frac{B \cdot B}{\frac{A}{F}}} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{2 \cdot \frac{F}{B}}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (/ (- (sqrt 2.0)) B)))
   (if (<= F -5e-310)
     (-
      (/
       (sqrt (* (* 2.0 (* F (* -4.0 (* A C)))) (+ A (+ A C))))
       (- (* B B) (* (* A C) 4.0))))
     (if (<= F 7.5e+34)
       (* (sqrt (* B F)) t_0)
       (if (<= F 1.2e+262)
         (- (sqrt (/ 2.0 (/ B F))))
         (if (<= F 1.7e+303)
           (* (sqrt (* -0.5 (/ (* B B) (/ A F)))) t_0)
           (- (sqrt (* 2.0 (/ F B))))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = -sqrt(2.0) / B;
	double tmp;
	if (F <= -5e-310) {
		tmp = -(sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)));
	} else if (F <= 7.5e+34) {
		tmp = sqrt((B * F)) * t_0;
	} else if (F <= 1.2e+262) {
		tmp = -sqrt((2.0 / (B / F)));
	} else if (F <= 1.7e+303) {
		tmp = sqrt((-0.5 * ((B * B) / (A / F)))) * t_0;
	} else {
		tmp = -sqrt((2.0 * (F / B)));
	}
	return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: tmp
    t_0 = -sqrt(2.0d0) / b
    if (f <= (-5d-310)) then
        tmp = -(sqrt(((2.0d0 * (f * ((-4.0d0) * (a * c)))) * (a + (a + c)))) / ((b * b) - ((a * c) * 4.0d0)))
    else if (f <= 7.5d+34) then
        tmp = sqrt((b * f)) * t_0
    else if (f <= 1.2d+262) then
        tmp = -sqrt((2.0d0 / (b / f)))
    else if (f <= 1.7d+303) then
        tmp = sqrt(((-0.5d0) * ((b * b) / (a / f)))) * t_0
    else
        tmp = -sqrt((2.0d0 * (f / b)))
    end if
    code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double t_0 = -Math.sqrt(2.0) / B;
	double tmp;
	if (F <= -5e-310) {
		tmp = -(Math.sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)));
	} else if (F <= 7.5e+34) {
		tmp = Math.sqrt((B * F)) * t_0;
	} else if (F <= 1.2e+262) {
		tmp = -Math.sqrt((2.0 / (B / F)));
	} else if (F <= 1.7e+303) {
		tmp = Math.sqrt((-0.5 * ((B * B) / (A / F)))) * t_0;
	} else {
		tmp = -Math.sqrt((2.0 * (F / B)));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = -math.sqrt(2.0) / B
	tmp = 0
	if F <= -5e-310:
		tmp = -(math.sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)))
	elif F <= 7.5e+34:
		tmp = math.sqrt((B * F)) * t_0
	elif F <= 1.2e+262:
		tmp = -math.sqrt((2.0 / (B / F)))
	elif F <= 1.7e+303:
		tmp = math.sqrt((-0.5 * ((B * B) / (A / F)))) * t_0
	else:
		tmp = -math.sqrt((2.0 * (F / B)))
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(-sqrt(2.0)) / B)
	tmp = 0.0
	if (F <= -5e-310)
		tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * Float64(F * Float64(-4.0 * Float64(A * C)))) * Float64(A + Float64(A + C)))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))));
	elseif (F <= 7.5e+34)
		tmp = Float64(sqrt(Float64(B * F)) * t_0);
	elseif (F <= 1.2e+262)
		tmp = Float64(-sqrt(Float64(2.0 / Float64(B / F))));
	elseif (F <= 1.7e+303)
		tmp = Float64(sqrt(Float64(-0.5 * Float64(Float64(B * B) / Float64(A / F)))) * t_0);
	else
		tmp = Float64(-sqrt(Float64(2.0 * Float64(F / B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = -sqrt(2.0) / B;
	tmp = 0.0;
	if (F <= -5e-310)
		tmp = -(sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)));
	elseif (F <= 7.5e+34)
		tmp = sqrt((B * F)) * t_0;
	elseif (F <= 1.2e+262)
		tmp = -sqrt((2.0 / (B / F)));
	elseif (F <= 1.7e+303)
		tmp = sqrt((-0.5 * ((B * B) / (A / F)))) * t_0;
	else
		tmp = -sqrt((2.0 * (F / B)));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]}, If[LessEqual[F, -5e-310], (-N[(N[Sqrt[N[(N[(2.0 * N[(F * N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 7.5e+34], N[(N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[F, 1.2e+262], (-N[Sqrt[N[(2.0 / N[(B / F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[F, 1.7e+303], N[(N[Sqrt[N[(-0.5 * N[(N[(B * B), $MachinePrecision] / N[(A / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], (-N[Sqrt[N[(2.0 * N[(F / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \frac{-\sqrt{2}}{B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\

\mathbf{elif}\;F \leq 7.5 \cdot 10^{+34}:\\
\;\;\;\;\sqrt{B \cdot F} \cdot t_0\\

\mathbf{elif}\;F \leq 1.2 \cdot 10^{+262}:\\
\;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\

\mathbf{elif}\;F \leq 1.7 \cdot 10^{+303}:\\
\;\;\;\;\sqrt{-0.5 \cdot \frac{B \cdot B}{\frac{A}{F}}} \cdot t_0\\

\mathbf{else}:\\
\;\;\;\;-\sqrt{2 \cdot \frac{F}{B}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -4.999999999999985e-310

    1. Initial program 36.5%

      \[\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} \]
    2. Simplified36.5%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in A around inf 39.4%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in B around 0 39.4%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\color{blue}{\left(-4 \cdot \left(A \cdot C\right)\right)} \cdot F\right)\right) \cdot \left(\left(A + C\right) + A\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if -4.999999999999985e-310 < F < 7.49999999999999976e34

    1. Initial program 20.8%

      \[\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} \]
    2. Simplified20.8%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 8.8%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg8.8%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in8.8%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative8.8%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow28.8%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow28.8%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def22.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified22.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 18.4%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \color{blue}{B}}\right) \]

    if 7.49999999999999976e34 < F < 1.19999999999999991e262

    1. Initial program 15.4%

      \[\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} \]
    2. Simplified15.4%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 13.6%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg13.6%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in13.6%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative13.6%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow213.6%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow213.6%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def17.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified17.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 25.1%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg25.1%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    8. Simplified25.1%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    9. Step-by-step derivation
      1. sqrt-unprod25.2%

        \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    10. Applied egg-rr25.2%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u24.5%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)\right)} \]
      2. expm1-udef12.5%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)} - 1\right)} \]
      3. *-commutative12.5%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right)} - 1\right) \]
    12. Applied egg-rr12.5%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)} - 1\right)} \]
    13. Step-by-step derivation
      1. expm1-def24.5%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)\right)} \]
      2. expm1-log1p25.2%

        \[\leadsto -\color{blue}{\sqrt{2 \cdot \frac{F}{B}}} \]
      3. associate-*r/25.2%

        \[\leadsto -\sqrt{\color{blue}{\frac{2 \cdot F}{B}}} \]
      4. associate-/l*25.2%

        \[\leadsto -\sqrt{\color{blue}{\frac{2}{\frac{B}{F}}}} \]
    14. Simplified25.2%

      \[\leadsto -\color{blue}{\sqrt{\frac{2}{\frac{B}{F}}}} \]

    if 1.19999999999999991e262 < F < 1.7e303

    1. Initial program 9.5%

      \[\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} \]
    2. Simplified9.5%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 2.7%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg2.7%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in2.7%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative2.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow22.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow22.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def3.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified3.7%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around -inf 1.6%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{\color{blue}{-0.5 \cdot \frac{{B}^{2} \cdot F}{A}}}\right) \]
    7. Step-by-step derivation
      1. associate-/l*8.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{-0.5 \cdot \color{blue}{\frac{{B}^{2}}{\frac{A}{F}}}}\right) \]
      2. unpow28.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{-0.5 \cdot \frac{\color{blue}{B \cdot B}}{\frac{A}{F}}}\right) \]
    8. Simplified8.7%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{\color{blue}{-0.5 \cdot \frac{B \cdot B}{\frac{A}{F}}}}\right) \]

    if 1.7e303 < F

    1. Initial program 0.0%

      \[\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} \]
    2. Simplified0.0%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 3.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg3.2%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in3.2%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative3.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow23.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow23.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def3.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified3.2%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 100.0%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg100.0%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    8. Simplified100.0%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    9. Step-by-step derivation
      1. sqrt-unprod100.0%

        \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    10. Applied egg-rr100.0%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification22.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+34}:\\ \;\;\;\;\sqrt{B \cdot F} \cdot \frac{-\sqrt{2}}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{+262}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+303}:\\ \;\;\;\;\sqrt{-0.5 \cdot \frac{B \cdot B}{\frac{A}{F}}} \cdot \frac{-\sqrt{2}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{2 \cdot \frac{F}{B}}\\ \end{array} \]

Alternative 8: 36.9% accurate, 3.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+41}:\\ \;\;\;\;\sqrt{B \cdot F} \cdot \frac{-\sqrt{2}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= F -5e-310)
   (-
    (/
     (sqrt (* (* 2.0 (* F (* -4.0 (* A C)))) (+ A (+ A C))))
     (- (* B B) (* (* A C) 4.0))))
   (if (<= F 9e+41)
     (* (sqrt (* B F)) (/ (- (sqrt 2.0)) B))
     (- (sqrt (/ 2.0 (/ B F)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= -5e-310) {
		tmp = -(sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)));
	} else if (F <= 9e+41) {
		tmp = sqrt((B * F)) * (-sqrt(2.0) / B);
	} else {
		tmp = -sqrt((2.0 / (B / F)));
	}
	return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= (-5d-310)) then
        tmp = -(sqrt(((2.0d0 * (f * ((-4.0d0) * (a * c)))) * (a + (a + c)))) / ((b * b) - ((a * c) * 4.0d0)))
    else if (f <= 9d+41) then
        tmp = sqrt((b * f)) * (-sqrt(2.0d0) / b)
    else
        tmp = -sqrt((2.0d0 / (b / f)))
    end if
    code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= -5e-310) {
		tmp = -(Math.sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)));
	} else if (F <= 9e+41) {
		tmp = Math.sqrt((B * F)) * (-Math.sqrt(2.0) / B);
	} else {
		tmp = -Math.sqrt((2.0 / (B / F)));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if F <= -5e-310:
		tmp = -(math.sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)))
	elif F <= 9e+41:
		tmp = math.sqrt((B * F)) * (-math.sqrt(2.0) / B)
	else:
		tmp = -math.sqrt((2.0 / (B / F)))
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if (F <= -5e-310)
		tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * Float64(F * Float64(-4.0 * Float64(A * C)))) * Float64(A + Float64(A + C)))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))));
	elseif (F <= 9e+41)
		tmp = Float64(sqrt(Float64(B * F)) * Float64(Float64(-sqrt(2.0)) / B));
	else
		tmp = Float64(-sqrt(Float64(2.0 / Float64(B / F))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (F <= -5e-310)
		tmp = -(sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)));
	elseif (F <= 9e+41)
		tmp = sqrt((B * F)) * (-sqrt(2.0) / B);
	else
		tmp = -sqrt((2.0 / (B / F)));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[F, -5e-310], (-N[(N[Sqrt[N[(N[(2.0 * N[(F * N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 9e+41], N[(N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[(2.0 / N[(B / F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\

\mathbf{elif}\;F \leq 9 \cdot 10^{+41}:\\
\;\;\;\;\sqrt{B \cdot F} \cdot \frac{-\sqrt{2}}{B}\\

\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.999999999999985e-310

    1. Initial program 36.5%

      \[\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} \]
    2. Simplified36.5%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in A around inf 39.4%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in B around 0 39.4%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\color{blue}{\left(-4 \cdot \left(A \cdot C\right)\right)} \cdot F\right)\right) \cdot \left(\left(A + C\right) + A\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if -4.999999999999985e-310 < F < 9.0000000000000002e41

    1. Initial program 20.5%

      \[\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} \]
    2. Simplified20.5%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 8.7%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg8.7%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in8.7%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative8.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow28.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow28.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def22.8%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified22.8%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 18.2%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \color{blue}{B}}\right) \]

    if 9.0000000000000002e41 < F

    1. Initial program 14.7%

      \[\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} \]
    2. Simplified14.7%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 12.3%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg12.3%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in12.3%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative12.3%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow212.3%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow212.3%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def15.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified15.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 23.3%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg23.3%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    8. Simplified23.3%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    9. Step-by-step derivation
      1. sqrt-unprod23.3%

        \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    10. Applied egg-rr23.3%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u22.7%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)\right)} \]
      2. expm1-udef12.3%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)} - 1\right)} \]
      3. *-commutative12.3%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right)} - 1\right) \]
    12. Applied egg-rr12.3%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)} - 1\right)} \]
    13. Step-by-step derivation
      1. expm1-def22.7%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)\right)} \]
      2. expm1-log1p23.3%

        \[\leadsto -\color{blue}{\sqrt{2 \cdot \frac{F}{B}}} \]
      3. associate-*r/23.3%

        \[\leadsto -\sqrt{\color{blue}{\frac{2 \cdot F}{B}}} \]
      4. associate-/l*23.4%

        \[\leadsto -\sqrt{\color{blue}{\frac{2}{\frac{B}{F}}}} \]
    14. Simplified23.4%

      \[\leadsto -\color{blue}{\sqrt{\frac{2}{\frac{B}{F}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification22.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+41}:\\ \;\;\;\;\sqrt{B \cdot F} \cdot \frac{-\sqrt{2}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \end{array} \]

Alternative 9: 36.3% accurate, 5.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-302}:\\ \;\;\;\;\frac{-\sqrt{\left(A + \left(A + C\right)\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-29}:\\ \;\;\;\;\frac{-\sqrt{\left(B + C\right) \cdot \left(2 \cdot F\right)}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= F -4.2e-302)
   (/
    (- (sqrt (* (+ A (+ A C)) (* 2.0 (* -4.0 (* A (* F C)))))))
    (- (* B B) (* (* A C) 4.0)))
   (if (<= F 7e-29)
     (/ (- (sqrt (* (+ B C) (* 2.0 F)))) B)
     (- (sqrt (/ 2.0 (/ B F)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= -4.2e-302) {
		tmp = -sqrt(((A + (A + C)) * (2.0 * (-4.0 * (A * (F * C)))))) / ((B * B) - ((A * C) * 4.0));
	} else if (F <= 7e-29) {
		tmp = -sqrt(((B + C) * (2.0 * F))) / B;
	} else {
		tmp = -sqrt((2.0 / (B / F)));
	}
	return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= (-4.2d-302)) then
        tmp = -sqrt(((a + (a + c)) * (2.0d0 * ((-4.0d0) * (a * (f * c)))))) / ((b * b) - ((a * c) * 4.0d0))
    else if (f <= 7d-29) then
        tmp = -sqrt(((b + c) * (2.0d0 * f))) / b
    else
        tmp = -sqrt((2.0d0 / (b / f)))
    end if
    code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= -4.2e-302) {
		tmp = -Math.sqrt(((A + (A + C)) * (2.0 * (-4.0 * (A * (F * C)))))) / ((B * B) - ((A * C) * 4.0));
	} else if (F <= 7e-29) {
		tmp = -Math.sqrt(((B + C) * (2.0 * F))) / B;
	} else {
		tmp = -Math.sqrt((2.0 / (B / F)));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if F <= -4.2e-302:
		tmp = -math.sqrt(((A + (A + C)) * (2.0 * (-4.0 * (A * (F * C)))))) / ((B * B) - ((A * C) * 4.0))
	elif F <= 7e-29:
		tmp = -math.sqrt(((B + C) * (2.0 * F))) / B
	else:
		tmp = -math.sqrt((2.0 / (B / F)))
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if (F <= -4.2e-302)
		tmp = Float64(Float64(-sqrt(Float64(Float64(A + Float64(A + C)) * Float64(2.0 * Float64(-4.0 * Float64(A * Float64(F * C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)));
	elseif (F <= 7e-29)
		tmp = Float64(Float64(-sqrt(Float64(Float64(B + C) * Float64(2.0 * F)))) / B);
	else
		tmp = Float64(-sqrt(Float64(2.0 / Float64(B / F))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (F <= -4.2e-302)
		tmp = -sqrt(((A + (A + C)) * (2.0 * (-4.0 * (A * (F * C)))))) / ((B * B) - ((A * C) * 4.0));
	elseif (F <= 7e-29)
		tmp = -sqrt(((B + C) * (2.0 * F))) / B;
	else
		tmp = -sqrt((2.0 / (B / F)));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[F, -4.2e-302], N[((-N[Sqrt[N[(N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(-4.0 * N[(A * N[(F * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-29], N[((-N[Sqrt[N[(N[(B + C), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], (-N[Sqrt[N[(2.0 / N[(B / F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.2 \cdot 10^{-302}:\\
\;\;\;\;\frac{-\sqrt{\left(A + \left(A + C\right)\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\

\mathbf{elif}\;F \leq 7 \cdot 10^{-29}:\\
\;\;\;\;\frac{-\sqrt{\left(B + C\right) \cdot \left(2 \cdot F\right)}}{B}\\

\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.20000000000000026e-302

    1. Initial program 38.0%

      \[\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} \]
    2. Simplified38.0%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in A around inf 36.7%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in B around 0 31.0%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \color{blue}{\left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}\right) \cdot \left(\left(A + C\right) + A\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if -4.20000000000000026e-302 < F < 6.9999999999999995e-29

    1. Initial program 22.8%

      \[\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} \]
    2. Simplified22.8%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 21.8%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\sqrt{{A}^{2} + {B}^{2}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. +-commutative21.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. unpow221.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. unpow221.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. hypot-def25.7%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified25.7%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in A around 0 17.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg17.4%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}} \]
    8. Simplified17.4%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}} \]
    9. Step-by-step derivation
      1. expm1-log1p-u17.3%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}\right)\right)} \]
      2. expm1-udef2.7%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}\right)} - 1\right)} \]
      3. associate-*l/2.7%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}}\right)} - 1\right) \]
      4. pow1/22.7%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}\right)} - 1\right) \]
      5. pow1/22.7%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(B + C\right)\right)}^{0.5}}}{B}\right)} - 1\right) \]
      6. pow-prod-down2.7%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}}{B}\right)} - 1\right) \]
    10. Applied egg-rr2.7%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\right)} - 1\right)} \]
    11. Step-by-step derivation
      1. expm1-def17.4%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\right)\right)} \]
      2. expm1-log1p17.5%

        \[\leadsto -\color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}} \]
      3. unpow1/217.5%

        \[\leadsto -\frac{\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(B + C\right)\right)}}}{B} \]
      4. *-commutative17.5%

        \[\leadsto -\frac{\sqrt{\color{blue}{\left(F \cdot \left(B + C\right)\right) \cdot 2}}}{B} \]
      5. *-commutative17.5%

        \[\leadsto -\frac{\sqrt{\color{blue}{\left(\left(B + C\right) \cdot F\right)} \cdot 2}}{B} \]
      6. associate-*l*17.5%

        \[\leadsto -\frac{\sqrt{\color{blue}{\left(B + C\right) \cdot \left(F \cdot 2\right)}}}{B} \]
    12. Simplified17.5%

      \[\leadsto -\color{blue}{\frac{\sqrt{\left(B + C\right) \cdot \left(F \cdot 2\right)}}{B}} \]

    if 6.9999999999999995e-29 < F

    1. Initial program 13.6%

      \[\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} \]
    2. Simplified13.6%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 10.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg10.2%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in10.2%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative10.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow210.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow210.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def16.6%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified16.6%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 22.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg22.2%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    8. Simplified22.2%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    9. Step-by-step derivation
      1. sqrt-unprod22.2%

        \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    10. Applied egg-rr22.2%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u21.7%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)\right)} \]
      2. expm1-udef10.1%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)} - 1\right)} \]
      3. *-commutative10.1%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right)} - 1\right) \]
    12. Applied egg-rr10.1%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)} - 1\right)} \]
    13. Step-by-step derivation
      1. expm1-def21.7%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)\right)} \]
      2. expm1-log1p22.2%

        \[\leadsto -\color{blue}{\sqrt{2 \cdot \frac{F}{B}}} \]
      3. associate-*r/22.2%

        \[\leadsto -\sqrt{\color{blue}{\frac{2 \cdot F}{B}}} \]
      4. associate-/l*22.2%

        \[\leadsto -\sqrt{\color{blue}{\frac{2}{\frac{B}{F}}}} \]
    14. Simplified22.2%

      \[\leadsto -\color{blue}{\sqrt{\frac{2}{\frac{B}{F}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification20.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-302}:\\ \;\;\;\;\frac{-\sqrt{\left(A + \left(A + C\right)\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-29}:\\ \;\;\;\;\frac{-\sqrt{\left(B + C\right) \cdot \left(2 \cdot F\right)}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \end{array} \]

Alternative 10: 36.8% accurate, 5.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;F \leq 4.1 \cdot 10^{-32}:\\ \;\;\;\;\frac{-{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= F -5e-310)
   (-
    (/
     (sqrt (* (* 2.0 (* F (* -4.0 (* A C)))) (+ A (+ A C))))
     (- (* B B) (* (* A C) 4.0))))
   (if (<= F 4.1e-32)
     (/ (- (pow (* 2.0 (* F (+ B C))) 0.5)) B)
     (- (sqrt (/ 2.0 (/ B F)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= -5e-310) {
		tmp = -(sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)));
	} else if (F <= 4.1e-32) {
		tmp = -pow((2.0 * (F * (B + C))), 0.5) / B;
	} else {
		tmp = -sqrt((2.0 / (B / F)));
	}
	return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= (-5d-310)) then
        tmp = -(sqrt(((2.0d0 * (f * ((-4.0d0) * (a * c)))) * (a + (a + c)))) / ((b * b) - ((a * c) * 4.0d0)))
    else if (f <= 4.1d-32) then
        tmp = -((2.0d0 * (f * (b + c))) ** 0.5d0) / b
    else
        tmp = -sqrt((2.0d0 / (b / f)))
    end if
    code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= -5e-310) {
		tmp = -(Math.sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)));
	} else if (F <= 4.1e-32) {
		tmp = -Math.pow((2.0 * (F * (B + C))), 0.5) / B;
	} else {
		tmp = -Math.sqrt((2.0 / (B / F)));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if F <= -5e-310:
		tmp = -(math.sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)))
	elif F <= 4.1e-32:
		tmp = -math.pow((2.0 * (F * (B + C))), 0.5) / B
	else:
		tmp = -math.sqrt((2.0 / (B / F)))
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if (F <= -5e-310)
		tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * Float64(F * Float64(-4.0 * Float64(A * C)))) * Float64(A + Float64(A + C)))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))));
	elseif (F <= 4.1e-32)
		tmp = Float64(Float64(-(Float64(2.0 * Float64(F * Float64(B + C))) ^ 0.5)) / B);
	else
		tmp = Float64(-sqrt(Float64(2.0 / Float64(B / F))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (F <= -5e-310)
		tmp = -(sqrt(((2.0 * (F * (-4.0 * (A * C)))) * (A + (A + C)))) / ((B * B) - ((A * C) * 4.0)));
	elseif (F <= 4.1e-32)
		tmp = -((2.0 * (F * (B + C))) ^ 0.5) / B;
	else
		tmp = -sqrt((2.0 / (B / F)));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[F, -5e-310], (-N[(N[Sqrt[N[(N[(2.0 * N[(F * N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4.1e-32], N[((-N[Power[N[(2.0 * N[(F * N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]) / B), $MachinePrecision], (-N[Sqrt[N[(2.0 / N[(B / F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\

\mathbf{elif}\;F \leq 4.1 \cdot 10^{-32}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\\

\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.999999999999985e-310

    1. Initial program 36.5%

      \[\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} \]
    2. Simplified36.5%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in A around inf 39.4%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in B around 0 39.4%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\color{blue}{\left(-4 \cdot \left(A \cdot C\right)\right)} \cdot F\right)\right) \cdot \left(\left(A + C\right) + A\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if -4.999999999999985e-310 < F < 4.09999999999999975e-32

    1. Initial program 23.0%

      \[\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} \]
    2. Simplified23.0%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 22.0%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\sqrt{{A}^{2} + {B}^{2}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. +-commutative22.0%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. unpow222.0%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. unpow222.0%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. hypot-def25.0%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified25.0%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in A around 0 17.5%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg17.5%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}} \]
    8. Simplified17.5%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}} \]
    9. Step-by-step derivation
      1. associate-*l/17.6%

        \[\leadsto -\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}} \]
      2. pow1/217.6%

        \[\leadsto -\frac{\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(B + C\right)}}{B} \]
      3. pow1/217.6%

        \[\leadsto -\frac{{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(B + C\right)\right)}^{0.5}}}{B} \]
      4. pow-prod-down17.6%

        \[\leadsto -\frac{\color{blue}{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}}{B} \]
    10. Applied egg-rr17.6%

      \[\leadsto -\color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}} \]

    if 4.09999999999999975e-32 < F

    1. Initial program 13.6%

      \[\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} \]
    2. Simplified13.6%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 10.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg10.2%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in10.2%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative10.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow210.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow210.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def16.6%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified16.6%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 22.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg22.2%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    8. Simplified22.2%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    9. Step-by-step derivation
      1. sqrt-unprod22.2%

        \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    10. Applied egg-rr22.2%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u21.7%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)\right)} \]
      2. expm1-udef10.1%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)} - 1\right)} \]
      3. *-commutative10.1%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right)} - 1\right) \]
    12. Applied egg-rr10.1%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)} - 1\right)} \]
    13. Step-by-step derivation
      1. expm1-def21.7%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)\right)} \]
      2. expm1-log1p22.2%

        \[\leadsto -\color{blue}{\sqrt{2 \cdot \frac{F}{B}}} \]
      3. associate-*r/22.2%

        \[\leadsto -\sqrt{\color{blue}{\frac{2 \cdot F}{B}}} \]
      4. associate-/l*22.2%

        \[\leadsto -\sqrt{\color{blue}{\frac{2}{\frac{B}{F}}}} \]
    14. Simplified22.2%

      \[\leadsto -\color{blue}{\sqrt{\frac{2}{\frac{B}{F}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification21.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;F \leq 4.1 \cdot 10^{-32}:\\ \;\;\;\;\frac{-{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \end{array} \]

Alternative 11: 33.6% accurate, 5.6× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;F \leq 5.9 \cdot 10^{-33}:\\ \;\;\;\;\frac{-{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= F 5.9e-33)
   (/ (- (pow (* 2.0 (* F (+ B C))) 0.5)) B)
   (- (sqrt (/ 2.0 (/ B F))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= 5.9e-33) {
		tmp = -pow((2.0 * (F * (B + C))), 0.5) / B;
	} else {
		tmp = -sqrt((2.0 / (B / F)));
	}
	return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= 5.9d-33) then
        tmp = -((2.0d0 * (f * (b + c))) ** 0.5d0) / b
    else
        tmp = -sqrt((2.0d0 / (b / f)))
    end if
    code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= 5.9e-33) {
		tmp = -Math.pow((2.0 * (F * (B + C))), 0.5) / B;
	} else {
		tmp = -Math.sqrt((2.0 / (B / F)));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if F <= 5.9e-33:
		tmp = -math.pow((2.0 * (F * (B + C))), 0.5) / B
	else:
		tmp = -math.sqrt((2.0 / (B / F)))
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if (F <= 5.9e-33)
		tmp = Float64(Float64(-(Float64(2.0 * Float64(F * Float64(B + C))) ^ 0.5)) / B);
	else
		tmp = Float64(-sqrt(Float64(2.0 / Float64(B / F))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (F <= 5.9e-33)
		tmp = -((2.0 * (F * (B + C))) ^ 0.5) / B;
	else
		tmp = -sqrt((2.0 / (B / F)));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[F, 5.9e-33], N[((-N[Power[N[(2.0 * N[(F * N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]) / B), $MachinePrecision], (-N[Sqrt[N[(2.0 / N[(B / F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5.9 \cdot 10^{-33}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\\

\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 5.89999999999999985e-33

    1. Initial program 25.2%

      \[\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} \]
    2. Simplified25.2%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 22.8%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\sqrt{{A}^{2} + {B}^{2}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. +-commutative22.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. unpow222.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. unpow222.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. hypot-def27.5%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified27.5%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in A around 0 14.8%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg14.8%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}} \]
    8. Simplified14.8%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}} \]
    9. Step-by-step derivation
      1. associate-*l/14.8%

        \[\leadsto -\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}} \]
      2. pow1/214.8%

        \[\leadsto -\frac{\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(B + C\right)}}{B} \]
      3. pow1/214.9%

        \[\leadsto -\frac{{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(B + C\right)\right)}^{0.5}}}{B} \]
      4. pow-prod-down14.9%

        \[\leadsto -\frac{\color{blue}{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}}{B} \]
    10. Applied egg-rr14.9%

      \[\leadsto -\color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}} \]

    if 5.89999999999999985e-33 < F

    1. Initial program 13.6%

      \[\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} \]
    2. Simplified13.6%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 10.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg10.2%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in10.2%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative10.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow210.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow210.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def16.6%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified16.6%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 22.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg22.2%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    8. Simplified22.2%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    9. Step-by-step derivation
      1. sqrt-unprod22.2%

        \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    10. Applied egg-rr22.2%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u21.7%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)\right)} \]
      2. expm1-udef10.1%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)} - 1\right)} \]
      3. *-commutative10.1%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right)} - 1\right) \]
    12. Applied egg-rr10.1%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)} - 1\right)} \]
    13. Step-by-step derivation
      1. expm1-def21.7%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)\right)} \]
      2. expm1-log1p22.2%

        \[\leadsto -\color{blue}{\sqrt{2 \cdot \frac{F}{B}}} \]
      3. associate-*r/22.2%

        \[\leadsto -\sqrt{\color{blue}{\frac{2 \cdot F}{B}}} \]
      4. associate-/l*22.2%

        \[\leadsto -\sqrt{\color{blue}{\frac{2}{\frac{B}{F}}}} \]
    14. Simplified22.2%

      \[\leadsto -\color{blue}{\sqrt{\frac{2}{\frac{B}{F}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification18.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 5.9 \cdot 10^{-33}:\\ \;\;\;\;\frac{-{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \end{array} \]

Alternative 12: 33.6% accurate, 5.7× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;F \leq 1.75 \cdot 10^{-28}:\\ \;\;\;\;\frac{-\sqrt{\left(B + C\right) \cdot \left(2 \cdot F\right)}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= F 1.75e-28)
   (/ (- (sqrt (* (+ B C) (* 2.0 F)))) B)
   (- (sqrt (/ 2.0 (/ B F))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= 1.75e-28) {
		tmp = -sqrt(((B + C) * (2.0 * F))) / B;
	} else {
		tmp = -sqrt((2.0 / (B / F)));
	}
	return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= 1.75d-28) then
        tmp = -sqrt(((b + c) * (2.0d0 * f))) / b
    else
        tmp = -sqrt((2.0d0 / (b / f)))
    end if
    code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= 1.75e-28) {
		tmp = -Math.sqrt(((B + C) * (2.0 * F))) / B;
	} else {
		tmp = -Math.sqrt((2.0 / (B / F)));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if F <= 1.75e-28:
		tmp = -math.sqrt(((B + C) * (2.0 * F))) / B
	else:
		tmp = -math.sqrt((2.0 / (B / F)))
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if (F <= 1.75e-28)
		tmp = Float64(Float64(-sqrt(Float64(Float64(B + C) * Float64(2.0 * F)))) / B);
	else
		tmp = Float64(-sqrt(Float64(2.0 / Float64(B / F))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (F <= 1.75e-28)
		tmp = -sqrt(((B + C) * (2.0 * F))) / B;
	else
		tmp = -sqrt((2.0 / (B / F)));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[F, 1.75e-28], N[((-N[Sqrt[N[(N[(B + C), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], (-N[Sqrt[N[(2.0 / N[(B / F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.75 \cdot 10^{-28}:\\
\;\;\;\;\frac{-\sqrt{\left(B + C\right) \cdot \left(2 \cdot F\right)}}{B}\\

\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 1.75e-28

    1. Initial program 25.2%

      \[\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} \]
    2. Simplified25.2%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 22.8%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\sqrt{{A}^{2} + {B}^{2}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. +-commutative22.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. unpow222.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. unpow222.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. hypot-def27.5%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified27.5%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in A around 0 14.8%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg14.8%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}} \]
    8. Simplified14.8%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}} \]
    9. Step-by-step derivation
      1. expm1-log1p-u14.5%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}\right)\right)} \]
      2. expm1-udef2.3%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(B + C\right)}\right)} - 1\right)} \]
      3. associate-*l/2.3%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}}\right)} - 1\right) \]
      4. pow1/22.3%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}\right)} - 1\right) \]
      5. pow1/22.3%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(B + C\right)\right)}^{0.5}}}{B}\right)} - 1\right) \]
      6. pow-prod-down2.3%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}}{B}\right)} - 1\right) \]
    10. Applied egg-rr2.3%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\right)} - 1\right)} \]
    11. Step-by-step derivation
      1. expm1-def14.6%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\right)\right)} \]
      2. expm1-log1p14.9%

        \[\leadsto -\color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}} \]
      3. unpow1/214.8%

        \[\leadsto -\frac{\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(B + C\right)\right)}}}{B} \]
      4. *-commutative14.8%

        \[\leadsto -\frac{\sqrt{\color{blue}{\left(F \cdot \left(B + C\right)\right) \cdot 2}}}{B} \]
      5. *-commutative14.8%

        \[\leadsto -\frac{\sqrt{\color{blue}{\left(\left(B + C\right) \cdot F\right)} \cdot 2}}{B} \]
      6. associate-*l*14.8%

        \[\leadsto -\frac{\sqrt{\color{blue}{\left(B + C\right) \cdot \left(F \cdot 2\right)}}}{B} \]
    12. Simplified14.8%

      \[\leadsto -\color{blue}{\frac{\sqrt{\left(B + C\right) \cdot \left(F \cdot 2\right)}}{B}} \]

    if 1.75e-28 < F

    1. Initial program 13.6%

      \[\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} \]
    2. Simplified13.6%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around 0 10.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg10.2%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in10.2%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
      3. +-commutative10.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
      4. unpow210.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow210.2%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def16.6%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified16.6%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Taylor expanded in A around 0 22.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg22.2%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    8. Simplified22.2%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    9. Step-by-step derivation
      1. sqrt-unprod22.2%

        \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    10. Applied egg-rr22.2%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u21.7%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)\right)} \]
      2. expm1-udef10.1%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot 2}\right)} - 1\right)} \]
      3. *-commutative10.1%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right)} - 1\right) \]
    12. Applied egg-rr10.1%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)} - 1\right)} \]
    13. Step-by-step derivation
      1. expm1-def21.7%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2 \cdot \frac{F}{B}}\right)\right)} \]
      2. expm1-log1p22.2%

        \[\leadsto -\color{blue}{\sqrt{2 \cdot \frac{F}{B}}} \]
      3. associate-*r/22.2%

        \[\leadsto -\sqrt{\color{blue}{\frac{2 \cdot F}{B}}} \]
      4. associate-/l*22.2%

        \[\leadsto -\sqrt{\color{blue}{\frac{2}{\frac{B}{F}}}} \]
    14. Simplified22.2%

      \[\leadsto -\color{blue}{\sqrt{\frac{2}{\frac{B}{F}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification18.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.75 \cdot 10^{-28}:\\ \;\;\;\;\frac{-\sqrt{\left(B + C\right) \cdot \left(2 \cdot F\right)}}{B}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2}{\frac{B}{F}}}\\ \end{array} \]

Alternative 13: 26.7% accurate, 5.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ -{\left(2 \cdot \frac{F}{B}\right)}^{0.5} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F) :precision binary64 (- (pow (* 2.0 (/ F B)) 0.5)))
B = abs(B);
double code(double A, double B, double C, double F) {
	return -pow((2.0 * (F / B)), 0.5);
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = -((2.0d0 * (f / b)) ** 0.5d0)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	return -Math.pow((2.0 * (F / B)), 0.5);
}
B = abs(B)
def code(A, B, C, F):
	return -math.pow((2.0 * (F / B)), 0.5)
B = abs(B)
function code(A, B, C, F)
	return Float64(-(Float64(2.0 * Float64(F / B)) ^ 0.5))
end
B = abs(B)
function tmp = code(A, B, C, F)
	tmp = -((2.0 * (F / B)) ^ 0.5);
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := (-N[Power[N[(2.0 * N[(F / B), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision])
\begin{array}{l}
B = |B|\\
\\
-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 19.8%

    \[\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} \]
  2. Simplified19.8%

    \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
  3. Taylor expanded in C around 0 9.3%

    \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
  4. Step-by-step derivation
    1. mul-1-neg9.3%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
    2. distribute-rgt-neg-in9.3%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    3. +-commutative9.3%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
    4. unpow29.3%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
    5. unpow29.3%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
    6. hypot-def18.2%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
  5. Simplified18.2%

    \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
  6. Taylor expanded in A around 0 16.0%

    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
  7. Step-by-step derivation
    1. mul-1-neg16.0%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  8. Simplified16.0%

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  9. Step-by-step derivation
    1. sqrt-unprod16.1%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  10. Applied egg-rr16.1%

    \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  11. Step-by-step derivation
    1. pow1/216.2%

      \[\leadsto -\color{blue}{{\left(\frac{F}{B} \cdot 2\right)}^{0.5}} \]
    2. *-commutative16.2%

      \[\leadsto -{\color{blue}{\left(2 \cdot \frac{F}{B}\right)}}^{0.5} \]
  12. Applied egg-rr16.2%

    \[\leadsto -\color{blue}{{\left(2 \cdot \frac{F}{B}\right)}^{0.5}} \]
  13. Final simplification16.2%

    \[\leadsto -{\left(2 \cdot \frac{F}{B}\right)}^{0.5} \]

Alternative 14: 26.7% accurate, 6.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ -\sqrt{2 \cdot \frac{F}{B}} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F) :precision binary64 (- (sqrt (* 2.0 (/ F B)))))
B = abs(B);
double code(double A, double B, double C, double F) {
	return -sqrt((2.0 * (F / B)));
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = -sqrt((2.0d0 * (f / b)))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	return -Math.sqrt((2.0 * (F / B)));
}
B = abs(B)
def code(A, B, C, F):
	return -math.sqrt((2.0 * (F / B)))
B = abs(B)
function code(A, B, C, F)
	return Float64(-sqrt(Float64(2.0 * Float64(F / B))))
end
B = abs(B)
function tmp = code(A, B, C, F)
	tmp = -sqrt((2.0 * (F / B)));
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := (-N[Sqrt[N[(2.0 * N[(F / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B = |B|\\
\\
-\sqrt{2 \cdot \frac{F}{B}}
\end{array}
Derivation
  1. Initial program 19.8%

    \[\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} \]
  2. Simplified19.8%

    \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
  3. Taylor expanded in C around 0 9.3%

    \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
  4. Step-by-step derivation
    1. mul-1-neg9.3%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
    2. distribute-rgt-neg-in9.3%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    3. +-commutative9.3%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right)}\right) \]
    4. unpow29.3%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
    5. unpow29.3%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
    6. hypot-def18.2%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
  5. Simplified18.2%

    \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
  6. Taylor expanded in A around 0 16.0%

    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
  7. Step-by-step derivation
    1. mul-1-neg16.0%

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  8. Simplified16.0%

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  9. Step-by-step derivation
    1. sqrt-unprod16.1%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  10. Applied egg-rr16.1%

    \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  11. Final simplification16.1%

    \[\leadsto -\sqrt{2 \cdot \frac{F}{B}} \]

Reproduce

?
herbie shell --seed 2023271 
(FPCore (A B C F)
  :name "ABCF->ab-angle a"
  :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))))