Average Error: 52.4 → 44.2
Time: 1.3min
Precision: binary64
Cost: 75152
\[\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 := \sqrt{-16 \cdot \left(C \cdot F\right)}\\ t_1 := \mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)\\ t_2 := \mathsf{hypot}\left(A - C, B\right)\\ t_3 := \mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)\\ t_4 := \sqrt{2 \cdot \left(t_3 \cdot \left(F \cdot \left(\left(C + t_2\right) + A\right)\right)\right)}\\ t_5 := \left(C - A\right) - t_2\\ \mathbf{if}\;A \leq -1.4 \cdot 10^{+79}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot \mathsf{fma}\left(2, C, \frac{-0.5 \cdot \left(B \cdot B\right)}{A}\right)\right)\right)}}{t_1}\\ \mathbf{elif}\;A \leq 200000:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;t_4 \ne 0:\\ \;\;\;\;\frac{1}{\frac{1}{t_4}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(t_3 \cdot \left(F \cdot \begin{array}{l} \mathbf{if}\;t_5 \ne 0:\\ \;\;\;\;\frac{\mathsf{fma}\left(C, C, -{\left(t_2 + A\right)}^{2}\right)}{t_5}\\ \mathbf{else}:\\ \;\;\;\;\left(A + C\right) + t_2\\ \end{array}\right)\right)}\\ \end{array}}{t_1}\\ \mathbf{elif}\;A \ne 0:\\ \;\;\;\;\frac{t_0}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-A}}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot t_0}{\mathsf{fma}\left(-B, B, 4 \cdot \left(A \cdot C\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 (* -16.0 (* C F))))
        (t_1 (fma 4.0 (* A C) (- (* B B))))
        (t_2 (hypot (- A C) B))
        (t_3 (fma (* -4.0 A) C (* B B)))
        (t_4 (sqrt (* 2.0 (* t_3 (* F (+ (+ C t_2) A))))))
        (t_5 (- (- C A) t_2)))
   (if (<= A -1.4e+79)
     (/
      (sqrt
       (*
        2.0
        (*
         (fma B B (* (* -4.0 A) C))
         (* F (fma 2.0 C (/ (* -0.5 (* B B)) A))))))
      t_1)
     (if (<= A 200000.0)
       (/
        (if (!= t_4 0.0)
          (/ 1.0 (/ 1.0 t_4))
          (sqrt
           (*
            2.0
            (*
             t_3
             (*
              F
              (if (!= t_5 0.0)
                (/ (fma C C (- (pow (+ t_2 A) 2.0))) t_5)
                (+ (+ A C) t_2)))))))
        t_1)
       (if (!= A 0.0)
         (/ t_0 (/ (fma B B (* -4.0 (* A C))) (- A)))
         (/ (* A t_0) (fma (- B) B (* 4.0 (* A C)))))))))
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((-16.0 * (C * F)));
	double t_1 = fma(4.0, (A * C), -(B * B));
	double t_2 = hypot((A - C), B);
	double t_3 = fma((-4.0 * A), C, (B * B));
	double t_4 = sqrt((2.0 * (t_3 * (F * ((C + t_2) + A)))));
	double t_5 = (C - A) - t_2;
	double tmp;
	if (A <= -1.4e+79) {
		tmp = sqrt((2.0 * (fma(B, B, ((-4.0 * A) * C)) * (F * fma(2.0, C, ((-0.5 * (B * B)) / A)))))) / t_1;
	} else if (A <= 200000.0) {
		double tmp_1;
		if (t_4 != 0.0) {
			tmp_1 = 1.0 / (1.0 / t_4);
		} else {
			double tmp_2;
			if (t_5 != 0.0) {
				tmp_2 = fma(C, C, -pow((t_2 + A), 2.0)) / t_5;
			} else {
				tmp_2 = (A + C) + t_2;
			}
			tmp_1 = sqrt((2.0 * (t_3 * (F * tmp_2))));
		}
		tmp = tmp_1 / t_1;
	} else if (A != 0.0) {
		tmp = t_0 / (fma(B, B, (-4.0 * (A * C))) / -A);
	} else {
		tmp = (A * t_0) / fma(-B, B, (4.0 * (A * C)));
	}
	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 = sqrt(Float64(-16.0 * Float64(C * F)))
	t_1 = fma(4.0, Float64(A * C), Float64(-Float64(B * B)))
	t_2 = hypot(Float64(A - C), B)
	t_3 = fma(Float64(-4.0 * A), C, Float64(B * B))
	t_4 = sqrt(Float64(2.0 * Float64(t_3 * Float64(F * Float64(Float64(C + t_2) + A)))))
	t_5 = Float64(Float64(C - A) - t_2)
	tmp = 0.0
	if (A <= -1.4e+79)
		tmp = Float64(sqrt(Float64(2.0 * Float64(fma(B, B, Float64(Float64(-4.0 * A) * C)) * Float64(F * fma(2.0, C, Float64(Float64(-0.5 * Float64(B * B)) / A)))))) / t_1);
	elseif (A <= 200000.0)
		tmp_1 = 0.0
		if (t_4 != 0.0)
			tmp_1 = Float64(1.0 / Float64(1.0 / t_4));
		else
			tmp_2 = 0.0
			if (t_5 != 0.0)
				tmp_2 = Float64(fma(C, C, Float64(-(Float64(t_2 + A) ^ 2.0))) / t_5);
			else
				tmp_2 = Float64(Float64(A + C) + t_2);
			end
			tmp_1 = sqrt(Float64(2.0 * Float64(t_3 * Float64(F * tmp_2))));
		end
		tmp = Float64(tmp_1 / t_1);
	elseif (A != 0.0)
		tmp = Float64(t_0 / Float64(fma(B, B, Float64(-4.0 * Float64(A * C))) / Float64(-A)));
	else
		tmp = Float64(Float64(A * t_0) / fma(Float64(-B), B, Float64(4.0 * Float64(A * C))));
	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[Sqrt[N[(-16.0 * N[(C * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * N[(A * C), $MachinePrecision] + (-N[(B * B), $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]}, Block[{t$95$3 = N[(N[(-4.0 * A), $MachinePrecision] * C + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(2.0 * N[(t$95$3 * N[(F * N[(N[(C + t$95$2), $MachinePrecision] + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[(C - A), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[A, -1.4e+79], N[(N[Sqrt[N[(2.0 * N[(N[(B * B + N[(N[(-4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C + N[(N[(-0.5 * N[(B * B), $MachinePrecision]), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[A, 200000.0], N[(If[Unequal[t$95$4, 0.0], N[(1.0 / N[(1.0 / t$95$4), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(2.0 * N[(t$95$3 * N[(F * If[Unequal[t$95$5, 0.0], N[(N[(C * C + (-N[Power[N[(t$95$2 + A), $MachinePrecision], 2.0], $MachinePrecision])), $MachinePrecision] / t$95$5), $MachinePrecision], N[(N[(A + C), $MachinePrecision] + t$95$2), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] / t$95$1), $MachinePrecision], If[Unequal[A, 0.0], N[(t$95$0 / N[(N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-A)), $MachinePrecision]), $MachinePrecision], N[(N[(A * t$95$0), $MachinePrecision] / N[((-B) * B + N[(4.0 * N[(A * C), $MachinePrecision]), $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 := \sqrt{-16 \cdot \left(C \cdot F\right)}\\
t_1 := \mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)\\
t_2 := \mathsf{hypot}\left(A - C, B\right)\\
t_3 := \mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)\\
t_4 := \sqrt{2 \cdot \left(t_3 \cdot \left(F \cdot \left(\left(C + t_2\right) + A\right)\right)\right)}\\
t_5 := \left(C - A\right) - t_2\\
\mathbf{if}\;A \leq -1.4 \cdot 10^{+79}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot \mathsf{fma}\left(2, C, \frac{-0.5 \cdot \left(B \cdot B\right)}{A}\right)\right)\right)}}{t_1}\\

\mathbf{elif}\;A \leq 200000:\\
\;\;\;\;\frac{\begin{array}{l}
\mathbf{if}\;t_4 \ne 0:\\
\;\;\;\;\frac{1}{\frac{1}{t_4}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(t_3 \cdot \left(F \cdot \begin{array}{l}
\mathbf{if}\;t_5 \ne 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(C, C, -{\left(t_2 + A\right)}^{2}\right)}{t_5}\\

\mathbf{else}:\\
\;\;\;\;\left(A + C\right) + t_2\\


\end{array}\right)\right)}\\


\end{array}}{t_1}\\

\mathbf{elif}\;A \ne 0:\\
\;\;\;\;\frac{t_0}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-A}}\\

\mathbf{else}:\\
\;\;\;\;\frac{A \cdot t_0}{\mathsf{fma}\left(-B, B, 4 \cdot \left(A \cdot C\right)\right)}\\


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if A < -1.4000000000000001e79

    1. Initial program 62.7

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

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

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

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

    if -1.4000000000000001e79 < A < 2e5

    1. Initial program 48.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. Simplified46.1

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

      \[\leadsto \frac{\color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\sqrt{2 \cdot \left(\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right) \cdot \left(F \cdot \left(\left(C + \mathsf{hypot}\left(A - C, B\right)\right) + A\right)\right)\right)} \ne 0:\\ \;\;\;\;\frac{1}{\frac{1}{\sqrt{2 \cdot \left(\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right) \cdot \left(F \cdot \left(\left(C + \mathsf{hypot}\left(A - C, B\right)\right) + A\right)\right)\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right) \cdot \left(F \cdot \left(\left(C + \mathsf{hypot}\left(A - C, B\right)\right) + A\right)\right)\right)}\\ } \end{array}}}{\mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)} \]
    4. Applied egg-rr45.3

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

    if 2e5 < A

    1. Initial program 52.7

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

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

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

      \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;A \ne 0:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot F\right)}}{\frac{\mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)}{A}}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot \sqrt{-16 \cdot \left(C \cdot F\right)}}{\mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)}\\ } \end{array}} \]
    5. Simplified42.3

      \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;A \ne 0:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-A}}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot \sqrt{-16 \cdot \left(C \cdot F\right)}}{\mathsf{fma}\left(-B, B, 4 \cdot \left(A \cdot C\right)\right)}\\ } \end{array}} \]
      Proof
  3. Recombined 3 regimes into one program.

Alternatives

Alternative 1
Error44.1
Cost34892
\[\begin{array}{l} t_0 := \sqrt{-16 \cdot \left(C \cdot F\right)}\\ t_1 := \mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)\\ t_2 := \sqrt{2 \cdot \left(\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right) \cdot \left(F \cdot \left(\left(C + \mathsf{hypot}\left(A - C, B\right)\right) + A\right)\right)\right)}\\ \mathbf{if}\;A \leq -5.2 \cdot 10^{+78}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot \mathsf{fma}\left(2, C, \frac{-0.5 \cdot \left(B \cdot B\right)}{A}\right)\right)\right)}}{t_1}\\ \mathbf{elif}\;A \leq 570000:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;C \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \ne 0:\\ \;\;\;\;\frac{1}{\frac{1}{t_2}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array}}{t_1}\\ \mathbf{elif}\;A \ne 0:\\ \;\;\;\;\frac{t_0}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-A}}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot t_0}{\mathsf{fma}\left(-B, B, 4 \cdot \left(A \cdot C\right)\right)}\\ \end{array} \]
Alternative 2
Error45.3
Cost27784
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)\\ t_1 := \sqrt{-16 \cdot \left(C \cdot F\right)}\\ \mathbf{if}\;A \leq -2.7 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{\mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)}\\ \mathbf{elif}\;A \leq 2.4 \cdot 10^{-65}:\\ \;\;\;\;\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)} \cdot \frac{-1}{t_0}\\ \mathbf{elif}\;A \ne 0:\\ \;\;\;\;\frac{t_1}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-A}}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot t_1}{\mathsf{fma}\left(-B, B, 4 \cdot \left(A \cdot C\right)\right)}\\ \end{array} \]
Alternative 3
Error44.4
Cost27784
\[\begin{array}{l} t_0 := \sqrt{-16 \cdot \left(C \cdot F\right)}\\ t_1 := \mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)\\ \mathbf{if}\;A \leq -2.55 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \mathsf{fma}\left(2, C, \frac{-0.5 \cdot \left(B \cdot B\right)}{A}\right)\right)\right)}}{\mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)}\\ \mathbf{elif}\;A \leq 1.52 \cdot 10^{-65}:\\ \;\;\;\;\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)} \cdot \frac{-1}{t_1}\\ \mathbf{elif}\;A \ne 0:\\ \;\;\;\;\frac{t_0}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-A}}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot t_0}{\mathsf{fma}\left(-B, B, 4 \cdot \left(A \cdot C\right)\right)}\\ \end{array} \]
Alternative 4
Error46.5
Cost27720
\[\begin{array}{l} t_0 := \mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)\\ t_1 := \sqrt{-16 \cdot \left(C \cdot F\right)}\\ \mathbf{if}\;A \leq -3.7 \cdot 10^{+51}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;A \leq 4.3 \cdot 10^{-66}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right) \cdot \left(\left(C + \mathsf{hypot}\left(A - C, B\right)\right) + A\right)\right) \cdot F\right)}}{t_0}\\ \mathbf{elif}\;A \ne 0:\\ \;\;\;\;\frac{t_1}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-A}}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot t_1}{\mathsf{fma}\left(-B, B, 4 \cdot \left(A \cdot C\right)\right)}\\ \end{array} \]
Alternative 5
Error45.2
Cost27720
\[\begin{array}{l} t_0 := \mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)\\ t_1 := \sqrt{-16 \cdot \left(C \cdot F\right)}\\ t_2 := \mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)\\ \mathbf{if}\;A \leq -2.5 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;A \leq 3.05 \cdot 10^{-65}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;A \ne 0:\\ \;\;\;\;\frac{t_1}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-A}}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot t_1}{\mathsf{fma}\left(-B, B, 4 \cdot \left(A \cdot C\right)\right)}\\ \end{array} \]
Alternative 6
Error46.7
Cost21512
\[\begin{array}{l} t_0 := \sqrt{-16 \cdot \left(C \cdot F\right)}\\ \mathbf{if}\;A \leq -1.6 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{\mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)}\\ \mathbf{elif}\;A \leq 2.25 \cdot 10^{-66}:\\ \;\;\;\;\frac{-1}{B \cdot B - \left(4 \cdot C\right) \cdot A} \cdot \sqrt{\left(F + F\right) \cdot \left(\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right) \cdot \left(C + \left(\mathsf{hypot}\left(A - C, B\right) + A\right)\right)\right)}\\ \mathbf{elif}\;A \ne 0:\\ \;\;\;\;\frac{t_0}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-A}}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot t_0}{\mathsf{fma}\left(-B, B, 4 \cdot \left(A \cdot C\right)\right)}\\ \end{array} \]
Alternative 7
Error48.4
Cost21132
\[\begin{array}{l} t_0 := \frac{\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{\mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)}\\ t_1 := \sqrt{-16 \cdot \left(C \cdot F\right)}\\ \mathbf{if}\;A \leq -3 \cdot 10^{-43}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 2.4 \cdot 10^{-169}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(C + \sqrt{B \cdot B + C \cdot C}\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)\right)}}{B \cdot B}\\ \mathbf{elif}\;A \leq 8.6 \cdot 10^{-66}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \ne 0:\\ \;\;\;\;\frac{t_1}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-A}}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot t_1}{\mathsf{fma}\left(-B, B, 4 \cdot \left(A \cdot C\right)\right)}\\ \end{array} \]
Alternative 8
Error48.1
Cost14216
\[\begin{array}{l} \mathbf{if}\;C \leq -1.6 \cdot 10^{-156}:\\ \;\;\;\;\frac{A \cdot \sqrt{-16 \cdot \left(C \cdot F\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;C \leq 5.2 \cdot 10^{-172}:\\ \;\;\;\;\frac{\sqrt{\left(\left(A + \mathsf{hypot}\left(B, A\right)\right) \cdot F\right) \cdot \left(\left(B \cdot B\right) \cdot 2\right)}}{B} \cdot \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{C \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)}\\ \end{array} \]
Alternative 9
Error48.2
Cost14152
\[\begin{array}{l} t_0 := -B \cdot B\\ \mathbf{if}\;C \leq -8.6 \cdot 10^{-157}:\\ \;\;\;\;\frac{A \cdot \sqrt{-16 \cdot \left(C \cdot F\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;C \leq 1.55 \cdot 10^{-169}:\\ \;\;\;\;\frac{\sqrt{\left(\left(\left(\left(A + \mathsf{hypot}\left(B, A\right)\right) \cdot F\right) \cdot B\right) \cdot B\right) \cdot 2}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{C \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\mathsf{fma}\left(4, A \cdot C, t_0\right)}\\ \end{array} \]
Alternative 10
Error48.1
Cost14152
\[\begin{array}{l} \mathbf{if}\;C \leq -1.6 \cdot 10^{-156}:\\ \;\;\;\;\frac{A \cdot \sqrt{-16 \cdot \left(C \cdot F\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;C \leq 1.6 \cdot 10^{-167}:\\ \;\;\;\;\frac{\frac{\sqrt{\left(A + \mathsf{hypot}\left(A, B\right)\right) \cdot \left(F \cdot \left(2 \cdot \left(B \cdot B\right)\right)\right)}}{-B}}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{C \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\mathsf{fma}\left(4, A \cdot C, -B \cdot B\right)}\\ \end{array} \]
Alternative 11
Error50.8
Cost14088
\[\begin{array}{l} t_0 := -B \cdot B\\ \mathbf{if}\;A \leq -2.8 \cdot 10^{-36}:\\ \;\;\;\;\frac{\sqrt{\left(\left(\frac{-0.5}{A} \cdot \left(B \cdot B\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot 2}}{t_0}\\ \mathbf{elif}\;A \leq 2.4 \cdot 10^{-87}:\\ \;\;\;\;\frac{\sqrt{\left(\left(B \cdot B\right) \cdot \left(F \cdot \sqrt{B \cdot B}\right)\right) \cdot 2}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-16 \cdot \left(C \cdot F\right)}}{1} \cdot \frac{A}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \end{array} \]
Alternative 12
Error49.9
Cost14088
\[\begin{array}{l} t_0 := -B \cdot B\\ \mathbf{if}\;A \leq -2.5 \cdot 10^{-57}:\\ \;\;\;\;\frac{C \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\mathsf{fma}\left(4, A \cdot C, t_0\right)}\\ \mathbf{elif}\;A \leq 8 \cdot 10^{-89}:\\ \;\;\;\;\frac{\sqrt{\left(\left(B \cdot B\right) \cdot \left(F \cdot \sqrt{B \cdot B}\right)\right) \cdot 2}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-16 \cdot \left(C \cdot F\right)}}{1} \cdot \frac{A}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \end{array} \]
Alternative 13
Error52.4
Cost7812
\[\begin{array}{l} \mathbf{if}\;A \leq -1.3 \cdot 10^{-82}:\\ \;\;\;\;\frac{\sqrt{\left(\left(-0.5 \cdot \left(B \cdot B\right)\right) \cdot \left(\left(B \cdot B\right) \cdot \frac{F}{A}\right)\right) \cdot 2}}{-B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot \sqrt{-16 \cdot \left(C \cdot F\right)}}{4 \cdot \left(A \cdot C\right)}\\ \end{array} \]
Alternative 14
Error52.2
Cost7812
\[\begin{array}{l} \mathbf{if}\;A \leq -1.08 \cdot 10^{-306}:\\ \;\;\;\;\frac{\sqrt{\left(\left(\frac{-0.5}{A} \cdot \left(B \cdot B\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot 2}}{-B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;\frac{A \cdot \sqrt{-16 \cdot \left(C \cdot F\right)}}{4 \cdot \left(A \cdot C\right)}\\ \end{array} \]
Alternative 15
Error53.7
Cost7556
\[\begin{array}{l} \mathbf{if}\;B \leq 2.5 \cdot 10^{+14}:\\ \;\;\;\;\frac{A \cdot \sqrt{-16 \cdot \left(C \cdot F\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(\left(\left(A + B\right) \cdot F\right) \cdot \left(B \cdot B\right)\right) \cdot 2}}{-B \cdot B}\\ \end{array} \]
Alternative 16
Error54.2
Cost7232
\[\frac{A \cdot \sqrt{-16 \cdot \left(C \cdot F\right)}}{4 \cdot \left(A \cdot C\right)} \]
Alternative 17
Error62.1
Cost6848
\[\frac{\sqrt{4 \cdot \left(A \cdot F\right)}}{B} \]

Error

Reproduce

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