Average Error: 53.0 → 35.8
Time: 54.0s
Precision: binary64
Cost: 149132
\[ \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 := C \cdot \left(A \cdot -4\right)\\ t_1 := \frac{-\sqrt{\left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} - \left(A + C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(\left(4 \cdot A\right) \cdot C - {B}^{2}\right)\right)\right)}}{{B}^{2} + t_0}\\ t_2 := \mathsf{fma}\left(B, B, t_0\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{-195}:\\ \;\;\;\;\left(\sqrt{2 \cdot \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)} \cdot \sqrt{F \cdot \left(C + \left(A - \mathsf{hypot}\left(A - C, B\right)\right)\right)}\right) \cdot \frac{1}{-t_2}\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{+130}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot t_2\right) \cdot \left(F \cdot \left(A + \mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(B, B, A \cdot A\right) - A \cdot A}{C}, A\right)\right)\right)}}{t_2}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;\frac{\sqrt{\left(A - \left(\mathsf{hypot}\left(B, A - C\right) - C\right)\right) \cdot -8} \cdot \left(-\sqrt{F \cdot \left(A \cdot C\right)}\right)}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \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 (* C (* A -4.0)))
        (t_1
         (/
          (-
           (sqrt
            (*
             (- (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))) (+ A C))
             (* 2.0 (* F (- (* (* 4.0 A) C) (pow B 2.0)))))))
          (+ (pow B 2.0) t_0)))
        (t_2 (fma B B t_0)))
   (if (<= t_1 -1e-195)
     (*
      (*
       (sqrt (* 2.0 (fma C (* A -4.0) (* B B))))
       (sqrt (* F (+ C (- A (hypot (- A C) B))))))
      (/ 1.0 (- t_2)))
     (if (<= t_1 4e+130)
       (/
        (-
         (sqrt
          (*
           (* 2.0 t_2)
           (* F (+ A (fma -0.5 (/ (- (fma B B (* A A)) (* A A)) C) A))))))
        t_2)
       (if (<= t_1 INFINITY)
         (/
          (*
           (sqrt (* (- A (- (hypot B (- A C)) C)) -8.0))
           (- (sqrt (* F (* A C)))))
          t_2)
         (* (sqrt (* F (- A (hypot A B)))) (/ (- (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 = C * (A * -4.0);
	double t_1 = -sqrt(((sqrt((pow(B, 2.0) + pow((A - C), 2.0))) - (A + C)) * (2.0 * (F * (((4.0 * A) * C) - pow(B, 2.0)))))) / (pow(B, 2.0) + t_0);
	double t_2 = fma(B, B, t_0);
	double tmp;
	if (t_1 <= -1e-195) {
		tmp = (sqrt((2.0 * fma(C, (A * -4.0), (B * B)))) * sqrt((F * (C + (A - hypot((A - C), B)))))) * (1.0 / -t_2);
	} else if (t_1 <= 4e+130) {
		tmp = -sqrt(((2.0 * t_2) * (F * (A + fma(-0.5, ((fma(B, B, (A * A)) - (A * A)) / C), A))))) / t_2;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = (sqrt(((A - (hypot(B, (A - C)) - C)) * -8.0)) * -sqrt((F * (A * C)))) / t_2;
	} else {
		tmp = sqrt((F * (A - hypot(A, B)))) * (-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 = Float64(C * Float64(A * -4.0))
	t_1 = Float64(Float64(-sqrt(Float64(Float64(sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))) - Float64(A + C)) * Float64(2.0 * Float64(F * Float64(Float64(Float64(4.0 * A) * C) - (B ^ 2.0))))))) / Float64((B ^ 2.0) + t_0))
	t_2 = fma(B, B, t_0)
	tmp = 0.0
	if (t_1 <= -1e-195)
		tmp = Float64(Float64(sqrt(Float64(2.0 * fma(C, Float64(A * -4.0), Float64(B * B)))) * sqrt(Float64(F * Float64(C + Float64(A - hypot(Float64(A - C), B)))))) * Float64(1.0 / Float64(-t_2)));
	elseif (t_1 <= 4e+130)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * t_2) * Float64(F * Float64(A + fma(-0.5, Float64(Float64(fma(B, B, Float64(A * A)) - Float64(A * A)) / C), A)))))) / t_2);
	elseif (t_1 <= Inf)
		tmp = Float64(Float64(sqrt(Float64(Float64(A - Float64(hypot(B, Float64(A - C)) - C)) * -8.0)) * Float64(-sqrt(Float64(F * Float64(A * C))))) / t_2);
	else
		tmp = Float64(sqrt(Float64(F * Float64(A - hypot(A, B)))) * 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[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-N[Sqrt[N[(N[(N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(A + C), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(B * B + t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-195], N[(N[(N[Sqrt[N[(2.0 * N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(F * N[(C + N[(A - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / (-t$95$2)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+130], N[((-N[Sqrt[N[(N[(2.0 * t$95$2), $MachinePrecision] * N[(F * N[(A + N[(-0.5 * N[(N[(N[(B * B + N[(A * A), $MachinePrecision]), $MachinePrecision] - N[(A * A), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision] + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[Sqrt[N[(N[(A - N[(N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision] - C), $MachinePrecision]), $MachinePrecision] * -8.0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 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 := C \cdot \left(A \cdot -4\right)\\
t_1 := \frac{-\sqrt{\left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} - \left(A + C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(\left(4 \cdot A\right) \cdot C - {B}^{2}\right)\right)\right)}}{{B}^{2} + t_0}\\
t_2 := \mathsf{fma}\left(B, B, t_0\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-195}:\\
\;\;\;\;\left(\sqrt{2 \cdot \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)} \cdot \sqrt{F \cdot \left(C + \left(A - \mathsf{hypot}\left(A - C, B\right)\right)\right)}\right) \cdot \frac{1}{-t_2}\\

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

\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\left(A - \left(\mathsf{hypot}\left(B, A - C\right) - C\right)\right) \cdot -8} \cdot \left(-\sqrt{F \cdot \left(A \cdot C\right)}\right)}{t_2}\\

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


\end{array}

Error

Derivation

  1. Split input into 4 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))) < -1.0000000000000001e-195

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

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

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

    if -1.0000000000000001e-195 < (/.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))) < 4.0000000000000002e130

    1. Initial program 52.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. Applied egg-rr48.0

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

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

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

    if 4.0000000000000002e130 < (/.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 53.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. Simplified36.5

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

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

      \[\leadsto \frac{-\color{blue}{\sqrt[3]{{\left(\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)\right)}^{1.5}}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \]
    5. Applied egg-rr15.9

      \[\leadsto \frac{-\color{blue}{\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot -8} \cdot \sqrt{F \cdot \left(A \cdot C\right)}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\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 64.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-rr62.9

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

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

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

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

Alternatives

Alternative 1
Error38.9
Cost34052
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := 2 \cdot t_0\\ t_2 := \mathsf{hypot}\left(A - C, B\right)\\ t_3 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\ \mathbf{if}\;B \leq -5.8 \cdot 10^{-121}:\\ \;\;\;\;\sqrt{2 \cdot t_3} \cdot \left(\sqrt{F \cdot \left(C + \left(A - t_2\right)\right)} \cdot \frac{-1}{t_3}\right)\\ \mathbf{elif}\;B \leq 8.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(F \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 2.05 \cdot 10^{+40}:\\ \;\;\;\;\frac{1}{-t_0} \cdot \sqrt{t_1 \cdot \left(F \cdot \left(A - \left(t_2 - C\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 2
Error38.8
Cost33988
\[\begin{array}{l} t_0 := \mathsf{hypot}\left(A - C, B\right)\\ t_1 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_2 := 2 \cdot t_1\\ \mathbf{if}\;B \leq -5.8 \cdot 10^{-121}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)} \cdot \left(-\sqrt{F \cdot \left(C + \left(A - t_0\right)\right)}\right)}{t_1}\\ \mathbf{elif}\;B \leq 8.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{t_2 \cdot \left(F \cdot \left(A + A\right)\right)}}{t_1}\\ \mathbf{elif}\;B \leq 2.05 \cdot 10^{+40}:\\ \;\;\;\;\frac{1}{-t_1} \cdot \sqrt{t_2 \cdot \left(F \cdot \left(A - \left(t_0 - C\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 3
Error39.0
Cost33348
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := 2 \cdot t_0\\ t_2 := \frac{1}{-t_0}\\ t_3 := \sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)}\\ \mathbf{if}\;B \leq -3.5 \cdot 10^{-98}:\\ \;\;\;\;\frac{-\left|\sqrt{2} \cdot \left(B \cdot t_3\right)\right|}{t_0}\\ \mathbf{elif}\;B \leq 8.1 \cdot 10^{-47}:\\ \;\;\;\;t_2 \cdot \sqrt{t_1 \cdot \left(F \cdot \left(A + A\right)\right)}\\ \mathbf{elif}\;B \leq 2.05 \cdot 10^{+40}:\\ \;\;\;\;t_2 \cdot \sqrt{t_1 \cdot \left(F \cdot \left(A - \left(\mathsf{hypot}\left(A - C, B\right) - C\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_3 \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 4
Error39.5
Cost27980
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := 2 \cdot t_0\\ t_2 := \sqrt{t_1 \cdot \left(F \cdot \left(A - \left(\mathsf{hypot}\left(A - C, B\right) - C\right)\right)\right)}\\ \mathbf{if}\;B \leq -1 \cdot 10^{-122}:\\ \;\;\;\;\frac{-t_2}{t_0}\\ \mathbf{elif}\;B \leq 8.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(F \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 2.05 \cdot 10^{+40}:\\ \;\;\;\;\frac{1}{-t_0} \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 5
Error39.5
Cost27852
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := 2 \cdot t_0\\ t_2 := \frac{-\sqrt{t_1 \cdot \left(F \cdot \left(A - \left(\mathsf{hypot}\left(A - C, B\right) - C\right)\right)\right)}}{t_0}\\ \mathbf{if}\;B \leq -1 \cdot 10^{-122}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 8.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(F \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 2.05 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 6
Error40.2
Cost27596
\[\begin{array}{l} t_0 := F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)\\ t_1 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_2 := 2 \cdot t_1\\ t_3 := \frac{-\sqrt{t_2 \cdot t_0}}{t_1}\\ \mathbf{if}\;B \leq -1 \cdot 10^{-122}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 8.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{t_2 \cdot \left(F \cdot \left(A + A\right)\right)}}{t_1}\\ \mathbf{elif}\;B \leq 6.2 \cdot 10^{+54}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 1.35 \cdot 10^{+162}:\\ \;\;\;\;\frac{\sqrt{F \cdot -2} \cdot \left(-{B}^{1.5}\right)}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{t_0} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 7
Error40.8
Cost21128
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -3.5 \cdot 10^{-98}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A - \left(\mathsf{hypot}\left(B, A - C\right) - C\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 1.55 \cdot 10^{-15}:\\ \;\;\;\;\frac{1}{-t_0} \cdot \sqrt{\left(2 \cdot t_0\right) \cdot \left(F \cdot \left(A + A\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 8
Error40.7
Cost21000
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := A - \mathsf{hypot}\left(A, B\right)\\ \mathbf{if}\;B \leq -3.5 \cdot 10^{-98}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 1.55 \cdot 10^{-15}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot t_0\right) \cdot \left(F \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot t_1} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 9
Error40.7
Cost21000
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -3.5 \cdot 10^{-98}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A - \left(\mathsf{hypot}\left(B, A - C\right) - C\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 1.55 \cdot 10^{-15}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot t_0\right) \cdot \left(F \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 10
Error43.0
Cost20676
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{-\sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot F\right)\right) \cdot \left(\mathsf{hypot}\left(B, A\right) - A\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 8.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot -16\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 11
Error43.0
Cost20676
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := A - \mathsf{hypot}\left(A, B\right)\\ \mathbf{if}\;B \leq -4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 8.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot -16\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot t_1} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 12
Error43.8
Cost20168
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B\right)\right) \cdot \left(B + A\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 8.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot -16\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]
Alternative 13
Error49.8
Cost14344
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := F \cdot \left(B \cdot B\right)\\ \mathbf{if}\;B \leq -4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(B + A\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 5.5 \cdot 10^{-52}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot -16\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A - B\right)\right)}}{t_0}\\ \end{array} \]
Alternative 14
Error50.3
Cost14216
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B\right)\right) \cdot \left(B + A\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 5.5 \cdot 10^{-52}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot -16\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-2 \cdot \left(F \cdot {B}^{3}\right)}}{B \cdot B}\\ \end{array} \]
Alternative 15
Error50.2
Cost14084
\[\begin{array}{l} \mathbf{if}\;B \leq 5.5 \cdot 10^{-52}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot -16\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-2 \cdot \left(F \cdot {B}^{3}\right)}}{B \cdot B}\\ \end{array} \]
Alternative 16
Error53.0
Cost13636
\[\begin{array}{l} \mathbf{if}\;B \leq 8.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(A \cdot A\right) \cdot -16\right) \cdot \left(C \cdot F\right)}}{C \cdot \left(A \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-2 \cdot \left(F \cdot {B}^{3}\right)}}{B \cdot B}\\ \end{array} \]
Alternative 17
Error53.6
Cost7424
\[\frac{-\sqrt{\left(\left(A \cdot A\right) \cdot -16\right) \cdot \left(C \cdot F\right)}}{C \cdot \left(A \cdot -4\right)} \]
Alternative 18
Error62.7
Cost7296
\[\frac{-\sqrt{A \cdot \left(A \cdot \left(F \cdot \left(C \cdot -16\right)\right)\right)}}{B \cdot B} \]
Alternative 19
Error63.4
Cost6976
\[\frac{0.5}{\frac{A}{B}} \cdot \sqrt{\frac{F}{C}} \]

Error

Reproduce

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