ABCF->ab-angle a

Percentage Accurate: 18.7% → 56.7%
Time: 39.5s
Alternatives: 17
Speedup: 3.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 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.7% 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: 56.7% accurate, 0.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := \left(4 \cdot A\right) \cdot C\\ t_2 := 2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\\ t_3 := t\_1 - {B\_m}^{2}\\ t_4 := \frac{\sqrt{t\_2 \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_3}\\ \mathbf{if}\;t\_4 \leq -1 \cdot 10^{-211}:\\ \;\;\;\;\frac{\left(\sqrt{C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)} \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B\_m}^{2}\right)}}{4 \cdot \left(A \cdot C\right) - {B\_m}^{2}}\\ \mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+185}:\\ \;\;\;\;\frac{\sqrt{t\_2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_3}\\ \mathbf{elif}\;t\_4 \leq \infty:\\ \;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)} \cdot \sqrt{t\_0 \cdot \left(2 \cdot F\right)}}{-t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
        (t_1 (* (* 4.0 A) C))
        (t_2 (* 2.0 (* (- (pow B_m 2.0) t_1) F)))
        (t_3 (- t_1 (pow B_m 2.0)))
        (t_4
         (/
          (sqrt (* t_2 (+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
          t_3)))
   (if (<= t_4 -1e-211)
     (/
      (*
       (* (sqrt (+ C (+ A (hypot B_m (- A C))))) (sqrt F))
       (sqrt (* 2.0 (fma A (* C -4.0) (pow B_m 2.0)))))
      (- (* 4.0 (* A C)) (pow B_m 2.0)))
     (if (<= t_4 4e+185)
       (/ (sqrt (* t_2 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))) t_3)
       (if (<= t_4 INFINITY)
         (/
          (* (sqrt (+ (+ A C) (hypot (- A C) B_m))) (sqrt (* t_0 (* 2.0 F))))
          (- t_0))
         (*
          (/ (sqrt 2.0) B_m)
          (* (sqrt (+ C (hypot B_m C))) (- (sqrt F)))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_1 = (4.0 * A) * C;
	double t_2 = 2.0 * ((pow(B_m, 2.0) - t_1) * F);
	double t_3 = t_1 - pow(B_m, 2.0);
	double t_4 = sqrt((t_2 * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_3;
	double tmp;
	if (t_4 <= -1e-211) {
		tmp = ((sqrt((C + (A + hypot(B_m, (A - C))))) * sqrt(F)) * sqrt((2.0 * fma(A, (C * -4.0), pow(B_m, 2.0))))) / ((4.0 * (A * C)) - pow(B_m, 2.0));
	} else if (t_4 <= 4e+185) {
		tmp = sqrt((t_2 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_3;
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = (sqrt(((A + C) + hypot((A - C), B_m))) * sqrt((t_0 * (2.0 * F)))) / -t_0;
	} else {
		tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(Float64(4.0 * A) * C)
	t_2 = Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_1) * F))
	t_3 = Float64(t_1 - (B_m ^ 2.0))
	t_4 = Float64(sqrt(Float64(t_2 * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_3)
	tmp = 0.0
	if (t_4 <= -1e-211)
		tmp = Float64(Float64(Float64(sqrt(Float64(C + Float64(A + hypot(B_m, Float64(A - C))))) * sqrt(F)) * sqrt(Float64(2.0 * fma(A, Float64(C * -4.0), (B_m ^ 2.0))))) / Float64(Float64(4.0 * Float64(A * C)) - (B_m ^ 2.0)));
	elseif (t_4 <= 4e+185)
		tmp = Float64(sqrt(Float64(t_2 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C)))) / t_3);
	elseif (t_4 <= Inf)
		tmp = Float64(Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) * sqrt(Float64(t_0 * Float64(2.0 * F)))) / Float64(-t_0));
	else
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(t$95$2 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[t$95$4, -1e-211], N[(N[(N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 4e+185], N[(N[Sqrt[N[(t$95$2 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \left(4 \cdot A\right) \cdot C\\
t_2 := 2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\\
t_3 := t\_1 - {B\_m}^{2}\\
t_4 := \frac{\sqrt{t\_2 \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_3}\\
\mathbf{if}\;t\_4 \leq -1 \cdot 10^{-211}:\\
\;\;\;\;\frac{\left(\sqrt{C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)} \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B\_m}^{2}\right)}}{4 \cdot \left(A \cdot C\right) - {B\_m}^{2}}\\

\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+185}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_3}\\

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)} \cdot \sqrt{t\_0 \cdot \left(2 \cdot F\right)}}{-t\_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -1.00000000000000009e-211

    1. Initial program 48.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. Simplified43.3%

      \[\leadsto \color{blue}{\frac{\sqrt{F \cdot \left(\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)\right)\right)}}{4 \cdot \left(A \cdot C\right) - {B}^{2}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. pow1/243.3%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{{\left(F \cdot \left(\mathsf{hypot}\left(A - C, B\right) + \left(A + C\right)\right)\right)}^{0.5} \cdot \sqrt{2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}}}{4 \cdot \left(A \cdot C\right) - {B}^{2}} \]
    6. Step-by-step derivation
      1. unpow1/269.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000009e-211 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < 3.9999999999999999e185

    1. Initial program 21.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. Add Preprocessing
    3. Taylor expanded in A around -inf 50.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(-0.5 \cdot \frac{{B}^{2}}{A} + 2 \cdot C\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if 3.9999999999999999e185 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0

    1. Initial program 9.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. Simplified54.4%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot \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. Add Preprocessing
    4. Step-by-step derivation
      1. pow1/254.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}} \leq -1 \cdot 10^{-211}:\\ \;\;\;\;\frac{\left(\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}}{4 \cdot \left(A \cdot C\right) - {B}^{2}}\\ \mathbf{elif}\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}} \leq 4 \cdot 10^{+185}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(-0.5 \cdot \frac{{B}^{2}}{A} + 2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}} \leq \infty:\\ \;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)} \cdot \sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 45.0% accurate, 0.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ t_1 := t\_0 - {B\_m}^{2}\\ t_2 := 2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\\ t_3 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_1}\\ \mathbf{if}\;{B\_m}^{2} \leq 0:\\ \;\;\;\;\frac{\sqrt{\left|t\_2 \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-219}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-128}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot t\_2} \cdot \sqrt{C}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* 4.0 A) C))
        (t_1 (- t_0 (pow B_m 2.0)))
        (t_2 (* 2.0 (+ (pow B_m 2.0) (* -4.0 (* A C)))))
        (t_3 (/ (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 A))) t_1)))
   (if (<= (pow B_m 2.0) 0.0)
     (/ (sqrt (fabs (* t_2 (* F (* 2.0 C))))) t_1)
     (if (<= (pow B_m 2.0) 1e-219)
       t_3
       (if (<= (pow B_m 2.0) 2e-128)
         (/ (* (sqrt (* (* 2.0 F) t_2)) (sqrt C)) t_1)
         (if (<= (pow B_m 2.0) 1e-127)
           t_3
           (*
            (* (sqrt F) (sqrt (+ A (hypot B_m A))))
            (/ (sqrt 2.0) (- B_m)))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - pow(B_m, 2.0);
	double t_2 = 2.0 * (pow(B_m, 2.0) + (-4.0 * (A * C)));
	double t_3 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
	double tmp;
	if (pow(B_m, 2.0) <= 0.0) {
		tmp = sqrt(fabs((t_2 * (F * (2.0 * C))))) / t_1;
	} else if (pow(B_m, 2.0) <= 1e-219) {
		tmp = t_3;
	} else if (pow(B_m, 2.0) <= 2e-128) {
		tmp = (sqrt(((2.0 * F) * t_2)) * sqrt(C)) / t_1;
	} else if (pow(B_m, 2.0) <= 1e-127) {
		tmp = t_3;
	} else {
		tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - Math.pow(B_m, 2.0);
	double t_2 = 2.0 * (Math.pow(B_m, 2.0) + (-4.0 * (A * C)));
	double t_3 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
	double tmp;
	if (Math.pow(B_m, 2.0) <= 0.0) {
		tmp = Math.sqrt(Math.abs((t_2 * (F * (2.0 * C))))) / t_1;
	} else if (Math.pow(B_m, 2.0) <= 1e-219) {
		tmp = t_3;
	} else if (Math.pow(B_m, 2.0) <= 2e-128) {
		tmp = (Math.sqrt(((2.0 * F) * t_2)) * Math.sqrt(C)) / t_1;
	} else if (Math.pow(B_m, 2.0) <= 1e-127) {
		tmp = t_3;
	} else {
		tmp = (Math.sqrt(F) * Math.sqrt((A + Math.hypot(B_m, A)))) * (Math.sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = (4.0 * A) * C
	t_1 = t_0 - math.pow(B_m, 2.0)
	t_2 = 2.0 * (math.pow(B_m, 2.0) + (-4.0 * (A * C)))
	t_3 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1
	tmp = 0
	if math.pow(B_m, 2.0) <= 0.0:
		tmp = math.sqrt(math.fabs((t_2 * (F * (2.0 * C))))) / t_1
	elif math.pow(B_m, 2.0) <= 1e-219:
		tmp = t_3
	elif math.pow(B_m, 2.0) <= 2e-128:
		tmp = (math.sqrt(((2.0 * F) * t_2)) * math.sqrt(C)) / t_1
	elif math.pow(B_m, 2.0) <= 1e-127:
		tmp = t_3
	else:
		tmp = (math.sqrt(F) * math.sqrt((A + math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	t_1 = Float64(t_0 - (B_m ^ 2.0))
	t_2 = Float64(2.0 * Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C))))
	t_3 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * A))) / t_1)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 0.0)
		tmp = Float64(sqrt(abs(Float64(t_2 * Float64(F * Float64(2.0 * C))))) / t_1);
	elseif ((B_m ^ 2.0) <= 1e-219)
		tmp = t_3;
	elseif ((B_m ^ 2.0) <= 2e-128)
		tmp = Float64(Float64(sqrt(Float64(Float64(2.0 * F) * t_2)) * sqrt(C)) / t_1);
	elseif ((B_m ^ 2.0) <= 1e-127)
		tmp = t_3;
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (4.0 * A) * C;
	t_1 = t_0 - (B_m ^ 2.0);
	t_2 = 2.0 * ((B_m ^ 2.0) + (-4.0 * (A * C)));
	t_3 = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 0.0)
		tmp = sqrt(abs((t_2 * (F * (2.0 * C))))) / t_1;
	elseif ((B_m ^ 2.0) <= 1e-219)
		tmp = t_3;
	elseif ((B_m ^ 2.0) <= 2e-128)
		tmp = (sqrt(((2.0 * F) * t_2)) * sqrt(C)) / t_1;
	elseif ((B_m ^ 2.0) <= 1e-127)
		tmp = t_3;
	else
		tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 0.0], N[(N[Sqrt[N[Abs[N[(t$95$2 * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-219], t$95$3, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-128], N[(N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sqrt[C], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-127], t$95$3, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
t_2 := 2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\\
t_3 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_1}\\
\mathbf{if}\;{B\_m}^{2} \leq 0:\\
\;\;\;\;\frac{\sqrt{\left|t\_2 \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{t\_1}\\

\mathbf{elif}\;{B\_m}^{2} \leq 10^{-219}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-128}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot t\_2} \cdot \sqrt{C}}{t\_1}\\

\mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\
\;\;\;\;t\_3\\

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in A around -inf 34.3%

      \[\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} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt34.3%

        \[\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/234.3%

        \[\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/234.4%

        \[\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-down18.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. pow218.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-*r*18.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (pow.f64 B 2) < 1e-219 or 2.00000000000000011e-128 < (pow.f64 B 2) < 1e-127

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

      \[\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 A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if 1e-219 < (pow.f64 B 2) < 2.00000000000000011e-128

    1. Initial program 28.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. Add Preprocessing
    3. Taylor expanded in A around -inf 20.8%

      \[\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} \]
    4. Step-by-step derivation
      1. pow1/220.9%

        \[\leadsto \frac{-\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} \]
      2. associate-*r*20.9%

        \[\leadsto \frac{-{\color{blue}{\left(\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot 2\right) \cdot C\right)}}^{0.5}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      3. unpow-prod-down34.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e-127 < (pow.f64 B 2)

    1. Initial program 18.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. Add Preprocessing
    3. Taylor expanded in C around 0 13.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 0:\\ \;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;{B}^{2} \leq 10^{-219}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-128}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(2 \cdot \left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{C}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;{B}^{2} \leq 10^{-127}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \frac{\sqrt{2}}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 45.0% accurate, 0.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ t_1 := {B\_m}^{2} - t\_0\\ t_2 := t\_0 - {B\_m}^{2}\\ t_3 := \frac{\sqrt{\left(2 \cdot \left(t\_1 \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_2}\\ \mathbf{if}\;{B\_m}^{2} \leq 0:\\ \;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{t\_2}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-219}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-128}:\\ \;\;\;\;\frac{\sqrt{F \cdot \left(2 \cdot t\_1\right)} \cdot \sqrt{2 \cdot C}}{t\_2}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* 4.0 A) C))
        (t_1 (- (pow B_m 2.0) t_0))
        (t_2 (- t_0 (pow B_m 2.0)))
        (t_3 (/ (sqrt (* (* 2.0 (* t_1 F)) (* 2.0 A))) t_2)))
   (if (<= (pow B_m 2.0) 0.0)
     (/
      (sqrt
       (fabs (* (* 2.0 (+ (pow B_m 2.0) (* -4.0 (* A C)))) (* F (* 2.0 C)))))
      t_2)
     (if (<= (pow B_m 2.0) 1e-219)
       t_3
       (if (<= (pow B_m 2.0) 2e-128)
         (/ (* (sqrt (* F (* 2.0 t_1))) (sqrt (* 2.0 C))) t_2)
         (if (<= (pow B_m 2.0) 1e-127)
           t_3
           (*
            (* (sqrt F) (sqrt (+ A (hypot B_m A))))
            (/ (sqrt 2.0) (- B_m)))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = pow(B_m, 2.0) - t_0;
	double t_2 = t_0 - pow(B_m, 2.0);
	double t_3 = sqrt(((2.0 * (t_1 * F)) * (2.0 * A))) / t_2;
	double tmp;
	if (pow(B_m, 2.0) <= 0.0) {
		tmp = sqrt(fabs(((2.0 * (pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_2;
	} else if (pow(B_m, 2.0) <= 1e-219) {
		tmp = t_3;
	} else if (pow(B_m, 2.0) <= 2e-128) {
		tmp = (sqrt((F * (2.0 * t_1))) * sqrt((2.0 * C))) / t_2;
	} else if (pow(B_m, 2.0) <= 1e-127) {
		tmp = t_3;
	} else {
		tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = Math.pow(B_m, 2.0) - t_0;
	double t_2 = t_0 - Math.pow(B_m, 2.0);
	double t_3 = Math.sqrt(((2.0 * (t_1 * F)) * (2.0 * A))) / t_2;
	double tmp;
	if (Math.pow(B_m, 2.0) <= 0.0) {
		tmp = Math.sqrt(Math.abs(((2.0 * (Math.pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_2;
	} else if (Math.pow(B_m, 2.0) <= 1e-219) {
		tmp = t_3;
	} else if (Math.pow(B_m, 2.0) <= 2e-128) {
		tmp = (Math.sqrt((F * (2.0 * t_1))) * Math.sqrt((2.0 * C))) / t_2;
	} else if (Math.pow(B_m, 2.0) <= 1e-127) {
		tmp = t_3;
	} else {
		tmp = (Math.sqrt(F) * Math.sqrt((A + Math.hypot(B_m, A)))) * (Math.sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = (4.0 * A) * C
	t_1 = math.pow(B_m, 2.0) - t_0
	t_2 = t_0 - math.pow(B_m, 2.0)
	t_3 = math.sqrt(((2.0 * (t_1 * F)) * (2.0 * A))) / t_2
	tmp = 0
	if math.pow(B_m, 2.0) <= 0.0:
		tmp = math.sqrt(math.fabs(((2.0 * (math.pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_2
	elif math.pow(B_m, 2.0) <= 1e-219:
		tmp = t_3
	elif math.pow(B_m, 2.0) <= 2e-128:
		tmp = (math.sqrt((F * (2.0 * t_1))) * math.sqrt((2.0 * C))) / t_2
	elif math.pow(B_m, 2.0) <= 1e-127:
		tmp = t_3
	else:
		tmp = (math.sqrt(F) * math.sqrt((A + math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	t_1 = Float64((B_m ^ 2.0) - t_0)
	t_2 = Float64(t_0 - (B_m ^ 2.0))
	t_3 = Float64(sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(2.0 * A))) / t_2)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 0.0)
		tmp = Float64(sqrt(abs(Float64(Float64(2.0 * Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C)))) * Float64(F * Float64(2.0 * C))))) / t_2);
	elseif ((B_m ^ 2.0) <= 1e-219)
		tmp = t_3;
	elseif ((B_m ^ 2.0) <= 2e-128)
		tmp = Float64(Float64(sqrt(Float64(F * Float64(2.0 * t_1))) * sqrt(Float64(2.0 * C))) / t_2);
	elseif ((B_m ^ 2.0) <= 1e-127)
		tmp = t_3;
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (4.0 * A) * C;
	t_1 = (B_m ^ 2.0) - t_0;
	t_2 = t_0 - (B_m ^ 2.0);
	t_3 = sqrt(((2.0 * (t_1 * F)) * (2.0 * A))) / t_2;
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 0.0)
		tmp = sqrt(abs(((2.0 * ((B_m ^ 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_2;
	elseif ((B_m ^ 2.0) <= 1e-219)
		tmp = t_3;
	elseif ((B_m ^ 2.0) <= 2e-128)
		tmp = (sqrt((F * (2.0 * t_1))) * sqrt((2.0 * C))) / t_2;
	elseif ((B_m ^ 2.0) <= 1e-127)
		tmp = t_3;
	else
		tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 0.0], N[(N[Sqrt[N[Abs[N[(N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-219], t$95$3, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-128], N[(N[(N[Sqrt[N[(F * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-127], t$95$3, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := {B\_m}^{2} - t\_0\\
t_2 := t\_0 - {B\_m}^{2}\\
t_3 := \frac{\sqrt{\left(2 \cdot \left(t\_1 \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_2}\\
\mathbf{if}\;{B\_m}^{2} \leq 0:\\
\;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{t\_2}\\

\mathbf{elif}\;{B\_m}^{2} \leq 10^{-219}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-128}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(2 \cdot t\_1\right)} \cdot \sqrt{2 \cdot C}}{t\_2}\\

\mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\
\;\;\;\;t\_3\\

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in A around -inf 34.3%

      \[\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} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt34.3%

        \[\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/234.3%

        \[\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/234.4%

        \[\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-down18.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. pow218.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-*r*18.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (pow.f64 B 2) < 1e-219 or 2.00000000000000011e-128 < (pow.f64 B 2) < 1e-127

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

      \[\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 A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if 1e-219 < (pow.f64 B 2) < 2.00000000000000011e-128

    1. Initial program 28.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. Add Preprocessing
    3. Taylor expanded in A around -inf 20.8%

      \[\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} \]
    4. Step-by-step derivation
      1. sqrt-prod34.3%

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

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

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

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

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

    if 1e-127 < (pow.f64 B 2)

    1. Initial program 18.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. Add Preprocessing
    3. Taylor expanded in C around 0 13.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 0:\\ \;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;{B}^{2} \leq 10^{-219}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-128}:\\ \;\;\;\;\frac{\sqrt{F \cdot \left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)} \cdot \sqrt{2 \cdot C}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;{B}^{2} \leq 10^{-127}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \frac{\sqrt{2}}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 47.6% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 0:\\ \;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+117}:\\ \;\;\;\;\frac{\sqrt{\left(t\_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)}}{-t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= (pow B_m 2.0) 0.0)
     (/
      (sqrt
       (fabs (* (* 2.0 (+ (pow B_m 2.0) (* -4.0 (* A C)))) (* F (* 2.0 C)))))
      (- (* (* 4.0 A) C) (pow B_m 2.0)))
     (if (<= (pow B_m 2.0) 2e+117)
       (/ (sqrt (* (* t_0 (* 2.0 F)) (+ (+ A C) (hypot B_m (- A C))))) (- t_0))
       (* (* (sqrt F) (sqrt (+ A (hypot B_m A)))) (/ (sqrt 2.0) (- B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (pow(B_m, 2.0) <= 0.0) {
		tmp = sqrt(fabs(((2.0 * (pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / (((4.0 * A) * C) - pow(B_m, 2.0));
	} else if (pow(B_m, 2.0) <= 2e+117) {
		tmp = sqrt(((t_0 * (2.0 * F)) * ((A + C) + hypot(B_m, (A - C))))) / -t_0;
	} else {
		tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 0.0)
		tmp = Float64(sqrt(abs(Float64(Float64(2.0 * Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C)))) * Float64(F * Float64(2.0 * C))))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0)));
	elseif ((B_m ^ 2.0) <= 2e+117)
		tmp = Float64(sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))) / Float64(-t_0));
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 0.0], N[(N[Sqrt[N[Abs[N[(N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+117], N[(N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 0:\\
\;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\

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

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in A around -inf 34.3%

      \[\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} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt34.3%

        \[\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/234.3%

        \[\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/234.4%

        \[\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-down18.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. pow218.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-*r*18.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (pow.f64 B 2) < 2.0000000000000001e117

    1. Initial program 37.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. Simplified45.3%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot \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. Add Preprocessing

    if 2.0000000000000001e117 < (pow.f64 B 2)

    1. Initial program 7.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. Add Preprocessing
    3. Taylor expanded in C around 0 11.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\sqrt{2}}{B} \cdot \color{blue}{\left({\left(A + \mathsf{hypot}\left(B, A\right)\right)}^{0.5} \cdot {F}^{0.5}\right)} \]
      4. pow1/246.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/246.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 0:\\ \;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+117}:\\ \;\;\;\;\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\right) \cdot \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)}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \frac{\sqrt{2}}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 51.6% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{+117}:\\ \;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)} \cdot \sqrt{t\_0 \cdot \left(2 \cdot F\right)}}{-t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= (pow B_m 2.0) 2e+117)
     (/
      (* (sqrt (+ (+ A C) (hypot (- A C) B_m))) (sqrt (* t_0 (* 2.0 F))))
      (- t_0))
     (* (* (sqrt F) (sqrt (+ A (hypot B_m A)))) (/ (sqrt 2.0) (- B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (pow(B_m, 2.0) <= 2e+117) {
		tmp = (sqrt(((A + C) + hypot((A - C), B_m))) * sqrt((t_0 * (2.0 * F)))) / -t_0;
	} else {
		tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e+117)
		tmp = Float64(Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) * sqrt(Float64(t_0 * Float64(2.0 * F)))) / Float64(-t_0));
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+117], N[(N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{+117}:\\
\;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)} \cdot \sqrt{t\_0 \cdot \left(2 \cdot F\right)}}{-t\_0}\\

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


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

    1. Initial program 30.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. Simplified39.0%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot \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. Add Preprocessing
    4. Step-by-step derivation
      1. pow1/239.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e117 < (pow.f64 B 2)

    1. Initial program 7.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. Add Preprocessing
    3. Taylor expanded in C around 0 11.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\sqrt{2}}{B} \cdot \color{blue}{\left({\left(A + \mathsf{hypot}\left(B, A\right)\right)}^{0.5} \cdot {F}^{0.5}\right)} \]
      4. pow1/246.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/246.2%

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

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

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

Alternative 6: 44.8% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ t_1 := t\_0 - {B\_m}^{2}\\ \mathbf{if}\;{B\_m}^{2} \leq 0:\\ \;\;\;\;\frac{\sqrt{4 \cdot \left(\left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot F\right)\right)}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* 4.0 A) C)) (t_1 (- t_0 (pow B_m 2.0))))
   (if (<= (pow B_m 2.0) 0.0)
     (/ (sqrt (* 4.0 (* (+ (pow B_m 2.0) (* -4.0 (* A C))) (* C F)))) t_1)
     (if (<= (pow B_m 2.0) 1e-127)
       (/ (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 A))) t_1)
       (* (* (sqrt F) (sqrt (+ A (hypot B_m A)))) (/ (sqrt 2.0) (- B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - pow(B_m, 2.0);
	double tmp;
	if (pow(B_m, 2.0) <= 0.0) {
		tmp = sqrt((4.0 * ((pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / t_1;
	} else if (pow(B_m, 2.0) <= 1e-127) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
	} else {
		tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - Math.pow(B_m, 2.0);
	double tmp;
	if (Math.pow(B_m, 2.0) <= 0.0) {
		tmp = Math.sqrt((4.0 * ((Math.pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / t_1;
	} else if (Math.pow(B_m, 2.0) <= 1e-127) {
		tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
	} else {
		tmp = (Math.sqrt(F) * Math.sqrt((A + Math.hypot(B_m, A)))) * (Math.sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = (4.0 * A) * C
	t_1 = t_0 - math.pow(B_m, 2.0)
	tmp = 0
	if math.pow(B_m, 2.0) <= 0.0:
		tmp = math.sqrt((4.0 * ((math.pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / t_1
	elif math.pow(B_m, 2.0) <= 1e-127:
		tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1
	else:
		tmp = (math.sqrt(F) * math.sqrt((A + math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	t_1 = Float64(t_0 - (B_m ^ 2.0))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 0.0)
		tmp = Float64(sqrt(Float64(4.0 * Float64(Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C))) * Float64(C * F)))) / t_1);
	elseif ((B_m ^ 2.0) <= 1e-127)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * A))) / t_1);
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (4.0 * A) * C;
	t_1 = t_0 - (B_m ^ 2.0);
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 0.0)
		tmp = sqrt((4.0 * (((B_m ^ 2.0) + (-4.0 * (A * C))) * (C * F)))) / t_1;
	elseif ((B_m ^ 2.0) <= 1e-127)
		tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
	else
		tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 0.0], N[(N[Sqrt[N[(4.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-127], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
\mathbf{if}\;{B\_m}^{2} \leq 0:\\
\;\;\;\;\frac{\sqrt{4 \cdot \left(\left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot F\right)\right)}}{t\_1}\\

\mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_1}\\

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in A around -inf 34.3%

      \[\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} \]
    4. Taylor expanded in F around 0 34.1%

      \[\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} \]
    5. Step-by-step derivation
      1. associate-*r*35.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. *-commutative35.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-inv35.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-eval35.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} \]
    6. Simplified35.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 0.0 < (pow.f64 B 2) < 1e-127

    1. Initial program 30.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. Add Preprocessing
    3. Taylor expanded in A around inf 34.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 A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if 1e-127 < (pow.f64 B 2)

    1. Initial program 18.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. Add Preprocessing
    3. Taylor expanded in C around 0 13.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 44.9% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ t_1 := t\_0 - {B\_m}^{2}\\ \mathbf{if}\;{B\_m}^{2} \leq 0:\\ \;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* 4.0 A) C)) (t_1 (- t_0 (pow B_m 2.0))))
   (if (<= (pow B_m 2.0) 0.0)
     (/
      (sqrt
       (fabs (* (* 2.0 (+ (pow B_m 2.0) (* -4.0 (* A C)))) (* F (* 2.0 C)))))
      t_1)
     (if (<= (pow B_m 2.0) 1e-127)
       (/ (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 A))) t_1)
       (* (* (sqrt F) (sqrt (+ A (hypot B_m A)))) (/ (sqrt 2.0) (- B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - pow(B_m, 2.0);
	double tmp;
	if (pow(B_m, 2.0) <= 0.0) {
		tmp = sqrt(fabs(((2.0 * (pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_1;
	} else if (pow(B_m, 2.0) <= 1e-127) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
	} else {
		tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - Math.pow(B_m, 2.0);
	double tmp;
	if (Math.pow(B_m, 2.0) <= 0.0) {
		tmp = Math.sqrt(Math.abs(((2.0 * (Math.pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_1;
	} else if (Math.pow(B_m, 2.0) <= 1e-127) {
		tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
	} else {
		tmp = (Math.sqrt(F) * Math.sqrt((A + Math.hypot(B_m, A)))) * (Math.sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = (4.0 * A) * C
	t_1 = t_0 - math.pow(B_m, 2.0)
	tmp = 0
	if math.pow(B_m, 2.0) <= 0.0:
		tmp = math.sqrt(math.fabs(((2.0 * (math.pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_1
	elif math.pow(B_m, 2.0) <= 1e-127:
		tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1
	else:
		tmp = (math.sqrt(F) * math.sqrt((A + math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	t_1 = Float64(t_0 - (B_m ^ 2.0))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 0.0)
		tmp = Float64(sqrt(abs(Float64(Float64(2.0 * Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C)))) * Float64(F * Float64(2.0 * C))))) / t_1);
	elseif ((B_m ^ 2.0) <= 1e-127)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * A))) / t_1);
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (4.0 * A) * C;
	t_1 = t_0 - (B_m ^ 2.0);
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 0.0)
		tmp = sqrt(abs(((2.0 * ((B_m ^ 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_1;
	elseif ((B_m ^ 2.0) <= 1e-127)
		tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
	else
		tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 0.0], N[(N[Sqrt[N[Abs[N[(N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-127], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
\mathbf{if}\;{B\_m}^{2} \leq 0:\\
\;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{t\_1}\\

\mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_1}\\

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in A around -inf 34.3%

      \[\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} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt34.3%

        \[\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/234.3%

        \[\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/234.4%

        \[\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-down18.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. pow218.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-*r*18.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (pow.f64 B 2) < 1e-127

    1. Initial program 30.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. Add Preprocessing
    3. Taylor expanded in A around inf 34.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 A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if 1e-127 < (pow.f64 B 2)

    1. Initial program 18.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. Add Preprocessing
    3. Taylor expanded in C around 0 13.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 40.5% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\ \;\;\;\;\frac{\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -8\right)\right)}}{-\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;F \leq 175000:\\ \;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -4.3e-296)
   (/
    (sqrt (* (+ (+ A C) (hypot B_m (- A C))) (* (* C F) (* A -8.0))))
    (- (fma B_m B_m (* A (* C -4.0)))))
   (if (<= F 175000.0)
     (/ (pow (* 2.0 (* F (+ A (hypot B_m A)))) 0.5) (- B_m))
     (* (sqrt 2.0) (- (sqrt (/ F B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -4.3e-296) {
		tmp = sqrt((((A + C) + hypot(B_m, (A - C))) * ((C * F) * (A * -8.0)))) / -fma(B_m, B_m, (A * (C * -4.0)));
	} else if (F <= 175000.0) {
		tmp = pow((2.0 * (F * (A + hypot(B_m, A)))), 0.5) / -B_m;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -4.3e-296)
		tmp = Float64(sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) * Float64(Float64(C * F) * Float64(A * -8.0)))) / Float64(-fma(B_m, B_m, Float64(A * Float64(C * -4.0)))));
	elseif (F <= 175000.0)
		tmp = Float64((Float64(2.0 * Float64(F * Float64(A + hypot(B_m, A)))) ^ 0.5) / Float64(-B_m));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -4.3e-296], N[(N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(C * F), $MachinePrecision] * N[(A * -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 175000.0], N[(N[Power[N[(2.0 * N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -8\right)\right)}}{-\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\

\mathbf{elif}\;F \leq 175000:\\
\;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\

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


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

    1. Initial program 21.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. Simplified43.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot \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. Add Preprocessing
    4. Taylor expanded in B around 0 35.7%

      \[\leadsto \frac{\sqrt{\color{blue}{\left(-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)} \cdot \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)} \]
    5. Step-by-step derivation
      1. associate-*r*35.7%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\left(-8 \cdot A\right) \cdot \left(C \cdot F\right)\right)} \cdot \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)} \]
    6. Simplified35.7%

      \[\leadsto \frac{\sqrt{\color{blue}{\left(\left(-8 \cdot A\right) \cdot \left(C \cdot F\right)\right)} \cdot \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)} \]

    if -4.29999999999999978e-296 < F < 175000

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in C around 0 12.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 175000 < F

    1. Initial program 20.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\ \;\;\;\;\frac{\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -8\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;F \leq 175000:\\ \;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 38.8% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\ \;\;\;\;\frac{\sqrt{4 \cdot \left(\left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\ \mathbf{elif}\;F \leq 500000:\\ \;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -4.3e-296)
   (/
    (sqrt (* 4.0 (* (+ (pow B_m 2.0) (* -4.0 (* A C))) (* C F))))
    (- (* (* 4.0 A) C) (pow B_m 2.0)))
   (if (<= F 500000.0)
     (/ (pow (* 2.0 (* F (+ A (hypot B_m A)))) 0.5) (- B_m))
     (* (sqrt 2.0) (- (sqrt (/ F B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -4.3e-296) {
		tmp = sqrt((4.0 * ((pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / (((4.0 * A) * C) - pow(B_m, 2.0));
	} else if (F <= 500000.0) {
		tmp = pow((2.0 * (F * (A + hypot(B_m, A)))), 0.5) / -B_m;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -4.3e-296) {
		tmp = Math.sqrt((4.0 * ((Math.pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / (((4.0 * A) * C) - Math.pow(B_m, 2.0));
	} else if (F <= 500000.0) {
		tmp = Math.pow((2.0 * (F * (A + Math.hypot(B_m, A)))), 0.5) / -B_m;
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= -4.3e-296:
		tmp = math.sqrt((4.0 * ((math.pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / (((4.0 * A) * C) - math.pow(B_m, 2.0))
	elif F <= 500000.0:
		tmp = math.pow((2.0 * (F * (A + math.hypot(B_m, A)))), 0.5) / -B_m
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -4.3e-296)
		tmp = Float64(sqrt(Float64(4.0 * Float64(Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C))) * Float64(C * F)))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0)));
	elseif (F <= 500000.0)
		tmp = Float64((Float64(2.0 * Float64(F * Float64(A + hypot(B_m, A)))) ^ 0.5) / Float64(-B_m));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= -4.3e-296)
		tmp = sqrt((4.0 * (((B_m ^ 2.0) + (-4.0 * (A * C))) * (C * F)))) / (((4.0 * A) * C) - (B_m ^ 2.0));
	elseif (F <= 500000.0)
		tmp = ((2.0 * (F * (A + hypot(B_m, A)))) ^ 0.5) / -B_m;
	else
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -4.3e-296], N[(N[Sqrt[N[(4.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 500000.0], N[(N[Power[N[(2.0 * N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{4 \cdot \left(\left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\

\mathbf{elif}\;F \leq 500000:\\
\;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\

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


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

    1. Initial program 21.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. Add Preprocessing
    3. Taylor expanded in A around -inf 22.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} \]
    4. Taylor expanded in F around 0 22.2%

      \[\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} \]
    5. Step-by-step derivation
      1. associate-*r*25.2%

        \[\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. *-commutative25.2%

        \[\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-inv25.2%

        \[\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-eval25.2%

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

      \[\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 -4.29999999999999978e-296 < F < 5e5

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in C around 0 12.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e5 < F

    1. Initial program 20.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\ \;\;\;\;\frac{\sqrt{4 \cdot \left(\left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;F \leq 500000:\\ \;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 38.7% accurate, 2.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -4\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\ \mathbf{elif}\;F \leq 530000:\\ \;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -4.3e-296)
   (/
    (sqrt (* (* 2.0 C) (* 2.0 (* (* C F) (* A -4.0)))))
    (- (* (* 4.0 A) C) (pow B_m 2.0)))
   (if (<= F 530000.0)
     (/ (pow (* 2.0 (* F (+ A (hypot B_m A)))) 0.5) (- B_m))
     (* (sqrt 2.0) (- (sqrt (/ F B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -4.3e-296) {
		tmp = sqrt(((2.0 * C) * (2.0 * ((C * F) * (A * -4.0))))) / (((4.0 * A) * C) - pow(B_m, 2.0));
	} else if (F <= 530000.0) {
		tmp = pow((2.0 * (F * (A + hypot(B_m, A)))), 0.5) / -B_m;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -4.3e-296) {
		tmp = Math.sqrt(((2.0 * C) * (2.0 * ((C * F) * (A * -4.0))))) / (((4.0 * A) * C) - Math.pow(B_m, 2.0));
	} else if (F <= 530000.0) {
		tmp = Math.pow((2.0 * (F * (A + Math.hypot(B_m, A)))), 0.5) / -B_m;
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= -4.3e-296:
		tmp = math.sqrt(((2.0 * C) * (2.0 * ((C * F) * (A * -4.0))))) / (((4.0 * A) * C) - math.pow(B_m, 2.0))
	elif F <= 530000.0:
		tmp = math.pow((2.0 * (F * (A + math.hypot(B_m, A)))), 0.5) / -B_m
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -4.3e-296)
		tmp = Float64(sqrt(Float64(Float64(2.0 * C) * Float64(2.0 * Float64(Float64(C * F) * Float64(A * -4.0))))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0)));
	elseif (F <= 530000.0)
		tmp = Float64((Float64(2.0 * Float64(F * Float64(A + hypot(B_m, A)))) ^ 0.5) / Float64(-B_m));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= -4.3e-296)
		tmp = sqrt(((2.0 * C) * (2.0 * ((C * F) * (A * -4.0))))) / (((4.0 * A) * C) - (B_m ^ 2.0));
	elseif (F <= 530000.0)
		tmp = ((2.0 * (F * (A + hypot(B_m, A)))) ^ 0.5) / -B_m;
	else
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -4.3e-296], N[(N[Sqrt[N[(N[(2.0 * C), $MachinePrecision] * N[(2.0 * N[(N[(C * F), $MachinePrecision] * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 530000.0], N[(N[Power[N[(2.0 * N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -4\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\

\mathbf{elif}\;F \leq 530000:\\
\;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\

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


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

    1. Initial program 21.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. Add Preprocessing
    3. Taylor expanded in A around -inf 22.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} \]
    4. Taylor expanded in B around 0 22.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} \]
    5. Step-by-step derivation
      1. associate-*r*22.6%

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

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

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

    if -4.29999999999999978e-296 < F < 5.3e5

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in C around 0 12.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.3e5 < F

    1. Initial program 20.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -4\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;F \leq 530000:\\ \;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 35.9% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq 680:\\ \;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 680.0)
   (/ (pow (* 2.0 (* F (+ A (hypot B_m A)))) 0.5) (- B_m))
   (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 680.0) {
		tmp = pow((2.0 * (F * (A + hypot(B_m, A)))), 0.5) / -B_m;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 680.0) {
		tmp = Math.pow((2.0 * (F * (A + Math.hypot(B_m, A)))), 0.5) / -B_m;
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= 680.0:
		tmp = math.pow((2.0 * (F * (A + math.hypot(B_m, A)))), 0.5) / -B_m
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= 680.0)
		tmp = Float64((Float64(2.0 * Float64(F * Float64(A + hypot(B_m, A)))) ^ 0.5) / Float64(-B_m));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= 680.0)
		tmp = ((2.0 * (F * (A + hypot(B_m, A)))) ^ 0.5) / -B_m;
	else
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 680.0], N[(N[Power[N[(2.0 * N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq 680:\\
\;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\

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


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

    1. Initial program 21.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. Add Preprocessing
    3. Taylor expanded in C around 0 9.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 680 < F

    1. Initial program 20.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 680:\\ \;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 36.1% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq 450000000000:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)\right)}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 450000000000.0)
   (/ (sqrt (* 2.0 (* F (+ C (hypot B_m C))))) (- B_m))
   (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 450000000000.0) {
		tmp = sqrt((2.0 * (F * (C + hypot(B_m, C))))) / -B_m;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 450000000000.0) {
		tmp = Math.sqrt((2.0 * (F * (C + Math.hypot(B_m, C))))) / -B_m;
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= 450000000000.0:
		tmp = math.sqrt((2.0 * (F * (C + math.hypot(B_m, C))))) / -B_m
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= 450000000000.0)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(B_m, C))))) / Float64(-B_m));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= 450000000000.0)
		tmp = sqrt((2.0 * (F * (C + hypot(B_m, C))))) / -B_m;
	else
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 450000000000.0], N[(N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq 450000000000:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)\right)}}{-B\_m}\\

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in A around 0 7.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)\right)}^{0.5}}{B}} \]
    8. Step-by-step derivation
      1. unpow1/217.2%

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

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

    if 4.5e11 < F

    1. Initial program 21.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. Add Preprocessing
    3. Taylor expanded in C around 0 13.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 450000000000:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 35.9% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq 70000:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 70000.0)
   (/ (sqrt (* (* 2.0 F) (+ A (hypot B_m A)))) (- B_m))
   (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 70000.0) {
		tmp = sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / -B_m;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 70000.0) {
		tmp = Math.sqrt(((2.0 * F) * (A + Math.hypot(B_m, A)))) / -B_m;
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= 70000.0:
		tmp = math.sqrt(((2.0 * F) * (A + math.hypot(B_m, A)))) / -B_m
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= 70000.0)
		tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(A + hypot(B_m, A)))) / Float64(-B_m));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= 70000.0)
		tmp = sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / -B_m;
	else
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 70000.0], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq 70000:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)}}{-B\_m}\\

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


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

    1. Initial program 21.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. Add Preprocessing
    3. Taylor expanded in C around 0 9.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}{B}} \]
    8. Step-by-step derivation
      1. unpow1/221.5%

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

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

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

    if 7e4 < F

    1. Initial program 20.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 70000:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 33.7% accurate, 3.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq 2.6 \cdot 10^{+55}:\\ \;\;\;\;\sqrt{B\_m \cdot F} \cdot \frac{\sqrt{2}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 2.6e+55)
   (* (sqrt (* B_m F)) (/ (sqrt 2.0) (- B_m)))
   (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 2.6e+55) {
		tmp = sqrt((B_m * F)) * (sqrt(2.0) / -B_m);
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= 2.6d+55) then
        tmp = sqrt((b_m * f)) * (sqrt(2.0d0) / -b_m)
    else
        tmp = sqrt(2.0d0) * -sqrt((f / b_m))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 2.6e+55) {
		tmp = Math.sqrt((B_m * F)) * (Math.sqrt(2.0) / -B_m);
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= 2.6e+55:
		tmp = math.sqrt((B_m * F)) * (math.sqrt(2.0) / -B_m)
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= 2.6e+55)
		tmp = Float64(sqrt(Float64(B_m * F)) * Float64(sqrt(2.0) / Float64(-B_m)));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= 2.6e+55)
		tmp = sqrt((B_m * F)) * (sqrt(2.0) / -B_m);
	else
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 2.6e+55], N[(N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.6 \cdot 10^{+55}:\\
\;\;\;\;\sqrt{B\_m \cdot F} \cdot \frac{\sqrt{2}}{-B\_m}\\

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


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

    1. Initial program 22.5%

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

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

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

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

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

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

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

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

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

    if 2.6e55 < F

    1. Initial program 18.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. Add Preprocessing
    3. Taylor expanded in C around 0 10.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 2.6 \cdot 10^{+55}:\\ \;\;\;\;\sqrt{B \cdot F} \cdot \frac{\sqrt{2}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 27.4% accurate, 3.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;A \leq 7.5 \cdot 10^{+124}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \left(-\frac{2}{B\_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= A 7.5e+124)
   (* (sqrt 2.0) (- (sqrt (/ F B_m))))
   (* (sqrt (* A F)) (- (/ 2.0 B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (A <= 7.5e+124) {
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	} else {
		tmp = sqrt((A * F)) * -(2.0 / B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (a <= 7.5d+124) then
        tmp = sqrt(2.0d0) * -sqrt((f / b_m))
    else
        tmp = sqrt((a * f)) * -(2.0d0 / b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (A <= 7.5e+124) {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
	} else {
		tmp = Math.sqrt((A * F)) * -(2.0 / B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if A <= 7.5e+124:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B_m))
	else:
		tmp = math.sqrt((A * F)) * -(2.0 / B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (A <= 7.5e+124)
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))));
	else
		tmp = Float64(sqrt(Float64(A * F)) * Float64(-Float64(2.0 / B_m)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (A <= 7.5e+124)
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	else
		tmp = sqrt((A * F)) * -(2.0 / B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[A, 7.5e+124], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * (-N[(2.0 / B$95$m), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;A \leq 7.5 \cdot 10^{+124}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < 7.50000000000000038e124

    1. Initial program 23.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. Add Preprocessing
    3. Taylor expanded in C around 0 12.2%

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

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

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

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

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

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

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

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

    if 7.50000000000000038e124 < A

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq 7.5 \cdot 10^{+124}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \left(-\frac{2}{B}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 8.2% accurate, 5.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := -\frac{2}{B\_m}\\ \mathbf{if}\;C \leq 1.3 \cdot 10^{-98}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{C \cdot F} \cdot t\_0\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (/ 2.0 B_m))))
   (if (<= C 1.3e-98) (* (sqrt (* A F)) t_0) (* (sqrt (* C F)) t_0))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = -(2.0 / B_m);
	double tmp;
	if (C <= 1.3e-98) {
		tmp = sqrt((A * F)) * t_0;
	} else {
		tmp = sqrt((C * F)) * t_0;
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: tmp
    t_0 = -(2.0d0 / b_m)
    if (c <= 1.3d-98) then
        tmp = sqrt((a * f)) * t_0
    else
        tmp = sqrt((c * f)) * t_0
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = -(2.0 / B_m);
	double tmp;
	if (C <= 1.3e-98) {
		tmp = Math.sqrt((A * F)) * t_0;
	} else {
		tmp = Math.sqrt((C * F)) * t_0;
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = -(2.0 / B_m)
	tmp = 0
	if C <= 1.3e-98:
		tmp = math.sqrt((A * F)) * t_0
	else:
		tmp = math.sqrt((C * F)) * t_0
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(-Float64(2.0 / B_m))
	tmp = 0.0
	if (C <= 1.3e-98)
		tmp = Float64(sqrt(Float64(A * F)) * t_0);
	else
		tmp = Float64(sqrt(Float64(C * F)) * t_0);
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = -(2.0 / B_m);
	tmp = 0.0;
	if (C <= 1.3e-98)
		tmp = sqrt((A * F)) * t_0;
	else
		tmp = sqrt((C * F)) * t_0;
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = (-N[(2.0 / B$95$m), $MachinePrecision])}, If[LessEqual[C, 1.3e-98], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := -\frac{2}{B\_m}\\
\mathbf{if}\;C \leq 1.3 \cdot 10^{-98}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot t\_0\\

\mathbf{else}:\\
\;\;\;\;\sqrt{C \cdot F} \cdot t\_0\\


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

    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. Add Preprocessing
    3. Taylor expanded in C around 0 13.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.30000000000000007e-98 < C

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq 1.3 \cdot 10^{-98}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \left(-\frac{2}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{C \cdot F} \cdot \left(-\frac{2}{B}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 4.9% accurate, 5.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \sqrt{A \cdot F} \cdot \frac{2}{-B\_m} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 (* (sqrt (* A F)) (/ 2.0 (- B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return sqrt((A * F)) * (2.0 / -B_m);
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = sqrt((a * f)) * (2.0d0 / -b_m)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return Math.sqrt((A * F)) * (2.0 / -B_m);
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return math.sqrt((A * F)) * (2.0 / -B_m)
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(sqrt(Float64(A * F)) * Float64(2.0 / Float64(-B_m)))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = sqrt((A * F)) * (2.0 / -B_m);
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(2.0 / (-B$95$m)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\sqrt{A \cdot F} \cdot \frac{2}{-B\_m}
\end{array}
Derivation
  1. Initial program 20.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. Add Preprocessing
  3. Taylor expanded in C around 0 11.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -\color{blue}{\sqrt{F \cdot A} \cdot \frac{2}{B}} \]
  9. Final simplification5.0%

    \[\leadsto \sqrt{A \cdot F} \cdot \frac{2}{-B} \]
  10. Add Preprocessing

Reproduce

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