?

Average Error: 52.6 → 38.6
Time: 47.6s
Precision: binary64
Cost: 27720

?

\[\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 := \mathsf{hypot}\left(B, A - C\right)\\ t_1 := \sqrt{F \cdot \left(\left(C + A\right) - t_0\right)}\\ t_2 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -6 \cdot 10^{+32}:\\ \;\;\;\;t_1 \cdot \frac{\sqrt{2}}{B}\\ \mathbf{elif}\;B \leq 9.2 \cdot 10^{-32}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(A + \left(C - t_0\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot t_2}}{t_2}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \frac{-\sqrt{2}}{B}\\ \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 (hypot B (- A C)))
        (t_1 (sqrt (* F (- (+ C A) t_0))))
        (t_2 (fma B B (* A (* C -4.0)))))
   (if (<= B -6e+32)
     (* t_1 (/ (sqrt 2.0) B))
     (if (<= B 9.2e-32)
       (/ (- (sqrt (* (* (+ A (- C t_0)) (* F 2.0)) t_2))) t_2)
       (* t_1 (/ (- (sqrt 2.0)) B))))))
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 = hypot(B, (A - C));
	double t_1 = sqrt((F * ((C + A) - t_0)));
	double t_2 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (B <= -6e+32) {
		tmp = t_1 * (sqrt(2.0) / B);
	} else if (B <= 9.2e-32) {
		tmp = -sqrt((((A + (C - t_0)) * (F * 2.0)) * t_2)) / t_2;
	} else {
		tmp = t_1 * (-sqrt(2.0) / B);
	}
	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 = hypot(B, Float64(A - C))
	t_1 = sqrt(Float64(F * Float64(Float64(C + A) - t_0)))
	t_2 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (B <= -6e+32)
		tmp = Float64(t_1 * Float64(sqrt(2.0) / B));
	elseif (B <= 9.2e-32)
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(A + Float64(C - t_0)) * Float64(F * 2.0)) * t_2))) / t_2);
	else
		tmp = Float64(t_1 * Float64(Float64(-sqrt(2.0)) / B));
	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[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(F * N[(N[(C + A), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -6e+32], N[(t$95$1 * N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9.2e-32], N[((-N[Sqrt[N[(N[(N[(A + N[(C - t$95$0), $MachinePrecision]), $MachinePrecision] * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], N[(t$95$1 * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $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 := \mathsf{hypot}\left(B, A - C\right)\\
t_1 := \sqrt{F \cdot \left(\left(C + A\right) - t_0\right)}\\
t_2 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B \leq -6 \cdot 10^{+32}:\\
\;\;\;\;t_1 \cdot \frac{\sqrt{2}}{B}\\

\mathbf{elif}\;B \leq 9.2 \cdot 10^{-32}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(A + \left(C - t_0\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot t_2}}{t_2}\\

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


\end{array}

Error?

Derivation?

  1. Split input into 3 regimes
  2. if B < -6e32

    1. Initial program 57.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. Simplified55.4

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

      [Start]57.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} \]
    3. Applied egg-rr50.1

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

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

      [Start]50.1

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

      *-commutative [=>]50.1

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

      *-commutative [=>]50.1

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

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

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

      [Start]50.2

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

      +-commutative [=>]50.2

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

      distribute-lft-neg-out [=>]50.2

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

      associate-*r/ [=>]50.1

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

      *-rgt-identity [=>]50.1

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

      distribute-frac-neg [<=]50.1

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

      associate-*r* [=>]50.1

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

      associate-*r* [=>]50.1

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

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

    if -6e32 < B < 9.2000000000000002e-32

    1. Initial program 50.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. Simplified44.2

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

      [Start]50.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} \]

    if 9.2000000000000002e-32 < B

    1. Initial program 53.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. Simplified51.2

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

      [Start]53.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} \]
    3. Applied egg-rr47.0

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

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

      [Start]47.0

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

      *-commutative [=>]47.0

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

      *-commutative [=>]47.0

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

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

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

      [Start]47.2

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

      +-commutative [=>]47.2

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

      distribute-lft-neg-out [=>]47.2

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

      associate-*r/ [=>]47.2

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

      *-rgt-identity [=>]47.2

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

      distribute-frac-neg [<=]47.2

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

      associate-*r* [=>]47.2

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

      associate-*r* [=>]47.2

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

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

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

      [Start]33.4

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

      associate-*r/ [=>]33.4

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

      mul-1-neg [=>]33.4

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

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

Alternatives

Alternative 1
Error38.4
Cost27720
\[\begin{array}{l} t_0 := \mathsf{hypot}\left(B, A - C\right)\\ t_1 := \sqrt{F \cdot \left(\left(C + A\right) - t_0\right)}\\ t_2 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -7.5 \cdot 10^{+32}:\\ \;\;\;\;t_1 \cdot \frac{\sqrt{2}}{B}\\ \mathbf{elif}\;B \leq 5.9 \cdot 10^{+47}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(C - \left(t_0 - A\right)\right)\right)\right)}}{t_2}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 2
Error40.6
Cost21000
\[\begin{array}{l} t_0 := \sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)}\\ t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -1.05 \cdot 10^{-58}:\\ \;\;\;\;t_0 \cdot \frac{\sqrt{2}}{B}\\ \mathbf{elif}\;B \leq 7.8 \cdot 10^{-88}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(C \cdot 2\right)\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 3
Error40.8
Cost20424
\[\begin{array}{l} t_0 := \sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)}\\ \mathbf{if}\;B \leq -3.9 \cdot 10^{-56}:\\ \;\;\;\;t_0 \cdot \frac{\sqrt{2}}{B}\\ \mathbf{elif}\;B \leq 1.85 \cdot 10^{-87}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(C + C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 4
Error42.4
Cost20228
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ \mathbf{if}\;B \leq -3.5 \cdot 10^{-58}:\\ \;\;\;\;\sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot t_0\\ \mathbf{elif}\;B \leq 1.55 \cdot 10^{-86}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(C + C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(A + \left(C - B\right)\right)}\right)\\ \end{array} \]
Alternative 5
Error44.1
Cost14472
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ \mathbf{if}\;B \leq -4.4 \cdot 10^{-54}:\\ \;\;\;\;t_0 \cdot \sqrt{F \cdot \left(A + \left(B + C\right)\right)}\\ \mathbf{elif}\;B \leq 2.05 \cdot 10^{-85}:\\ \;\;\;\;\sqrt{-8 \cdot \left(\left(A \cdot \left(C + C\right)\right) \cdot \left(F \cdot C\right)\right)} \cdot \frac{1}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(A + \left(C - B\right)\right)}\right)\\ \end{array} \]
Alternative 6
Error44.1
Cost14472
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ \mathbf{if}\;B \leq -2.2 \cdot 10^{-59}:\\ \;\;\;\;t_0 \cdot \sqrt{F \cdot \left(A + \left(B + C\right)\right)}\\ \mathbf{elif}\;B \leq 4.4 \cdot 10^{-87}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(C + C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(A + \left(C - B\right)\right)}\right)\\ \end{array} \]
Alternative 7
Error45.6
Cost13832
\[\begin{array}{l} t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\ \mathbf{if}\;B \leq -1.08 \cdot 10^{-32}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{elif}\;B \leq 4.2 \cdot 10^{-146}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + C\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - B\right)\right)}\right)\\ \end{array} \]
Alternative 8
Error46.3
Cost13832
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ t_1 := B \cdot B - \left(C \cdot A\right) \cdot 4\\ \mathbf{if}\;B \leq -4 \cdot 10^{-27}:\\ \;\;\;\;t_0 \cdot \sqrt{F \cdot \left(A + \left(B + C\right)\right)}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{-145}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(A + \left(C + C\right)\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(A + \left(C - B\right)\right)}\right)\\ \end{array} \]
Alternative 9
Error50.2
Cost13316
\[\begin{array}{l} t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\ t_1 := F \cdot t_0\\ \mathbf{if}\;B \leq -5.2 \cdot 10^{-32}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{elif}\;B \leq 2 \cdot 10^{-162}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(C + C\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C - B\right)\right) \cdot t_1\right)}}{t_0}\\ \end{array} \]
Alternative 10
Error53.1
Cost9092
\[\begin{array}{l} t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\ t_1 := F \cdot t_0\\ \mathbf{if}\;C \leq -0.18:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(C + \left(\left(C - A\right) - -0.5 \cdot \frac{B}{\frac{C}{B}}\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;C \leq 9 \cdot 10^{-67}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C - B\right)\right) \cdot t_1\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{C \cdot \left(A \cdot -4\right)}\\ \end{array} \]
Alternative 11
Error55.6
Cost8584
\[\begin{array}{l} t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\ t_1 := F \cdot t_0\\ \mathbf{if}\;A \leq -2.9 \cdot 10^{+82}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(C + A\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;A \leq -4.6 \cdot 10^{-180}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{C \cdot \left(A \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C - B\right)\right) \cdot t_1\right)}}{t_0}\\ \end{array} \]
Alternative 12
Error55.3
Cost8584
\[\begin{array}{l} t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\ t_1 := F \cdot t_0\\ \mathbf{if}\;B \leq -1.8 \cdot 10^{-181}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(B + C\right)\right) \cdot t_1\right)}}{t_0}\\ \mathbf{elif}\;B \leq 1.9 \cdot 10^{-81}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{C \cdot \left(A \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C - B\right)\right) \cdot t_1\right)}}{t_0}\\ \end{array} \]
Alternative 13
Error53.2
Cost8584
\[\begin{array}{l} t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\ t_1 := F \cdot t_0\\ \mathbf{if}\;C \leq -12500000000:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(C + C\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;C \leq 5.2 \cdot 10^{-70}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C - B\right)\right) \cdot t_1\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{C \cdot \left(A \cdot -4\right)}\\ \end{array} \]
Alternative 14
Error56.2
Cost8452
\[\begin{array}{l} t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\ \mathbf{if}\;C \leq 7.2 \cdot 10^{-63}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C - B\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{C \cdot \left(A \cdot -4\right)}\\ \end{array} \]
Alternative 15
Error57.8
Cost7556
\[\begin{array}{l} \mathbf{if}\;C \leq 1.55 \cdot 10^{-240}:\\ \;\;\;\;\sqrt{F \cdot C} \cdot \frac{-2}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{C \cdot \left(A \cdot -4\right)}\\ \end{array} \]
Alternative 16
Error62.1
Cost6848
\[\sqrt{F \cdot C} \cdot \frac{-2}{B} \]

Error

Reproduce?

herbie shell --seed 2023038 
(FPCore (A B C F)
  :name "ABCF->ab-angle b"
  :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))))