ABCF->ab-angle b

Percentage Accurate: 20.0% → 44.0%
Time: 23.9s
Alternatives: 18
Speedup: 5.8×

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 18 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: 20.0% 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: 44.0% accurate, 2.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(A \cdot C\right) \cdot 4\\ \mathbf{if}\;B\_m \leq 5.5 \cdot 10^{-230}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot A\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)}{C}\right)}}{t\_0}\\ \mathbf{elif}\;B\_m \leq 2.08 \cdot 10^{+68}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{B\_m} \cdot \frac{-1}{B\_m}\right) \cdot \sqrt{0 - 2 \cdot F}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* A C) 4.0)))
   (if (<= B_m 5.5e-230)
     (/
      (sqrt
       (*
        C
        (+
         (* (* A -8.0) (* F (+ A A)))
         (*
          2.0
          (/ (* F (+ (* 2.0 (* (* B_m B_m) A)) (* (* B_m B_m) (+ A A)))) C)))))
      t_0)
     (if (<= B_m 2.08e+68)
       (/
        (sqrt
         (*
          (* 2.0 F)
          (*
           (+ A (- C (hypot B_m (- A C))))
           (+ (* B_m B_m) (* (* A C) -4.0)))))
        (- t_0 (* B_m B_m)))
       (* (* (sqrt B_m) (/ -1.0 B_m)) (sqrt (- 0.0 (* 2.0 F))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = (A * C) * 4.0;
	double tmp;
	if (B_m <= 5.5e-230) {
		tmp = sqrt((C * (((A * -8.0) * (F * (A + A))) + (2.0 * ((F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A)))) / C))))) / t_0;
	} else if (B_m <= 2.08e+68) {
		tmp = sqrt(((2.0 * F) * ((A + (C - hypot(B_m, (A - C)))) * ((B_m * B_m) + ((A * C) * -4.0))))) / (t_0 - (B_m * B_m));
	} else {
		tmp = (sqrt(B_m) * (-1.0 / B_m)) * sqrt((0.0 - (2.0 * F)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (A * C) * 4.0;
	double tmp;
	if (B_m <= 5.5e-230) {
		tmp = Math.sqrt((C * (((A * -8.0) * (F * (A + A))) + (2.0 * ((F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A)))) / C))))) / t_0;
	} else if (B_m <= 2.08e+68) {
		tmp = Math.sqrt(((2.0 * F) * ((A + (C - Math.hypot(B_m, (A - C)))) * ((B_m * B_m) + ((A * C) * -4.0))))) / (t_0 - (B_m * B_m));
	} else {
		tmp = (Math.sqrt(B_m) * (-1.0 / B_m)) * Math.sqrt((0.0 - (2.0 * F)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = (A * C) * 4.0
	tmp = 0
	if B_m <= 5.5e-230:
		tmp = math.sqrt((C * (((A * -8.0) * (F * (A + A))) + (2.0 * ((F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A)))) / C))))) / t_0
	elif B_m <= 2.08e+68:
		tmp = math.sqrt(((2.0 * F) * ((A + (C - math.hypot(B_m, (A - C)))) * ((B_m * B_m) + ((A * C) * -4.0))))) / (t_0 - (B_m * B_m))
	else:
		tmp = (math.sqrt(B_m) * (-1.0 / B_m)) * math.sqrt((0.0 - (2.0 * F)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(A * C) * 4.0)
	tmp = 0.0
	if (B_m <= 5.5e-230)
		tmp = Float64(sqrt(Float64(C * Float64(Float64(Float64(A * -8.0) * Float64(F * Float64(A + A))) + Float64(2.0 * Float64(Float64(F * Float64(Float64(2.0 * Float64(Float64(B_m * B_m) * A)) + Float64(Float64(B_m * B_m) * Float64(A + A)))) / C))))) / t_0);
	elseif (B_m <= 2.08e+68)
		tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(Float64(A + Float64(C - hypot(B_m, Float64(A - C)))) * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0))))) / Float64(t_0 - Float64(B_m * B_m)));
	else
		tmp = Float64(Float64(sqrt(B_m) * Float64(-1.0 / B_m)) * sqrt(Float64(0.0 - Float64(2.0 * F))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (A * C) * 4.0;
	tmp = 0.0;
	if (B_m <= 5.5e-230)
		tmp = sqrt((C * (((A * -8.0) * (F * (A + A))) + (2.0 * ((F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A)))) / C))))) / t_0;
	elseif (B_m <= 2.08e+68)
		tmp = sqrt(((2.0 * F) * ((A + (C - hypot(B_m, (A - C)))) * ((B_m * B_m) + ((A * C) * -4.0))))) / (t_0 - (B_m * B_m));
	else
		tmp = (sqrt(B_m) * (-1.0 / B_m)) * sqrt((0.0 - (2.0 * F)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]}, If[LessEqual[B$95$m, 5.5e-230], N[(N[Sqrt[N[(C * N[(N[(N[(A * -8.0), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(F * N[(N[(2.0 * N[(N[(B$95$m * B$95$m), $MachinePrecision] * A), $MachinePrecision]), $MachinePrecision] + N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 2.08e+68], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(0.0 - N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(A \cdot C\right) \cdot 4\\
\mathbf{if}\;B\_m \leq 5.5 \cdot 10^{-230}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot A\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)}{C}\right)}}{t\_0}\\

\mathbf{elif}\;B\_m \leq 2.08 \cdot 10^{+68}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 5.4999999999999997e-230

    1. Initial program 18.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. Simplified24.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \color{blue}{\left(4 \cdot \left(A \cdot C\right)\right)}\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f6415.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified15.8%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(C \cdot \left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)}\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\left(\left(-8 \cdot A\right) \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(-8 \cdot A\right), \left(F \cdot \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(F \cdot \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(-1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\mathsf{neg}\left(A\right)\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      9. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right), \mathsf{*.f64}\left(2, \left(\frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right), \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)\right), C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified15.2%

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

    if 5.4999999999999997e-230 < B < 2.08e68

    1. Initial program 32.7%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(2 \cdot \left(F \cdot \left(\left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(2 \cdot F\right) \cdot \left(\left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(2 \cdot F\right), \left(\left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \left(\left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \left(\left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \left(\left({B}^{2} + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right), \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      8. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(\left({B}^{2} + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)\right), \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(\left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right), \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left({B}^{2}\right), \left(-4 \cdot \left(A \cdot C\right)\right)\right), \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(B \cdot B\right), \left(-4 \cdot \left(A \cdot C\right)\right)\right), \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \left(-4 \cdot \left(A \cdot C\right)\right)\right), \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \left(A \cdot C\right)\right)\right), \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      15. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), \left(A + \left(C - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      16. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), \mathsf{+.f64}\left(A, \left(C - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified41.3%

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

    if 2.08e68 < B

    1. Initial program 7.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. Add Preprocessing
    3. Taylor expanded in A around 0

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6440.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified40.0%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\left(-1 \cdot B\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(\mathsf{neg}\left(B\right)\right)\right)\right)\right) \]
      2. neg-lowering-neg.f6437.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    8. Simplified37.5%

      \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \color{blue}{\left(-B\right)}} \]
    9. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \left(\frac{B}{\sqrt{2}}\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \left(\sqrt{2}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f6437.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(2\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    10. Applied egg-rr37.5%

      \[\leadsto \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \cdot \sqrt{F \cdot \left(-B\right)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{F \cdot \left(\mathsf{neg}\left(B\right)\right)} \cdot \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \]
      2. distribute-rgt-neg-outN/A

        \[\leadsto \sqrt{\mathsf{neg}\left(F \cdot B\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      3. *-commutativeN/A

        \[\leadsto \sqrt{\mathsf{neg}\left(B \cdot F\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{B \cdot \left(\mathsf{neg}\left(F\right)\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      5. sqrt-unprodN/A

        \[\leadsto \left(\sqrt{B} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right) \cdot \frac{\color{blue}{-1}}{\frac{B}{\sqrt{2}}} \]
      6. associate-*l*N/A

        \[\leadsto \sqrt{B} \cdot \color{blue}{\left(\sqrt{\mathsf{neg}\left(F\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}}\right)} \]
      7. *-commutativeN/A

        \[\leadsto \sqrt{B} \cdot \left(\frac{-1}{\frac{B}{\sqrt{2}}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(F\right)}}\right) \]
      8. associate-/r/N/A

        \[\leadsto \sqrt{B} \cdot \left(\left(\frac{-1}{B} \cdot \sqrt{2}\right) \cdot \sqrt{\color{blue}{\mathsf{neg}\left(F\right)}}\right) \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{B} \cdot \left(\frac{-1}{B} \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)}\right) \]
      10. associate-*r*N/A

        \[\leadsto \left(\sqrt{B} \cdot \frac{-1}{B}\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B} \cdot \frac{-1}{B}\right), \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{B}\right), \left(\frac{-1}{B}\right)\right), \left(\color{blue}{\sqrt{2}} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \left(\frac{-1}{B}\right)\right), \left(\sqrt{\color{blue}{2}} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      15. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \left(\sqrt{2 \cdot \left(\mathsf{neg}\left(F\right)\right)}\right)\right) \]
      16. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\left(2 \cdot \left(\mathsf{neg}\left(F\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(\mathsf{neg}\left(F\right)\right)\right)\right)\right) \]
      18. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(0 - F\right)\right)\right)\right) \]
      19. --lowering--.f6468.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(0, F\right)\right)\right)\right) \]
    12. Applied egg-rr68.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 5.5 \cdot 10^{-230}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(\left(B \cdot B\right) \cdot A\right) + \left(B \cdot B\right) \cdot \left(A + A\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;B \leq 2.08 \cdot 10^{+68}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right)}}{\left(A \cdot C\right) \cdot 4 - B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{B} \cdot \frac{-1}{B}\right) \cdot \sqrt{0 - 2 \cdot F}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 46.7% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{+136}:\\ \;\;\;\;\frac{\sqrt{\left(\left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{B\_m} \cdot \frac{-1}{B\_m}\right) \cdot \sqrt{0 - 2 \cdot F}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= (pow B_m 2.0) 5e+136)
   (/
    (sqrt
     (*
      (* (+ A (- C (hypot B_m (- A C)))) (* 2.0 F))
      (+ (* B_m B_m) (* (* A C) -4.0))))
    (- (* (* A C) 4.0) (* B_m B_m)))
   (* (* (sqrt B_m) (/ -1.0 B_m)) (sqrt (- 0.0 (* 2.0 F))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (pow(B_m, 2.0) <= 5e+136) {
		tmp = sqrt((((A + (C - hypot(B_m, (A - C)))) * (2.0 * F)) * ((B_m * B_m) + ((A * C) * -4.0)))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = (sqrt(B_m) * (-1.0 / B_m)) * sqrt((0.0 - (2.0 * F)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (Math.pow(B_m, 2.0) <= 5e+136) {
		tmp = Math.sqrt((((A + (C - Math.hypot(B_m, (A - C)))) * (2.0 * F)) * ((B_m * B_m) + ((A * C) * -4.0)))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = (Math.sqrt(B_m) * (-1.0 / B_m)) * Math.sqrt((0.0 - (2.0 * F)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if math.pow(B_m, 2.0) <= 5e+136:
		tmp = math.sqrt((((A + (C - math.hypot(B_m, (A - C)))) * (2.0 * F)) * ((B_m * B_m) + ((A * C) * -4.0)))) / (((A * C) * 4.0) - (B_m * B_m))
	else:
		tmp = (math.sqrt(B_m) * (-1.0 / B_m)) * math.sqrt((0.0 - (2.0 * F)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 5e+136)
		tmp = Float64(sqrt(Float64(Float64(Float64(A + Float64(C - hypot(B_m, Float64(A - C)))) * Float64(2.0 * F)) * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) / Float64(Float64(Float64(A * C) * 4.0) - Float64(B_m * B_m)));
	else
		tmp = Float64(Float64(sqrt(B_m) * Float64(-1.0 / B_m)) * sqrt(Float64(0.0 - Float64(2.0 * F))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 5e+136)
		tmp = sqrt((((A + (C - hypot(B_m, (A - C)))) * (2.0 * F)) * ((B_m * B_m) + ((A * C) * -4.0)))) / (((A * C) * 4.0) - (B_m * B_m));
	else
		tmp = (sqrt(B_m) * (-1.0 / B_m)) * sqrt((0.0 - (2.0 * F)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+136], N[(N[Sqrt[N[(N[(N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(0.0 - N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{+136}:\\
\;\;\;\;\frac{\sqrt{\left(\left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000002e136

    1. Initial program 25.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. Simplified35.9%

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

    if 5.0000000000000002e136 < (pow.f64 B #s(literal 2 binary64))

    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. Add Preprocessing
    3. Taylor expanded in A around 0

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6421.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified21.4%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\left(-1 \cdot B\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(\mathsf{neg}\left(B\right)\right)\right)\right)\right) \]
      2. neg-lowering-neg.f6419.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    8. Simplified19.2%

      \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \color{blue}{\left(-B\right)}} \]
    9. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \left(\frac{B}{\sqrt{2}}\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \left(\sqrt{2}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f6419.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(2\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    10. Applied egg-rr19.2%

      \[\leadsto \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \cdot \sqrt{F \cdot \left(-B\right)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{F \cdot \left(\mathsf{neg}\left(B\right)\right)} \cdot \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \]
      2. distribute-rgt-neg-outN/A

        \[\leadsto \sqrt{\mathsf{neg}\left(F \cdot B\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      3. *-commutativeN/A

        \[\leadsto \sqrt{\mathsf{neg}\left(B \cdot F\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{B \cdot \left(\mathsf{neg}\left(F\right)\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      5. sqrt-unprodN/A

        \[\leadsto \left(\sqrt{B} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right) \cdot \frac{\color{blue}{-1}}{\frac{B}{\sqrt{2}}} \]
      6. associate-*l*N/A

        \[\leadsto \sqrt{B} \cdot \color{blue}{\left(\sqrt{\mathsf{neg}\left(F\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}}\right)} \]
      7. *-commutativeN/A

        \[\leadsto \sqrt{B} \cdot \left(\frac{-1}{\frac{B}{\sqrt{2}}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(F\right)}}\right) \]
      8. associate-/r/N/A

        \[\leadsto \sqrt{B} \cdot \left(\left(\frac{-1}{B} \cdot \sqrt{2}\right) \cdot \sqrt{\color{blue}{\mathsf{neg}\left(F\right)}}\right) \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{B} \cdot \left(\frac{-1}{B} \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)}\right) \]
      10. associate-*r*N/A

        \[\leadsto \left(\sqrt{B} \cdot \frac{-1}{B}\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B} \cdot \frac{-1}{B}\right), \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{B}\right), \left(\frac{-1}{B}\right)\right), \left(\color{blue}{\sqrt{2}} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \left(\frac{-1}{B}\right)\right), \left(\sqrt{\color{blue}{2}} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      15. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \left(\sqrt{2 \cdot \left(\mathsf{neg}\left(F\right)\right)}\right)\right) \]
      16. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\left(2 \cdot \left(\mathsf{neg}\left(F\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(\mathsf{neg}\left(F\right)\right)\right)\right)\right) \]
      18. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(0 - F\right)\right)\right)\right) \]
      19. --lowering--.f6434.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(0, F\right)\right)\right)\right) \]
    12. Applied egg-rr34.7%

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

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

Alternative 3: 41.8% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;{B\_m}^{2} \leq 10^{-53}:\\ \;\;\;\;\frac{\sqrt{\left(\left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A \cdot C\right) \cdot -4\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{B\_m} \cdot \frac{-1}{B\_m}\right) \cdot \sqrt{0 - 2 \cdot F}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= (pow B_m 2.0) 1e-53)
   (/
    (sqrt (* (* (+ A (- C (hypot B_m (- A C)))) (* 2.0 F)) (* (* A C) -4.0)))
    (- (* (* A C) 4.0) (* B_m B_m)))
   (* (* (sqrt B_m) (/ -1.0 B_m)) (sqrt (- 0.0 (* 2.0 F))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (pow(B_m, 2.0) <= 1e-53) {
		tmp = sqrt((((A + (C - hypot(B_m, (A - C)))) * (2.0 * F)) * ((A * C) * -4.0))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = (sqrt(B_m) * (-1.0 / B_m)) * sqrt((0.0 - (2.0 * F)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (Math.pow(B_m, 2.0) <= 1e-53) {
		tmp = Math.sqrt((((A + (C - Math.hypot(B_m, (A - C)))) * (2.0 * F)) * ((A * C) * -4.0))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = (Math.sqrt(B_m) * (-1.0 / B_m)) * Math.sqrt((0.0 - (2.0 * F)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if math.pow(B_m, 2.0) <= 1e-53:
		tmp = math.sqrt((((A + (C - math.hypot(B_m, (A - C)))) * (2.0 * F)) * ((A * C) * -4.0))) / (((A * C) * 4.0) - (B_m * B_m))
	else:
		tmp = (math.sqrt(B_m) * (-1.0 / B_m)) * math.sqrt((0.0 - (2.0 * F)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1e-53)
		tmp = Float64(sqrt(Float64(Float64(Float64(A + Float64(C - hypot(B_m, Float64(A - C)))) * Float64(2.0 * F)) * Float64(Float64(A * C) * -4.0))) / Float64(Float64(Float64(A * C) * 4.0) - Float64(B_m * B_m)));
	else
		tmp = Float64(Float64(sqrt(B_m) * Float64(-1.0 / B_m)) * sqrt(Float64(0.0 - Float64(2.0 * F))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 1e-53)
		tmp = sqrt((((A + (C - hypot(B_m, (A - C)))) * (2.0 * F)) * ((A * C) * -4.0))) / (((A * C) * 4.0) - (B_m * B_m));
	else
		tmp = (sqrt(B_m) * (-1.0 / B_m)) * sqrt((0.0 - (2.0 * F)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-53], N[(N[Sqrt[N[(N[(N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(0.0 - N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;{B\_m}^{2} \leq 10^{-53}:\\
\;\;\;\;\frac{\sqrt{\left(\left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A \cdot C\right) \cdot -4\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000003e-53

    1. Initial program 20.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. Simplified32.3%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(-4 \cdot \left(A \cdot C\right)\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-4, \left(A \cdot C\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      2. *-lowering-*.f6429.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified29.6%

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

    if 1.00000000000000003e-53 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 17.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. Add Preprocessing
    3. Taylor expanded in A around 0

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6420.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified20.8%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\left(-1 \cdot B\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(\mathsf{neg}\left(B\right)\right)\right)\right)\right) \]
      2. neg-lowering-neg.f6418.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    8. Simplified18.3%

      \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \color{blue}{\left(-B\right)}} \]
    9. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \left(\frac{B}{\sqrt{2}}\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \left(\sqrt{2}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f6418.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(2\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    10. Applied egg-rr18.3%

      \[\leadsto \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \cdot \sqrt{F \cdot \left(-B\right)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{F \cdot \left(\mathsf{neg}\left(B\right)\right)} \cdot \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \]
      2. distribute-rgt-neg-outN/A

        \[\leadsto \sqrt{\mathsf{neg}\left(F \cdot B\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      3. *-commutativeN/A

        \[\leadsto \sqrt{\mathsf{neg}\left(B \cdot F\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{B \cdot \left(\mathsf{neg}\left(F\right)\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      5. sqrt-unprodN/A

        \[\leadsto \left(\sqrt{B} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right) \cdot \frac{\color{blue}{-1}}{\frac{B}{\sqrt{2}}} \]
      6. associate-*l*N/A

        \[\leadsto \sqrt{B} \cdot \color{blue}{\left(\sqrt{\mathsf{neg}\left(F\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}}\right)} \]
      7. *-commutativeN/A

        \[\leadsto \sqrt{B} \cdot \left(\frac{-1}{\frac{B}{\sqrt{2}}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(F\right)}}\right) \]
      8. associate-/r/N/A

        \[\leadsto \sqrt{B} \cdot \left(\left(\frac{-1}{B} \cdot \sqrt{2}\right) \cdot \sqrt{\color{blue}{\mathsf{neg}\left(F\right)}}\right) \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{B} \cdot \left(\frac{-1}{B} \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)}\right) \]
      10. associate-*r*N/A

        \[\leadsto \left(\sqrt{B} \cdot \frac{-1}{B}\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B} \cdot \frac{-1}{B}\right), \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{B}\right), \left(\frac{-1}{B}\right)\right), \left(\color{blue}{\sqrt{2}} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \left(\frac{-1}{B}\right)\right), \left(\sqrt{\color{blue}{2}} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      15. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \left(\sqrt{2 \cdot \left(\mathsf{neg}\left(F\right)\right)}\right)\right) \]
      16. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\left(2 \cdot \left(\mathsf{neg}\left(F\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(\mathsf{neg}\left(F\right)\right)\right)\right)\right) \]
      18. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(0 - F\right)\right)\right)\right) \]
      19. --lowering--.f6430.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(0, F\right)\right)\right)\right) \]
    12. Applied egg-rr30.7%

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

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

Alternative 4: 41.7% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;{B\_m}^{2} \leq 10^{-53}:\\ \;\;\;\;\frac{\sqrt{\left(\left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A \cdot C\right) \cdot -4\right)}}{\left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{B\_m} \cdot \frac{-1}{B\_m}\right) \cdot \sqrt{0 - 2 \cdot F}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= (pow B_m 2.0) 1e-53)
   (/
    (sqrt (* (* (+ A (- C (hypot B_m (- A C)))) (* 2.0 F)) (* (* A C) -4.0)))
    (* (* A C) 4.0))
   (* (* (sqrt B_m) (/ -1.0 B_m)) (sqrt (- 0.0 (* 2.0 F))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (pow(B_m, 2.0) <= 1e-53) {
		tmp = sqrt((((A + (C - hypot(B_m, (A - C)))) * (2.0 * F)) * ((A * C) * -4.0))) / ((A * C) * 4.0);
	} else {
		tmp = (sqrt(B_m) * (-1.0 / B_m)) * sqrt((0.0 - (2.0 * F)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (Math.pow(B_m, 2.0) <= 1e-53) {
		tmp = Math.sqrt((((A + (C - Math.hypot(B_m, (A - C)))) * (2.0 * F)) * ((A * C) * -4.0))) / ((A * C) * 4.0);
	} else {
		tmp = (Math.sqrt(B_m) * (-1.0 / B_m)) * Math.sqrt((0.0 - (2.0 * F)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if math.pow(B_m, 2.0) <= 1e-53:
		tmp = math.sqrt((((A + (C - math.hypot(B_m, (A - C)))) * (2.0 * F)) * ((A * C) * -4.0))) / ((A * C) * 4.0)
	else:
		tmp = (math.sqrt(B_m) * (-1.0 / B_m)) * math.sqrt((0.0 - (2.0 * F)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1e-53)
		tmp = Float64(sqrt(Float64(Float64(Float64(A + Float64(C - hypot(B_m, Float64(A - C)))) * Float64(2.0 * F)) * Float64(Float64(A * C) * -4.0))) / Float64(Float64(A * C) * 4.0));
	else
		tmp = Float64(Float64(sqrt(B_m) * Float64(-1.0 / B_m)) * sqrt(Float64(0.0 - Float64(2.0 * F))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 1e-53)
		tmp = sqrt((((A + (C - hypot(B_m, (A - C)))) * (2.0 * F)) * ((A * C) * -4.0))) / ((A * C) * 4.0);
	else
		tmp = (sqrt(B_m) * (-1.0 / B_m)) * sqrt((0.0 - (2.0 * F)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-53], N[(N[Sqrt[N[(N[(N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(0.0 - N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;{B\_m}^{2} \leq 10^{-53}:\\
\;\;\;\;\frac{\sqrt{\left(\left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A \cdot C\right) \cdot -4\right)}}{\left(A \cdot C\right) \cdot 4}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000003e-53

    1. Initial program 20.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. Simplified32.3%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \color{blue}{\left(4 \cdot \left(A \cdot C\right)\right)}\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f6429.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified29.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(-4 \cdot \left(A \cdot C\right)\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-4, \left(A \cdot C\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      2. *-lowering-*.f6429.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified29.4%

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

    if 1.00000000000000003e-53 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 17.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. Add Preprocessing
    3. Taylor expanded in A around 0

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6420.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified20.8%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\left(-1 \cdot B\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(\mathsf{neg}\left(B\right)\right)\right)\right)\right) \]
      2. neg-lowering-neg.f6418.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    8. Simplified18.3%

      \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \color{blue}{\left(-B\right)}} \]
    9. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \left(\frac{B}{\sqrt{2}}\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \left(\sqrt{2}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f6418.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(2\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    10. Applied egg-rr18.3%

      \[\leadsto \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \cdot \sqrt{F \cdot \left(-B\right)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{F \cdot \left(\mathsf{neg}\left(B\right)\right)} \cdot \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \]
      2. distribute-rgt-neg-outN/A

        \[\leadsto \sqrt{\mathsf{neg}\left(F \cdot B\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      3. *-commutativeN/A

        \[\leadsto \sqrt{\mathsf{neg}\left(B \cdot F\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{B \cdot \left(\mathsf{neg}\left(F\right)\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      5. sqrt-unprodN/A

        \[\leadsto \left(\sqrt{B} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right) \cdot \frac{\color{blue}{-1}}{\frac{B}{\sqrt{2}}} \]
      6. associate-*l*N/A

        \[\leadsto \sqrt{B} \cdot \color{blue}{\left(\sqrt{\mathsf{neg}\left(F\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}}\right)} \]
      7. *-commutativeN/A

        \[\leadsto \sqrt{B} \cdot \left(\frac{-1}{\frac{B}{\sqrt{2}}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(F\right)}}\right) \]
      8. associate-/r/N/A

        \[\leadsto \sqrt{B} \cdot \left(\left(\frac{-1}{B} \cdot \sqrt{2}\right) \cdot \sqrt{\color{blue}{\mathsf{neg}\left(F\right)}}\right) \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{B} \cdot \left(\frac{-1}{B} \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)}\right) \]
      10. associate-*r*N/A

        \[\leadsto \left(\sqrt{B} \cdot \frac{-1}{B}\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B} \cdot \frac{-1}{B}\right), \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{B}\right), \left(\frac{-1}{B}\right)\right), \left(\color{blue}{\sqrt{2}} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \left(\frac{-1}{B}\right)\right), \left(\sqrt{\color{blue}{2}} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      15. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \left(\sqrt{2 \cdot \left(\mathsf{neg}\left(F\right)\right)}\right)\right) \]
      16. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\left(2 \cdot \left(\mathsf{neg}\left(F\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(\mathsf{neg}\left(F\right)\right)\right)\right)\right) \]
      18. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(0 - F\right)\right)\right)\right) \]
      19. --lowering--.f6430.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(0, F\right)\right)\right)\right) \]
    12. Applied egg-rr30.7%

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

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

Alternative 5: 39.1% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-59}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(-8 \cdot \left(\left(A + A\right) \cdot \left(A \cdot F\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot A\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{B\_m} \cdot \frac{-1}{B\_m}\right) \cdot \sqrt{0 - 2 \cdot F}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= (pow B_m 2.0) 5e-59)
   (/
    (sqrt
     (*
      C
      (+
       (* -8.0 (* (+ A A) (* A F)))
       (/
        (* 2.0 (* F (+ (* 2.0 (* (* B_m B_m) A)) (* (* B_m B_m) (+ A A)))))
        C))))
    (- (* (* A C) 4.0) (* B_m B_m)))
   (* (* (sqrt B_m) (/ -1.0 B_m)) (sqrt (- 0.0 (* 2.0 F))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (pow(B_m, 2.0) <= 5e-59) {
		tmp = sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = (sqrt(B_m) * (-1.0 / B_m)) * sqrt((0.0 - (2.0 * F)));
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if ((b_m ** 2.0d0) <= 5d-59) then
        tmp = sqrt((c * (((-8.0d0) * ((a + a) * (a * f))) + ((2.0d0 * (f * ((2.0d0 * ((b_m * b_m) * a)) + ((b_m * b_m) * (a + a))))) / c)))) / (((a * c) * 4.0d0) - (b_m * b_m))
    else
        tmp = (sqrt(b_m) * ((-1.0d0) / b_m)) * sqrt((0.0d0 - (2.0d0 * f)))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (Math.pow(B_m, 2.0) <= 5e-59) {
		tmp = Math.sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = (Math.sqrt(B_m) * (-1.0 / B_m)) * Math.sqrt((0.0 - (2.0 * F)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if math.pow(B_m, 2.0) <= 5e-59:
		tmp = math.sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m))
	else:
		tmp = (math.sqrt(B_m) * (-1.0 / B_m)) * math.sqrt((0.0 - (2.0 * F)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 5e-59)
		tmp = Float64(sqrt(Float64(C * Float64(Float64(-8.0 * Float64(Float64(A + A) * Float64(A * F))) + Float64(Float64(2.0 * Float64(F * Float64(Float64(2.0 * Float64(Float64(B_m * B_m) * A)) + Float64(Float64(B_m * B_m) * Float64(A + A))))) / C)))) / Float64(Float64(Float64(A * C) * 4.0) - Float64(B_m * B_m)));
	else
		tmp = Float64(Float64(sqrt(B_m) * Float64(-1.0 / B_m)) * sqrt(Float64(0.0 - Float64(2.0 * F))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 5e-59)
		tmp = sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m));
	else
		tmp = (sqrt(B_m) * (-1.0 / B_m)) * sqrt((0.0 - (2.0 * F)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-59], N[(N[Sqrt[N[(C * N[(N[(-8.0 * N[(N[(A + A), $MachinePrecision] * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(F * N[(N[(2.0 * N[(N[(B$95$m * B$95$m), $MachinePrecision] * A), $MachinePrecision]), $MachinePrecision] + N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(0.0 - N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-59}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(-8 \cdot \left(\left(A + A\right) \cdot \left(A \cdot F\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot A\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000001e-59

    1. Initial program 21.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. Simplified31.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(C \cdot \left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \left(\left(A \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\left(A \cdot F\right), \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      7. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \left(\left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \left(1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      11. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right), \left(\frac{2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right), \mathsf{/.f64}\left(\left(2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)\right)\right), C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified26.9%

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

    if 5.0000000000000001e-59 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 17.5%

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

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6420.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified20.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\left(-1 \cdot B\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(\mathsf{neg}\left(B\right)\right)\right)\right)\right) \]
      2. neg-lowering-neg.f6418.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    8. Simplified18.2%

      \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \color{blue}{\left(-B\right)}} \]
    9. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \left(\frac{B}{\sqrt{2}}\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \left(\sqrt{2}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f6418.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(2\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    10. Applied egg-rr18.2%

      \[\leadsto \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \cdot \sqrt{F \cdot \left(-B\right)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{F \cdot \left(\mathsf{neg}\left(B\right)\right)} \cdot \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \]
      2. distribute-rgt-neg-outN/A

        \[\leadsto \sqrt{\mathsf{neg}\left(F \cdot B\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      3. *-commutativeN/A

        \[\leadsto \sqrt{\mathsf{neg}\left(B \cdot F\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{B \cdot \left(\mathsf{neg}\left(F\right)\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}} \]
      5. sqrt-unprodN/A

        \[\leadsto \left(\sqrt{B} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right) \cdot \frac{\color{blue}{-1}}{\frac{B}{\sqrt{2}}} \]
      6. associate-*l*N/A

        \[\leadsto \sqrt{B} \cdot \color{blue}{\left(\sqrt{\mathsf{neg}\left(F\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}}\right)} \]
      7. *-commutativeN/A

        \[\leadsto \sqrt{B} \cdot \left(\frac{-1}{\frac{B}{\sqrt{2}}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(F\right)}}\right) \]
      8. associate-/r/N/A

        \[\leadsto \sqrt{B} \cdot \left(\left(\frac{-1}{B} \cdot \sqrt{2}\right) \cdot \sqrt{\color{blue}{\mathsf{neg}\left(F\right)}}\right) \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{B} \cdot \left(\frac{-1}{B} \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)}\right) \]
      10. associate-*r*N/A

        \[\leadsto \left(\sqrt{B} \cdot \frac{-1}{B}\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B} \cdot \frac{-1}{B}\right), \color{blue}{\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{B}\right), \left(\frac{-1}{B}\right)\right), \left(\color{blue}{\sqrt{2}} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \left(\frac{-1}{B}\right)\right), \left(\sqrt{\color{blue}{2}} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right)\right) \]
      15. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \left(\sqrt{2 \cdot \left(\mathsf{neg}\left(F\right)\right)}\right)\right) \]
      16. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\left(2 \cdot \left(\mathsf{neg}\left(F\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(\mathsf{neg}\left(F\right)\right)\right)\right)\right) \]
      18. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(0 - F\right)\right)\right)\right) \]
      19. --lowering--.f6430.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{/.f64}\left(-1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(0, F\right)\right)\right)\right) \]
    12. Applied egg-rr30.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-59}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(-8 \cdot \left(\left(A + A\right) \cdot \left(A \cdot F\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(\left(B \cdot B\right) \cdot A\right) + \left(B \cdot B\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4 - B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{B} \cdot \frac{-1}{B}\right) \cdot \sqrt{0 - 2 \cdot F}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 35.0% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 1.36 \cdot 10^{-28}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(-8 \cdot \left(\left(A + A\right) \cdot \left(A \cdot F\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot A\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{B\_m} \cdot \frac{\sqrt{0 - 2 \cdot F}}{0 - B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 1.36e-28)
   (/
    (sqrt
     (*
      C
      (+
       (* -8.0 (* (+ A A) (* A F)))
       (/
        (* 2.0 (* F (+ (* 2.0 (* (* B_m B_m) A)) (* (* B_m B_m) (+ A A)))))
        C))))
    (- (* (* A C) 4.0) (* B_m B_m)))
   (* (sqrt B_m) (/ (sqrt (- 0.0 (* 2.0 F))) (- 0.0 B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 1.36e-28) {
		tmp = sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = sqrt(B_m) * (sqrt((0.0 - (2.0 * F))) / (0.0 - B_m));
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b_m <= 1.36d-28) then
        tmp = sqrt((c * (((-8.0d0) * ((a + a) * (a * f))) + ((2.0d0 * (f * ((2.0d0 * ((b_m * b_m) * a)) + ((b_m * b_m) * (a + a))))) / c)))) / (((a * c) * 4.0d0) - (b_m * b_m))
    else
        tmp = sqrt(b_m) * (sqrt((0.0d0 - (2.0d0 * f))) / (0.0d0 - b_m))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 1.36e-28) {
		tmp = Math.sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = Math.sqrt(B_m) * (Math.sqrt((0.0 - (2.0 * F))) / (0.0 - B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 1.36e-28:
		tmp = math.sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m))
	else:
		tmp = math.sqrt(B_m) * (math.sqrt((0.0 - (2.0 * F))) / (0.0 - B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 1.36e-28)
		tmp = Float64(sqrt(Float64(C * Float64(Float64(-8.0 * Float64(Float64(A + A) * Float64(A * F))) + Float64(Float64(2.0 * Float64(F * Float64(Float64(2.0 * Float64(Float64(B_m * B_m) * A)) + Float64(Float64(B_m * B_m) * Float64(A + A))))) / C)))) / Float64(Float64(Float64(A * C) * 4.0) - Float64(B_m * B_m)));
	else
		tmp = Float64(sqrt(B_m) * Float64(sqrt(Float64(0.0 - Float64(2.0 * F))) / Float64(0.0 - B_m)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 1.36e-28)
		tmp = sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m));
	else
		tmp = sqrt(B_m) * (sqrt((0.0 - (2.0 * F))) / (0.0 - B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1.36e-28], N[(N[Sqrt[N[(C * N[(N[(-8.0 * N[(N[(A + A), $MachinePrecision] * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(F * N[(N[(2.0 * N[(N[(B$95$m * B$95$m), $MachinePrecision] * A), $MachinePrecision]), $MachinePrecision] + N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[B$95$m], $MachinePrecision] * N[(N[Sqrt[N[(0.0 - N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1.36 \cdot 10^{-28}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(-8 \cdot \left(\left(A + A\right) \cdot \left(A \cdot F\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot A\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{B\_m} \cdot \frac{\sqrt{0 - 2 \cdot F}}{0 - B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.35999999999999989e-28

    1. Initial program 20.5%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(C \cdot \left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \left(\left(A \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\left(A \cdot F\right), \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      7. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \left(\left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \left(1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      11. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right), \left(\frac{2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right), \mathsf{/.f64}\left(\left(2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)\right)\right), C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified17.0%

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

    if 1.35999999999999989e-28 < B

    1. Initial program 15.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. Add Preprocessing
    3. Taylor expanded in A around 0

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6438.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified38.3%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\left(-1 \cdot B\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(\mathsf{neg}\left(B\right)\right)\right)\right)\right) \]
      2. neg-lowering-neg.f6435.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    8. Simplified35.2%

      \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \color{blue}{\left(-B\right)}} \]
    9. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{\frac{B}{\sqrt{2}}}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \left(\frac{B}{\sqrt{2}}\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \left(\sqrt{2}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\mathsf{neg.f64}\left(B\right)}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f6435.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(2\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right)\right) \]
    10. Applied egg-rr35.2%

      \[\leadsto \color{blue}{\frac{-1}{\frac{B}{\sqrt{2}}}} \cdot \sqrt{F \cdot \left(-B\right)} \]
    11. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left(-1 \cdot \frac{1}{\frac{B}{\sqrt{2}}}\right) \cdot \sqrt{\color{blue}{F \cdot \left(\mathsf{neg}\left(B\right)\right)}} \]
      2. clear-numN/A

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \color{blue}{\left(\mathsf{neg}\left(B\right)\right)}} \]
      3. associate-*l*N/A

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(\mathsf{neg}\left(B\right)\right)}\right)} \]
      4. distribute-rgt-neg-outN/A

        \[\leadsto -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\mathsf{neg}\left(F \cdot B\right)}\right) \]
      5. distribute-lft-neg-inN/A

        \[\leadsto -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(\mathsf{neg}\left(F\right)\right) \cdot B}\right) \]
      6. sqrt-unprodN/A

        \[\leadsto -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \left(\sqrt{\mathsf{neg}\left(F\right)} \cdot \color{blue}{\sqrt{B}}\right)\right) \]
      7. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \left(\sqrt{\mathsf{neg}\left(F\right)} \cdot \sqrt{B}\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right) \cdot \sqrt{B}\right) \]
      9. distribute-rgt-neg-inN/A

        \[\leadsto \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\sqrt{B}\right)\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right), \color{blue}{\left(\mathsf{neg}\left(\sqrt{B}\right)\right)}\right) \]
      11. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}}{B}\right), \left(\mathsf{neg}\left(\color{blue}{\sqrt{B}}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2} \cdot \sqrt{\mathsf{neg}\left(F\right)}\right), B\right), \left(\mathsf{neg}\left(\color{blue}{\sqrt{B}}\right)\right)\right) \]
      13. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2 \cdot \left(\mathsf{neg}\left(F\right)\right)}\right), B\right), \left(\mathsf{neg}\left(\sqrt{\color{blue}{B}}\right)\right)\right) \]
      14. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(2 \cdot \left(\mathsf{neg}\left(F\right)\right)\right)\right), B\right), \left(\mathsf{neg}\left(\sqrt{\color{blue}{B}}\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(\mathsf{neg}\left(F\right)\right)\right)\right), B\right), \left(\mathsf{neg}\left(\sqrt{B}\right)\right)\right) \]
      16. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(0 - F\right)\right)\right), B\right), \left(\mathsf{neg}\left(\sqrt{B}\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(0, F\right)\right)\right), B\right), \left(\mathsf{neg}\left(\sqrt{B}\right)\right)\right) \]
      18. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(0, F\right)\right)\right), B\right), \mathsf{neg.f64}\left(\left(\sqrt{B}\right)\right)\right) \]
    12. Applied egg-rr54.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.36 \cdot 10^{-28}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(-8 \cdot \left(\left(A + A\right) \cdot \left(A \cdot F\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(\left(B \cdot B\right) \cdot A\right) + \left(B \cdot B\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4 - B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{B} \cdot \frac{\sqrt{0 - 2 \cdot F}}{0 - B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 30.4% accurate, 4.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 9.5 \cdot 10^{-30}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(-8 \cdot \left(\left(A + A\right) \cdot \left(A \cdot F\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot A\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 9.5e-30)
   (/
    (sqrt
     (*
      C
      (+
       (* -8.0 (* (+ A A) (* A F)))
       (/
        (* 2.0 (* F (+ (* 2.0 (* (* B_m B_m) A)) (* (* B_m B_m) (+ A A)))))
        C))))
    (- (* (* A C) 4.0) (* B_m B_m)))
   (/ (pow (* -2.0 (* B_m F)) 0.5) (- 0.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 9.5e-30) {
		tmp = sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b_m <= 9.5d-30) then
        tmp = sqrt((c * (((-8.0d0) * ((a + a) * (a * f))) + ((2.0d0 * (f * ((2.0d0 * ((b_m * b_m) * a)) + ((b_m * b_m) * (a + a))))) / c)))) / (((a * c) * 4.0d0) - (b_m * b_m))
    else
        tmp = (((-2.0d0) * (b_m * f)) ** 0.5d0) / (0.0d0 - b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 9.5e-30) {
		tmp = Math.sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = Math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 9.5e-30:
		tmp = math.sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m))
	else:
		tmp = math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 9.5e-30)
		tmp = Float64(sqrt(Float64(C * Float64(Float64(-8.0 * Float64(Float64(A + A) * Float64(A * F))) + Float64(Float64(2.0 * Float64(F * Float64(Float64(2.0 * Float64(Float64(B_m * B_m) * A)) + Float64(Float64(B_m * B_m) * Float64(A + A))))) / C)))) / Float64(Float64(Float64(A * C) * 4.0) - Float64(B_m * B_m)));
	else
		tmp = Float64((Float64(-2.0 * Float64(B_m * F)) ^ 0.5) / Float64(0.0 - B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 9.5e-30)
		tmp = sqrt((C * ((-8.0 * ((A + A) * (A * F))) + ((2.0 * (F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A))))) / C)))) / (((A * C) * 4.0) - (B_m * B_m));
	else
		tmp = ((-2.0 * (B_m * F)) ^ 0.5) / (0.0 - B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 9.5e-30], N[(N[Sqrt[N[(C * N[(N[(-8.0 * N[(N[(A + A), $MachinePrecision] * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(F * N[(N[(2.0 * N[(N[(B$95$m * B$95$m), $MachinePrecision] * A), $MachinePrecision]), $MachinePrecision] + N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 9.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(-8 \cdot \left(\left(A + A\right) \cdot \left(A \cdot F\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot A\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 9.49999999999999939e-30

    1. Initial program 20.5%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(C \cdot \left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \left(\left(A \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\left(A \cdot F\right), \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      7. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \left(\left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \left(1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      11. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right), \left(\frac{2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)\right)}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right), \mathsf{/.f64}\left(\left(2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)\right)\right), C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified17.0%

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

    if 9.49999999999999939e-30 < B

    1. Initial program 15.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. Add Preprocessing
    3. Taylor expanded in A around 0

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6438.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified38.3%

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right) \]
      3. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{B}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), B\right)\right) \]
    7. Applied egg-rr38.3%

      \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)\right)}^{0.5}}{B}} \]
    8. Taylor expanded in C around 0

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}, \frac{1}{2}\right), B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \left(B \cdot F\right)\right), \frac{1}{2}\right), B\right)\right) \]
      2. *-lowering-*.f6435.3%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(B, F\right)\right), \frac{1}{2}\right), B\right)\right) \]
    10. Simplified35.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 9.5 \cdot 10^{-30}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(-8 \cdot \left(\left(A + A\right) \cdot \left(A \cdot F\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(\left(B \cdot B\right) \cdot A\right) + \left(B \cdot B\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4 - B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B \cdot F\right)\right)}^{0.5}}{0 - B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 30.3% accurate, 4.4× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 5.5 \cdot 10^{-30}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot A\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 5.5e-30)
   (/
    (sqrt
     (*
      C
      (+
       (* (* A -8.0) (* F (+ A A)))
       (*
        2.0
        (/ (* F (+ (* 2.0 (* (* B_m B_m) A)) (* (* B_m B_m) (+ A A)))) C)))))
    (* (* A C) 4.0))
   (/ (pow (* -2.0 (* B_m F)) 0.5) (- 0.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 5.5e-30) {
		tmp = sqrt((C * (((A * -8.0) * (F * (A + A))) + (2.0 * ((F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A)))) / C))))) / ((A * C) * 4.0);
	} else {
		tmp = pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b_m <= 5.5d-30) then
        tmp = sqrt((c * (((a * (-8.0d0)) * (f * (a + a))) + (2.0d0 * ((f * ((2.0d0 * ((b_m * b_m) * a)) + ((b_m * b_m) * (a + a)))) / c))))) / ((a * c) * 4.0d0)
    else
        tmp = (((-2.0d0) * (b_m * f)) ** 0.5d0) / (0.0d0 - b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 5.5e-30) {
		tmp = Math.sqrt((C * (((A * -8.0) * (F * (A + A))) + (2.0 * ((F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A)))) / C))))) / ((A * C) * 4.0);
	} else {
		tmp = Math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 5.5e-30:
		tmp = math.sqrt((C * (((A * -8.0) * (F * (A + A))) + (2.0 * ((F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A)))) / C))))) / ((A * C) * 4.0)
	else:
		tmp = math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 5.5e-30)
		tmp = Float64(sqrt(Float64(C * Float64(Float64(Float64(A * -8.0) * Float64(F * Float64(A + A))) + Float64(2.0 * Float64(Float64(F * Float64(Float64(2.0 * Float64(Float64(B_m * B_m) * A)) + Float64(Float64(B_m * B_m) * Float64(A + A)))) / C))))) / Float64(Float64(A * C) * 4.0));
	else
		tmp = Float64((Float64(-2.0 * Float64(B_m * F)) ^ 0.5) / Float64(0.0 - B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 5.5e-30)
		tmp = sqrt((C * (((A * -8.0) * (F * (A + A))) + (2.0 * ((F * ((2.0 * ((B_m * B_m) * A)) + ((B_m * B_m) * (A + A)))) / C))))) / ((A * C) * 4.0);
	else
		tmp = ((-2.0 * (B_m * F)) ^ 0.5) / (0.0 - B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 5.5e-30], N[(N[Sqrt[N[(C * N[(N[(N[(A * -8.0), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(F * N[(N[(2.0 * N[(N[(B$95$m * B$95$m), $MachinePrecision] * A), $MachinePrecision]), $MachinePrecision] + N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 5.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot A\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 5.49999999999999976e-30

    1. Initial program 20.5%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \color{blue}{\left(4 \cdot \left(A \cdot C\right)\right)}\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f6419.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified19.1%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(C \cdot \left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)}\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\left(-8 \cdot \left(A \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\left(\left(-8 \cdot A\right) \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(-8 \cdot A\right), \left(F \cdot \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(F \cdot \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \left(A - -1 \cdot A\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(-1 \cdot A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\mathsf{neg}\left(A\right)\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      9. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right), \left(2 \cdot \frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right), \mathsf{*.f64}\left(2, \left(\frac{F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)}{C}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right), \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(F \cdot \left(2 \cdot \left(A \cdot {B}^{2}\right) + {B}^{2} \cdot \left(A - -1 \cdot A\right)\right)\right), C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified16.9%

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

    if 5.49999999999999976e-30 < B

    1. Initial program 15.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. Add Preprocessing
    3. Taylor expanded in A around 0

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6438.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified38.3%

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right) \]
      3. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{B}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), B\right)\right) \]
    7. Applied egg-rr38.3%

      \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)\right)}^{0.5}}{B}} \]
    8. Taylor expanded in C around 0

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}, \frac{1}{2}\right), B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \left(B \cdot F\right)\right), \frac{1}{2}\right), B\right)\right) \]
      2. *-lowering-*.f6435.3%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(B, F\right)\right), \frac{1}{2}\right), B\right)\right) \]
    10. Simplified35.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 5.5 \cdot 10^{-30}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left(\left(B \cdot B\right) \cdot A\right) + \left(B \cdot B\right) \cdot \left(A + A\right)\right)}{C}\right)}}{\left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B \cdot F\right)\right)}^{0.5}}{0 - B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 30.6% accurate, 5.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 5.7 \cdot 10^{-30}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 5.7e-30)
   (/
    (sqrt (* (* A -8.0) (* (+ A A) (* C F))))
    (- (* (* A C) 4.0) (* B_m B_m)))
   (/ (pow (* -2.0 (* B_m F)) 0.5) (- 0.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 5.7e-30) {
		tmp = sqrt(((A * -8.0) * ((A + A) * (C * F)))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b_m <= 5.7d-30) then
        tmp = sqrt(((a * (-8.0d0)) * ((a + a) * (c * f)))) / (((a * c) * 4.0d0) - (b_m * b_m))
    else
        tmp = (((-2.0d0) * (b_m * f)) ** 0.5d0) / (0.0d0 - b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 5.7e-30) {
		tmp = Math.sqrt(((A * -8.0) * ((A + A) * (C * F)))) / (((A * C) * 4.0) - (B_m * B_m));
	} else {
		tmp = Math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 5.7e-30:
		tmp = math.sqrt(((A * -8.0) * ((A + A) * (C * F)))) / (((A * C) * 4.0) - (B_m * B_m))
	else:
		tmp = math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 5.7e-30)
		tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(Float64(A + A) * Float64(C * F)))) / Float64(Float64(Float64(A * C) * 4.0) - Float64(B_m * B_m)));
	else
		tmp = Float64((Float64(-2.0 * Float64(B_m * F)) ^ 0.5) / Float64(0.0 - B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 5.7e-30)
		tmp = sqrt(((A * -8.0) * ((A + A) * (C * F)))) / (((A * C) * 4.0) - (B_m * B_m));
	else
		tmp = ((-2.0 * (B_m * F)) ^ 0.5) / (0.0 - B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 5.7e-30], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(N[(A + A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 5.7 \cdot 10^{-30}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)}}{\left(A \cdot C\right) \cdot 4 - B\_m \cdot B\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 5.69999999999999977e-30

    1. Initial program 20.5%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-8 \cdot A\right) \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(-8 \cdot A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(\left(C \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\left(C \cdot F\right), \left(A - -1 \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \left(A - -1 \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      7. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \mathsf{+.f64}\left(A, \left(\left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \mathsf{+.f64}\left(A, \left(1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      10. *-lowering-*.f6415.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified15.5%

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

    if 5.69999999999999977e-30 < B

    1. Initial program 15.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. Add Preprocessing
    3. Taylor expanded in A around 0

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6438.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified38.3%

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right) \]
      3. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{B}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), B\right)\right) \]
    7. Applied egg-rr38.3%

      \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)\right)}^{0.5}}{B}} \]
    8. Taylor expanded in C around 0

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}, \frac{1}{2}\right), B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \left(B \cdot F\right)\right), \frac{1}{2}\right), B\right)\right) \]
      2. *-lowering-*.f6435.3%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(B, F\right)\right), \frac{1}{2}\right), B\right)\right) \]
    10. Simplified35.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 5.7 \cdot 10^{-30}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)}}{\left(A \cdot C\right) \cdot 4 - B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B \cdot F\right)\right)}^{0.5}}{0 - B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 30.5% accurate, 5.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 5.5 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)}}{\left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 5.5e-29)
   (/ (sqrt (* (* A -8.0) (* (+ A A) (* C F)))) (* (* A C) 4.0))
   (/ (pow (* -2.0 (* B_m F)) 0.5) (- 0.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 5.5e-29) {
		tmp = sqrt(((A * -8.0) * ((A + A) * (C * F)))) / ((A * C) * 4.0);
	} else {
		tmp = pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b_m <= 5.5d-29) then
        tmp = sqrt(((a * (-8.0d0)) * ((a + a) * (c * f)))) / ((a * c) * 4.0d0)
    else
        tmp = (((-2.0d0) * (b_m * f)) ** 0.5d0) / (0.0d0 - b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 5.5e-29) {
		tmp = Math.sqrt(((A * -8.0) * ((A + A) * (C * F)))) / ((A * C) * 4.0);
	} else {
		tmp = Math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 5.5e-29:
		tmp = math.sqrt(((A * -8.0) * ((A + A) * (C * F)))) / ((A * C) * 4.0)
	else:
		tmp = math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 5.5e-29)
		tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(Float64(A + A) * Float64(C * F)))) / Float64(Float64(A * C) * 4.0));
	else
		tmp = Float64((Float64(-2.0 * Float64(B_m * F)) ^ 0.5) / Float64(0.0 - B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 5.5e-29)
		tmp = sqrt(((A * -8.0) * ((A + A) * (C * F)))) / ((A * C) * 4.0);
	else
		tmp = ((-2.0 * (B_m * F)) ^ 0.5) / (0.0 - B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 5.5e-29], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(N[(A + A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 5.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)}}{\left(A \cdot C\right) \cdot 4}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 5.4999999999999999e-29

    1. Initial program 20.5%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \color{blue}{\left(4 \cdot \left(A \cdot C\right)\right)}\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f6419.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified19.1%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)}\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-8 \cdot A\right) \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(-8 \cdot A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(\left(C \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\left(C \cdot F\right), \left(A - -1 \cdot A\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \left(A - -1 \cdot A\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \mathsf{\_.f64}\left(A, \left(-1 \cdot A\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \mathsf{\_.f64}\left(A, \left(\mathsf{neg}\left(A\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      9. neg-lowering-neg.f6415.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified15.9%

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

    if 5.4999999999999999e-29 < B

    1. Initial program 15.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. Add Preprocessing
    3. Taylor expanded in A around 0

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6438.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified38.3%

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right) \]
      3. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{B}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), B\right)\right) \]
    7. Applied egg-rr38.3%

      \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)\right)}^{0.5}}{B}} \]
    8. Taylor expanded in C around 0

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}, \frac{1}{2}\right), B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \left(B \cdot F\right)\right), \frac{1}{2}\right), B\right)\right) \]
      2. *-lowering-*.f6435.3%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(B, F\right)\right), \frac{1}{2}\right), B\right)\right) \]
    10. Simplified35.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 5.5 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)}}{\left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B \cdot F\right)\right)}^{0.5}}{0 - B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 28.9% accurate, 5.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 1.3 \cdot 10^{-31}:\\ \;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{\left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 1.3e-31)
   (/ (sqrt (* (* C F) (* -16.0 (* A A)))) (* (* A C) 4.0))
   (/ (pow (* -2.0 (* B_m F)) 0.5) (- 0.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 1.3e-31) {
		tmp = sqrt(((C * F) * (-16.0 * (A * A)))) / ((A * C) * 4.0);
	} else {
		tmp = pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b_m <= 1.3d-31) then
        tmp = sqrt(((c * f) * ((-16.0d0) * (a * a)))) / ((a * c) * 4.0d0)
    else
        tmp = (((-2.0d0) * (b_m * f)) ** 0.5d0) / (0.0d0 - b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 1.3e-31) {
		tmp = Math.sqrt(((C * F) * (-16.0 * (A * A)))) / ((A * C) * 4.0);
	} else {
		tmp = Math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 1.3e-31:
		tmp = math.sqrt(((C * F) * (-16.0 * (A * A)))) / ((A * C) * 4.0)
	else:
		tmp = math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 1.3e-31)
		tmp = Float64(sqrt(Float64(Float64(C * F) * Float64(-16.0 * Float64(A * A)))) / Float64(Float64(A * C) * 4.0));
	else
		tmp = Float64((Float64(-2.0 * Float64(B_m * F)) ^ 0.5) / Float64(0.0 - B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 1.3e-31)
		tmp = sqrt(((C * F) * (-16.0 * (A * A)))) / ((A * C) * 4.0);
	else
		tmp = ((-2.0 * (B_m * F)) ^ 0.5) / (0.0 - B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1.3e-31], N[(N[Sqrt[N[(N[(C * F), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1.3 \cdot 10^{-31}:\\
\;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{\left(A \cdot C\right) \cdot 4}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.29999999999999998e-31

    1. Initial program 20.5%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \color{blue}{\left(4 \cdot \left(A \cdot C\right)\right)}\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f6418.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified18.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-16 \cdot {A}^{2}\right) \cdot \left(C \cdot F\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(-16 \cdot {A}^{2}\right), \left(C \cdot F\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2}\right)\right), \left(C \cdot F\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \left(A \cdot A\right)\right), \left(C \cdot F\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \left(C \cdot F\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      6. *-lowering-*.f6413.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified13.4%

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

    if 1.29999999999999998e-31 < B

    1. Initial program 15.5%

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

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6437.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified37.8%

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right) \]
      3. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{B}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), B\right)\right) \]
    7. Applied egg-rr37.9%

      \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)\right)}^{0.5}}{B}} \]
    8. Taylor expanded in C around 0

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}, \frac{1}{2}\right), B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \left(B \cdot F\right)\right), \frac{1}{2}\right), B\right)\right) \]
      2. *-lowering-*.f6434.9%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(B, F\right)\right), \frac{1}{2}\right), B\right)\right) \]
    10. Simplified34.9%

      \[\leadsto -\frac{{\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}}^{0.5}}{B} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification19.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.3 \cdot 10^{-31}:\\ \;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{\left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B \cdot F\right)\right)}^{0.5}}{0 - B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 29.3% accurate, 5.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 3.8 \cdot 10^{-32}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{\left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 3.8e-32)
   (/ (sqrt (* -16.0 (* A (* F (* C C))))) (* (* A C) 4.0))
   (/ (pow (* -2.0 (* B_m F)) 0.5) (- 0.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 3.8e-32) {
		tmp = sqrt((-16.0 * (A * (F * (C * C))))) / ((A * C) * 4.0);
	} else {
		tmp = pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b_m <= 3.8d-32) then
        tmp = sqrt(((-16.0d0) * (a * (f * (c * c))))) / ((a * c) * 4.0d0)
    else
        tmp = (((-2.0d0) * (b_m * f)) ** 0.5d0) / (0.0d0 - b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 3.8e-32) {
		tmp = Math.sqrt((-16.0 * (A * (F * (C * C))))) / ((A * C) * 4.0);
	} else {
		tmp = Math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 3.8e-32:
		tmp = math.sqrt((-16.0 * (A * (F * (C * C))))) / ((A * C) * 4.0)
	else:
		tmp = math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 3.8e-32)
		tmp = Float64(sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(C * C))))) / Float64(Float64(A * C) * 4.0));
	else
		tmp = Float64((Float64(-2.0 * Float64(B_m * F)) ^ 0.5) / Float64(0.0 - B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 3.8e-32)
		tmp = sqrt((-16.0 * (A * (F * (C * C))))) / ((A * C) * 4.0);
	else
		tmp = ((-2.0 * (B_m * F)) ^ 0.5) / (0.0 - B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 3.8e-32], N[(N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 3.8 \cdot 10^{-32}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{\left(A \cdot C\right) \cdot 4}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 3.80000000000000008e-32

    1. Initial program 20.5%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \color{blue}{\left(4 \cdot \left(A \cdot C\right)\right)}\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f6418.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified18.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, \left({C}^{2} \cdot F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(\left({C}^{2}\right), F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(\left(C \cdot C\right), F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      5. *-lowering-*.f6412.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified12.3%

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

    if 3.80000000000000008e-32 < B

    1. Initial program 15.5%

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

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6437.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified37.8%

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right) \]
      3. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{B}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), B\right)\right) \]
    7. Applied egg-rr37.9%

      \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)\right)}^{0.5}}{B}} \]
    8. Taylor expanded in C around 0

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}, \frac{1}{2}\right), B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \left(B \cdot F\right)\right), \frac{1}{2}\right), B\right)\right) \]
      2. *-lowering-*.f6434.9%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(B, F\right)\right), \frac{1}{2}\right), B\right)\right) \]
    10. Simplified34.9%

      \[\leadsto -\frac{{\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}}^{0.5}}{B} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification19.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.8 \cdot 10^{-32}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{\left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B \cdot F\right)\right)}^{0.5}}{0 - B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 26.9% accurate, 5.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;A \leq -7.2 \cdot 10^{+125}:\\ \;\;\;\;\frac{{\left(\frac{\left(B\_m \cdot B\_m\right) \cdot F}{0 - C}\right)}^{0.5}}{0 - B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= A -7.2e+125)
   (/ (pow (/ (* (* B_m B_m) F) (- 0.0 C)) 0.5) (- 0.0 B_m))
   (/ (pow (* -2.0 (* B_m F)) 0.5) (- 0.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (A <= -7.2e+125) {
		tmp = pow((((B_m * B_m) * F) / (0.0 - C)), 0.5) / (0.0 - B_m);
	} else {
		tmp = pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (a <= (-7.2d+125)) then
        tmp = ((((b_m * b_m) * f) / (0.0d0 - c)) ** 0.5d0) / (0.0d0 - b_m)
    else
        tmp = (((-2.0d0) * (b_m * f)) ** 0.5d0) / (0.0d0 - b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (A <= -7.2e+125) {
		tmp = Math.pow((((B_m * B_m) * F) / (0.0 - C)), 0.5) / (0.0 - B_m);
	} else {
		tmp = Math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if A <= -7.2e+125:
		tmp = math.pow((((B_m * B_m) * F) / (0.0 - C)), 0.5) / (0.0 - B_m)
	else:
		tmp = math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (A <= -7.2e+125)
		tmp = Float64((Float64(Float64(Float64(B_m * B_m) * F) / Float64(0.0 - C)) ^ 0.5) / Float64(0.0 - B_m));
	else
		tmp = Float64((Float64(-2.0 * Float64(B_m * F)) ^ 0.5) / Float64(0.0 - B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (A <= -7.2e+125)
		tmp = ((((B_m * B_m) * F) / (0.0 - C)) ^ 0.5) / (0.0 - B_m);
	else
		tmp = ((-2.0 * (B_m * F)) ^ 0.5) / (0.0 - B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[A, -7.2e+125], N[(N[Power[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * F), $MachinePrecision] / N[(0.0 - C), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;A \leq -7.2 \cdot 10^{+125}:\\
\;\;\;\;\frac{{\left(\frac{\left(B\_m \cdot B\_m\right) \cdot F}{0 - C}\right)}^{0.5}}{0 - B\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -7.2000000000000007e125

    1. Initial program 7.5%

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

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f642.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified2.3%

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right) \]
      3. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{B}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), B\right)\right) \]
    7. Applied egg-rr2.4%

      \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)\right)}^{0.5}}{B}} \]
    8. Taylor expanded in C around inf

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(-1 \cdot \frac{{B}^{2} \cdot F}{C}\right)}, \frac{1}{2}\right), B\right)\right) \]
    9. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\frac{-1 \cdot \left({B}^{2} \cdot F\right)}{C}\right), \frac{1}{2}\right), B\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left({B}^{2} \cdot F\right)\right), C\right), \frac{1}{2}\right), B\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-1, \left({B}^{2} \cdot F\right)\right), C\right), \frac{1}{2}\right), B\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-1, \left(F \cdot {B}^{2}\right)\right), C\right), \frac{1}{2}\right), B\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{*.f64}\left(F, \left({B}^{2}\right)\right)\right), C\right), \frac{1}{2}\right), B\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{*.f64}\left(F, \left(B \cdot B\right)\right)\right), C\right), \frac{1}{2}\right), B\right)\right) \]
      7. *-lowering-*.f6423.4%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{*.f64}\left(F, \mathsf{*.f64}\left(B, B\right)\right)\right), C\right), \frac{1}{2}\right), B\right)\right) \]
    10. Simplified23.4%

      \[\leadsto -\frac{{\color{blue}{\left(\frac{-1 \cdot \left(F \cdot \left(B \cdot B\right)\right)}{C}\right)}}^{0.5}}{B} \]

    if -7.2000000000000007e125 < A

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in A around 0

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

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6416.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified16.0%

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right) \]
      3. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{B}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), B\right)\right) \]
    7. Applied egg-rr16.0%

      \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)\right)}^{0.5}}{B}} \]
    8. Taylor expanded in C around 0

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}, \frac{1}{2}\right), B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \left(B \cdot F\right)\right), \frac{1}{2}\right), B\right)\right) \]
      2. *-lowering-*.f6413.7%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(B, F\right)\right), \frac{1}{2}\right), B\right)\right) \]
    10. Simplified13.7%

      \[\leadsto -\frac{{\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}}^{0.5}}{B} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification14.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -7.2 \cdot 10^{+125}:\\ \;\;\;\;\frac{{\left(\frac{\left(B \cdot B\right) \cdot F}{0 - C}\right)}^{0.5}}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(-2 \cdot \left(B \cdot F\right)\right)}^{0.5}}{0 - B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 7.9% accurate, 5.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;C \leq -2.2 \cdot 10^{-194}:\\ \;\;\;\;\frac{-2 \cdot {\left(C \cdot F\right)}^{0.5}}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;{\left(A \cdot F\right)}^{0.5} \cdot \frac{-2}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= C -2.2e-194)
   (/ (* -2.0 (pow (* C F) 0.5)) B_m)
   (* (pow (* A F) 0.5) (/ -2.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -2.2e-194) {
		tmp = (-2.0 * pow((C * F), 0.5)) / B_m;
	} else {
		tmp = pow((A * F), 0.5) * (-2.0 / B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (c <= (-2.2d-194)) then
        tmp = ((-2.0d0) * ((c * f) ** 0.5d0)) / b_m
    else
        tmp = ((a * f) ** 0.5d0) * ((-2.0d0) / b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -2.2e-194) {
		tmp = (-2.0 * Math.pow((C * F), 0.5)) / B_m;
	} else {
		tmp = Math.pow((A * F), 0.5) * (-2.0 / B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if C <= -2.2e-194:
		tmp = (-2.0 * math.pow((C * F), 0.5)) / B_m
	else:
		tmp = math.pow((A * F), 0.5) * (-2.0 / B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= -2.2e-194)
		tmp = Float64(Float64(-2.0 * (Float64(C * F) ^ 0.5)) / B_m);
	else
		tmp = Float64((Float64(A * F) ^ 0.5) * Float64(-2.0 / B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= -2.2e-194)
		tmp = (-2.0 * ((C * F) ^ 0.5)) / B_m;
	else
		tmp = ((A * F) ^ 0.5) * (-2.0 / B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -2.2e-194], N[(N[(-2.0 * N[Power[N[(C * F), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision], N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] * N[(-2.0 / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;C \leq -2.2 \cdot 10^{-194}:\\
\;\;\;\;\frac{-2 \cdot {\left(C \cdot F\right)}^{0.5}}{B\_m}\\

\mathbf{else}:\\
\;\;\;\;{\left(A \cdot F\right)}^{0.5} \cdot \frac{-2}{B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -2.2000000000000001e-194

    1. Initial program 21.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. Simplified29.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left({C}^{2} \cdot \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left({C}^{2}\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(C \cdot C\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      4. fma-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(\mathsf{fma}\left(-16, A \cdot F, -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(\mathsf{fma}\left(-16, A \cdot F, \mathsf{neg}\left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. fmm-undefN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(-16 \cdot \left(A \cdot F\right) - \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\left(-16 \cdot \left(A \cdot F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \left(A \cdot F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}\right), C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified13.1%

      \[\leadsto \frac{\sqrt{\color{blue}{\left(C \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot F\right) - \frac{-4 \cdot \left(\left(B \cdot B\right) \cdot F\right) + \frac{4 \cdot \left(A \cdot \left(\left(B \cdot B\right) \cdot F\right)\right)}{C}}{C}\right)}}}{4 \cdot \left(A \cdot C\right) - B \cdot B} \]
    7. Taylor expanded in A around 0

      \[\leadsto \color{blue}{-2 \cdot \left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \color{blue}{\left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(\frac{1}{B}\right), \color{blue}{\left(\sqrt{C \cdot F}\right)}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \left(\sqrt{\color{blue}{C \cdot F}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right)\right)\right) \]
      5. *-lowering-*.f646.4%

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right)\right) \]
    9. Simplified6.4%

      \[\leadsto \color{blue}{-2 \cdot \left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right) \cdot \color{blue}{-2} \]
      2. *-commutativeN/A

        \[\leadsto \left(\sqrt{C \cdot F} \cdot \frac{1}{B}\right) \cdot -2 \]
      3. un-div-invN/A

        \[\leadsto \frac{\sqrt{C \cdot F}}{B} \cdot -2 \]
      4. associate-*l/N/A

        \[\leadsto \frac{\sqrt{C \cdot F} \cdot -2}{\color{blue}{B}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{C \cdot F} \cdot -2\right), \color{blue}{B}\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{C \cdot F}\right), -2\right), B\right) \]
      7. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({\left(C \cdot F\right)}^{\frac{1}{2}}\right), -2\right), B\right) \]
      8. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(C \cdot F\right), \frac{1}{2}\right), -2\right), B\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot C\right), \frac{1}{2}\right), -2\right), B\right) \]
      10. *-lowering-*.f646.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(F, C\right), \frac{1}{2}\right), -2\right), B\right) \]
    11. Applied egg-rr6.5%

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

    if -2.2000000000000001e-194 < C

    1. Initial program 17.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. Add Preprocessing
    3. Taylor expanded in C around 0

      \[\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. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{A} - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + {B}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + B \cdot B}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\mathsf{hypot}\left(A, B\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6416.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(A, B\right)\right)\right)\right)\right) \]
    5. Simplified16.5%

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

      \[\leadsto \color{blue}{\sqrt{A \cdot F} \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}} \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{A \cdot F}\right), \color{blue}{\left(\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}}{B}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      6. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot 2}{B}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-2}{B}\right)\right) \]
      10. /-lowering-/.f643.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \mathsf{/.f64}\left(-2, \color{blue}{B}\right)\right) \]
    8. Simplified3.8%

      \[\leadsto \color{blue}{\sqrt{F \cdot A} \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(F \cdot A\right)}^{\frac{1}{2}}\right), \mathsf{/.f64}\left(\color{blue}{-2}, B\right)\right) \]
      2. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot A\right), \frac{1}{2}\right), \mathsf{/.f64}\left(\color{blue}{-2}, B\right)\right) \]
      3. *-lowering-*.f643.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(F, A\right), \frac{1}{2}\right), \mathsf{/.f64}\left(-2, B\right)\right) \]
    10. Applied egg-rr3.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -2.2 \cdot 10^{-194}:\\ \;\;\;\;\frac{-2 \cdot {\left(C \cdot F\right)}^{0.5}}{B}\\ \mathbf{else}:\\ \;\;\;\;{\left(A \cdot F\right)}^{0.5} \cdot \frac{-2}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 7.9% accurate, 5.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-194}:\\ \;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;{\left(A \cdot F\right)}^{0.5} \cdot \frac{-2}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= C -4.6e-194)
   (* -2.0 (/ (sqrt (* C F)) B_m))
   (* (pow (* A F) 0.5) (/ -2.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -4.6e-194) {
		tmp = -2.0 * (sqrt((C * F)) / B_m);
	} else {
		tmp = pow((A * F), 0.5) * (-2.0 / B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (c <= (-4.6d-194)) then
        tmp = (-2.0d0) * (sqrt((c * f)) / b_m)
    else
        tmp = ((a * f) ** 0.5d0) * ((-2.0d0) / b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -4.6e-194) {
		tmp = -2.0 * (Math.sqrt((C * F)) / B_m);
	} else {
		tmp = Math.pow((A * F), 0.5) * (-2.0 / B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if C <= -4.6e-194:
		tmp = -2.0 * (math.sqrt((C * F)) / B_m)
	else:
		tmp = math.pow((A * F), 0.5) * (-2.0 / B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= -4.6e-194)
		tmp = Float64(-2.0 * Float64(sqrt(Float64(C * F)) / B_m));
	else
		tmp = Float64((Float64(A * F) ^ 0.5) * Float64(-2.0 / B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= -4.6e-194)
		tmp = -2.0 * (sqrt((C * F)) / B_m);
	else
		tmp = ((A * F) ^ 0.5) * (-2.0 / B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -4.6e-194], N[(-2.0 * N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] * N[(-2.0 / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;C \leq -4.6 \cdot 10^{-194}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B\_m}\\

\mathbf{else}:\\
\;\;\;\;{\left(A \cdot F\right)}^{0.5} \cdot \frac{-2}{B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -4.60000000000000005e-194

    1. Initial program 21.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. Simplified29.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left({C}^{2} \cdot \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left({C}^{2}\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(C \cdot C\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      4. fma-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(\mathsf{fma}\left(-16, A \cdot F, -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(\mathsf{fma}\left(-16, A \cdot F, \mathsf{neg}\left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. fmm-undefN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(-16 \cdot \left(A \cdot F\right) - \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\left(-16 \cdot \left(A \cdot F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \left(A \cdot F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}\right), C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified13.1%

      \[\leadsto \frac{\sqrt{\color{blue}{\left(C \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot F\right) - \frac{-4 \cdot \left(\left(B \cdot B\right) \cdot F\right) + \frac{4 \cdot \left(A \cdot \left(\left(B \cdot B\right) \cdot F\right)\right)}{C}}{C}\right)}}}{4 \cdot \left(A \cdot C\right) - B \cdot B} \]
    7. Taylor expanded in A around 0

      \[\leadsto \color{blue}{-2 \cdot \left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \color{blue}{\left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(\frac{1}{B}\right), \color{blue}{\left(\sqrt{C \cdot F}\right)}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \left(\sqrt{\color{blue}{C \cdot F}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right)\right)\right) \]
      5. *-lowering-*.f646.4%

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right)\right) \]
    9. Simplified6.4%

      \[\leadsto \color{blue}{-2 \cdot \left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)} \]
    10. Step-by-step derivation
      1. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left({B}^{-1}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(C, F\right)}\right)\right)\right) \]
      2. pow-to-expN/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(e^{\log B \cdot -1}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(C, F\right)}\right)\right)\right) \]
      3. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\left(\log B \cdot -1\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(C, F\right)}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\log B, -1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\color{blue}{C}, F\right)\right)\right)\right) \]
      5. log-lowering-log.f645.1%

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(B\right), -1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right)\right) \]
    11. Applied egg-rr5.1%

      \[\leadsto -2 \cdot \left(\color{blue}{e^{\log B \cdot -1}} \cdot \sqrt{C \cdot F}\right) \]
    12. Taylor expanded in B around 0

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

        \[\leadsto \mathsf{*.f64}\left(-2, \left(\frac{1 \cdot \sqrt{C \cdot F}}{\color{blue}{B}}\right)\right) \]
      2. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(-2, \left(\frac{\sqrt{C \cdot F}}{B}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\left(\sqrt{C \cdot F}\right), \color{blue}{B}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right), B\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot C\right)\right), B\right)\right) \]
      6. *-lowering-*.f646.4%

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), B\right)\right) \]
    14. Simplified6.4%

      \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{F \cdot C}}{B}} \]

    if -4.60000000000000005e-194 < C

    1. Initial program 17.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. Add Preprocessing
    3. Taylor expanded in C around 0

      \[\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. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{A} - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + {B}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + B \cdot B}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\mathsf{hypot}\left(A, B\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6416.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(A, B\right)\right)\right)\right)\right) \]
    5. Simplified16.5%

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

      \[\leadsto \color{blue}{\sqrt{A \cdot F} \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}} \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{A \cdot F}\right), \color{blue}{\left(\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}}{B}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      6. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot 2}{B}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-2}{B}\right)\right) \]
      10. /-lowering-/.f643.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \mathsf{/.f64}\left(-2, \color{blue}{B}\right)\right) \]
    8. Simplified3.8%

      \[\leadsto \color{blue}{\sqrt{F \cdot A} \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(F \cdot A\right)}^{\frac{1}{2}}\right), \mathsf{/.f64}\left(\color{blue}{-2}, B\right)\right) \]
      2. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot A\right), \frac{1}{2}\right), \mathsf{/.f64}\left(\color{blue}{-2}, B\right)\right) \]
      3. *-lowering-*.f643.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(F, A\right), \frac{1}{2}\right), \mathsf{/.f64}\left(-2, B\right)\right) \]
    10. Applied egg-rr3.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-194}:\\ \;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\ \mathbf{else}:\\ \;\;\;\;{\left(A \cdot F\right)}^{0.5} \cdot \frac{-2}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 7.9% accurate, 5.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;C \leq -1.4 \cdot 10^{-193}:\\ \;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{B\_m} \cdot \sqrt{A \cdot F}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= C -1.4e-193)
   (* -2.0 (/ (sqrt (* C F)) B_m))
   (* (/ -2.0 B_m) (sqrt (* A F)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -1.4e-193) {
		tmp = -2.0 * (sqrt((C * F)) / B_m);
	} else {
		tmp = (-2.0 / B_m) * sqrt((A * F));
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (c <= (-1.4d-193)) then
        tmp = (-2.0d0) * (sqrt((c * f)) / b_m)
    else
        tmp = ((-2.0d0) / b_m) * sqrt((a * f))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -1.4e-193) {
		tmp = -2.0 * (Math.sqrt((C * F)) / B_m);
	} else {
		tmp = (-2.0 / B_m) * Math.sqrt((A * F));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if C <= -1.4e-193:
		tmp = -2.0 * (math.sqrt((C * F)) / B_m)
	else:
		tmp = (-2.0 / B_m) * math.sqrt((A * F))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= -1.4e-193)
		tmp = Float64(-2.0 * Float64(sqrt(Float64(C * F)) / B_m));
	else
		tmp = Float64(Float64(-2.0 / B_m) * sqrt(Float64(A * F)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= -1.4e-193)
		tmp = -2.0 * (sqrt((C * F)) / B_m);
	else
		tmp = (-2.0 / B_m) * sqrt((A * F));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -1.4e-193], N[(-2.0 * N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.4 \cdot 10^{-193}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{-2}{B\_m} \cdot \sqrt{A \cdot F}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -1.4000000000000001e-193

    1. Initial program 21.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. Simplified29.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left({C}^{2} \cdot \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left({C}^{2}\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(C \cdot C\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      4. fma-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(\mathsf{fma}\left(-16, A \cdot F, -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(\mathsf{fma}\left(-16, A \cdot F, \mathsf{neg}\left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. fmm-undefN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(-16 \cdot \left(A \cdot F\right) - \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\left(-16 \cdot \left(A \cdot F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \left(A \cdot F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}\right), C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified13.1%

      \[\leadsto \frac{\sqrt{\color{blue}{\left(C \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot F\right) - \frac{-4 \cdot \left(\left(B \cdot B\right) \cdot F\right) + \frac{4 \cdot \left(A \cdot \left(\left(B \cdot B\right) \cdot F\right)\right)}{C}}{C}\right)}}}{4 \cdot \left(A \cdot C\right) - B \cdot B} \]
    7. Taylor expanded in A around 0

      \[\leadsto \color{blue}{-2 \cdot \left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \color{blue}{\left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(\frac{1}{B}\right), \color{blue}{\left(\sqrt{C \cdot F}\right)}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \left(\sqrt{\color{blue}{C \cdot F}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right)\right)\right) \]
      5. *-lowering-*.f646.4%

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right)\right) \]
    9. Simplified6.4%

      \[\leadsto \color{blue}{-2 \cdot \left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)} \]
    10. Step-by-step derivation
      1. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left({B}^{-1}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(C, F\right)}\right)\right)\right) \]
      2. pow-to-expN/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(e^{\log B \cdot -1}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(C, F\right)}\right)\right)\right) \]
      3. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\left(\log B \cdot -1\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(C, F\right)}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\log B, -1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\color{blue}{C}, F\right)\right)\right)\right) \]
      5. log-lowering-log.f645.1%

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(B\right), -1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right)\right) \]
    11. Applied egg-rr5.1%

      \[\leadsto -2 \cdot \left(\color{blue}{e^{\log B \cdot -1}} \cdot \sqrt{C \cdot F}\right) \]
    12. Taylor expanded in B around 0

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

        \[\leadsto \mathsf{*.f64}\left(-2, \left(\frac{1 \cdot \sqrt{C \cdot F}}{\color{blue}{B}}\right)\right) \]
      2. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(-2, \left(\frac{\sqrt{C \cdot F}}{B}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\left(\sqrt{C \cdot F}\right), \color{blue}{B}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right), B\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot C\right)\right), B\right)\right) \]
      6. *-lowering-*.f646.4%

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), B\right)\right) \]
    14. Simplified6.4%

      \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{F \cdot C}}{B}} \]

    if -1.4000000000000001e-193 < C

    1. Initial program 17.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. Add Preprocessing
    3. Taylor expanded in C around 0

      \[\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. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{A} - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + {B}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + B \cdot B}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\mathsf{hypot}\left(A, B\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6416.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(A, B\right)\right)\right)\right)\right) \]
    5. Simplified16.5%

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

      \[\leadsto \color{blue}{\sqrt{A \cdot F} \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}} \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{A \cdot F}\right), \color{blue}{\left(\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}}{B}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      6. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot 2}{B}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-2}{B}\right)\right) \]
      10. /-lowering-/.f643.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \mathsf{/.f64}\left(-2, \color{blue}{B}\right)\right) \]
    8. Simplified3.8%

      \[\leadsto \color{blue}{\sqrt{F \cdot A} \cdot \frac{-2}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification4.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -1.4 \cdot 10^{-193}:\\ \;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{B} \cdot \sqrt{A \cdot F}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 26.3% accurate, 5.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (/ (pow (* -2.0 (* B_m F)) 0.5) (- 0.0 B_m)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = (((-2.0d0) * (b_m * f)) ** 0.5d0) / (0.0d0 - b_m)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return Math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m);
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return math.pow((-2.0 * (B_m * F)), 0.5) / (0.0 - B_m)
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64((Float64(-2.0 * Float64(B_m * F)) ^ 0.5) / Float64(0.0 - B_m))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = ((-2.0 * (B_m * F)) ^ 0.5) / (0.0 - B_m);
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[Power[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\frac{{\left(-2 \cdot \left(B\_m \cdot F\right)\right)}^{0.5}}{0 - B\_m}
\end{array}
Derivation
  1. Initial program 19.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. Add Preprocessing
  3. Taylor expanded in A around 0

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

      \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
    6. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
    10. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
    11. hypot-defineN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
    12. hypot-lowering-hypot.f6414.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
  5. Simplified14.2%

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

      \[\leadsto -1 \cdot \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)} \]
    2. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right) \]
    3. neg-lowering-neg.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right) \]
    4. associate-*l/N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{B}\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), B\right)\right) \]
  7. Applied egg-rr14.2%

    \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)\right)}^{0.5}}{B}} \]
  8. Taylor expanded in C around 0

    \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}, \frac{1}{2}\right), B\right)\right) \]
  9. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \left(B \cdot F\right)\right), \frac{1}{2}\right), B\right)\right) \]
    2. *-lowering-*.f6412.4%

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(B, F\right)\right), \frac{1}{2}\right), B\right)\right) \]
  10. Simplified12.4%

    \[\leadsto -\frac{{\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}}^{0.5}}{B} \]
  11. Final simplification12.4%

    \[\leadsto \frac{{\left(-2 \cdot \left(B \cdot F\right)\right)}^{0.5}}{0 - B} \]
  12. Add Preprocessing

Alternative 18: 5.2% accurate, 5.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ -2 \cdot \frac{\sqrt{C \cdot F}}{B\_m} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 (* -2.0 (/ (sqrt (* C F)) B_m)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return -2.0 * (sqrt((C * F)) / B_m);
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = (-2.0d0) * (sqrt((c * f)) / b_m)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return -2.0 * (Math.sqrt((C * F)) / B_m);
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return -2.0 * (math.sqrt((C * F)) / B_m)
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(-2.0 * Float64(sqrt(Float64(C * F)) / B_m))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = -2.0 * (sqrt((C * F)) / B_m);
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(-2.0 * N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
-2 \cdot \frac{\sqrt{C \cdot F}}{B\_m}
\end{array}
Derivation
  1. Initial program 19.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. Simplified25.3%

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

    \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left({C}^{2} \cdot \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
  5. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left({C}^{2}\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    2. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(C \cdot C\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(-16 \cdot \left(A \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    4. fma-defineN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(\mathsf{fma}\left(-16, A \cdot F, -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. mul-1-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(\mathsf{fma}\left(-16, A \cdot F, \mathsf{neg}\left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. fmm-undefN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \left(-16 \cdot \left(A \cdot F\right) - \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\left(-16 \cdot \left(A \cdot F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \left(A \cdot F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}}{C}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{A \cdot \left({B}^{2} \cdot F\right)}{C}\right), C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
  6. Simplified7.8%

    \[\leadsto \frac{\sqrt{\color{blue}{\left(C \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot F\right) - \frac{-4 \cdot \left(\left(B \cdot B\right) \cdot F\right) + \frac{4 \cdot \left(A \cdot \left(\left(B \cdot B\right) \cdot F\right)\right)}{C}}{C}\right)}}}{4 \cdot \left(A \cdot C\right) - B \cdot B} \]
  7. Taylor expanded in A around 0

    \[\leadsto \color{blue}{-2 \cdot \left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)} \]
  8. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(-2, \color{blue}{\left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)}\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(\frac{1}{B}\right), \color{blue}{\left(\sqrt{C \cdot F}\right)}\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \left(\sqrt{\color{blue}{C \cdot F}}\right)\right)\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right)\right)\right) \]
    5. *-lowering-*.f643.1%

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right)\right) \]
  9. Simplified3.1%

    \[\leadsto \color{blue}{-2 \cdot \left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)} \]
  10. Step-by-step derivation
    1. inv-powN/A

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left({B}^{-1}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(C, F\right)}\right)\right)\right) \]
    2. pow-to-expN/A

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(e^{\log B \cdot -1}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(C, F\right)}\right)\right)\right) \]
    3. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\left(\log B \cdot -1\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(C, F\right)}\right)\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\log B, -1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\color{blue}{C}, F\right)\right)\right)\right) \]
    5. log-lowering-log.f642.4%

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(B\right), -1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right)\right) \]
  11. Applied egg-rr2.4%

    \[\leadsto -2 \cdot \left(\color{blue}{e^{\log B \cdot -1}} \cdot \sqrt{C \cdot F}\right) \]
  12. Taylor expanded in B around 0

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

      \[\leadsto \mathsf{*.f64}\left(-2, \left(\frac{1 \cdot \sqrt{C \cdot F}}{\color{blue}{B}}\right)\right) \]
    2. *-lft-identityN/A

      \[\leadsto \mathsf{*.f64}\left(-2, \left(\frac{\sqrt{C \cdot F}}{B}\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\left(\sqrt{C \cdot F}\right), \color{blue}{B}\right)\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right), B\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot C\right)\right), B\right)\right) \]
    6. *-lowering-*.f643.1%

      \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), B\right)\right) \]
  14. Simplified3.1%

    \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{F \cdot C}}{B}} \]
  15. Final simplification3.1%

    \[\leadsto -2 \cdot \frac{\sqrt{C \cdot F}}{B} \]
  16. Add Preprocessing

Reproduce

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