ABCF->ab-angle b

Percentage Accurate: 18.9% → 48.5%
Time: 17.9s
Alternatives: 10
Speedup: 13.3×

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 10 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: 18.9% accurate, 1.0× speedup?

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

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

Alternative 1: 48.5% accurate, 3.8× speedup?

\[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;C \leq -1.4 \cdot 10^{-291}:\\ \;\;\;\;\frac{\left(2 \cdot \left(\sqrt{C \cdot -4} \cdot \sqrt{F}\right)\right) \cdot -0.25}{C}\\ \mathbf{elif}\;C \leq 4.7 \cdot 10^{-45}:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)} \cdot \sqrt{\left(F \cdot 2\right) \cdot \left(\left(C + A\right) - \sqrt{\mathsf{fma}\left(A - C, A - C, B \cdot B\right)}\right)}\right) \cdot \frac{-1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.25 \cdot \left(\left(2 \cdot \sqrt{C}\right) \cdot \sqrt{-4 \cdot F}\right)}{C}\\ \end{array} \end{array} \]
NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (if (<= C -1.4e-291)
   (/ (* (* 2.0 (* (sqrt (* C -4.0)) (sqrt F))) -0.25) C)
   (if (<= C 4.7e-45)
     (*
      (*
       (sqrt (fma C (* A -4.0) (* B B)))
       (sqrt (* (* F 2.0) (- (+ C A) (sqrt (fma (- A C) (- A C) (* B B)))))))
      (/ -1.0 (fma B B (* C (* A -4.0)))))
     (/ (* -0.25 (* (* 2.0 (sqrt C)) (sqrt (* -4.0 F)))) C))))
assert(A < B && B < C && C < F);
double code(double A, double B, double C, double F) {
	double tmp;
	if (C <= -1.4e-291) {
		tmp = ((2.0 * (sqrt((C * -4.0)) * sqrt(F))) * -0.25) / C;
	} else if (C <= 4.7e-45) {
		tmp = (sqrt(fma(C, (A * -4.0), (B * B))) * sqrt(((F * 2.0) * ((C + A) - sqrt(fma((A - C), (A - C), (B * B))))))) * (-1.0 / fma(B, B, (C * (A * -4.0))));
	} else {
		tmp = (-0.25 * ((2.0 * sqrt(C)) * sqrt((-4.0 * F)))) / C;
	}
	return tmp;
}
A, B, C, F = sort([A, B, C, F])
function code(A, B, C, F)
	tmp = 0.0
	if (C <= -1.4e-291)
		tmp = Float64(Float64(Float64(2.0 * Float64(sqrt(Float64(C * -4.0)) * sqrt(F))) * -0.25) / C);
	elseif (C <= 4.7e-45)
		tmp = Float64(Float64(sqrt(fma(C, Float64(A * -4.0), Float64(B * B))) * sqrt(Float64(Float64(F * 2.0) * Float64(Float64(C + A) - sqrt(fma(Float64(A - C), Float64(A - C), Float64(B * B))))))) * Float64(-1.0 / fma(B, B, Float64(C * Float64(A * -4.0)))));
	else
		tmp = Float64(Float64(-0.25 * Float64(Float64(2.0 * sqrt(C)) * sqrt(Float64(-4.0 * F)))) / C);
	end
	return tmp
end
NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := If[LessEqual[C, -1.4e-291], N[(N[(N[(2.0 * N[(N[Sqrt[N[(C * -4.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision] / C), $MachinePrecision], If[LessEqual[C, 4.7e-45], N[(N[(N[Sqrt[N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(F * 2.0), $MachinePrecision] * N[(N[(C + A), $MachinePrecision] - N[Sqrt[N[(N[(A - C), $MachinePrecision] * N[(A - C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.25 * N[(N[(2.0 * N[Sqrt[C], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(-4.0 * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]]]
\begin{array}{l}
[A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.4 \cdot 10^{-291}:\\
\;\;\;\;\frac{\left(2 \cdot \left(\sqrt{C \cdot -4} \cdot \sqrt{F}\right)\right) \cdot -0.25}{C}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -1.4e-291

    1. Initial program 18.4%

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

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

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

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

        \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
      3. lower-/.f64N/A

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

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

        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
      6. lower-sqrt.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
      7. lower-sqrt.f64N/A

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

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

        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
      12. lower-*.f6414.8

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

      \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
    7. Step-by-step derivation
      1. Applied rewrites15.0%

        \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
      2. Step-by-step derivation
        1. Applied rewrites18.5%

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

        if -1.4e-291 < C < 4.6999999999999998e-45

        1. Initial program 27.2%

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

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

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

        if 4.6999999999999998e-45 < C

        1. Initial program 7.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. Applied rewrites6.1%

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

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

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

            \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
          3. lower-/.f64N/A

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

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

            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
          6. lower-sqrt.f64N/A

            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
          7. lower-sqrt.f64N/A

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

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

            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
          10. distribute-rgt-out--N/A

            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
          11. metadata-evalN/A

            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
          12. lower-*.f6428.2

            \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
        6. Applied rewrites28.2%

          \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
        7. Step-by-step derivation
          1. Applied rewrites28.6%

            \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
          2. Step-by-step derivation
            1. Applied rewrites36.6%

              \[\leadsto \frac{\left(\left(2 \cdot \sqrt{C}\right) \cdot \sqrt{-4 \cdot F}\right) \cdot -0.25}{C} \]
          3. Recombined 3 regimes into one program.
          4. Final simplification26.8%

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

          Alternative 2: 48.5% accurate, 3.8× speedup?

          \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;C \leq -1.4 \cdot 10^{-291}:\\ \;\;\;\;\frac{\left(2 \cdot \left(\sqrt{C \cdot -4} \cdot \sqrt{F}\right)\right) \cdot -0.25}{C}\\ \mathbf{elif}\;C \leq 4.7 \cdot 10^{-45}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \left(\sqrt{2 \cdot \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)} \cdot \sqrt{F \cdot \left(\left(C + A\right) - \sqrt{\mathsf{fma}\left(A - C, A - C, B \cdot B\right)}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.25 \cdot \left(\left(2 \cdot \sqrt{C}\right) \cdot \sqrt{-4 \cdot F}\right)}{C}\\ \end{array} \end{array} \]
          NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
          (FPCore (A B C F)
           :precision binary64
           (if (<= C -1.4e-291)
             (/ (* (* 2.0 (* (sqrt (* C -4.0)) (sqrt F))) -0.25) C)
             (if (<= C 4.7e-45)
               (*
                (/ -1.0 (fma B B (* C (* A -4.0))))
                (*
                 (sqrt (* 2.0 (fma C (* A -4.0) (* B B))))
                 (sqrt (* F (- (+ C A) (sqrt (fma (- A C) (- A C) (* B B))))))))
               (/ (* -0.25 (* (* 2.0 (sqrt C)) (sqrt (* -4.0 F)))) C))))
          assert(A < B && B < C && C < F);
          double code(double A, double B, double C, double F) {
          	double tmp;
          	if (C <= -1.4e-291) {
          		tmp = ((2.0 * (sqrt((C * -4.0)) * sqrt(F))) * -0.25) / C;
          	} else if (C <= 4.7e-45) {
          		tmp = (-1.0 / fma(B, B, (C * (A * -4.0)))) * (sqrt((2.0 * fma(C, (A * -4.0), (B * B)))) * sqrt((F * ((C + A) - sqrt(fma((A - C), (A - C), (B * B)))))));
          	} else {
          		tmp = (-0.25 * ((2.0 * sqrt(C)) * sqrt((-4.0 * F)))) / C;
          	}
          	return tmp;
          }
          
          A, B, C, F = sort([A, B, C, F])
          function code(A, B, C, F)
          	tmp = 0.0
          	if (C <= -1.4e-291)
          		tmp = Float64(Float64(Float64(2.0 * Float64(sqrt(Float64(C * -4.0)) * sqrt(F))) * -0.25) / C);
          	elseif (C <= 4.7e-45)
          		tmp = Float64(Float64(-1.0 / fma(B, B, Float64(C * Float64(A * -4.0)))) * Float64(sqrt(Float64(2.0 * fma(C, Float64(A * -4.0), Float64(B * B)))) * sqrt(Float64(F * Float64(Float64(C + A) - sqrt(fma(Float64(A - C), Float64(A - C), Float64(B * B))))))));
          	else
          		tmp = Float64(Float64(-0.25 * Float64(Float64(2.0 * sqrt(C)) * sqrt(Float64(-4.0 * F)))) / C);
          	end
          	return tmp
          end
          
          NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
          code[A_, B_, C_, F_] := If[LessEqual[C, -1.4e-291], N[(N[(N[(2.0 * N[(N[Sqrt[N[(C * -4.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision] / C), $MachinePrecision], If[LessEqual[C, 4.7e-45], N[(N[(-1.0 / N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(2.0 * N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(F * N[(N[(C + A), $MachinePrecision] - N[Sqrt[N[(N[(A - C), $MachinePrecision] * N[(A - C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.25 * N[(N[(2.0 * N[Sqrt[C], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(-4.0 * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]]]
          
          \begin{array}{l}
          [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;C \leq -1.4 \cdot 10^{-291}:\\
          \;\;\;\;\frac{\left(2 \cdot \left(\sqrt{C \cdot -4} \cdot \sqrt{F}\right)\right) \cdot -0.25}{C}\\
          
          \mathbf{elif}\;C \leq 4.7 \cdot 10^{-45}:\\
          \;\;\;\;\frac{-1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \left(\sqrt{2 \cdot \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)} \cdot \sqrt{F \cdot \left(\left(C + A\right) - \sqrt{\mathsf{fma}\left(A - C, A - C, B \cdot B\right)}\right)}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{-0.25 \cdot \left(\left(2 \cdot \sqrt{C}\right) \cdot \sqrt{-4 \cdot F}\right)}{C}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if C < -1.4e-291

            1. Initial program 18.4%

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

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

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

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

                \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
              3. lower-/.f64N/A

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

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

                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
              6. lower-sqrt.f64N/A

                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
              7. lower-sqrt.f64N/A

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

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

                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
              10. distribute-rgt-out--N/A

                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
              11. metadata-evalN/A

                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
              12. lower-*.f6414.8

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

              \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
            7. Step-by-step derivation
              1. Applied rewrites15.0%

                \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
              2. Step-by-step derivation
                1. Applied rewrites18.5%

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

                if -1.4e-291 < C < 4.6999999999999998e-45

                1. Initial program 27.2%

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

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

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

                if 4.6999999999999998e-45 < C

                1. Initial program 7.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. Applied rewrites6.1%

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

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

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

                    \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                  3. lower-/.f64N/A

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

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

                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                  6. lower-sqrt.f64N/A

                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                  7. lower-sqrt.f64N/A

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

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

                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                  10. distribute-rgt-out--N/A

                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                  11. metadata-evalN/A

                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                  12. lower-*.f6428.2

                    \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
                6. Applied rewrites28.2%

                  \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                7. Step-by-step derivation
                  1. Applied rewrites28.6%

                    \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
                  2. Step-by-step derivation
                    1. Applied rewrites36.6%

                      \[\leadsto \frac{\left(\left(2 \cdot \sqrt{C}\right) \cdot \sqrt{-4 \cdot F}\right) \cdot -0.25}{C} \]
                  3. Recombined 3 regimes into one program.
                  4. Final simplification26.8%

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

                  Alternative 3: 45.1% accurate, 6.1× speedup?

                  \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;C \leq -1.4 \cdot 10^{-291}:\\ \;\;\;\;\frac{\left(2 \cdot \left(\sqrt{C \cdot -4} \cdot \sqrt{F}\right)\right) \cdot -0.25}{C}\\ \mathbf{elif}\;C \leq 7.6 \cdot 10^{-171}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)} \cdot \frac{\sqrt{2}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.25 \cdot \left(\left(2 \cdot \sqrt{C}\right) \cdot \sqrt{-4 \cdot F}\right)}{C}\\ \end{array} \end{array} \]
                  NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
                  (FPCore (A B C F)
                   :precision binary64
                   (if (<= C -1.4e-291)
                     (/ (* (* 2.0 (* (sqrt (* C -4.0)) (sqrt F))) -0.25) C)
                     (if (<= C 7.6e-171)
                       (* (sqrt (* F (- A (sqrt (fma B B (* A A)))))) (/ (sqrt 2.0) (- B)))
                       (/ (* -0.25 (* (* 2.0 (sqrt C)) (sqrt (* -4.0 F)))) C))))
                  assert(A < B && B < C && C < F);
                  double code(double A, double B, double C, double F) {
                  	double tmp;
                  	if (C <= -1.4e-291) {
                  		tmp = ((2.0 * (sqrt((C * -4.0)) * sqrt(F))) * -0.25) / C;
                  	} else if (C <= 7.6e-171) {
                  		tmp = sqrt((F * (A - sqrt(fma(B, B, (A * A)))))) * (sqrt(2.0) / -B);
                  	} else {
                  		tmp = (-0.25 * ((2.0 * sqrt(C)) * sqrt((-4.0 * F)))) / C;
                  	}
                  	return tmp;
                  }
                  
                  A, B, C, F = sort([A, B, C, F])
                  function code(A, B, C, F)
                  	tmp = 0.0
                  	if (C <= -1.4e-291)
                  		tmp = Float64(Float64(Float64(2.0 * Float64(sqrt(Float64(C * -4.0)) * sqrt(F))) * -0.25) / C);
                  	elseif (C <= 7.6e-171)
                  		tmp = Float64(sqrt(Float64(F * Float64(A - sqrt(fma(B, B, Float64(A * A)))))) * Float64(sqrt(2.0) / Float64(-B)));
                  	else
                  		tmp = Float64(Float64(-0.25 * Float64(Float64(2.0 * sqrt(C)) * sqrt(Float64(-4.0 * F)))) / C);
                  	end
                  	return tmp
                  end
                  
                  NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
                  code[A_, B_, C_, F_] := If[LessEqual[C, -1.4e-291], N[(N[(N[(2.0 * N[(N[Sqrt[N[(C * -4.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision] / C), $MachinePrecision], If[LessEqual[C, 7.6e-171], N[(N[Sqrt[N[(F * N[(A - N[Sqrt[N[(B * B + N[(A * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B)), $MachinePrecision]), $MachinePrecision], N[(N[(-0.25 * N[(N[(2.0 * N[Sqrt[C], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(-4.0 * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;C \leq -1.4 \cdot 10^{-291}:\\
                  \;\;\;\;\frac{\left(2 \cdot \left(\sqrt{C \cdot -4} \cdot \sqrt{F}\right)\right) \cdot -0.25}{C}\\
                  
                  \mathbf{elif}\;C \leq 7.6 \cdot 10^{-171}:\\
                  \;\;\;\;\sqrt{F \cdot \left(A - \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)} \cdot \frac{\sqrt{2}}{-B}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{-0.25 \cdot \left(\left(2 \cdot \sqrt{C}\right) \cdot \sqrt{-4 \cdot F}\right)}{C}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if C < -1.4e-291

                    1. Initial program 18.4%

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

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

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

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

                        \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                      3. lower-/.f64N/A

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

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

                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                      6. lower-sqrt.f64N/A

                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                      7. lower-sqrt.f64N/A

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

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

                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                      10. distribute-rgt-out--N/A

                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                      11. metadata-evalN/A

                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                      12. lower-*.f6414.8

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

                      \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                    7. Step-by-step derivation
                      1. Applied rewrites15.0%

                        \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
                      2. Step-by-step derivation
                        1. Applied rewrites18.5%

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

                        if -1.4e-291 < C < 7.60000000000000043e-171

                        1. Initial program 28.6%

                          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                        2. 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. mul-1-negN/A

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

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

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

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

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

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

                        if 7.60000000000000043e-171 < C

                        1. Initial program 10.2%

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

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

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

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

                            \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                          3. lower-/.f64N/A

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

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

                            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                          6. lower-sqrt.f64N/A

                            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                          7. lower-sqrt.f64N/A

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

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

                            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                          10. distribute-rgt-out--N/A

                            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                          11. metadata-evalN/A

                            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                          12. lower-*.f6427.7

                            \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
                        6. Applied rewrites27.7%

                          \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites28.1%

                            \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
                          2. Step-by-step derivation
                            1. Applied rewrites35.9%

                              \[\leadsto \frac{\left(\left(2 \cdot \sqrt{C}\right) \cdot \sqrt{-4 \cdot F}\right) \cdot -0.25}{C} \]
                          3. Recombined 3 regimes into one program.
                          4. Final simplification24.1%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -1.4 \cdot 10^{-291}:\\ \;\;\;\;\frac{\left(2 \cdot \left(\sqrt{C \cdot -4} \cdot \sqrt{F}\right)\right) \cdot -0.25}{C}\\ \mathbf{elif}\;C \leq 7.6 \cdot 10^{-171}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)} \cdot \frac{\sqrt{2}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.25 \cdot \left(\left(2 \cdot \sqrt{C}\right) \cdot \sqrt{-4 \cdot F}\right)}{C}\\ \end{array} \]
                          5. Add Preprocessing

                          Alternative 4: 46.3% accurate, 8.5× speedup?

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

                            1. Initial program 18.4%

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

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

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

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

                                \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                              3. lower-/.f64N/A

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

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

                                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                              6. lower-sqrt.f64N/A

                                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                              7. lower-sqrt.f64N/A

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

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

                                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                              10. distribute-rgt-out--N/A

                                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                              11. metadata-evalN/A

                                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                              12. lower-*.f6414.8

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

                              \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                            7. Step-by-step derivation
                              1. Applied rewrites15.0%

                                \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
                              2. Step-by-step derivation
                                1. Applied rewrites18.5%

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

                                if -9.99999999999999962e-292 < C

                                1. Initial program 16.2%

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

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

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

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

                                    \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                                  3. lower-/.f64N/A

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

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

                                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                  6. lower-sqrt.f64N/A

                                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                  7. lower-sqrt.f64N/A

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

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

                                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                                  10. distribute-rgt-out--N/A

                                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                                  11. metadata-evalN/A

                                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                                  12. lower-*.f6421.8

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

                                  \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites22.1%

                                    \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites28.3%

                                      \[\leadsto \frac{\left(\left(2 \cdot \sqrt{C}\right) \cdot \sqrt{-4 \cdot F}\right) \cdot -0.25}{C} \]
                                  3. Recombined 2 regimes into one program.
                                  4. Final simplification23.6%

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

                                  Alternative 5: 38.7% accurate, 8.5× speedup?

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

                                    1. Initial program 15.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. Applied rewrites8.5%

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

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

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

                                        \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                                      3. lower-/.f64N/A

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

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

                                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                      6. lower-sqrt.f64N/A

                                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                      7. lower-sqrt.f64N/A

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

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

                                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                                      10. distribute-rgt-out--N/A

                                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                                      11. metadata-evalN/A

                                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                                      12. lower-*.f6413.4

                                        \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
                                    6. Applied rewrites13.4%

                                      \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites13.5%

                                        \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites13.5%

                                          \[\leadsto \frac{\sqrt{C \cdot \left(-4 \cdot F\right)} \cdot -0.5}{C} \]

                                        if -4.999999999999985e-310 < F

                                        1. Initial program 25.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. Applied rewrites0.0%

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

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

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

                                            \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                                          3. lower-/.f64N/A

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

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

                                            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                          6. lower-sqrt.f64N/A

                                            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                          7. lower-sqrt.f64N/A

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

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

                                            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                                          10. distribute-rgt-out--N/A

                                            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                                          11. metadata-evalN/A

                                            \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                                          12. lower-*.f6448.2

                                            \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
                                        6. Applied rewrites48.2%

                                          \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites48.8%

                                            \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites62.0%

                                              \[\leadsto \frac{\left(2 \cdot \left(\sqrt{C \cdot -4} \cdot \sqrt{F}\right)\right) \cdot -0.25}{C} \]
                                          3. Recombined 2 regimes into one program.
                                          4. Add Preprocessing

                                          Alternative 6: 38.7% accurate, 8.5× speedup?

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

                                            1. Initial program 15.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. Applied rewrites8.5%

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

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

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

                                                \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                                              3. lower-/.f64N/A

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

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

                                                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                              6. lower-sqrt.f64N/A

                                                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                              7. lower-sqrt.f64N/A

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

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

                                                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                                              10. distribute-rgt-out--N/A

                                                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                                              11. metadata-evalN/A

                                                \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                                              12. lower-*.f6413.4

                                                \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
                                            6. Applied rewrites13.4%

                                              \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites13.5%

                                                \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
                                              2. Step-by-step derivation
                                                1. Applied rewrites13.5%

                                                  \[\leadsto \frac{\sqrt{C \cdot \left(-4 \cdot F\right)} \cdot -0.5}{C} \]

                                                if -4.999999999999985e-310 < F

                                                1. Initial program 25.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. Applied rewrites0.0%

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

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

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

                                                    \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                                                  3. lower-/.f64N/A

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

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

                                                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                                  6. lower-sqrt.f64N/A

                                                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                                  7. lower-sqrt.f64N/A

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

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

                                                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                                                  10. distribute-rgt-out--N/A

                                                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                                                  11. metadata-evalN/A

                                                    \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                                                  12. lower-*.f6448.2

                                                    \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
                                                6. Applied rewrites48.2%

                                                  \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites61.8%

                                                    \[\leadsto -0.25 \cdot \left(\sqrt{F} \cdot \color{blue}{\left(\sqrt{C \cdot -4} \cdot \frac{2}{C}\right)}\right) \]
                                                8. Recombined 2 regimes into one program.
                                                9. Add Preprocessing

                                                Alternative 7: 37.5% accurate, 9.3× speedup?

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

                                                  1. Initial program 17.4%

                                                    \[\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. Applied rewrites5.9%

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

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

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

                                                      \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                                                    3. lower-/.f64N/A

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

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

                                                      \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                                    6. lower-sqrt.f64N/A

                                                      \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                                    7. lower-sqrt.f64N/A

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

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

                                                      \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                                                    10. distribute-rgt-out--N/A

                                                      \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                                                    11. metadata-evalN/A

                                                      \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                                                    12. lower-*.f6414.4

                                                      \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
                                                  6. Applied rewrites14.4%

                                                    \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites18.5%

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

                                                    if -9.0000000000000003e-240 < C

                                                    1. Initial program 17.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. Applied rewrites8.4%

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

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

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

                                                        \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                                                      3. lower-/.f64N/A

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

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

                                                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                                      6. lower-sqrt.f64N/A

                                                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                                      7. lower-sqrt.f64N/A

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

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

                                                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                                                      10. distribute-rgt-out--N/A

                                                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                                                      11. metadata-evalN/A

                                                        \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                                                      12. lower-*.f6421.6

                                                        \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
                                                    6. Applied rewrites21.6%

                                                      \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites21.8%

                                                        \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
                                                      2. Step-by-step derivation
                                                        1. Applied rewrites21.8%

                                                          \[\leadsto \frac{\sqrt{C \cdot \left(-4 \cdot F\right)} \cdot -0.5}{C} \]
                                                      3. Recombined 2 regimes into one program.
                                                      4. Final simplification20.4%

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -9 \cdot 10^{-240}:\\ \;\;\;\;\sqrt{C \cdot -4} \cdot \left(\sqrt{F} \cdot \frac{-0.5}{C}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(-4 \cdot F\right)} \cdot -0.5}{C}\\ \end{array} \]
                                                      5. Add Preprocessing

                                                      Alternative 8: 36.3% accurate, 13.3× speedup?

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

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

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

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

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

                                                          \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                                                        3. lower-/.f64N/A

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

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

                                                          \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                                        6. lower-sqrt.f64N/A

                                                          \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                                        7. lower-sqrt.f64N/A

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

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

                                                          \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                                                        10. distribute-rgt-out--N/A

                                                          \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                                                        11. metadata-evalN/A

                                                          \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                                                        12. lower-*.f6418.4

                                                          \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
                                                      6. Applied rewrites18.4%

                                                        \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites18.6%

                                                          \[\leadsto \frac{\left(2 \cdot \sqrt{C \cdot \left(-4 \cdot F\right)}\right) \cdot -0.25}{\color{blue}{C}} \]
                                                        2. Step-by-step derivation
                                                          1. Applied rewrites18.6%

                                                            \[\leadsto \frac{\sqrt{C \cdot \left(-4 \cdot F\right)} \cdot -0.5}{C} \]
                                                          2. Add Preprocessing

                                                          Alternative 9: 36.3% accurate, 13.3× speedup?

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

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

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

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

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

                                                              \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(\frac{{\left(\sqrt{2}\right)}^{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right)} \]
                                                            3. lower-/.f64N/A

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

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

                                                              \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                                            6. lower-sqrt.f64N/A

                                                              \[\leadsto \frac{-1}{4} \cdot \left(\frac{\color{blue}{\sqrt{2}} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}\right) \]
                                                            7. lower-sqrt.f64N/A

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

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

                                                              \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{\color{blue}{F \cdot \left(-2 \cdot C - 2 \cdot C\right)}}\right) \]
                                                            10. distribute-rgt-out--N/A

                                                              \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot \left(-2 - 2\right)\right)}}\right) \]
                                                            11. metadata-evalN/A

                                                              \[\leadsto \frac{-1}{4} \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot \color{blue}{-4}\right)}\right) \]
                                                            12. lower-*.f6418.4

                                                              \[\leadsto -0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \color{blue}{\left(C \cdot -4\right)}}\right) \]
                                                          6. Applied rewrites18.4%

                                                            \[\leadsto \color{blue}{-0.25 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{2}}{C} \cdot \sqrt{F \cdot \left(C \cdot -4\right)}\right)} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites18.6%

                                                              \[\leadsto \frac{-0.5}{C} \cdot \color{blue}{\sqrt{C \cdot \left(-4 \cdot F\right)}} \]
                                                            2. Final simplification18.6%

                                                              \[\leadsto \sqrt{C \cdot \left(-4 \cdot F\right)} \cdot \frac{-0.5}{C} \]
                                                            3. Add Preprocessing

                                                            Alternative 10: 2.0% accurate, 18.2× speedup?

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \mathsf{neg}\left(\sqrt{\frac{F}{B}} \cdot \color{blue}{\left(-1 \cdot \sqrt{2}\right)}\right) \]
                                                              9. lower-sqrt.f642.0

                                                                \[\leadsto -\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \color{blue}{\sqrt{2}}\right) \]
                                                            5. Applied rewrites2.0%

                                                              \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)} \]
                                                            6. Step-by-step derivation
                                                              1. Applied rewrites2.0%

                                                                \[\leadsto \sqrt{\frac{F}{B}} \cdot \color{blue}{\sqrt{2}} \]
                                                              2. Applied rewrites2.0%

                                                                \[\leadsto \color{blue}{\sqrt{\frac{2 \cdot F}{B}}} \]
                                                              3. Final simplification2.0%

                                                                \[\leadsto \sqrt{\frac{F \cdot 2}{B}} \]
                                                              4. Add Preprocessing

                                                              Reproduce

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