ABCF->ab-angle a

Percentage Accurate: 19.0% → 53.4%
Time: 30.6s
Alternatives: 15
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 15 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: 19.0% 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: 53.4% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{+114}:\\ \;\;\;\;\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{A + \mathsf{hypot}\left(B\_m, A\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) 2e+114)
   (/
    (*
     (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 (+ A (hypot B_m A))) (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) <= 2e+114) {
		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((A + hypot(B_m, A))) * 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) <= 2e+114) {
		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((A + Math.hypot(B_m, A))) * 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) <= 2e+114:
		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((A + math.hypot(B_m, A))) * 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) <= 2e+114)
		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(A + hypot(B_m, A))) * 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) <= 2e+114)
		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((A + hypot(B_m, A))) * 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], 2e+114], 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[(A + N[Sqrt[B$95$m ^ 2 + A ^ 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 2 \cdot 10^{+114}:\\
\;\;\;\;\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{A + \mathsf{hypot}\left(B\_m, A\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) < 2e114

    1. Initial program 30.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. Step-by-step derivation
      1. *-commutative30.8%

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

        \[\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+33.2%

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

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

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

        \[\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*42.2%

        \[\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*42.2%

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

      \[\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 2e114 < (pow.f64 B 2)

    1. Initial program 10.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 7.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 52.9% accurate, 1.0× speedup?

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

\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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) < 2e114

    1. Initial program 30.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. Step-by-step derivation
      1. sqrt-prod33.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e114 < (pow.f64 B 2)

    1. Initial program 10.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 7.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 49.9% accurate, 1.2× speedup?

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

\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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) < 5.00000000000000022e92

    1. Initial program 30.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. Step-by-step derivation
      1. sqrt-prod32.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000022e92 < (pow.f64 B 2)

    1. Initial program 12.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 C around 0 7.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 49.3% 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}^{2} \leq 5 \cdot 10^{+92}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot t\_0\right) \cdot \left(F \cdot \left(\mathsf{hypot}\left(A - C, B\_m\right) + \left(A + C\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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 (<= (pow B_m 2.0) 5e+92)
     (/ (- (sqrt (* (* 2.0 t_0) (* F (+ (hypot (- A C) B_m) (+ A C)))))) t_0)
     (* (* (sqrt (+ A (hypot B_m A))) (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 (pow(B_m, 2.0) <= 5e+92) {
		tmp = -sqrt(((2.0 * t_0) * (F * (hypot((A - C), B_m) + (A + C))))) / t_0;
	} else {
		tmp = (sqrt((A + hypot(B_m, A))) * 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 ^ 2.0) <= 5e+92)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * t_0) * Float64(F * Float64(hypot(Float64(A - C), B_m) + Float64(A + C)))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * 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[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+92], N[((-N[Sqrt[N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(F * N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 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}^{2} \leq 5 \cdot 10^{+92}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot t\_0\right) \cdot \left(F \cdot \left(\mathsf{hypot}\left(A - C, B\_m\right) + \left(A + C\right)\right)\right)}}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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) < 5.00000000000000022e92

    1. Initial program 30.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. Step-by-step derivation
      1. neg-sub030.2%

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

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

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

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

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

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

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

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

    if 5.00000000000000022e92 < (pow.f64 B 2)

    1. Initial program 12.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 C around 0 7.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 50.1% 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}^{2} \leq 5 \cdot 10^{+92}:\\ \;\;\;\;\frac{-\sqrt{\left(t\_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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 (<= (pow B_m 2.0) 5e+92)
     (/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A (+ C (hypot B_m (- A C))))))) t_0)
     (* (* (sqrt (+ A (hypot B_m A))) (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 (pow(B_m, 2.0) <= 5e+92) {
		tmp = -sqrt(((t_0 * (2.0 * F)) * (A + (C + hypot(B_m, (A - C)))))) / t_0;
	} else {
		tmp = (sqrt((A + hypot(B_m, A))) * 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 ^ 2.0) <= 5e+92)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * 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[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+92], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 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}^{2} \leq 5 \cdot 10^{+92}:\\
\;\;\;\;\frac{-\sqrt{\left(t\_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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) < 5.00000000000000022e92

    1. Initial program 30.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. Simplified34.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

    if 5.00000000000000022e92 < (pow.f64 B 2)

    1. Initial program 12.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 C around 0 7.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 45.2% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B\_m}^{2} - C \cdot \left(A \cdot 4\right)\\ t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_2 := \sqrt{2 \cdot \left(F \cdot t\_1\right)}\\ \mathbf{if}\;B\_m \leq 3.2 \cdot 10^{-225}:\\ \;\;\;\;\frac{t\_2 \cdot \left(-\sqrt{2 \cdot A}\right)}{t\_0}\\ \mathbf{elif}\;B\_m \leq 6.6 \cdot 10^{-135}:\\ \;\;\;\;\frac{t\_2 \cdot \left(-\sqrt{2 \cdot C}\right)}{t\_0}\\ \mathbf{elif}\;B\_m \leq 1.5 \cdot 10^{-119}:\\ \;\;\;\;\frac{-\sqrt{\left(t\_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_1}\\ \mathbf{elif}\;B\_m \leq 5.8 \cdot 10^{-109}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t\_0\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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 (- (pow B_m 2.0) (* C (* A 4.0))))
        (t_1 (fma B_m B_m (* A (* C -4.0))))
        (t_2 (sqrt (* 2.0 (* F t_1)))))
   (if (<= B_m 3.2e-225)
     (/ (* t_2 (- (sqrt (* 2.0 A)))) t_0)
     (if (<= B_m 6.6e-135)
       (/ (* t_2 (- (sqrt (* 2.0 C)))) t_0)
       (if (<= B_m 1.5e-119)
         (/ (- (sqrt (* (* t_1 (* 2.0 F)) (+ A A)))) t_1)
         (if (<= B_m 5.8e-109)
           (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
           (*
            (* (sqrt (+ A (hypot B_m A))) (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 = pow(B_m, 2.0) - (C * (A * 4.0));
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_2 = sqrt((2.0 * (F * t_1)));
	double tmp;
	if (B_m <= 3.2e-225) {
		tmp = (t_2 * -sqrt((2.0 * A))) / t_0;
	} else if (B_m <= 6.6e-135) {
		tmp = (t_2 * -sqrt((2.0 * C))) / t_0;
	} else if (B_m <= 1.5e-119) {
		tmp = -sqrt(((t_1 * (2.0 * F)) * (A + A))) / t_1;
	} else if (B_m <= 5.8e-109) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else {
		tmp = (sqrt((A + hypot(B_m, A))) * sqrt(F)) * (-sqrt(2.0) / B_m);
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_2 = sqrt(Float64(2.0 * Float64(F * t_1)))
	tmp = 0.0
	if (B_m <= 3.2e-225)
		tmp = Float64(Float64(t_2 * Float64(-sqrt(Float64(2.0 * A)))) / t_0);
	elseif (B_m <= 6.6e-135)
		tmp = Float64(Float64(t_2 * Float64(-sqrt(Float64(2.0 * C)))) / t_0);
	elseif (B_m <= 1.5e-119)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_1 * Float64(2.0 * F)) * Float64(A + A)))) / t_1);
	elseif (B_m <= 5.8e-109)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * 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[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B$95$m, 3.2e-225], N[(N[(t$95$2 * (-N[Sqrt[N[(2.0 * A), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 6.6e-135], N[(N[(t$95$2 * (-N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.5e-119], N[((-N[Sqrt[N[(N[(t$95$1 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 5.8e-109], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 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 := {B\_m}^{2} - C \cdot \left(A \cdot 4\right)\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := \sqrt{2 \cdot \left(F \cdot t\_1\right)}\\
\mathbf{if}\;B\_m \leq 3.2 \cdot 10^{-225}:\\
\;\;\;\;\frac{t\_2 \cdot \left(-\sqrt{2 \cdot A}\right)}{t\_0}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 3.19999999999999975e-225

    1. Initial program 21.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-prod25.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.19999999999999975e-225 < B < 6.5999999999999999e-135

    1. Initial program 22.2%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-prod21.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.5999999999999999e-135 < B < 1.5000000000000001e-119

    1. Initial program 50.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. Simplified50.9%

      \[\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 51.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-in51.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-eval51.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-lft51.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. Simplified51.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 1.5000000000000001e-119 < B < 5.8e-109

    1. Initial program 100.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 -inf 100.0%

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

    if 5.8e-109 < B

    1. Initial program 22.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 21.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-neg21.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 45.3% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B\_m}^{2} - C \cdot \left(A \cdot 4\right)\\ \mathbf{if}\;B\_m \leq 3 \cdot 10^{-111}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t\_0\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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 (- (pow B_m 2.0) (* C (* A 4.0)))))
   (if (<= B_m 3e-111)
     (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
     (* (* (sqrt (+ A (hypot B_m A))) (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 = pow(B_m, 2.0) - (C * (A * 4.0));
	double tmp;
	if (B_m <= 3e-111) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else {
		tmp = (sqrt((A + hypot(B_m, A))) * 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 t_0 = Math.pow(B_m, 2.0) - (C * (A * 4.0));
	double tmp;
	if (B_m <= 3e-111) {
		tmp = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else {
		tmp = (Math.sqrt((A + Math.hypot(B_m, A))) * Math.sqrt(F)) * (-Math.sqrt(2.0) / B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.pow(B_m, 2.0) - (C * (A * 4.0))
	tmp = 0
	if B_m <= 3e-111:
		tmp = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0
	else:
		tmp = (math.sqrt((A + math.hypot(B_m, A))) * math.sqrt(F)) * (-math.sqrt(2.0) / B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))
	tmp = 0.0
	if (B_m <= 3e-111)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * 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)
	t_0 = (B_m ^ 2.0) - (C * (A * 4.0));
	tmp = 0.0;
	if (B_m <= 3e-111)
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	else
		tmp = (sqrt((A + hypot(B_m, A))) * 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_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 3e-111], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 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 := {B\_m}^{2} - C \cdot \left(A \cdot 4\right)\\
\mathbf{if}\;B\_m \leq 3 \cdot 10^{-111}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t\_0\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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 < 3.00000000000000008e-111

    1. Initial program 23.3%

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

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

    if 3.00000000000000008e-111 < B

    1. Initial program 22.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 21.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-neg21.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 42.4% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 23.3%

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

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

    if 2.1999999999999999e-110 < B < 1.80000000000000008e103

    1. Initial program 44.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 36.4%

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

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

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

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

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

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

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

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

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

    if 1.80000000000000008e103 < B

    1. Initial program 2.6%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in C around 0 7.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-neg7.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 37.1% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 27.5%

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

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

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

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

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

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

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

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

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

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

    if 3.19999999999999993e103 < B

    1. Initial program 2.6%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in C around 0 7.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-neg7.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 36.2% accurate, 2.1× speedup?

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

\\
\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{B\_m} \cdot \left(-\sqrt{F}\right)\right)
\end{array}
Derivation
  1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(\color{blue}{\sqrt{B}} \cdot \sqrt{F}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
  9. Final simplification17.6%

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

Alternative 11: 28.9% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 25.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e213 < A

    1. Initial program 1.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(\sqrt{F} \cdot \sqrt{A}\right)} \cdot \frac{2}{B} \]
    10. Applied egg-rr24.3%

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

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

Alternative 12: 35.2% accurate, 3.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq 4.8 \cdot 10^{-52}:\\ \;\;\;\;\frac{-\sqrt{2}}{B\_m} \cdot \sqrt{B\_m \cdot F}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 4.8e-52)
   (* (/ (- (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 <= 4.8e-52) {
		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 <= 4.8d-52) 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 <= 4.8e-52) {
		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 <= 4.8e-52:
		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 <= 4.8e-52)
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * 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 <= 4.8e-52)
		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, 4.8e-52], 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 4.8 \cdot 10^{-52}:\\
\;\;\;\;\frac{-\sqrt{2}}{B\_m} \cdot \sqrt{B\_m \cdot F}\\

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


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

    1. Initial program 26.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.8000000000000003e-52 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 27.8% 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 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 5.3% accurate, 5.8× speedup?

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

\\
\frac{2}{B\_m} \cdot \left(-{\left(A \cdot F\right)}^{0.5}\right)
\end{array}
Derivation
  1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -\color{blue}{{\left(A \cdot F\right)}^{0.5}} \cdot \frac{2}{B} \]
  11. Final simplification4.3%

    \[\leadsto \frac{2}{B} \cdot \left(-{\left(A \cdot F\right)}^{0.5}\right) \]
  12. Add Preprocessing

Alternative 15: 5.1% accurate, 5.9× speedup?

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

\\
2 \cdot \left(-\frac{\sqrt{A \cdot F}}{B\_m}\right)
\end{array}
Derivation
  1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{F \cdot A} \cdot \frac{2}{B}} \]
  9. Taylor expanded in B around 0 4.1%

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

      \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
    2. *-rgt-identity4.1%

      \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
    3. *-commutative4.1%

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

    \[\leadsto -\color{blue}{2 \cdot \frac{\sqrt{F \cdot A}}{B}} \]
  12. Final simplification4.1%

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

Reproduce

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