Average Error: 52.2 → 31.1
Time: 45.6s
Precision: binary64
Cost: 34184
\[ \begin{array}{c}[A, C] = \mathsf{sort}([A, C])\\ \end{array} \]
\[\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} \]
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ t_1 := A \cdot \left(C \cdot -4\right)\\ t_2 := \sqrt{C + \left(A + \mathsf{hypot}\left(A - C, B\right)\right)}\\ t_3 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -5.2 \cdot 10^{+40}:\\ \;\;\;\;t_2 \cdot \left(t_0 \cdot \sqrt{F}\right)\\ \mathbf{elif}\;B \leq -1.75 \cdot 10^{-75}:\\ \;\;\;\;t_2 \cdot \frac{-1}{\frac{t_3}{\sqrt{t_3 \cdot \left(2 \cdot F\right)}}}\\ \mathbf{elif}\;B \leq 3.8 \cdot 10^{-230}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \mathbf{elif}\;B \leq 2.45 \cdot 10^{+36}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B\right) + F \cdot t_1\right) \cdot \left(C + \mathsf{fma}\left(-0.5, \frac{B}{\frac{A}{B}}, C\right)\right)\right)}}{\mathsf{fma}\left(B, B, t_1\right)}\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \left(t_0 \cdot \left(-\sqrt{F}\right)\right)\\ \end{array} \]
(FPCore (A B C F)
 :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))))
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (/ (sqrt 2.0) B))
        (t_1 (* A (* C -4.0)))
        (t_2 (sqrt (+ C (+ A (hypot (- A C) B)))))
        (t_3 (fma B B (* C (* A -4.0)))))
   (if (<= B -5.2e+40)
     (* t_2 (* t_0 (sqrt F)))
     (if (<= B -1.75e-75)
       (* t_2 (/ -1.0 (/ t_3 (sqrt (* t_3 (* 2.0 F))))))
       (if (<= B 3.8e-230)
         (sqrt (/ (- F) A))
         (if (<= B 2.45e+36)
           (/
            (-
             (sqrt
              (*
               2.0
               (*
                (+ (* F (* B B)) (* F t_1))
                (+ C (fma -0.5 (/ B (/ A B)) C))))))
            (fma B B t_1))
           (* t_2 (* t_0 (- (sqrt F))))))))))
double code(double A, double B, double C, double F) {
	return -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));
}
double code(double A, double B, double C, double F) {
	double t_0 = sqrt(2.0) / B;
	double t_1 = A * (C * -4.0);
	double t_2 = sqrt((C + (A + hypot((A - C), B))));
	double t_3 = fma(B, B, (C * (A * -4.0)));
	double tmp;
	if (B <= -5.2e+40) {
		tmp = t_2 * (t_0 * sqrt(F));
	} else if (B <= -1.75e-75) {
		tmp = t_2 * (-1.0 / (t_3 / sqrt((t_3 * (2.0 * F)))));
	} else if (B <= 3.8e-230) {
		tmp = sqrt((-F / A));
	} else if (B <= 2.45e+36) {
		tmp = -sqrt((2.0 * (((F * (B * B)) + (F * t_1)) * (C + fma(-0.5, (B / (A / B)), C))))) / fma(B, B, t_1);
	} else {
		tmp = t_2 * (t_0 * -sqrt(F));
	}
	return tmp;
}
function code(A, B, C, F)
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)))
end
function code(A, B, C, F)
	t_0 = Float64(sqrt(2.0) / B)
	t_1 = Float64(A * Float64(C * -4.0))
	t_2 = sqrt(Float64(C + Float64(A + hypot(Float64(A - C), B))))
	t_3 = fma(B, B, Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if (B <= -5.2e+40)
		tmp = Float64(t_2 * Float64(t_0 * sqrt(F)));
	elseif (B <= -1.75e-75)
		tmp = Float64(t_2 * Float64(-1.0 / Float64(t_3 / sqrt(Float64(t_3 * Float64(2.0 * F))))));
	elseif (B <= 3.8e-230)
		tmp = sqrt(Float64(Float64(-F) / A));
	elseif (B <= 2.45e+36)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(Float64(F * Float64(B * B)) + Float64(F * t_1)) * Float64(C + fma(-0.5, Float64(B / Float64(A / B)), C)))))) / fma(B, B, t_1));
	else
		tmp = Float64(t_2 * Float64(t_0 * Float64(-sqrt(F))));
	end
	return tmp
end
code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision] * 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]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(C + N[(A + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -5.2e+40], N[(t$95$2 * N[(t$95$0 * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.75e-75], N[(t$95$2 * N[(-1.0 / N[(t$95$3 / N[Sqrt[N[(t$95$3 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.8e-230], N[Sqrt[N[((-F) / A), $MachinePrecision]], $MachinePrecision], If[LessEqual[B, 2.45e+36], N[((-N[Sqrt[N[(2.0 * N[(N[(N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] + N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(C + N[(-0.5 * N[(B / N[(A / B), $MachinePrecision]), $MachinePrecision] + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B * B + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$0 * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\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}
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B}\\
t_1 := A \cdot \left(C \cdot -4\right)\\
t_2 := \sqrt{C + \left(A + \mathsf{hypot}\left(A - C, B\right)\right)}\\
t_3 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
\mathbf{if}\;B \leq -5.2 \cdot 10^{+40}:\\
\;\;\;\;t_2 \cdot \left(t_0 \cdot \sqrt{F}\right)\\

\mathbf{elif}\;B \leq -1.75 \cdot 10^{-75}:\\
\;\;\;\;t_2 \cdot \frac{-1}{\frac{t_3}{\sqrt{t_3 \cdot \left(2 \cdot F\right)}}}\\

\mathbf{elif}\;B \leq 3.8 \cdot 10^{-230}:\\
\;\;\;\;\sqrt{\frac{-F}{A}}\\

\mathbf{elif}\;B \leq 2.45 \cdot 10^{+36}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B\right) + F \cdot t_1\right) \cdot \left(C + \mathsf{fma}\left(-0.5, \frac{B}{\frac{A}{B}}, C\right)\right)\right)}}{\mathsf{fma}\left(B, B, t_1\right)}\\

\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(t_0 \cdot \left(-\sqrt{F}\right)\right)\\


\end{array}

Error

Derivation

  1. Split input into 5 regimes
  2. if B < -5.2000000000000001e40

    1. Initial program 57.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. Applied egg-rr50.9

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

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

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

    if -5.2000000000000001e40 < B < -1.74999999999999993e-75

    1. Initial program 42.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. Applied egg-rr32.1

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

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

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

    if -1.74999999999999993e-75 < B < 3.7999999999999998e-230

    1. Initial program 52.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. Simplified45.4

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Simplified41.2

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

    if 3.7999999999999998e-230 < B < 2.4499999999999999e36

    1. Initial program 47.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. Simplified40.0

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

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

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

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

    if 2.4499999999999999e36 < B

    1. Initial program 56.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. Applied egg-rr50.7

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -5.2 \cdot 10^{+40}:\\ \;\;\;\;\sqrt{C + \left(A + \mathsf{hypot}\left(A - C, B\right)\right)} \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F}\right)\\ \mathbf{elif}\;B \leq -1.75 \cdot 10^{-75}:\\ \;\;\;\;\sqrt{C + \left(A + \mathsf{hypot}\left(A - C, B\right)\right)} \cdot \frac{-1}{\frac{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}{\sqrt{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}}}\\ \mathbf{elif}\;B \leq 3.8 \cdot 10^{-230}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \mathbf{elif}\;B \leq 2.45 \cdot 10^{+36}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B\right) + F \cdot \left(A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(C + \mathsf{fma}\left(-0.5, \frac{B}{\frac{A}{B}}, C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{C + \left(A + \mathsf{hypot}\left(A - C, B\right)\right)} \cdot \left(\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F}\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error30.3
Cost26824
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ t_1 := A \cdot \left(C \cdot -4\right)\\ t_2 := \sqrt{C + \left(A + \mathsf{hypot}\left(A - C, B\right)\right)}\\ \mathbf{if}\;B \leq -4.2 \cdot 10^{+24}:\\ \;\;\;\;t_2 \cdot \left(t_0 \cdot \sqrt{F}\right)\\ \mathbf{elif}\;B \leq 2.45 \cdot 10^{+36}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B\right) + F \cdot t_1\right) \cdot \left(C + \mathsf{fma}\left(-0.5, \frac{B}{\frac{A}{B}}, C\right)\right)\right)}}{\mathsf{fma}\left(B, B, t_1\right)}\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \left(t_0 \cdot \left(-\sqrt{F}\right)\right)\\ \end{array} \]
Alternative 2
Error30.3
Cost26628
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ t_1 := A \cdot \left(C \cdot -4\right)\\ \mathbf{if}\;B \leq -4.2 \cdot 10^{+24}:\\ \;\;\;\;\sqrt{C + \left(A + \mathsf{hypot}\left(A - C, B\right)\right)} \cdot \left(t_0 \cdot \sqrt{F}\right)\\ \mathbf{elif}\;B \leq 2.45 \cdot 10^{+36}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B\right) + F \cdot t_1\right) \cdot \left(C + \mathsf{fma}\left(-0.5, \frac{B}{\frac{A}{B}}, C\right)\right)\right)}}{\mathsf{fma}\left(B, B, t_1\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + C}\right)\right)\\ \end{array} \]
Alternative 3
Error41.0
Cost21900
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + C}\right)\right)\\ t_1 := A \cdot \left(C \cdot -4\right)\\ t_2 := \mathsf{fma}\left(B, B, t_1\right)\\ \mathbf{if}\;C \leq -1 \cdot 10^{-295}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 2.2 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 7.8 \cdot 10^{-72}:\\ \;\;\;\;\sqrt{\left(F \cdot \left(B \cdot B\right) + F \cdot t_1\right) \cdot \left(2 \cdot \left(C + \mathsf{fma}\left(-0.5, B \cdot \frac{B}{A}, C\right)\right)\right)} \cdot \frac{1}{-t_2}\\ \mathbf{elif}\;C \leq 10^{-16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 5.627699782288802 \cdot 10^{+214}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_2\right) \cdot \left(C + C\right)\right)}}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \end{array} \]
Alternative 4
Error40.9
Cost21772
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + C}\right)\right)\\ t_1 := A \cdot \left(C \cdot -4\right)\\ t_2 := \mathsf{fma}\left(B, B, t_1\right)\\ \mathbf{if}\;C \leq -1 \cdot 10^{-295}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 2.2 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 1.82 \cdot 10^{-63}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B\right) + F \cdot t_1\right) \cdot \left(C + \mathsf{fma}\left(-0.5, \frac{B}{\frac{A}{B}}, C\right)\right)\right)}}{t_2}\\ \mathbf{elif}\;C \leq 10^{-16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 5.627699782288802 \cdot 10^{+214}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_2\right) \cdot \left(C + C\right)\right)}}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \end{array} \]
Alternative 5
Error41.4
Cost21580
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + C}\right)\right)\\ t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;C \leq -1 \cdot 10^{-295}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 2.2 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 7.8 \cdot 10^{-72}:\\ \;\;\;\;\frac{1}{-t_1} \cdot \sqrt{F \cdot \left(C \cdot \left(C \cdot \left(A \cdot -16\right) + B \cdot \left(B \cdot 8\right)\right) - \frac{{B}^{4}}{A}\right)}\\ \mathbf{elif}\;C \leq 10^{-16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 5.627699782288802 \cdot 10^{+214}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(C + C\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \end{array} \]
Alternative 6
Error41.9
Cost21396
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + C}\right)\right)\\ t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;C \leq -1 \cdot 10^{-295}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 2.2 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 1.82 \cdot 10^{-63}:\\ \;\;\;\;\frac{1}{-t_1} \cdot \sqrt{\left(A \cdot -16\right) \cdot \left(C \cdot \left(C \cdot F\right)\right)}\\ \mathbf{elif}\;C \leq 10^{-16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 5.627699782288802 \cdot 10^{+214}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(C + C\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \end{array} \]
Alternative 7
Error43.8
Cost20368
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + C}\right)\right)\\ t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;C \leq -1 \cdot 10^{-295}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 2.2 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 1.82 \cdot 10^{-63}:\\ \;\;\;\;\frac{1}{-t_1} \cdot \sqrt{\left(A \cdot -16\right) \cdot \left(C \cdot \left(C \cdot F\right)\right)}\\ \mathbf{elif}\;C \leq 10^{-16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 7.783670388023629 \cdot 10^{+146}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(B \cdot B\right) \cdot \left(C \cdot 4\right) + -8 \cdot \left(C \cdot \left(C \cdot A\right)\right)\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \end{array} \]
Alternative 8
Error44.3
Cost15252
\[\begin{array}{l} t_0 := \sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;C \leq -1.55 \cdot 10^{-291}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 2.2 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 1.82 \cdot 10^{-63}:\\ \;\;\;\;\frac{1}{-t_1} \cdot \sqrt{\left(A \cdot -16\right) \cdot \left(C \cdot \left(C \cdot F\right)\right)}\\ \mathbf{elif}\;C \leq 1.9637786642078746 \cdot 10^{-16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 7.783670388023629 \cdot 10^{+146}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(B \cdot B\right) \cdot \left(C \cdot 4\right) + -8 \cdot \left(C \cdot \left(C \cdot A\right)\right)\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \end{array} \]
Alternative 9
Error44.5
Cost14740
\[\begin{array}{l} t_0 := \sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ t_1 := \frac{1}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \sqrt{\left(A \cdot -16\right) \cdot \left(C \cdot \left(C \cdot F\right)\right)}\\ \mathbf{if}\;C \leq -1.55 \cdot 10^{-291}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 2.2 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 1.82 \cdot 10^{-63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq 3.55 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 5.53065544166697 \cdot 10^{+152}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \end{array} \]
Alternative 10
Error44.4
Cost14740
\[\begin{array}{l} t_0 := \sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;C \leq -1.55 \cdot 10^{-291}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 2.2 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 1.82 \cdot 10^{-63}:\\ \;\;\;\;\frac{1}{-t_1} \cdot \sqrt{\left(A \cdot -16\right) \cdot \left(C \cdot \left(C \cdot F\right)\right)}\\ \mathbf{elif}\;C \leq 3.55 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 1.753805347284203 \cdot 10^{+150}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(C \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot -8\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \end{array} \]
Alternative 11
Error45.8
Cost13316
\[\begin{array}{l} \mathbf{if}\;B \leq 2.25 \cdot 10^{+49}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
Alternative 12
Error49.4
Cost13188
\[\begin{array}{l} \mathbf{if}\;C \leq 1.4 \cdot 10^{-211}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \end{array} \]
Alternative 13
Error51.5
Cost6656
\[\sqrt{\frac{-F}{A}} \]

Error

Reproduce

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