ABCF->ab-angle b

Percentage Accurate: 19.7% → 48.9%
Time: 30.4s
Alternatives: 7
Speedup: 5.9×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0} \end{array} \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
   (/
    (-
     (sqrt
      (*
       (* 2.0 (* t_0 F))
       (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
    t_0)))
double code(double A, double B, double C, double F) {
	double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
	return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
    code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
	return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F):
	t_0 = math.pow(B, 2.0) - ((4.0 * A) * C)
	return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F)
	t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0)
end
function tmp = code(A, B, C, F)
	t_0 = (B ^ 2.0) - ((4.0 * A) * C);
	tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0;
end
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]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * 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]) / t$95$0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

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.

Accuracy vs Speed?

Herbie found 7 alternatives:

AlternativeAccuracySpeedup
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.

Initial Program: 19.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0} \end{array} \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
   (/
    (-
     (sqrt
      (*
       (* 2.0 (* t_0 F))
       (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
    t_0)))
double code(double A, double B, double C, double F) {
	double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
	return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
    code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
	return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F):
	t_0 = math.pow(B, 2.0) - ((4.0 * A) * C)
	return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F)
	t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0)
end
function tmp = code(A, B, C, F)
	t_0 = (B ^ 2.0) - ((4.0 * A) * C);
	tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0;
end
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]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * 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]) / t$95$0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}

Alternative 1: 48.9% accurate, 0.4× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\ \mathbf{if}\;t_2 \leq -2 \cdot 10^{-188}:\\ \;\;\;\;\frac{{\left(2 \cdot t_0\right)}^{0.5} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{t_0}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \left(A \cdot \left(2 \cdot C\right)\right)\right) \cdot -8\right)}}{A \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* A (* C -4.0))))
        (t_1 (- (pow B 2.0) (* (* 4.0 A) C)))
        (t_2
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_1 F))
             (- (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
          t_1)))
   (if (<= t_2 -2e-188)
     (/
      (* (pow (* 2.0 t_0) 0.5) (- (sqrt (* F (+ A (- C (hypot B (- A C))))))))
      t_0)
     (if (<= t_2 INFINITY)
       (* 0.25 (/ (sqrt (* A (* (* F (* A (* 2.0 C))) -8.0))) (* A C)))
       (/ (- (sqrt (* (* 2.0 F) (- A (hypot B A))))) B)))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double t_1 = pow(B, 2.0) - ((4.0 * A) * C);
	double t_2 = -sqrt(((2.0 * (t_1 * F)) * ((A + C) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_1;
	double tmp;
	if (t_2 <= -2e-188) {
		tmp = (pow((2.0 * t_0), 0.5) * -sqrt((F * (A + (C - hypot(B, (A - C))))))) / t_0;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = 0.25 * (sqrt((A * ((F * (A * (2.0 * C))) * -8.0))) / (A * C));
	} else {
		tmp = -sqrt(((2.0 * F) * (A - hypot(B, A)))) / B;
	}
	return tmp;
}
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_1 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_2 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(A + C) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_1)
	tmp = 0.0
	if (t_2 <= -2e-188)
		tmp = Float64(Float64((Float64(2.0 * t_0) ^ 0.5) * Float64(-sqrt(Float64(F * Float64(A + Float64(C - hypot(B, Float64(A - C)))))))) / t_0);
	elseif (t_2 <= Inf)
		tmp = Float64(0.25 * Float64(sqrt(Float64(A * Float64(Float64(F * Float64(A * Float64(2.0 * C))) * -8.0))) / Float64(A * C)));
	else
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * F) * Float64(A - hypot(B, A))))) / B);
	end
	return tmp
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * 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$1), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-188], N[(N[(N[Power[N[(2.0 * t$95$0), $MachinePrecision], 0.5], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(0.25 * N[(N[Sqrt[N[(A * N[(N[(F * N[(A * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -8.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{-188}:\\
\;\;\;\;\frac{{\left(2 \cdot t_0\right)}^{0.5} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{t_0}\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \left(A \cdot \left(2 \cdot C\right)\right)\right) \cdot -8\right)}}{A \cdot C}\\

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


\end{array}
\end{array}
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.9999999999999999e-188

    1. Initial program 46.8%

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

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

        \[\leadsto \frac{-\color{blue}{{\left(2 \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}^{0.5}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. associate-*r*51.1%

        \[\leadsto \frac{-{\color{blue}{\left(\left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}^{0.5}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. unpow-prod-down67.0%

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

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

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

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

    if -1.9999999999999999e-188 < (/.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 17.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. Simplified19.0%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(-4 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*27.6%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv27.6%

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

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

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

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\color{blue}{-4 \cdot \left(A \cdot C\right)}} \]
    7. Step-by-step derivation
      1. expm1-log1p-u26.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{-4 \cdot \left(A \cdot C\right)}\right)\right)} \]
      2. expm1-udef12.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{-4 \cdot \left(A \cdot C\right)}\right)} - 1} \]
    8. Applied egg-rr12.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def26.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}\right)\right)} \]
      2. expm1-log1p29.2%

        \[\leadsto \color{blue}{-\frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}} \]
      3. distribute-neg-frac29.2%

        \[\leadsto \color{blue}{\frac{-\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}} \]
      4. neg-mul-129.2%

        \[\leadsto \frac{\color{blue}{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}}{A \cdot \left(-4 \cdot C\right)} \]
      5. associate-*r*29.2%

        \[\leadsto \frac{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{\color{blue}{\left(A \cdot -4\right) \cdot C}} \]
      6. *-commutative29.2%

        \[\leadsto \frac{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{\color{blue}{\left(-4 \cdot A\right)} \cdot C} \]
      7. associate-*r*29.2%

        \[\leadsto \frac{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{\color{blue}{-4 \cdot \left(A \cdot C\right)}} \]
      8. times-frac29.2%

        \[\leadsto \color{blue}{\frac{-1}{-4} \cdot \frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot C}} \]
      9. metadata-eval29.2%

        \[\leadsto \color{blue}{0.25} \cdot \frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot C} \]
      10. associate-*l*29.2%

        \[\leadsto 0.25 \cdot \frac{\sqrt{\color{blue}{A \cdot \left(\left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right) \cdot -8\right)}}}{A \cdot C} \]
      11. associate-*r*25.4%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(\left(C \cdot F\right) \cdot \left(2 \cdot A\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      12. *-commutative25.4%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\left(\color{blue}{\left(F \cdot C\right)} \cdot \left(2 \cdot A\right)\right) \cdot -8\right)}}{A \cdot C} \]
    10. Simplified25.4%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{A \cdot \left(\left(\left(F \cdot C\right) \cdot \left(2 \cdot A\right)\right) \cdot -8\right)}}{A \cdot C}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u24.6%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(F \cdot C\right) \cdot \left(2 \cdot A\right)\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      2. expm1-udef10.6%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(e^{\mathsf{log1p}\left(\left(F \cdot C\right) \cdot \left(2 \cdot A\right)\right)} - 1\right)} \cdot -8\right)}}{A \cdot C} \]
      3. associate-*l*12.5%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\left(e^{\mathsf{log1p}\left(\color{blue}{F \cdot \left(C \cdot \left(2 \cdot A\right)\right)}\right)} - 1\right) \cdot -8\right)}}{A \cdot C} \]
    12. Applied egg-rr12.5%

      \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \left(C \cdot \left(2 \cdot A\right)\right)\right)} - 1\right)} \cdot -8\right)}}{A \cdot C} \]
    13. Step-by-step derivation
      1. expm1-def28.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(F \cdot \left(C \cdot \left(2 \cdot A\right)\right)\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      2. expm1-log1p31.0%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(F \cdot \left(C \cdot \left(2 \cdot A\right)\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      3. associate-*r*31.0%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \color{blue}{\left(\left(C \cdot 2\right) \cdot A\right)}\right) \cdot -8\right)}}{A \cdot C} \]
    14. Simplified31.0%

      \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(F \cdot \left(\left(C \cdot 2\right) \cdot A\right)\right)} \cdot -8\right)}}{A \cdot C} \]

    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. Simplified0.5%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg1.8%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in1.8%

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow21.8%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def12.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified12.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. associate-*l/12.9%

        \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
    7. Applied egg-rr12.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u3.8%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)\right)}}{B} \]
      2. expm1-udef2.0%

        \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)} - 1}}{B} \]
      3. distribute-rgt-neg-out2.0%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(\color{blue}{-\sqrt{2} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)} - 1}{B} \]
      4. pow1/22.0%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} - 1}{B} \]
      5. pow1/22.0%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
      6. pow-prod-down2.0%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
    9. Applied egg-rr2.0%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)} - 1}}{B} \]
    10. Step-by-step derivation
      1. expm1-def3.8%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)\right)}}{B} \]
      2. expm1-log1p13.0%

        \[\leadsto \frac{\color{blue}{-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}}{B} \]
      3. unpow1/213.0%

        \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}}{B} \]
      4. associate-*r*13.0%

        \[\leadsto \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
    11. Simplified13.0%

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

    \[\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 -2 \cdot 10^{-188}:\\ \;\;\;\;\frac{{\left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{0.5} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\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:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \left(A \cdot \left(2 \cdot C\right)\right)\right) \cdot -8\right)}}{A \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}{B}\\ \end{array} \]

Alternative 2: 48.6% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := {B}^{2} - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-69}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot t_1\right)\right) \cdot \left(A + A\right)}}{t_1}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+87}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* A (* C -4.0)))) (t_1 (- (pow B 2.0) (* 4.0 (* A C)))))
   (if (<= (pow B 2.0) 2e-69)
     (/ (- (sqrt (* (* F (* 2.0 t_1)) (+ A A)))) t_1)
     (if (<= (pow B 2.0) 2e+87)
       (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A (- C (hypot B (- A C))))))))) t_0)
       (/ (- (sqrt (* (* 2.0 F) (- A (hypot B A))))) B)))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double t_1 = pow(B, 2.0) - (4.0 * (A * C));
	double tmp;
	if (pow(B, 2.0) <= 2e-69) {
		tmp = -sqrt(((F * (2.0 * t_1)) * (A + A))) / t_1;
	} else if (pow(B, 2.0) <= 2e+87) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + (C - hypot(B, (A - C)))))))) / t_0;
	} else {
		tmp = -sqrt(((2.0 * F) * (A - hypot(B, A)))) / B;
	}
	return tmp;
}
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_1 = Float64((B ^ 2.0) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if ((B ^ 2.0) <= 2e-69)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * Float64(2.0 * t_1)) * Float64(A + A)))) / t_1);
	elseif ((B ^ 2.0) <= 2e+87)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + Float64(C - hypot(B, Float64(A - C))))))))) / t_0);
	else
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * F) * Float64(A - hypot(B, A))))) / B);
	end
	return tmp
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-69], N[((-N[Sqrt[N[(N[(F * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+87], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(A + N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := {B}^{2} - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-69}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot t_1\right)\right) \cdot \left(A + A\right)}}{t_1}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+87}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B 2) < 1.9999999999999999e-69

    1. Initial program 26.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. Simplified26.1%

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

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

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

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

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

      \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    5. Taylor expanded in C around inf 29.0%

      \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg29.0%

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \left(A - \color{blue}{\left(-A\right)}\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    7. Simplified29.0%

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

    if 1.9999999999999999e-69 < (pow.f64 B 2) < 1.9999999999999999e87

    1. Initial program 35.9%

      \[\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. Simplified41.5%

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

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

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

    if 1.9999999999999999e87 < (pow.f64 B 2)

    1. Initial program 10.8%

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

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

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

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in8.1%

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def18.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified18.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. associate-*l/18.9%

        \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
    7. Applied egg-rr18.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u6.6%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)\right)}}{B} \]
      2. expm1-udef1.5%

        \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)} - 1}}{B} \]
      3. distribute-rgt-neg-out1.5%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(\color{blue}{-\sqrt{2} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)} - 1}{B} \]
      4. pow1/21.5%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} - 1}{B} \]
      5. pow1/21.5%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
      6. pow-prod-down1.5%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
    9. Applied egg-rr1.5%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)} - 1}}{B} \]
    10. Step-by-step derivation
      1. expm1-def6.6%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)\right)}}{B} \]
      2. expm1-log1p19.0%

        \[\leadsto \frac{\color{blue}{-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}}{B} \]
      3. unpow1/219.0%

        \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}}{B} \]
      4. associate-*r*19.0%

        \[\leadsto \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
    11. Simplified19.0%

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

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

Alternative 3: 44.7% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+87}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \left(A \cdot \left(2 \cdot C\right)\right)\right) \cdot -8\right)}}{A \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (if (<= (pow B 2.0) 2e+87)
   (* 0.25 (/ (sqrt (* A (* (* F (* A (* 2.0 C))) -8.0))) (* A C)))
   (/ (- (sqrt (* (* 2.0 F) (- A (hypot B A))))) B)))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 2e+87) {
		tmp = 0.25 * (sqrt((A * ((F * (A * (2.0 * C))) * -8.0))) / (A * C));
	} else {
		tmp = -sqrt(((2.0 * F) * (A - hypot(B, A)))) / B;
	}
	return tmp;
}
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (Math.pow(B, 2.0) <= 2e+87) {
		tmp = 0.25 * (Math.sqrt((A * ((F * (A * (2.0 * C))) * -8.0))) / (A * C));
	} else {
		tmp = -Math.sqrt(((2.0 * F) * (A - Math.hypot(B, A)))) / B;
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	tmp = 0
	if math.pow(B, 2.0) <= 2e+87:
		tmp = 0.25 * (math.sqrt((A * ((F * (A * (2.0 * C))) * -8.0))) / (A * C))
	else:
		tmp = -math.sqrt(((2.0 * F) * (A - math.hypot(B, A)))) / B
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 2e+87)
		tmp = Float64(0.25 * Float64(sqrt(Float64(A * Float64(Float64(F * Float64(A * Float64(2.0 * C))) * -8.0))) / Float64(A * C)));
	else
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * F) * Float64(A - hypot(B, A))))) / B);
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if ((B ^ 2.0) <= 2e+87)
		tmp = 0.25 * (sqrt((A * ((F * (A * (2.0 * C))) * -8.0))) / (A * C));
	else
		tmp = -sqrt(((2.0 * F) * (A - hypot(B, A)))) / B;
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+87], N[(0.25 * N[(N[Sqrt[N[(A * N[(N[(F * N[(A * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -8.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+87}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \left(A \cdot \left(2 \cdot C\right)\right)\right) \cdot -8\right)}}{A \cdot C}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 1.9999999999999999e87

    1. Initial program 28.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. Simplified32.5%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(-4 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*23.0%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv23.0%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + \color{blue}{1} \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      5. *-lft-identity23.0%

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

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\color{blue}{-4 \cdot \left(A \cdot C\right)}} \]
    7. Step-by-step derivation
      1. expm1-log1p-u18.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{-4 \cdot \left(A \cdot C\right)}\right)\right)} \]
      2. expm1-udef6.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{-4 \cdot \left(A \cdot C\right)}\right)} - 1} \]
    8. Applied egg-rr6.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def18.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}\right)\right)} \]
      2. expm1-log1p24.1%

        \[\leadsto \color{blue}{-\frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}} \]
      3. distribute-neg-frac24.1%

        \[\leadsto \color{blue}{\frac{-\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}} \]
      4. neg-mul-124.1%

        \[\leadsto \frac{\color{blue}{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}}{A \cdot \left(-4 \cdot C\right)} \]
      5. associate-*r*24.1%

        \[\leadsto \frac{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{\color{blue}{\left(A \cdot -4\right) \cdot C}} \]
      6. *-commutative24.1%

        \[\leadsto \frac{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{\color{blue}{\left(-4 \cdot A\right)} \cdot C} \]
      7. associate-*r*24.1%

        \[\leadsto \frac{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{\color{blue}{-4 \cdot \left(A \cdot C\right)}} \]
      8. times-frac24.1%

        \[\leadsto \color{blue}{\frac{-1}{-4} \cdot \frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot C}} \]
      9. metadata-eval24.1%

        \[\leadsto \color{blue}{0.25} \cdot \frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot C} \]
      10. associate-*l*24.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{\color{blue}{A \cdot \left(\left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right) \cdot -8\right)}}}{A \cdot C} \]
      11. associate-*r*20.8%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(\left(C \cdot F\right) \cdot \left(2 \cdot A\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      12. *-commutative20.8%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\left(\color{blue}{\left(F \cdot C\right)} \cdot \left(2 \cdot A\right)\right) \cdot -8\right)}}{A \cdot C} \]
    10. Simplified20.8%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{A \cdot \left(\left(\left(F \cdot C\right) \cdot \left(2 \cdot A\right)\right) \cdot -8\right)}}{A \cdot C}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u18.8%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(F \cdot C\right) \cdot \left(2 \cdot A\right)\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      2. expm1-udef9.0%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(e^{\mathsf{log1p}\left(\left(F \cdot C\right) \cdot \left(2 \cdot A\right)\right)} - 1\right)} \cdot -8\right)}}{A \cdot C} \]
      3. associate-*l*10.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\left(e^{\mathsf{log1p}\left(\color{blue}{F \cdot \left(C \cdot \left(2 \cdot A\right)\right)}\right)} - 1\right) \cdot -8\right)}}{A \cdot C} \]
    12. Applied egg-rr10.3%

      \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \left(C \cdot \left(2 \cdot A\right)\right)\right)} - 1\right)} \cdot -8\right)}}{A \cdot C} \]
    13. Step-by-step derivation
      1. expm1-def21.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(F \cdot \left(C \cdot \left(2 \cdot A\right)\right)\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      2. expm1-log1p25.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(F \cdot \left(C \cdot \left(2 \cdot A\right)\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      3. associate-*r*25.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \color{blue}{\left(\left(C \cdot 2\right) \cdot A\right)}\right) \cdot -8\right)}}{A \cdot C} \]
    14. Simplified25.3%

      \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(F \cdot \left(\left(C \cdot 2\right) \cdot A\right)\right)} \cdot -8\right)}}{A \cdot C} \]

    if 1.9999999999999999e87 < (pow.f64 B 2)

    1. Initial program 10.8%

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

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

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

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in8.1%

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def18.9%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
    5. Simplified18.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. associate-*l/18.9%

        \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
    7. Applied egg-rr18.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u6.6%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)\right)}}{B} \]
      2. expm1-udef1.5%

        \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)} - 1}}{B} \]
      3. distribute-rgt-neg-out1.5%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(\color{blue}{-\sqrt{2} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)} - 1}{B} \]
      4. pow1/21.5%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} - 1}{B} \]
      5. pow1/21.5%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
      6. pow-prod-down1.5%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
    9. Applied egg-rr1.5%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)} - 1}}{B} \]
    10. Step-by-step derivation
      1. expm1-def6.6%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)\right)}}{B} \]
      2. expm1-log1p19.0%

        \[\leadsto \frac{\color{blue}{-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}}{B} \]
      3. unpow1/219.0%

        \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}}{B} \]
      4. associate-*r*19.0%

        \[\leadsto \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
    11. Simplified19.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+87}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \left(A \cdot \left(2 \cdot C\right)\right)\right) \cdot -8\right)}}{A \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}{B}\\ \end{array} \]

Alternative 4: 41.2% accurate, 5.3× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := 2 \cdot \left(A \cdot F\right)\\ \mathbf{if}\;B \leq 3.25 \cdot 10^{+44}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot t_0\right)\right)}}{A \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-2 \cdot \left(B \cdot F\right) + t_0}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (* 2.0 (* A F))))
   (if (<= B 3.25e+44)
     (* 0.25 (/ (sqrt (* -8.0 (* A (* C t_0)))) (* A C)))
     (/ (- (sqrt (+ (* -2.0 (* B F)) t_0))) B))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = 2.0 * (A * F);
	double tmp;
	if (B <= 3.25e+44) {
		tmp = 0.25 * (sqrt((-8.0 * (A * (C * t_0)))) / (A * C));
	} else {
		tmp = -sqrt(((-2.0 * (B * F)) + t_0)) / B;
	}
	return tmp;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 2.0d0 * (a * f)
    if (b <= 3.25d+44) then
        tmp = 0.25d0 * (sqrt(((-8.0d0) * (a * (c * t_0)))) / (a * c))
    else
        tmp = -sqrt((((-2.0d0) * (b * f)) + t_0)) / b
    end if
    code = tmp
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = 2.0 * (A * F);
	double tmp;
	if (B <= 3.25e+44) {
		tmp = 0.25 * (Math.sqrt((-8.0 * (A * (C * t_0)))) / (A * C));
	} else {
		tmp = -Math.sqrt(((-2.0 * (B * F)) + t_0)) / B;
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = 2.0 * (A * F)
	tmp = 0
	if B <= 3.25e+44:
		tmp = 0.25 * (math.sqrt((-8.0 * (A * (C * t_0)))) / (A * C))
	else:
		tmp = -math.sqrt(((-2.0 * (B * F)) + t_0)) / B
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(2.0 * Float64(A * F))
	tmp = 0.0
	if (B <= 3.25e+44)
		tmp = Float64(0.25 * Float64(sqrt(Float64(-8.0 * Float64(A * Float64(C * t_0)))) / Float64(A * C)));
	else
		tmp = Float64(Float64(-sqrt(Float64(Float64(-2.0 * Float64(B * F)) + t_0))) / B);
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = 2.0 * (A * F);
	tmp = 0.0;
	if (B <= 3.25e+44)
		tmp = 0.25 * (sqrt((-8.0 * (A * (C * t_0)))) / (A * C));
	else
		tmp = -sqrt(((-2.0 * (B * F)) + t_0)) / B;
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(2.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 3.25e+44], N[(0.25 * N[(N[Sqrt[N[(-8.0 * N[(A * N[(C * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(-2.0 * N[(B * F), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := 2 \cdot \left(A \cdot F\right)\\
\mathbf{if}\;B \leq 3.25 \cdot 10^{+44}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot t_0\right)\right)}}{A \cdot C}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 3.25000000000000009e44

    1. Initial program 22.9%

      \[\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. Simplified25.6%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(-4 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*16.8%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv16.8%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + \color{blue}{1} \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      5. *-lft-identity16.8%

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

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\color{blue}{-4 \cdot \left(A \cdot C\right)}} \]
    7. Step-by-step derivation
      1. add-cbrt-cube15.3%

        \[\leadsto \frac{-\color{blue}{\sqrt[3]{\left(\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)} \cdot \sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}\right) \cdot \sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}}}{-4 \cdot \left(A \cdot C\right)} \]
      2. pow1/314.3%

        \[\leadsto \frac{-\color{blue}{{\left(\left(\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)} \cdot \sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}\right) \cdot \sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}\right)}^{0.3333333333333333}}}{-4 \cdot \left(A \cdot C\right)} \]
    8. Applied egg-rr13.7%

      \[\leadsto \frac{-\color{blue}{{\left({\left(-8 \cdot \left(C \cdot \left(A \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right)\right)}^{1.5}\right)}^{0.3333333333333333}}}{-4 \cdot \left(A \cdot C\right)} \]
    9. Step-by-step derivation
      1. expm1-log1p-u10.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-{\left({\left(-8 \cdot \left(C \cdot \left(A \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{-4 \cdot \left(A \cdot C\right)}\right)\right)} \]
      2. expm1-udef3.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-{\left({\left(-8 \cdot \left(C \cdot \left(A \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{-4 \cdot \left(A \cdot C\right)}\right)} - 1} \]
    10. Applied egg-rr4.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\frac{\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{\left(-4 \cdot A\right) \cdot C}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def13.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\frac{\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{\left(-4 \cdot A\right) \cdot C}\right)\right)} \]
      2. expm1-log1p17.3%

        \[\leadsto \color{blue}{-\frac{\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{\left(-4 \cdot A\right) \cdot C}} \]
      3. distribute-neg-frac17.3%

        \[\leadsto \color{blue}{\frac{-\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{\left(-4 \cdot A\right) \cdot C}} \]
      4. neg-mul-117.3%

        \[\leadsto \frac{\color{blue}{-1 \cdot \sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}}{\left(-4 \cdot A\right) \cdot C} \]
      5. associate-*l*17.3%

        \[\leadsto \frac{-1 \cdot \sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{\color{blue}{-4 \cdot \left(A \cdot C\right)}} \]
      6. times-frac17.3%

        \[\leadsto \color{blue}{\frac{-1}{-4} \cdot \frac{\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{A \cdot C}} \]
      7. metadata-eval17.3%

        \[\leadsto \color{blue}{0.25} \cdot \frac{\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{A \cdot C} \]
      8. associate-*l*17.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-8 \cdot \color{blue}{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right)}}}{A \cdot C} \]
      9. *-commutative17.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \color{blue}{\left(\left(2 \cdot A\right) \cdot F\right)}\right)\right)}}{A \cdot C} \]
      10. associate-*r*17.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \color{blue}{\left(2 \cdot \left(A \cdot F\right)\right)}\right)\right)}}{A \cdot C} \]
      11. *-commutative17.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(2 \cdot \color{blue}{\left(F \cdot A\right)}\right)\right)\right)}}{A \cdot C} \]
    12. Simplified17.3%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(2 \cdot \left(F \cdot A\right)\right)\right)\right)}}{A \cdot C}} \]

    if 3.25000000000000009e44 < B

    1. Initial program 11.9%

      \[\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. Simplified12.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg18.3%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in18.3%

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def43.1%

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

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. associate-*l/43.2%

        \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
    7. Applied egg-rr43.2%

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u14.7%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)\right)}}{B} \]
      2. expm1-udef1.8%

        \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)} - 1}}{B} \]
      3. distribute-rgt-neg-out1.8%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(\color{blue}{-\sqrt{2} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)} - 1}{B} \]
      4. pow1/21.8%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} - 1}{B} \]
      5. pow1/21.8%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
      6. pow-prod-down1.8%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
    9. Applied egg-rr1.8%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)} - 1}}{B} \]
    10. Step-by-step derivation
      1. expm1-def14.8%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)\right)}}{B} \]
      2. expm1-log1p43.4%

        \[\leadsto \frac{\color{blue}{-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}}{B} \]
      3. unpow1/243.4%

        \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}}{B} \]
      4. associate-*r*43.4%

        \[\leadsto \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
    11. Simplified43.4%

      \[\leadsto \frac{\color{blue}{-\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
    12. Taylor expanded in A around 0 41.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.25 \cdot 10^{+44}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(2 \cdot \left(A \cdot F\right)\right)\right)\right)}}{A \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-2 \cdot \left(B \cdot F\right) + 2 \cdot \left(A \cdot F\right)}}{B}\\ \end{array} \]

Alternative 5: 42.0% accurate, 5.3× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 4.1 \cdot 10^{+43}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \left(A \cdot \left(2 \cdot C\right)\right)\right) \cdot -8\right)}}{A \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-2 \cdot \left(B \cdot F\right) + 2 \cdot \left(A \cdot F\right)}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (if (<= B 4.1e+43)
   (* 0.25 (/ (sqrt (* A (* (* F (* A (* 2.0 C))) -8.0))) (* A C)))
   (/ (- (sqrt (+ (* -2.0 (* B F)) (* 2.0 (* A F))))) B)))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 4.1e+43) {
		tmp = 0.25 * (sqrt((A * ((F * (A * (2.0 * C))) * -8.0))) / (A * C));
	} else {
		tmp = -sqrt(((-2.0 * (B * F)) + (2.0 * (A * F)))) / B;
	}
	return tmp;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b <= 4.1d+43) then
        tmp = 0.25d0 * (sqrt((a * ((f * (a * (2.0d0 * c))) * (-8.0d0)))) / (a * c))
    else
        tmp = -sqrt((((-2.0d0) * (b * f)) + (2.0d0 * (a * f)))) / b
    end if
    code = tmp
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 4.1e+43) {
		tmp = 0.25 * (Math.sqrt((A * ((F * (A * (2.0 * C))) * -8.0))) / (A * C));
	} else {
		tmp = -Math.sqrt(((-2.0 * (B * F)) + (2.0 * (A * F)))) / B;
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	tmp = 0
	if B <= 4.1e+43:
		tmp = 0.25 * (math.sqrt((A * ((F * (A * (2.0 * C))) * -8.0))) / (A * C))
	else:
		tmp = -math.sqrt(((-2.0 * (B * F)) + (2.0 * (A * F)))) / B
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 4.1e+43)
		tmp = Float64(0.25 * Float64(sqrt(Float64(A * Float64(Float64(F * Float64(A * Float64(2.0 * C))) * -8.0))) / Float64(A * C)));
	else
		tmp = Float64(Float64(-sqrt(Float64(Float64(-2.0 * Float64(B * F)) + Float64(2.0 * Float64(A * F))))) / B);
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (B <= 4.1e+43)
		tmp = 0.25 * (sqrt((A * ((F * (A * (2.0 * C))) * -8.0))) / (A * C));
	else
		tmp = -sqrt(((-2.0 * (B * F)) + (2.0 * (A * F)))) / B;
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := If[LessEqual[B, 4.1e+43], N[(0.25 * N[(N[Sqrt[N[(A * N[(N[(F * N[(A * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -8.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(-2.0 * N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 4.1 \cdot 10^{+43}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \left(A \cdot \left(2 \cdot C\right)\right)\right) \cdot -8\right)}}{A \cdot C}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 4.1e43

    1. Initial program 22.9%

      \[\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. Simplified25.6%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(-4 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*16.8%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv16.8%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + \color{blue}{1} \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      5. *-lft-identity16.8%

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

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\color{blue}{-4 \cdot \left(A \cdot C\right)}} \]
    7. Step-by-step derivation
      1. expm1-log1p-u13.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{-4 \cdot \left(A \cdot C\right)}\right)\right)} \]
      2. expm1-udef4.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{-4 \cdot \left(A \cdot C\right)}\right)} - 1} \]
    8. Applied egg-rr4.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def13.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}\right)\right)} \]
      2. expm1-log1p17.3%

        \[\leadsto \color{blue}{-\frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}} \]
      3. distribute-neg-frac17.3%

        \[\leadsto \color{blue}{\frac{-\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot \left(-4 \cdot C\right)}} \]
      4. neg-mul-117.3%

        \[\leadsto \frac{\color{blue}{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}}{A \cdot \left(-4 \cdot C\right)} \]
      5. associate-*r*17.3%

        \[\leadsto \frac{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{\color{blue}{\left(A \cdot -4\right) \cdot C}} \]
      6. *-commutative17.3%

        \[\leadsto \frac{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{\color{blue}{\left(-4 \cdot A\right)} \cdot C} \]
      7. associate-*r*17.3%

        \[\leadsto \frac{-1 \cdot \sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{\color{blue}{-4 \cdot \left(A \cdot C\right)}} \]
      8. times-frac17.3%

        \[\leadsto \color{blue}{\frac{-1}{-4} \cdot \frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot C}} \]
      9. metadata-eval17.3%

        \[\leadsto \color{blue}{0.25} \cdot \frac{\sqrt{\left(A \cdot \left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right) \cdot -8}}{A \cdot C} \]
      10. associate-*l*17.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{\color{blue}{A \cdot \left(\left(C \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right) \cdot -8\right)}}}{A \cdot C} \]
      11. associate-*r*15.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(\left(C \cdot F\right) \cdot \left(2 \cdot A\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      12. *-commutative15.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\left(\color{blue}{\left(F \cdot C\right)} \cdot \left(2 \cdot A\right)\right) \cdot -8\right)}}{A \cdot C} \]
    10. Simplified15.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{A \cdot \left(\left(\left(F \cdot C\right) \cdot \left(2 \cdot A\right)\right) \cdot -8\right)}}{A \cdot C}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u13.7%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(F \cdot C\right) \cdot \left(2 \cdot A\right)\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      2. expm1-udef7.0%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(e^{\mathsf{log1p}\left(\left(F \cdot C\right) \cdot \left(2 \cdot A\right)\right)} - 1\right)} \cdot -8\right)}}{A \cdot C} \]
      3. associate-*l*7.9%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\left(e^{\mathsf{log1p}\left(\color{blue}{F \cdot \left(C \cdot \left(2 \cdot A\right)\right)}\right)} - 1\right) \cdot -8\right)}}{A \cdot C} \]
    12. Applied egg-rr7.9%

      \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \left(C \cdot \left(2 \cdot A\right)\right)\right)} - 1\right)} \cdot -8\right)}}{A \cdot C} \]
    13. Step-by-step derivation
      1. expm1-def15.3%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(F \cdot \left(C \cdot \left(2 \cdot A\right)\right)\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      2. expm1-log1p18.2%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(F \cdot \left(C \cdot \left(2 \cdot A\right)\right)\right)} \cdot -8\right)}}{A \cdot C} \]
      3. associate-*r*18.2%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \color{blue}{\left(\left(C \cdot 2\right) \cdot A\right)}\right) \cdot -8\right)}}{A \cdot C} \]
    14. Simplified18.2%

      \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot \left(\color{blue}{\left(F \cdot \left(\left(C \cdot 2\right) \cdot A\right)\right)} \cdot -8\right)}}{A \cdot C} \]

    if 4.1e43 < B

    1. Initial program 11.9%

      \[\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. Simplified12.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg18.3%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. distribute-rgt-neg-in18.3%

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
      6. hypot-def43.1%

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

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. associate-*l/43.2%

        \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
    7. Applied egg-rr43.2%

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u14.7%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)\right)}}{B} \]
      2. expm1-udef1.8%

        \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)} - 1}}{B} \]
      3. distribute-rgt-neg-out1.8%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(\color{blue}{-\sqrt{2} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)} - 1}{B} \]
      4. pow1/21.8%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} - 1}{B} \]
      5. pow1/21.8%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
      6. pow-prod-down1.8%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
    9. Applied egg-rr1.8%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)} - 1}}{B} \]
    10. Step-by-step derivation
      1. expm1-def14.8%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)\right)}}{B} \]
      2. expm1-log1p43.4%

        \[\leadsto \frac{\color{blue}{-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}}{B} \]
      3. unpow1/243.4%

        \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}}{B} \]
      4. associate-*r*43.4%

        \[\leadsto \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
    11. Simplified43.4%

      \[\leadsto \frac{\color{blue}{-\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
    12. Taylor expanded in A around 0 41.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 4.1 \cdot 10^{+43}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{A \cdot \left(\left(F \cdot \left(A \cdot \left(2 \cdot C\right)\right)\right) \cdot -8\right)}}{A \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-2 \cdot \left(B \cdot F\right) + 2 \cdot \left(A \cdot F\right)}}{B}\\ \end{array} \]

Alternative 6: 0.6% accurate, 5.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \frac{-\sqrt{B \cdot \left(2 \cdot F\right)}}{B} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F) :precision binary64 (/ (- (sqrt (* B (* 2.0 F)))) B))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return -sqrt((B * (2.0 * F))) / B;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = -sqrt((b * (2.0d0 * f))) / b
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	return -Math.sqrt((B * (2.0 * F))) / B;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return -math.sqrt((B * (2.0 * F))) / B
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(Float64(-sqrt(Float64(B * Float64(2.0 * F)))) / B)
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = -sqrt((B * (2.0 * F))) / B;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(B * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{-\sqrt{B \cdot \left(2 \cdot F\right)}}{B}
\end{array}
Derivation
  1. Initial program 21.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. Simplified23.3%

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

    \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
  4. Step-by-step derivation
    1. mul-1-neg6.7%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
    2. distribute-rgt-neg-in6.7%

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

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

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

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
    6. hypot-def11.6%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
  5. Simplified11.6%

    \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
  6. Step-by-step derivation
    1. associate-*l/11.6%

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
  7. Applied egg-rr11.6%

    \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
  8. Step-by-step derivation
    1. expm1-log1p-u4.8%

      \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)\right)}}{B} \]
    2. expm1-udef1.9%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)} - 1}}{B} \]
    3. distribute-rgt-neg-out1.9%

      \[\leadsto \frac{e^{\mathsf{log1p}\left(\color{blue}{-\sqrt{2} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)} - 1}{B} \]
    4. pow1/21.9%

      \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} - 1}{B} \]
    5. pow1/21.9%

      \[\leadsto \frac{e^{\mathsf{log1p}\left(-{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
    6. pow-prod-down1.9%

      \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
  9. Applied egg-rr1.9%

    \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)} - 1}}{B} \]
  10. Step-by-step derivation
    1. expm1-def4.8%

      \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)\right)}}{B} \]
    2. expm1-log1p11.7%

      \[\leadsto \frac{\color{blue}{-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}}{B} \]
    3. unpow1/211.7%

      \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}}{B} \]
    4. associate-*r*11.7%

      \[\leadsto \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
  11. Simplified11.7%

    \[\leadsto \frac{\color{blue}{-\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
  12. Taylor expanded in B around -inf 1.6%

    \[\leadsto \frac{-\sqrt{\left(2 \cdot F\right) \cdot \color{blue}{B}}}{B} \]
  13. Final simplification1.6%

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

Alternative 7: 26.9% accurate, 5.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \frac{-\sqrt{-2 \cdot \left(B \cdot F\right)}}{B} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F) :precision binary64 (/ (- (sqrt (* -2.0 (* B F)))) B))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return -sqrt((-2.0 * (B * F))) / B;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = -sqrt(((-2.0d0) * (b * f))) / b
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	return -Math.sqrt((-2.0 * (B * F))) / B;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return -math.sqrt((-2.0 * (B * F))) / B
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(Float64(-sqrt(Float64(-2.0 * Float64(B * F)))) / B)
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = -sqrt((-2.0 * (B * F))) / B;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(-2.0 * N[(B * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{-\sqrt{-2 \cdot \left(B \cdot F\right)}}{B}
\end{array}
Derivation
  1. Initial program 21.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. Simplified23.3%

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

    \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)} \]
  4. Step-by-step derivation
    1. mul-1-neg6.7%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
    2. distribute-rgt-neg-in6.7%

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

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

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

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]
    6. hypot-def11.6%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
  5. Simplified11.6%

    \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
  6. Step-by-step derivation
    1. associate-*l/11.6%

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
  7. Applied egg-rr11.6%

    \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}} \]
  8. Step-by-step derivation
    1. expm1-log1p-u4.8%

      \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)\right)}}{B} \]
    2. expm1-udef1.9%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\right)} - 1}}{B} \]
    3. distribute-rgt-neg-out1.9%

      \[\leadsto \frac{e^{\mathsf{log1p}\left(\color{blue}{-\sqrt{2} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)} - 1}{B} \]
    4. pow1/21.9%

      \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} - 1}{B} \]
    5. pow1/21.9%

      \[\leadsto \frac{e^{\mathsf{log1p}\left(-{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
    6. pow-prod-down1.9%

      \[\leadsto \frac{e^{\mathsf{log1p}\left(-\color{blue}{{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}\right)} - 1}{B} \]
  9. Applied egg-rr1.9%

    \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)} - 1}}{B} \]
  10. Step-by-step derivation
    1. expm1-def4.8%

      \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}\right)\right)}}{B} \]
    2. expm1-log1p11.7%

      \[\leadsto \frac{\color{blue}{-{\left(2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)\right)}^{0.5}}}{B} \]
    3. unpow1/211.7%

      \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}}{B} \]
    4. associate-*r*11.7%

      \[\leadsto \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
  11. Simplified11.7%

    \[\leadsto \frac{\color{blue}{-\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}}{B} \]
  12. Taylor expanded in A around 0 10.4%

    \[\leadsto \frac{-\sqrt{\color{blue}{-2 \cdot \left(B \cdot F\right)}}}{B} \]
  13. Step-by-step derivation
    1. *-commutative10.4%

      \[\leadsto \frac{-\sqrt{\color{blue}{\left(B \cdot F\right) \cdot -2}}}{B} \]
  14. Simplified10.4%

    \[\leadsto \frac{-\sqrt{\color{blue}{\left(B \cdot F\right) \cdot -2}}}{B} \]
  15. Final simplification10.4%

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

Reproduce

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