ABCF->ab-angle a

?

Percentage Accurate: 19.0% → 48.0%
Time: 55.4s
Precision: binary64
Cost: 100872

?

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

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

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


\end{array}

Local Percentage Accuracy vs ?

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

Herbie found 22 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

Derivation?

  1. Split input into 3 regimes
  2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -1.0000000000000001e-208

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

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

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

      associate-*l* [=>]45.2%

      \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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} \]

      unpow2 [=>]45.2%

      \[ \frac{-\sqrt{\left(2 \cdot \left(\left(\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)\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} \]

      +-commutative [=>]45.2%

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

      unpow2 [=>]45.2%

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

      associate-*l* [=>]45.2%

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

      unpow2 [=>]45.2%

      \[ \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}{\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)} \]
    3. Applied egg-rr63.7%

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

      [Start]45.2%

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

      sqrt-prod [=>]53.3%

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

      *-commutative [=>]53.3%

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

      cancel-sign-sub-inv [=>]53.3%

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

      metadata-eval [=>]53.3%

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

      *-commutative [=>]53.3%

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

      associate-+l+ [=>]53.3%

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

      unpow2 [=>]53.3%

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

      hypot-udef [<=]63.7%

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

      associate-+r+ [=>]63.0%

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

      +-commutative [=>]63.0%

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

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

      [Start]63.7%

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

      sqrt-prod [=>]63.5%

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

      fma-def [=>]63.5%

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

      *-commutative [=>]63.5%

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

      associate-*r* [<=]63.5%

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

      *-commutative [=>]63.5%

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

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

      [Start]63.5%

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

      fma-def [<=]63.5%

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

      unpow2 [<=]63.5%

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

      +-commutative [<=]63.5%

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

      unpow2 [=>]63.5%

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

      fma-def [=>]63.5%

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

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

      [Start]63.5%

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

      sqrt-prod [=>]74.6%

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

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

      [Start]74.6%

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

      *-commutative [=>]74.6%

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

    if -1.0000000000000001e-208 < (/.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 19.5%

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

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

      [Start]19.5%

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

      associate-*l* [=>]19.5%

      \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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} \]

      unpow2 [=>]19.5%

      \[ \frac{-\sqrt{\left(2 \cdot \left(\left(\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)\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} \]

      +-commutative [=>]19.5%

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

      unpow2 [=>]19.5%

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

      associate-*l* [=>]19.5%

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

      unpow2 [=>]19.5%

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

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

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

      [Start]33.3%

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

      fma-def [=>]33.3%

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

      unpow2 [=>]33.3%

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

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

    1. Initial program 0.0%

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

      \[\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(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}} \]
      Step-by-step derivation

      [Start]0.0%

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

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

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

      [Start]0.7%

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

      *-commutative [=>]0.7%

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

      *-commutative [=>]0.7%

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

      +-commutative [=>]0.7%

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

      unpow2 [=>]0.7%

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

      unpow2 [=>]0.7%

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

      hypot-def [=>]2.9%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)} \]
    6. Simplified17.7%

      \[\leadsto \color{blue}{\left(-\sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}} \]
      Step-by-step derivation

      [Start]17.7%

      \[ -1 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right) \]

      associate-*r* [=>]17.7%

      \[ \color{blue}{\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}} \]

      neg-mul-1 [<=]17.7%

      \[ \color{blue}{\left(-\sqrt{2}\right)} \cdot \sqrt{\frac{F}{B}} \]
    7. Applied egg-rr26.7%

      \[\leadsto \left(-\sqrt{2}\right) \cdot \color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \]
      Step-by-step derivation

      [Start]17.7%

      \[ \left(-\sqrt{2}\right) \cdot \sqrt{\frac{F}{B}} \]

      sqrt-div [=>]26.7%

      \[ \left(-\sqrt{2}\right) \cdot \color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.1%

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

Alternatives

Alternative 1
Accuracy48.0%
Cost100872
\[\begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_1 := -\frac{\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_0}\\ t_2 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{-208}:\\ \;\;\;\;\frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(\left(\sqrt{F} \cdot \sqrt{\mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)}\right) \cdot \left(-\sqrt{2}\right)\right)}{t_2}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_2\right)\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\frac{\sqrt{F}}{\sqrt{B}}\right)\\ \end{array} \]
Alternative 2
Accuracy43.5%
Cost33668
\[\begin{array}{l} t_0 := -4 \cdot \left(A \cdot C\right)\\ t_1 := B \cdot B + t_0\\ \mathbf{if}\;B \leq -3.8:\\ \;\;\;\;\left(\sqrt{2} \cdot \left(B \cdot \sqrt{F}\right)\right) \cdot \left(\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, t_0\right)}\right)\\ \mathbf{elif}\;B \leq -9.6 \cdot 10^{-298}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot t_1\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 4.8 \cdot 10^{-15}:\\ \;\;\;\;\left(\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\right)} \cdot \sqrt{C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)}\right) \cdot \frac{-1}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\frac{\sqrt{F}}{\sqrt{B}}\right)\\ \end{array} \]
Alternative 3
Accuracy42.8%
Cost27268
\[\begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq -7.1:\\ \;\;\;\;\frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(\sqrt{2} \cdot \left(B \cdot \sqrt{F}\right)\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq -1.05 \cdot 10^{-297}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot t_0\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 4.7 \cdot 10^{-15}:\\ \;\;\;\;\left(\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\right)} \cdot \sqrt{C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)}\right) \cdot \frac{-1}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\frac{\sqrt{F}}{\sqrt{B}}\right)\\ \end{array} \]
Alternative 4
Accuracy44.3%
Cost21972
\[\begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ t_1 := \frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot t_0\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ t_2 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ t_3 := \frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_2}\\ \mathbf{if}\;B \leq -2.25 \cdot 10^{-72}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq -1.05 \cdot 10^{-297}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 8.5 \cdot 10^{-176}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(C, A \cdot -4, B \cdot B\right) \cdot \left(2 \cdot F\right)} \cdot \left(-\sqrt{2 \cdot C}\right)}{t_2}\\ \mathbf{elif}\;B \leq 8.6 \cdot 10^{-58}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{+80}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{-\sqrt{F}}{\sqrt{B}}\\ \end{array} \]
Alternative 5
Accuracy42.3%
Cost21836
\[\begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq -2.75 \cdot 10^{-72}:\\ \;\;\;\;\frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq -1.8 \cdot 10^{-296}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot t_0\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;\left(\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\right)} \cdot \sqrt{C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)}\right) \cdot \frac{-1}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\frac{\sqrt{F}}{\sqrt{B}}\right)\\ \end{array} \]
Alternative 6
Accuracy41.7%
Cost21588
\[\begin{array}{l} t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\ t_1 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ t_2 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ t_3 := \frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot t_1\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{if}\;B \leq -4.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B\right)\right)}\right)}{t_2}\\ \mathbf{elif}\;B \leq -1 \cdot 10^{-296}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 1.85 \cdot 10^{-174}:\\ \;\;\;\;\frac{\sqrt{t_0 \cdot \left(2 \cdot F\right)} \cdot \left(-\sqrt{2 \cdot C}\right)}{t_2}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{-61}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 5 \cdot 10^{-15}:\\ \;\;\;\;\left(\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \sqrt{C + C}\right) \cdot \frac{-1}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\frac{\sqrt{F}}{\sqrt{B}}\right)\\ \end{array} \]
Alternative 7
Accuracy40.9%
Cost21524
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ t_1 := \frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ t_2 := \frac{\sqrt{\mathsf{fma}\left(C, A \cdot -4, B \cdot B\right) \cdot \left(2 \cdot F\right)} \cdot \left(-\sqrt{2 \cdot C}\right)}{t_0}\\ \mathbf{if}\;B \leq -3.5 \cdot 10^{-58}:\\ \;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq -1.9 \cdot 10^{-297}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 2.3 \cdot 10^{-176}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 1.6 \cdot 10^{-57}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\frac{\sqrt{F}}{\sqrt{B}}\right)\\ \end{array} \]
Alternative 8
Accuracy41.6%
Cost21524
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ t_1 := \frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ t_2 := \frac{\sqrt{\mathsf{fma}\left(C, A \cdot -4, B \cdot B\right) \cdot \left(2 \cdot F\right)} \cdot \left(-\sqrt{2 \cdot C}\right)}{t_0}\\ \mathbf{if}\;B \leq -0.000115:\\ \;\;\;\;\frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B\right)\right)}\right)}{t_0}\\ \mathbf{elif}\;B \leq -4.8 \cdot 10^{-297}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.4 \cdot 10^{-176}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 9 \cdot 10^{-57}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 4.8 \cdot 10^{-15}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{-\sqrt{F}}{\sqrt{B}}\\ \end{array} \]
Alternative 9
Accuracy41.6%
Cost19848
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq -3.5 \cdot 10^{-60}:\\ \;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 4.5 \cdot 10^{+36}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\frac{\sqrt{F}}{\sqrt{B}}\right)\\ \end{array} \]
Alternative 10
Accuracy37.7%
Cost14788
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq -4.4 \cdot 10^{-65}:\\ \;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 1.7 \cdot 10^{+37}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
Alternative 11
Accuracy36.7%
Cost14728
\[\begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq -1.55 \cdot 10^{+18}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right) \cdot \left(\left(B - C\right) - A\right)}}{B \cdot B - t_0}\\ \mathbf{elif}\;B \leq 1.6 \cdot 10^{+36}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
Alternative 12
Accuracy36.4%
Cost13969
\[\begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ t_1 := B \cdot B - t_0\\ \mathbf{if}\;B \leq -5.3 \cdot 10^{+16}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right) \cdot \left(\left(B - C\right) - A\right)}}{t_1}\\ \mathbf{elif}\;B \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_1\right)\right) \cdot \left(2 \cdot C\right)}}{t_1}\\ \mathbf{elif}\;B \leq 7 \cdot 10^{+133} \lor \neg \left(B \leq 3.7 \cdot 10^{+205}\right):\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + C\right)}\right)\\ \end{array} \]
Alternative 13
Accuracy36.3%
Cost13448
\[\begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ t_1 := B \cdot B - t_0\\ \mathbf{if}\;B \leq -1.32 \cdot 10^{+17}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right) \cdot \left(\left(B - C\right) - A\right)}}{t_1}\\ \mathbf{elif}\;B \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_1\right)\right) \cdot \left(2 \cdot C\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
Alternative 14
Accuracy28.7%
Cost8584
\[\begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ t_1 := B \cdot B - t_0\\ t_2 := 2 \cdot \left(F \cdot t_1\right)\\ \mathbf{if}\;B \leq -3.3 \cdot 10^{+16}:\\ \;\;\;\;\frac{-\sqrt{B \cdot \left(2 \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right)}}{t_1}\\ \mathbf{elif}\;B \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{-\sqrt{t_2 \cdot \left(2 \cdot C\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{t_2 \cdot \left(A + \left(B + C\right)\right)}}{t_1}\\ \end{array} \]
Alternative 15
Accuracy28.7%
Cost8584
\[\begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ t_1 := B \cdot B - t_0\\ t_2 := 2 \cdot \left(F \cdot t_1\right)\\ \mathbf{if}\;B \leq -1.45 \cdot 10^{+17}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right) \cdot \left(\left(B - C\right) - A\right)}}{t_1}\\ \mathbf{elif}\;B \leq 4.8 \cdot 10^{-15}:\\ \;\;\;\;\frac{-\sqrt{t_2 \cdot \left(2 \cdot C\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{t_2 \cdot \left(A + \left(B + C\right)\right)}}{t_1}\\ \end{array} \]
Alternative 16
Accuracy28.6%
Cost8456
\[\begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ t_1 := B \cdot B - t_0\\ t_2 := 2 \cdot \left(F \cdot t_1\right)\\ \mathbf{if}\;B \leq -2.05 \cdot 10^{+17}:\\ \;\;\;\;\frac{-\sqrt{B \cdot \left(2 \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right)}}{t_1}\\ \mathbf{elif}\;B \leq 5 \cdot 10^{-15}:\\ \;\;\;\;\frac{-\sqrt{t_2 \cdot \left(2 \cdot C\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{B \cdot t_2}}{t_1}\\ \end{array} \]
Alternative 17
Accuracy12.0%
Cost8328
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ t_1 := 2 \cdot \left(F \cdot t_0\right)\\ \mathbf{if}\;B \leq -9 \cdot 10^{-77}:\\ \;\;\;\;2 \cdot \frac{{\left(C \cdot F\right)}^{0.5}}{B}\\ \mathbf{elif}\;B \leq 3.1 \cdot 10^{-46}:\\ \;\;\;\;-\frac{\sqrt{C \cdot t_1}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{B \cdot t_1}}{t_0}\\ \end{array} \]
Alternative 18
Accuracy9.8%
Cost8196
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq -4.5 \cdot 10^{-308}:\\ \;\;\;\;2 \cdot \frac{{\left(C \cdot F\right)}^{0.5}}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{B \cdot \left(2 \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \end{array} \]
Alternative 19
Accuracy9.3%
Cost7044
\[\begin{array}{l} \mathbf{if}\;B \leq -1.85 \cdot 10^{-205}:\\ \;\;\;\;2 \cdot \frac{\sqrt{C \cdot F}}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(C \cdot F\right)}^{0.5}}{B} \cdot -2\\ \end{array} \]
Alternative 20
Accuracy9.5%
Cost7044
\[\begin{array}{l} t_0 := \frac{{\left(C \cdot F\right)}^{0.5}}{B}\\ \mathbf{if}\;B \leq -5 \cdot 10^{-310}:\\ \;\;\;\;2 \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot -2\\ \end{array} \]
Alternative 21
Accuracy9.5%
Cost6980
\[\begin{array}{l} t_0 := \frac{\sqrt{C \cdot F}}{B}\\ \mathbf{if}\;B \leq -5 \cdot 10^{-310}:\\ \;\;\;\;2 \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot t_0\\ \end{array} \]
Alternative 22
Accuracy5.6%
Cost6848
\[-2 \cdot \frac{\sqrt{C \cdot F}}{B} \]

Reproduce?

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