ABCF->ab-angle a

Percentage Accurate: 18.8% → 52.6%
Time: 42.6s
Alternatives: 12
Speedup: 3.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 18.8% accurate, 1.0× speedup?

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

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

Alternative 1: 52.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{+131}:\\
\;\;\;\;\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B_m\right)\right)} \cdot \left(-\sqrt{\left(2 \cdot \left({B_m}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F}\right)}{{B_m}^{2} - C \cdot \left(A \cdot 4\right)}\\

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


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

    1. Initial program 23.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. Step-by-step derivation
      1. *-commutative23.6%

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

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

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

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

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

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

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

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

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

    if 4.99999999999999995e131 < (pow.f64 B 2)

    1. Initial program 6.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 0 10.6%

      \[\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-neg10.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 44.2% accurate, 1.2× 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 \leq 6.2 \cdot 10^{-175}:\\ \;\;\;\;\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)} \cdot \left(-\sqrt{-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)}\right)}{t_0}\\ \mathbf{elif}\;B_m \leq 4.4 \cdot 10^{-67}:\\ \;\;\;\;\frac{\left(\mathsf{hypot}\left(B_m, \sqrt{\left(A \cdot C\right) \cdot -4}\right) \cdot \sqrt{2 \cdot F}\right) \cdot \left(-\sqrt{A \cdot 0 + 2 \cdot C}\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B_m\right)} \cdot \sqrt{F}\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 (<= B_m 6.2e-175)
     (/
      (*
       (sqrt (+ A (+ C (hypot B_m (- A C)))))
       (- (sqrt (* -8.0 (* A (* C F))))))
      t_0)
     (if (<= B_m 4.4e-67)
       (/
        (*
         (* (hypot B_m (sqrt (* (* A C) -4.0))) (sqrt (* 2.0 F)))
         (- (sqrt (+ (* A 0.0) (* 2.0 C)))))
        t_0)
       (* (* (sqrt (+ C (hypot C B_m))) (sqrt F)) (/ (- (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 (B_m <= 6.2e-175) {
		tmp = (sqrt((A + (C + hypot(B_m, (A - C))))) * -sqrt((-8.0 * (A * (C * F))))) / t_0;
	} else if (B_m <= 4.4e-67) {
		tmp = ((hypot(B_m, sqrt(((A * C) * -4.0))) * sqrt((2.0 * F))) * -sqrt(((A * 0.0) + (2.0 * C)))) / t_0;
	} else {
		tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (-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 <= 6.2e-175)
		tmp = Float64(Float64(sqrt(Float64(A + Float64(C + hypot(B_m, Float64(A - C))))) * Float64(-sqrt(Float64(-8.0 * Float64(A * Float64(C * F)))))) / t_0);
	elseif (B_m <= 4.4e-67)
		tmp = Float64(Float64(Float64(hypot(B_m, sqrt(Float64(Float64(A * C) * -4.0))) * sqrt(Float64(2.0 * F))) * Float64(-sqrt(Float64(Float64(A * 0.0) + Float64(2.0 * C))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / 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[B$95$m, 6.2e-175], N[(N[(N[Sqrt[N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(-8.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 4.4e-67], N[(N[(N[(N[Sqrt[B$95$m ^ 2 + N[Sqrt[N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision] * N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[N[(N[(A * 0.0), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $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 \leq 6.2 \cdot 10^{-175}:\\
\;\;\;\;\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)} \cdot \left(-\sqrt{-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)}\right)}{t_0}\\

\mathbf{elif}\;B_m \leq 4.4 \cdot 10^{-67}:\\
\;\;\;\;\frac{\left(\mathsf{hypot}\left(B_m, \sqrt{\left(A \cdot C\right) \cdot -4}\right) \cdot \sqrt{2 \cdot F}\right) \cdot \left(-\sqrt{A \cdot 0 + 2 \cdot C}\right)}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 6.19999999999999997e-175

    1. Initial program 11.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. Simplified16.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(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 11.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)} \cdot \sqrt{\left(-8 \cdot A\right) \cdot \left(F \cdot C\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+l+16.7%

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

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

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

    if 6.19999999999999997e-175 < B < 4.4000000000000002e-67

    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. Simplified28.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(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. sqrt-prod40.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4000000000000002e-67 < B

    1. Initial program 23.4%

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

      \[\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-neg27.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 51.9% accurate, 1.2× 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 \leq 1.45 \cdot 10^{+66}:\\ \;\;\;\;\frac{\sqrt{\mathsf{hypot}\left(A - C, B_m\right) + \left(A + C\right)} \cdot \left(-\sqrt{t_0 \cdot \left(2 \cdot F\right)}\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B_m\right)} \cdot \sqrt{F}\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 (<= B_m 1.45e+66)
     (/
      (* (sqrt (+ (hypot (- A C) B_m) (+ A C))) (- (sqrt (* t_0 (* 2.0 F)))))
      t_0)
     (* (* (sqrt (+ C (hypot C B_m))) (sqrt F)) (/ (- (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 (B_m <= 1.45e+66) {
		tmp = (sqrt((hypot((A - C), B_m) + (A + C))) * -sqrt((t_0 * (2.0 * F)))) / t_0;
	} else {
		tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (-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 <= 1.45e+66)
		tmp = Float64(Float64(sqrt(Float64(hypot(Float64(A - C), B_m) + Float64(A + C))) * Float64(-sqrt(Float64(t_0 * Float64(2.0 * F))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / 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[B$95$m, 1.45e+66], N[(N[(N[Sqrt[N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision] + N[(A + C), $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[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $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 \leq 1.45 \cdot 10^{+66}:\\
\;\;\;\;\frac{\sqrt{\mathsf{hypot}\left(A - C, B_m\right) + \left(A + C\right)} \cdot \left(-\sqrt{t_0 \cdot \left(2 \cdot F\right)}\right)}{t_0}\\

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


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

    1. Initial program 18.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. Simplified23.8%

      \[\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(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. flip-+12.2%

        \[\leadsto \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(A + \color{blue}{\frac{C \cdot C - \mathsf{hypot}\left(B, A - C\right) \cdot \mathsf{hypot}\left(B, A - C\right)}{C - \mathsf{hypot}\left(B, A - C\right)}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. hypot-udef12.2%

        \[\leadsto \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(A + \frac{C \cdot C - \color{blue}{\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}} \cdot \mathsf{hypot}\left(B, A - C\right)}{C - \mathsf{hypot}\left(B, A - C\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. unpow212.2%

        \[\leadsto \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(A + \frac{C \cdot C - \sqrt{\color{blue}{{B}^{2}} + \left(A - C\right) \cdot \left(A - C\right)} \cdot \mathsf{hypot}\left(B, A - C\right)}{C - \mathsf{hypot}\left(B, A - C\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. unpow212.2%

        \[\leadsto \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(A + \frac{C \cdot C - \sqrt{{B}^{2} + \color{blue}{{\left(A - C\right)}^{2}}} \cdot \mathsf{hypot}\left(B, A - C\right)}{C - \mathsf{hypot}\left(B, A - C\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      5. hypot-udef12.2%

        \[\leadsto \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(A + \frac{C \cdot C - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}} \cdot \color{blue}{\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}}}{C - \mathsf{hypot}\left(B, A - C\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      6. unpow212.2%

        \[\leadsto \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(A + \frac{C \cdot C - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}} \cdot \sqrt{\color{blue}{{B}^{2}} + \left(A - C\right) \cdot \left(A - C\right)}}{C - \mathsf{hypot}\left(B, A - C\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      7. unpow212.2%

        \[\leadsto \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(A + \frac{C \cdot C - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}} \cdot \sqrt{{B}^{2} + \color{blue}{{\left(A - C\right)}^{2}}}}{C - \mathsf{hypot}\left(B, A - C\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      8. add-sqr-sqrt12.2%

        \[\leadsto \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(A + \frac{C \cdot C - \color{blue}{\left({B}^{2} + {\left(A - C\right)}^{2}\right)}}{C - \mathsf{hypot}\left(B, A - C\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      9. +-commutative12.2%

        \[\leadsto \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(A + \frac{C \cdot C - \color{blue}{\left({\left(A - C\right)}^{2} + {B}^{2}\right)}}{C - \mathsf{hypot}\left(B, A - C\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      10. div-sub12.2%

        \[\leadsto \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(A + \color{blue}{\left(\frac{C \cdot C}{C - \mathsf{hypot}\left(B, A - C\right)} - \frac{{\left(A - C\right)}^{2} + {B}^{2}}{C - \mathsf{hypot}\left(B, A - C\right)}\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Applied egg-rr12.2%

      \[\leadsto \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(A + \color{blue}{\left(\frac{{C}^{2}}{C - \mathsf{hypot}\left(A - C, B\right)} - \frac{{\left(\mathsf{hypot}\left(A - C, B\right)\right)}^{2}}{C - \mathsf{hypot}\left(A - C, B\right)}\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    6. Step-by-step derivation
      1. div-sub12.2%

        \[\leadsto \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(A + \color{blue}{\frac{{C}^{2} - {\left(\mathsf{hypot}\left(A - C, B\right)\right)}^{2}}{C - \mathsf{hypot}\left(A - C, B\right)}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Simplified12.2%

      \[\leadsto \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(A + \color{blue}{\frac{{C}^{2} - {\left(\mathsf{hypot}\left(A - C, B\right)\right)}^{2}}{C - \mathsf{hypot}\left(A - C, B\right)}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    8. Step-by-step derivation
      1. pow1/212.3%

        \[\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(A + \frac{{C}^{2} - {\left(\mathsf{hypot}\left(A - C, B\right)\right)}^{2}}{C - \mathsf{hypot}\left(A - C, B\right)}\right)\right)}^{0.5}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. *-commutative12.3%

        \[\leadsto \frac{-{\color{blue}{\left(\left(A + \frac{{C}^{2} - {\left(\mathsf{hypot}\left(A - C, B\right)\right)}^{2}}{C - \mathsf{hypot}\left(A - C, B\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-down14.3%

        \[\leadsto \frac{-\color{blue}{{\left(A + \frac{{C}^{2} - {\left(\mathsf{hypot}\left(A - C, B\right)\right)}^{2}}{C - \mathsf{hypot}\left(A - C, B\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/214.3%

        \[\leadsto \frac{-\color{blue}{\sqrt{A + \frac{{C}^{2} - {\left(\mathsf{hypot}\left(A - C, B\right)\right)}^{2}}{C - \mathsf{hypot}\left(A - C, B\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. unpow214.3%

        \[\leadsto \frac{-\sqrt{A + \frac{\color{blue}{C \cdot C} - {\left(\mathsf{hypot}\left(A - C, B\right)\right)}^{2}}{C - \mathsf{hypot}\left(A - C, B\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. unpow214.3%

        \[\leadsto \frac{-\sqrt{A + \frac{C \cdot C - \color{blue}{\mathsf{hypot}\left(A - C, B\right) \cdot \mathsf{hypot}\left(A - C, B\right)}}{C - \mathsf{hypot}\left(A - C, B\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. flip-+33.7%

        \[\leadsto \frac{-\sqrt{A + \color{blue}{\left(C + \mathsf{hypot}\left(A - C, B\right)\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. associate-+r+32.8%

        \[\leadsto \frac{-\sqrt{\color{blue}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\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. Applied egg-rr32.8%

      \[\leadsto \frac{-\color{blue}{\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(F \cdot 2\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    10. Step-by-step derivation
      1. +-commutative32.8%

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

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

    if 1.44999999999999993e66 < B

    1. Initial program 8.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 18.4%

      \[\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-neg18.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 45.3% accurate, 1.4× 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 := \frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)} \cdot \left(-\sqrt{-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)}\right)}{t_0}\\ \mathbf{if}\;B_m \leq 8.2 \cdot 10^{-167}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B_m \leq 1.12 \cdot 10^{-107}:\\ \;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_0}\\ \mathbf{elif}\;B_m \leq 4.2 \cdot 10^{-37}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B_m\right)} \cdot \sqrt{F}\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))))
        (t_1
         (/
          (*
           (sqrt (+ A (+ C (hypot B_m (- A C)))))
           (- (sqrt (* -8.0 (* A (* C F))))))
          t_0)))
   (if (<= B_m 8.2e-167)
     t_1
     (if (<= B_m 1.12e-107)
       (/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A A)))) t_0)
       (if (<= B_m 4.2e-37)
         t_1
         (*
          (* (sqrt (+ C (hypot C B_m))) (sqrt F))
          (/ (- (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 t_1 = (sqrt((A + (C + hypot(B_m, (A - C))))) * -sqrt((-8.0 * (A * (C * F))))) / t_0;
	double tmp;
	if (B_m <= 8.2e-167) {
		tmp = t_1;
	} else if (B_m <= 1.12e-107) {
		tmp = -sqrt(((t_0 * (2.0 * F)) * (A + A))) / t_0;
	} else if (B_m <= 4.2e-37) {
		tmp = t_1;
	} else {
		tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (-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)))
	t_1 = Float64(Float64(sqrt(Float64(A + Float64(C + hypot(B_m, Float64(A - C))))) * Float64(-sqrt(Float64(-8.0 * Float64(A * Float64(C * F)))))) / t_0)
	tmp = 0.0
	if (B_m <= 8.2e-167)
		tmp = t_1;
	elseif (B_m <= 1.12e-107)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + A)))) / t_0);
	elseif (B_m <= 4.2e-37)
		tmp = t_1;
	else
		tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / 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]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(-8.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[B$95$m, 8.2e-167], t$95$1, If[LessEqual[B$95$m, 1.12e-107], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 4.2e-37], t$95$1, N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $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)\\
t_1 := \frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)} \cdot \left(-\sqrt{-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)}\right)}{t_0}\\
\mathbf{if}\;B_m \leq 8.2 \cdot 10^{-167}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;B_m \leq 1.12 \cdot 10^{-107}:\\
\;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_0}\\

\mathbf{elif}\;B_m \leq 4.2 \cdot 10^{-37}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 8.20000000000000036e-167 or 1.12e-107 < B < 4.2000000000000002e-37

    1. Initial program 13.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. Simplified18.1%

      \[\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(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 12.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)} \cdot \sqrt{\left(-8 \cdot A\right) \cdot \left(F \cdot C\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+l+19.0%

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

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

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

    if 8.20000000000000036e-167 < B < 1.12e-107

    1. Initial program 15.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. Simplified26.8%

      \[\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(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in A around inf 22.9%

      \[\leadsto \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(A + \color{blue}{\left(A + \left(C + -1 \cdot C\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Step-by-step derivation
      1. distribute-rgt1-in22.9%

        \[\leadsto \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(A + \left(A + \color{blue}{\left(-1 + 1\right) \cdot C}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. metadata-eval22.9%

        \[\leadsto \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(A + \left(A + \color{blue}{0} \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. mul0-lft22.9%

        \[\leadsto \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(A + \left(A + \color{blue}{0}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    6. Simplified22.9%

      \[\leadsto \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(A + \color{blue}{\left(A + 0\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]

    if 4.2000000000000002e-37 < B

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

      \[\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-neg28.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 47.8% accurate, 1.4× 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 := A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)\\ \mathbf{if}\;B_m \leq 1.15 \cdot 10^{-173}:\\ \;\;\;\;\frac{\sqrt{t_1} \cdot \left(-\sqrt{-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)}\right)}{t_0}\\ \mathbf{elif}\;B_m \leq 7 \cdot 10^{-24}:\\ \;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot t_1}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B_m\right)} \cdot \sqrt{F}\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))))
        (t_1 (+ A (+ C (hypot B_m (- A C))))))
   (if (<= B_m 1.15e-173)
     (/ (* (sqrt t_1) (- (sqrt (* -8.0 (* A (* C F)))))) t_0)
     (if (<= B_m 7e-24)
       (/ (- (sqrt (* (* t_0 (* 2.0 F)) t_1))) t_0)
       (* (* (sqrt (+ C (hypot C B_m))) (sqrt F)) (/ (- (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 t_1 = A + (C + hypot(B_m, (A - C)));
	double tmp;
	if (B_m <= 1.15e-173) {
		tmp = (sqrt(t_1) * -sqrt((-8.0 * (A * (C * F))))) / t_0;
	} else if (B_m <= 7e-24) {
		tmp = -sqrt(((t_0 * (2.0 * F)) * t_1)) / t_0;
	} else {
		tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (-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)))
	t_1 = Float64(A + Float64(C + hypot(B_m, Float64(A - C))))
	tmp = 0.0
	if (B_m <= 1.15e-173)
		tmp = Float64(Float64(sqrt(t_1) * Float64(-sqrt(Float64(-8.0 * Float64(A * Float64(C * F)))))) / t_0);
	elseif (B_m <= 7e-24)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * t_1))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / 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]}, Block[{t$95$1 = N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.15e-173], N[(N[(N[Sqrt[t$95$1], $MachinePrecision] * (-N[Sqrt[N[(-8.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 7e-24], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $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)\\
t_1 := A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)\\
\mathbf{if}\;B_m \leq 1.15 \cdot 10^{-173}:\\
\;\;\;\;\frac{\sqrt{t_1} \cdot \left(-\sqrt{-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)}\right)}{t_0}\\

\mathbf{elif}\;B_m \leq 7 \cdot 10^{-24}:\\
\;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot t_1}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 1.14999999999999994e-173

    1. Initial program 11.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. Simplified16.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(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 11.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)} \cdot \sqrt{\left(-8 \cdot A\right) \cdot \left(F \cdot C\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Step-by-step derivation
      1. associate-+l+16.7%

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

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

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

    if 1.14999999999999994e-173 < B < 6.9999999999999993e-24

    1. Initial program 27.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. Simplified32.6%

      \[\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(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing

    if 6.9999999999999993e-24 < B

    1. Initial program 21.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 A around 0 29.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-neg29.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 43.1% accurate, 1.5× 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 \leq 5.8 \cdot 10^{-154}:\\ \;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B_m\right)} \cdot \sqrt{F}\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 (<= B_m 5.8e-154)
     (/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A A)))) t_0)
     (* (* (sqrt (+ C (hypot C B_m))) (sqrt F)) (/ (- (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 (B_m <= 5.8e-154) {
		tmp = -sqrt(((t_0 * (2.0 * F)) * (A + A))) / t_0;
	} else {
		tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (-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 <= 5.8e-154)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + A)))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / 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[B$95$m, 5.8e-154], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $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 \leq 5.8 \cdot 10^{-154}:\\
\;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 5.8e-154

    1. Initial program 11.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. Simplified16.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(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in A around inf 10.5%

      \[\leadsto \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(A + \color{blue}{\left(A + \left(C + -1 \cdot C\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Step-by-step derivation
      1. distribute-rgt1-in10.5%

        \[\leadsto \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(A + \left(A + \color{blue}{\left(-1 + 1\right) \cdot C}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. metadata-eval10.5%

        \[\leadsto \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(A + \left(A + \color{blue}{0} \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. mul0-lft10.5%

        \[\leadsto \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(A + \left(A + \color{blue}{0}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    6. Simplified10.5%

      \[\leadsto \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(A + \color{blue}{\left(A + 0\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]

    if 5.8e-154 < B

    1. Initial program 23.0%

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

      \[\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-neg24.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 40.1% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{\left(A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)\right) \cdot \left(-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;F \leq 8:\\ \;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}\right)\\ \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 -2e-310)
   (/
    (- (sqrt (* (+ A (+ C (hypot B_m (- A C)))) (* -8.0 (* A (* C F))))))
    (fma B_m B_m (* A (* C -4.0))))
   (if (<= F 8.0)
     (* (/ (sqrt 2.0) B_m) (- (sqrt (* F (+ A (hypot B_m A))))))
     (* (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 <= -2e-310) {
		tmp = -sqrt(((A + (C + hypot(B_m, (A - C)))) * (-8.0 * (A * (C * F))))) / fma(B_m, B_m, (A * (C * -4.0)));
	} else if (F <= 8.0) {
		tmp = (sqrt(2.0) / B_m) * -sqrt((F * (A + hypot(B_m, A))));
	} 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 <= -2e-310)
		tmp = Float64(Float64(-sqrt(Float64(Float64(A + Float64(C + hypot(B_m, Float64(A - C)))) * Float64(-8.0 * Float64(A * Float64(C * F)))))) / fma(B_m, B_m, Float64(A * Float64(C * -4.0))));
	elseif (F <= 8.0)
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(F * Float64(A + hypot(B_m, A))))));
	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, -2e-310], N[((-N[Sqrt[N[(N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-8.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.0], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{\left(A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)\right) \cdot \left(-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}\\

\mathbf{elif}\;F \leq 8:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}\right)\\

\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 < -1.999999999999994e-310

    1. Initial program 15.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. Simplified28.6%

      \[\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(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 25.6%

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

    if -1.999999999999994e-310 < F < 8

    1. Initial program 18.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 C around 0 14.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-neg14.2%

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

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

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

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

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

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

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

    if 8 < F

    1. Initial program 14.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 A around 0 11.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 37.1% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{-16 \cdot \left(A \cdot \left(F \cdot {C}^{2}\right)\right)}}{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;F \leq 17:\\ \;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}\right)\\ \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 -2e-310)
   (/
    (- (sqrt (* -16.0 (* A (* F (pow C 2.0))))))
    (fma B_m B_m (* A (* C -4.0))))
   (if (<= F 17.0)
     (* (/ (sqrt 2.0) B_m) (- (sqrt (* F (+ A (hypot B_m A))))))
     (* (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 <= -2e-310) {
		tmp = -sqrt((-16.0 * (A * (F * pow(C, 2.0))))) / fma(B_m, B_m, (A * (C * -4.0)));
	} else if (F <= 17.0) {
		tmp = (sqrt(2.0) / B_m) * -sqrt((F * (A + hypot(B_m, A))));
	} 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 <= -2e-310)
		tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64(A * Float64(F * (C ^ 2.0)))))) / fma(B_m, B_m, Float64(A * Float64(C * -4.0))));
	elseif (F <= 17.0)
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(F * Float64(A + hypot(B_m, A))))));
	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, -2e-310], N[((-N[Sqrt[N[(-16.0 * N[(A * N[(F * N[Power[C, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 17.0], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(A \cdot \left(F \cdot {C}^{2}\right)\right)}}{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}\\

\mathbf{elif}\;F \leq 17:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}\right)\\

\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 < -1.999999999999994e-310

    1. Initial program 15.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. Simplified28.6%

      \[\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(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 25.6%

      \[\leadsto \frac{-\sqrt{\color{blue}{\left(-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)} \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Taylor expanded in A around -inf 15.9%

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

    if -1.999999999999994e-310 < F < 17

    1. Initial program 18.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 C around 0 14.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-neg14.2%

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

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

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

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

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

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

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

    if 17 < F

    1. Initial program 14.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 A around 0 11.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 35.3% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq 1.7 \cdot 10^{+22}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B_m, C\right)\right)}\\ \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 1.7e+22)
   (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (+ C (hypot B_m C)))))
   (* (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 <= 1.7e+22) {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C + hypot(B_m, C))));
	} 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 <= 1.7e+22) {
		tmp = (-Math.sqrt(2.0) / B_m) * Math.sqrt((F * (C + Math.hypot(B_m, C))));
	} 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 <= 1.7e+22:
		tmp = (-math.sqrt(2.0) / B_m) * math.sqrt((F * (C + math.hypot(B_m, C))))
	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 <= 1.7e+22)
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C + hypot(B_m, C)))));
	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 <= 1.7e+22)
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C + hypot(B_m, C))));
	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, 1.7e+22], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 1.7 \cdot 10^{+22}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B_m, C\right)\right)}\\

\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 < 1.7e22

    1. Initial program 19.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 12.2%

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

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

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

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

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

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

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

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

    if 1.7e22 < F

    1. Initial program 11.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 A around 0 10.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-neg10.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 35.4% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq 13.2:\\ \;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}\right)\\ \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 13.2)
   (* (/ (sqrt 2.0) B_m) (- (sqrt (* F (+ A (hypot B_m A))))))
   (* (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 <= 13.2) {
		tmp = (sqrt(2.0) / B_m) * -sqrt((F * (A + hypot(B_m, A))));
	} 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 <= 13.2) {
		tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((F * (A + Math.hypot(B_m, A))));
	} 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 <= 13.2:
		tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((F * (A + math.hypot(B_m, A))))
	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 <= 13.2)
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(F * Float64(A + hypot(B_m, A))))));
	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 <= 13.2)
		tmp = (sqrt(2.0) / B_m) * -sqrt((F * (A + hypot(B_m, A))));
	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, 13.2], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 13.2:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}\right)\\

\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 < 13.199999999999999

    1. Initial program 17.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 11.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-neg11.3%

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

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

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

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

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

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

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

    if 13.199999999999999 < F

    1. Initial program 14.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 A around 0 11.2%

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

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

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

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

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

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

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

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

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

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

      \[\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 13.2:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 33.0% accurate, 3.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq 1.05 \cdot 10^{-67}:\\ \;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{B_m \cdot F}\right)\\ \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 1.05e-67)
   (* (/ (sqrt 2.0) B_m) (- (sqrt (* B_m F))))
   (* (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 <= 1.05e-67) {
		tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
	} 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 <= 1.05d-67) then
        tmp = (sqrt(2.0d0) / b_m) * -sqrt((b_m * f))
    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 <= 1.05e-67) {
		tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((B_m * F));
	} 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 <= 1.05e-67:
		tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((B_m * F))
	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 <= 1.05e-67)
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(B_m * F))));
	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 <= 1.05e-67)
		tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
	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, 1.05e-67], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $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 1.05 \cdot 10^{-67}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{B_m \cdot F}\right)\\

\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 < 1.0500000000000001e-67

    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 A around 0 11.7%

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

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

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

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

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

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

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

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

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

    if 1.0500000000000001e-67 < F

    1. Initial program 14.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 A around 0 11.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-neg11.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 26.3% accurate, 3.1× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \sqrt{2} \cdot \left(-\sqrt{\frac{F}{B_m}}\right) \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 (* (sqrt 2.0) (- (sqrt (/ F B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return sqrt(2.0) * -sqrt((F / 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(2.0d0) * -sqrt((f / 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(2.0) * -Math.sqrt((F / B_m));
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return math.sqrt(2.0) * -math.sqrt((F / B_m))
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = sqrt(2.0) * -sqrt((F / B_m));
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B_m}}\right)
\end{array}
Derivation
  1. Initial program 16.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 A around 0 11.4%

    \[\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-neg11.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  9. Final simplification18.6%

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

Reproduce

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