ABCF->ab-angle a

Percentage Accurate: 19.5% → 55.0%
Time: 38.7s
Alternatives: 12
Speedup: 3.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 19.5% 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: 55.0% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -1e-168 or 3.9999999999999997e-40 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0

    1. Initial program 36.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-prod41.4%

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

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

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

        \[\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. unpow241.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 + \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. unpow241.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 + \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-def69.5%

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

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

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

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

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

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

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

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

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

        \[\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} \]
    6. Simplified69.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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if -1e-168 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < 3.9999999999999997e-40

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 40.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-62}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{{B\_m}^{2} - \left(4 \cdot A\right) \cdot C}\\

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

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{B\_m + A} \cdot \left(-\sqrt{F}\right)\right)\\


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

    1. Initial program 19.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.88131e-323 < (pow.f64 B 2) < 2.0000000000000001e-62

    1. Initial program 19.2%

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

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

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

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

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

    if 2.0000000000000001e-62 < (pow.f64 B 2) < 4.00000000000000001e277

    1. Initial program 26.0%

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

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

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

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

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

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

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

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

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

    if 4.00000000000000001e277 < (pow.f64 B 2)

    1. Initial program 0.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 44.8% accurate, 1.0× speedup?

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

\mathbf{elif}\;{B\_m}^{2} \leq 20000000000000:\\
\;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left({B\_m}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{{B\_m}^{2} - \left(4 \cdot A\right) \cdot C}\\

\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 3 regimes
  2. if (pow.f64 B 2) < 9.88131e-323

    1. Initial program 19.0%

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

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

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

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

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

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

      \[\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 9.88131e-323 < (pow.f64 B 2) < 2e13

    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 A around -inf 38.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} \]
    4. Taylor expanded in F around 0 38.0%

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

    if 2e13 < (pow.f64 B 2)

    1. Initial program 10.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 10^{-322}:\\ \;\;\;\;\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}^{2} \leq 20000000000000:\\ \;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \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: 40.1% accurate, 1.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;{B\_m}^{2} \leq 10^{-322}:\\ \;\;\;\;\frac{-\sqrt{-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)}}{\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;{B\_m}^{2} \leq 20000000000000:\\ \;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left({B\_m}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{{B\_m}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B\_m}\right)\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= (pow B_m 2.0) 1e-322)
   (/
    (- (sqrt (* -16.0 (* (pow A 2.0) (* C F)))))
    (fma B_m B_m (* A (* C -4.0))))
   (if (<= (pow B_m 2.0) 20000000000000.0)
     (/
      (- (sqrt (* 4.0 (* C (* F (- (pow B_m 2.0) (* 4.0 (* A C))))))))
      (- (pow B_m 2.0) (* (* 4.0 A) C)))
     (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt 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) <= 1e-322) {
		tmp = -sqrt((-16.0 * (pow(A, 2.0) * (C * F)))) / fma(B_m, B_m, (A * (C * -4.0)));
	} else if (pow(B_m, 2.0) <= 20000000000000.0) {
		tmp = -sqrt((4.0 * (C * (F * (pow(B_m, 2.0) - (4.0 * (A * C))))))) / (pow(B_m, 2.0) - ((4.0 * A) * C));
	} else {
		tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt(B_m));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1e-322)
		tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64((A ^ 2.0) * Float64(C * F))))) / fma(B_m, B_m, Float64(A * Float64(C * -4.0))));
	elseif ((B_m ^ 2.0) <= 20000000000000.0)
		tmp = Float64(Float64(-sqrt(Float64(4.0 * Float64(C * Float64(F * Float64((B_m ^ 2.0) - Float64(4.0 * Float64(A * C)))))))) / Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)));
	else
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(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], 1e-322], N[((-N[Sqrt[N[(-16.0 * N[(N[Power[A, 2.0], $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 20000000000000.0], N[((-N[Sqrt[N[(4.0 * N[(C * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

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

\mathbf{elif}\;{B\_m}^{2} \leq 20000000000000:\\
\;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left({B\_m}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{{B\_m}^{2} - \left(4 \cdot A\right) \cdot C}\\

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


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

    1. Initial program 19.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.88131e-323 < (pow.f64 B 2) < 2e13

    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 A around -inf 38.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} \]
    4. Taylor expanded in F around 0 38.0%

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

    if 2e13 < (pow.f64 B 2)

    1. Initial program 10.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 41.9% accurate, 1.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 10^{-322}:\\ \;\;\;\;\frac{-\sqrt{\left(t\_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_0}\\ \mathbf{elif}\;{B\_m}^{2} \leq 20000000000000:\\ \;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left({B\_m}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{{B\_m}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B\_m}\right)\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= (pow B_m 2.0) 1e-322)
     (/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A A)))) t_0)
     (if (<= (pow B_m 2.0) 20000000000000.0)
       (/
        (- (sqrt (* 4.0 (* C (* F (- (pow B_m 2.0) (* 4.0 (* A C))))))))
        (- (pow B_m 2.0) (* (* 4.0 A) C)))
       (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt 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) <= 1e-322) {
		tmp = -sqrt(((t_0 * (2.0 * F)) * (A + A))) / t_0;
	} else if (pow(B_m, 2.0) <= 20000000000000.0) {
		tmp = -sqrt((4.0 * (C * (F * (pow(B_m, 2.0) - (4.0 * (A * C))))))) / (pow(B_m, 2.0) - ((4.0 * A) * C));
	} else {
		tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt(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) <= 1e-322)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + A)))) / t_0);
	elseif ((B_m ^ 2.0) <= 20000000000000.0)
		tmp = Float64(Float64(-sqrt(Float64(4.0 * Float64(C * Float64(F * Float64((B_m ^ 2.0) - Float64(4.0 * Float64(A * C)))))))) / Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)));
	else
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(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], 1e-322], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 20000000000000.0], N[((-N[Sqrt[N[(4.0 * N[(C * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

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

\mathbf{elif}\;{B\_m}^{2} \leq 20000000000000:\\
\;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left({B\_m}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{{B\_m}^{2} - \left(4 \cdot A\right) \cdot C}\\

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


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

    1. Initial program 19.0%

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

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

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

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

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

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

      \[\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 9.88131e-323 < (pow.f64 B 2) < 2e13

    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 A around -inf 38.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} \]
    4. Taylor expanded in F around 0 38.0%

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

    if 2e13 < (pow.f64 B 2)

    1. Initial program 10.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 42.1% accurate, 1.2× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{B\_m + A} \cdot \left(-\sqrt{F}\right)\right)\\


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

    1. Initial program 19.1%

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

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

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

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

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

    if 2.0000000000000001e-62 < (pow.f64 B 2) < 4.00000000000000001e277

    1. Initial program 26.0%

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

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

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

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

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

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

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

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

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

    if 4.00000000000000001e277 < (pow.f64 B 2)

    1. Initial program 0.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 41.7% accurate, 1.5× speedup?

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

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

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


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

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

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

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

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

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

    if 5.0000000000000002e-55 < (pow.f64 B 2)

    1. Initial program 12.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 7.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-neg7.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 34.0% accurate, 3.0× speedup?

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

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


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

    1. Initial program 16.0%

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

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

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

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

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

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

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

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

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

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

    if 3.59999999999999998e123 < F

    1. Initial program 14.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 27.7% accurate, 3.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 1.9999999999999999e196

    1. Initial program 17.2%

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e196 < C

    1. Initial program 1.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 A around -inf 24.9%

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

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

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

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

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

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

Alternative 10: 8.0% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;A \leq 7.5 \cdot 10^{-95}:\\
\;\;\;\;-2 \cdot \left(\frac{1}{B\_m} \cdot {\left(C \cdot F\right)}^{0.5}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < 7.5000000000000003e-95

    1. Initial program 14.1%

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

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

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

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

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

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

    if 7.5000000000000003e-95 < A

    1. Initial program 19.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 8.0% accurate, 5.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;A \leq 8 \cdot 10^{-95}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < 7.99999999999999992e-95

    1. Initial program 14.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.99999999999999992e-95 < A

    1. Initial program 19.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq 8 \cdot 10^{-95}:\\ \;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 5.1% accurate, 5.9× speedup?

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

\\
-2 \cdot \frac{\sqrt{C \cdot F}}{B\_m}
\end{array}
Derivation
  1. Initial program 15.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 A around -inf 15.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\sqrt{F \cdot C}}{B} \cdot -2} \]
  9. Final simplification4.5%

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

Reproduce

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