ABCF->ab-angle a

Percentage Accurate: 18.8% → 52.8%
Time: 23.1s
Alternatives: 13
Speedup: 3.1×

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 13 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.8% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+161}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\right)\right)\\ \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) 2e+161)
   (/
    (*
     (sqrt (* 2.0 (* F (fma B B (* (* A C) -4.0)))))
     (- (sqrt (+ A (+ C (hypot (- A C) B))))))
    (fma B B (* A (* C -4.0))))
   (* (/ (sqrt 2.0) B) (* (sqrt (+ A (hypot B A))) (- (sqrt F))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 2e+161) {
		tmp = (sqrt((2.0 * (F * fma(B, B, ((A * C) * -4.0))))) * -sqrt((A + (C + hypot((A - C), B))))) / fma(B, B, (A * (C * -4.0)));
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 2e+161)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * fma(B, B, Float64(Float64(A * C) * -4.0))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(Float64(A - C), B)))))) / fma(B, B, Float64(A * Float64(C * -4.0))));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-sqrt(F))));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+161], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(B * B + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+161}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\

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


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

    1. Initial program 27.3%

      \[\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. Simplified32.3%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*32.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{\color{blue}{\left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)} \cdot 2} \cdot \sqrt{\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      9. associate-*r*28.2%

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

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

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

    if 2.0000000000000001e161 < (pow.f64 B 2)

    1. Initial program 7.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. Taylor expanded in C around 0 6.4%

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

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

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

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

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

        \[\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) \]
    4. Simplified22.8%

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

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

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

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

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

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

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

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

Alternative 2: 46.8% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{-212}:\\ \;\;\;\;\frac{-\sqrt{\left|\left(\left(2 \cdot F\right) \cdot \left({B}^{2} + \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot C\right)\right|}}{{B}^{2} - C \cdot \left(A \cdot 4\right)}\\ \mathbf{elif}\;{B}^{2} \leq 10^{+109}:\\ \;\;\;\;\frac{-\sqrt{F \cdot \left(t_0 \cdot \left(2 \cdot \left(\mathsf{hypot}\left(A - C, B\right) + \left(A + C\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\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 (fma B B (* A (* C -4.0)))))
   (if (<= (pow B 2.0) 4e-212)
     (/
      (-
       (sqrt
        (fabs (* (* (* 2.0 F) (+ (pow B 2.0) (* (* A C) -4.0))) (* 2.0 C)))))
      (- (pow B 2.0) (* C (* A 4.0))))
     (if (<= (pow B 2.0) 1e+109)
       (/ (- (sqrt (* F (* t_0 (* 2.0 (+ (hypot (- A C) B) (+ A C))))))) t_0)
       (* (/ (sqrt 2.0) B) (* (sqrt (+ A (hypot B A))) (- (sqrt F))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (pow(B, 2.0) <= 4e-212) {
		tmp = -sqrt(fabs((((2.0 * F) * (pow(B, 2.0) + ((A * C) * -4.0))) * (2.0 * C)))) / (pow(B, 2.0) - (C * (A * 4.0)));
	} else if (pow(B, 2.0) <= 1e+109) {
		tmp = -sqrt((F * (t_0 * (2.0 * (hypot((A - C), B) + (A + C)))))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B ^ 2.0) <= 4e-212)
		tmp = Float64(Float64(-sqrt(abs(Float64(Float64(Float64(2.0 * F) * Float64((B ^ 2.0) + Float64(Float64(A * C) * -4.0))) * Float64(2.0 * C))))) / Float64((B ^ 2.0) - Float64(C * Float64(A * 4.0))));
	elseif ((B ^ 2.0) <= 1e+109)
		tmp = Float64(Float64(-sqrt(Float64(F * Float64(t_0 * Float64(2.0 * Float64(hypot(Float64(A - C), B) + Float64(A + C))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-sqrt(F))));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 4e-212], N[((-N[Sqrt[N[Abs[N[(N[(N[(2.0 * F), $MachinePrecision] * N[(N[Power[B, 2.0], $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+109], N[((-N[Sqrt[N[(F * N[(t$95$0 * N[(2.0 * N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{-212}:\\
\;\;\;\;\frac{-\sqrt{\left|\left(\left(2 \cdot F\right) \cdot \left({B}^{2} + \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot C\right)\right|}}{{B}^{2} - C \cdot \left(A \cdot 4\right)}\\

\mathbf{elif}\;{B}^{2} \leq 10^{+109}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(t_0 \cdot \left(2 \cdot \left(\mathsf{hypot}\left(A - C, B\right) + \left(A + C\right)\right)\right)\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B 2) < 3.99999999999999982e-212

    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. Taylor expanded in A around -inf 21.5%

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

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

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

        \[\leadsto \frac{-\sqrt{{\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)\right)}^{0.5} \cdot \color{blue}{{\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)\right)}^{0.5}}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      4. pow-prod-down13.1%

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

        \[\leadsto \frac{-\sqrt{{\color{blue}{\left({\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)\right)}^{2}\right)}}^{0.5}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      6. associate-*l*13.1%

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

        \[\leadsto \frac{-\sqrt{{\left({\left(2 \cdot \left(\color{blue}{\left(F \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)} \cdot \left(2 \cdot C\right)\right)\right)}^{2}\right)}^{0.5}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      8. associate-*l*13.1%

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

      \[\leadsto \frac{-\sqrt{\color{blue}{{\left({\left(2 \cdot \left(\left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(2 \cdot C\right)\right)\right)}^{2}\right)}^{0.5}}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    5. Step-by-step derivation
      1. unpow1/213.1%

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

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

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

        \[\leadsto \frac{-\sqrt{\left|\color{blue}{\left(2 \cdot \left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}\right|}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      5. associate-*r*22.5%

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

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

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

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

    if 3.99999999999999982e-212 < (pow.f64 B 2) < 9.99999999999999982e108

    1. Initial program 45.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. Step-by-step derivation
      1. neg-sub045.0%

        \[\leadsto \frac{\color{blue}{0 - \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. div-sub45.0%

        \[\leadsto \color{blue}{\frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \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}} \]
      3. associate-*l*45.0%

        \[\leadsto \frac{0}{{B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}} - \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} \]
    3. Applied egg-rr49.6%

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

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

    if 9.99999999999999982e108 < (pow.f64 B 2)

    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. Taylor expanded in C around 0 7.0%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow27.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-def23.1%

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

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

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

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

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

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

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

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

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

Alternative 3: 48.9% accurate, 1.2× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 10^{+109}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \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{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\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 (fma B B (* A (* C -4.0)))))
   (if (<= (pow B 2.0) 1e+109)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A (+ C (hypot B (- A C)))))))) t_0)
     (* (/ (sqrt 2.0) B) (* (sqrt (+ A (hypot B A))) (- (sqrt F)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (pow(B, 2.0) <= 1e+109) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + (C + hypot(B, (A - C))))))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B ^ 2.0) <= 1e+109)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-sqrt(F))));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+109], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * 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[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 10^{+109}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \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{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\right)\right)\\


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

    1. Initial program 26.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. Simplified31.7%

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

    if 9.99999999999999982e108 < (pow.f64 B 2)

    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. Taylor expanded in C around 0 7.0%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow27.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-def23.1%

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

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

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

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

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

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

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

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

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

Alternative 4: 44.8% accurate, 1.5× speedup?

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

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


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

    1. Initial program 22.3%

      \[\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. Taylor expanded in A around -inf 17.7%

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

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

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

        \[\leadsto \frac{-\sqrt{{\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)\right)}^{0.5} \cdot \color{blue}{{\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)\right)}^{0.5}}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      4. pow-prod-down11.5%

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

        \[\leadsto \frac{-\sqrt{{\color{blue}{\left({\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)\right)}^{2}\right)}}^{0.5}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      6. associate-*l*11.5%

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

        \[\leadsto \frac{-\sqrt{{\left({\left(2 \cdot \left(\color{blue}{\left(F \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)} \cdot \left(2 \cdot C\right)\right)\right)}^{2}\right)}^{0.5}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      8. associate-*l*11.5%

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

      \[\leadsto \frac{-\sqrt{\color{blue}{{\left({\left(2 \cdot \left(\left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(2 \cdot C\right)\right)\right)}^{2}\right)}^{0.5}}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    5. Step-by-step derivation
      1. unpow1/211.5%

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

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

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

        \[\leadsto \frac{-\sqrt{\left|\color{blue}{\left(2 \cdot \left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}\right|}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      5. associate-*r*18.7%

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

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

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

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

    if 6.9e10 < B

    1. Initial program 10.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. Taylor expanded in C around 0 14.8%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow214.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-def42.6%

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

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

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

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

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

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

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

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

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

Alternative 5: 44.3% accurate, 1.5× speedup?

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

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


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

    1. Initial program 22.3%

      \[\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. Taylor expanded in A around -inf 17.7%

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

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

    if 1.55e11 < B

    1. Initial program 10.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. Taylor expanded in C around 0 14.8%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow214.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-def42.6%

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

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

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

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

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

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

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

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

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

Alternative 6: 38.9% accurate, 1.9× speedup?

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

\mathbf{elif}\;F \leq 1.2 \cdot 10^{+37}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}}{B}\\

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


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

    1. Initial program 32.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. Taylor expanded in A around -inf 18.9%

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < F < 1.2e37

    1. Initial program 22.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. Taylor expanded in A around 0 8.2%

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

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

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

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

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

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

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

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

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)}}{B}\right)} - 1\right) \]
      7. sqrt-unprod6.3%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}}{B}\right)} - 1\right) \]
    6. Applied egg-rr6.3%

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

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

        \[\leadsto -\color{blue}{\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}} \]
      3. associate-*r*22.3%

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

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

    if 1.2e37 < F

    1. Initial program 13.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. Taylor expanded in C around 0 6.0%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow26.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-def6.4%

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified14.9%

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

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

Alternative 7: 37.7% accurate, 2.0× speedup?

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

\mathbf{elif}\;F \leq 1.4 \cdot 10^{+37}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}}{B}\\

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


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

    1. Initial program 31.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. Taylor expanded in A around -inf 18.2%

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

      \[\leadsto \frac{-\sqrt{\color{blue}{-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    4. Step-by-step derivation
      1. associate-*r*20.6%

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

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

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

    if 6.9999999999999984e-309 < F < 1.3999999999999999e37

    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. Taylor expanded in A around 0 8.2%

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

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

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

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

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

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

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

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

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)}}{B}\right)} - 1\right) \]
      7. sqrt-unprod6.3%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}}{B}\right)} - 1\right) \]
    6. Applied egg-rr6.3%

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

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

        \[\leadsto -\color{blue}{\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}} \]
      3. associate-*r*22.4%

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

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

    if 1.3999999999999999e37 < F

    1. Initial program 13.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. Taylor expanded in C around 0 6.0%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow26.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-def6.4%

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified14.9%

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

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

Alternative 8: 38.8% accurate, 2.8× speedup?

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

\mathbf{elif}\;F \leq 2.2 \cdot 10^{+37}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}}{B}\\

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


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

    1. Initial program 31.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. Taylor expanded in A around -inf 18.2%

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

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

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

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

    if 6.9999999999999984e-309 < F < 2.2000000000000001e37

    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. Taylor expanded in A around 0 8.2%

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

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

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

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

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

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

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

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

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)}}{B}\right)} - 1\right) \]
      7. sqrt-unprod6.3%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}}{B}\right)} - 1\right) \]
    6. Applied egg-rr6.3%

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

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

        \[\leadsto -\color{blue}{\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}} \]
      3. associate-*r*22.4%

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

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

    if 2.2000000000000001e37 < F

    1. Initial program 13.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. Taylor expanded in C around 0 6.0%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow26.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-def6.4%

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified14.9%

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

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

Alternative 9: 35.9% accurate, 3.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 5.5000000000000002e36

    1. Initial program 23.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. Taylor expanded in A around 0 6.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}}{B}\right)} - 1\right) \]
    6. Applied egg-rr5.4%

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

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

        \[\leadsto -\color{blue}{\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}} \]
      3. associate-*r*18.9%

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

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

    if 5.5000000000000002e36 < F

    1. Initial program 13.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. Taylor expanded in C around 0 6.0%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow26.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-def6.4%

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified14.9%

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

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

Alternative 10: 33.2% accurate, 3.0× speedup?

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

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


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

    1. Initial program 25.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. Taylor expanded in C around 0 5.9%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow25.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-def15.0%

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

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

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

    if 2.4000000000000001e-83 < F

    1. Initial program 15.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. Taylor expanded in C around 0 6.8%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow26.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-def13.3%

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

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

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

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

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

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

Alternative 11: 26.2% accurate, 3.1× speedup?

\[\begin{array}{l} B = |B|\\ \\ \sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right) \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F) :precision binary64 (* (sqrt 2.0) (- (sqrt (/ F B)))))
B = abs(B);
double code(double A, double B, double C, double F) {
	return sqrt(2.0) * -sqrt((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) * -sqrt((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) * -Math.sqrt((F / B));
}
B = abs(B)
def code(A, B, C, F):
	return math.sqrt(2.0) * -math.sqrt((F / B))
B = abs(B)
function code(A, B, C, F)
	return Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))))
end
B = abs(B)
function tmp = code(A, B, C, F)
	tmp = sqrt(2.0) * -sqrt((F / B));
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)
\end{array}
Derivation
  1. Initial program 19.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. Taylor expanded in C around 0 6.4%

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

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

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

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

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

      \[\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-def14.0%

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

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

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

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

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

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

Alternative 12: 8.3% accurate, 5.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 1.07999999999999996e-153

    1. Initial program 16.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. Taylor expanded in C around 0 7.9%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow27.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-def16.2%

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

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

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

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

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

        \[\leadsto -\sqrt{F \cdot A} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{B} \]
      4. rem-square-sqrt2.8%

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

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

    if 1.07999999999999996e-153 < C

    1. Initial program 24.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. Taylor expanded in A around 0 5.8%

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

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

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

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

        \[\leadsto -\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{B} \cdot \sqrt{C \cdot F} \]
      2. rem-square-sqrt6.7%

        \[\leadsto -\frac{\color{blue}{2}}{B} \cdot \sqrt{C \cdot F} \]
      3. *-commutative6.7%

        \[\leadsto -\frac{2}{B} \cdot \sqrt{\color{blue}{F \cdot C}} \]
    7. Simplified6.7%

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

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

Alternative 13: 5.1% accurate, 5.9× speedup?

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

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

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

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

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

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

      \[\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-def14.0%

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

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

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

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

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

      \[\leadsto -\sqrt{F \cdot A} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{B} \]
    4. rem-square-sqrt2.2%

      \[\leadsto -\sqrt{F \cdot A} \cdot \frac{\color{blue}{2}}{B} \]
  7. Simplified2.2%

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

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

Reproduce

?
herbie shell --seed 2023314 
(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))))