ABCF->ab-angle a

Percentage Accurate: 19.6% → 46.9%
Time: 28.3s
Alternatives: 9
Speedup: 3.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 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.6% 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: 46.9% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_5 \leq 10^{-63}:\\
\;\;\;\;\sqrt{2 \cdot \left(t\_4 \cdot \mathsf{fma}\left(2, A, \frac{{B\_m}^{2} \cdot -0.5}{C}\right)\right)} \cdot \frac{-1}{t\_3}\\

\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(-\sqrt{2}\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))) < -5.0000000000000002e-194 or 1.00000000000000007e-63 < (/.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 43.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. Simplified51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e-194 < (/.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.00000000000000007e-63

    1. Initial program 16.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 -inf 61.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}}{C} + 2 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    4. Step-by-step derivation
      1. div-inv61.2%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 2: 43.4% accurate, 1.2× speedup?

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

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

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

\mathbf{elif}\;F \leq 1.1 \cdot 10^{+58}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{C} + 2 \cdot A\right)}}{t\_0 - {B\_m}^{2}}\\

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


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

    1. Initial program 38.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < F < 2.5000000000000002e49

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

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

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

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

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

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

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

    if 2.5000000000000002e49 < F < 1.1e58

    1. Initial program 51.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 -inf 83.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}}{C} + 2 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if 1.1e58 < F

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

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

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

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

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

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

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

Alternative 3: 40.9% accurate, 1.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < 9.499999999999999e-294

    1. Initial program 39.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. Simplified59.2%

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

    if 9.499999999999999e-294 < F < 1.03999999999999998e49

    1. Initial program 20.8%

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

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

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

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

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

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

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

    if 1.03999999999999998e49 < F < 1.1e58

    1. Initial program 51.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 -inf 83.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}}{C} + 2 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if 1.1e58 < F

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

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

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

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

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

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

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

Alternative 4: 41.4% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 39.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. Simplified59.2%

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

    if 9.499999999999999e-294 < F < 1.94999999999999997e46

    1. Initial program 20.8%

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

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

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

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

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

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

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

    if 1.94999999999999997e46 < F

    1. Initial program 11.5%

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

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

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

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

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

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

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

Alternative 5: 41.0% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 38.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. Simplified59.5%

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

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

    if -4.999999999999985e-310 < F < 1.40000000000000009e43

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

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

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

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

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

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

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

    if 1.40000000000000009e43 < F

    1. Initial program 11.5%

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

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

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

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

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

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

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

Alternative 6: 38.0% accurate, 2.0× speedup?

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

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

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

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


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

    1. Initial program 38.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. Simplified55.9%

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

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

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

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

    if -4.999999999999985e-310 < F < 1.70000000000000006e43

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

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

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

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

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

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

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

    if 1.70000000000000006e43 < F

    1. Initial program 11.5%

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

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

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

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

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

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

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

Alternative 7: 36.2% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 23.8%

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

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

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

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

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

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

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

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

    if 1.35e17 < F

    1. Initial program 13.6%

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

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

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

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

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

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

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

Alternative 8: 35.8% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 24.3%

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

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

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

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

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

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

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

    if 2.15e43 < F

    1. Initial program 11.5%

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

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

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

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

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

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

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

Alternative 9: 27.0% accurate, 3.1× speedup?

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

\\
\sqrt{\frac{F}{B\_m}} \cdot \left(-\sqrt{2}\right)
\end{array}
Derivation
  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. Simplified20.9%

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

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

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

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

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

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

Reproduce

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