ABCF->ab-angle a

Percentage Accurate: 19.2% → 56.2%
Time: 10.3s
Alternatives: 16
Speedup: 9.7×

Specification

?
\[\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} \]
(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;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    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}
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}

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 16 alternatives:

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

Initial Program: 19.2% accurate, 1.0× speedup?

\[\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} \]
(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;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    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}
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}

Alternative 1: 56.2% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(A, C\right) - \mathsf{min}\left(A, C\right)\\ t_1 := \left|B\right| \cdot \left|B\right|\\ t_2 := \mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - t\_1\\ \mathbf{if}\;\left|B\right| \leq 1.7 \cdot 10^{-156}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{elif}\;\left|B\right| \leq 100000000:\\ \;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{\left(4 \cdot \left(\mathsf{max}\left(A, C\right) \cdot F\right)\right) \cdot \mathsf{fma}\left(\mathsf{max}\left(A, C\right) \cdot -4, \mathsf{min}\left(A, C\right), t\_1\right)}}}\\ \mathbf{elif}\;\left|B\right| \leq 7 \cdot 10^{+39}:\\ \;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{\mathsf{fma}\left(-4 \cdot \mathsf{min}\left(A, C\right), \mathsf{max}\left(A, C\right), t\_1\right)} \cdot \sqrt{\left(F + F\right) \cdot \left(\left(\mathsf{max}\left(A, C\right) + \mathsf{min}\left(A, C\right)\right) + \sqrt{\mathsf{fma}\left(t\_0, t\_0, t\_1\right)}\right)}}}\\ \mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (let* ((t_0 (- (fmax A C) (fmin A C)))
       (t_1 (* (fabs B) (fabs B)))
       (t_2 (- (* (fmax A C) (* (fmin A C) 4.0)) t_1)))
  (if (<= (fabs B) 1.7e-156)
    (* 0.25 (/ (sqrt (* -16.0 (* (fmin A C) F))) (fmin A C)))
    (if (<= (fabs B) 100000000.0)
      (/
       1.0
       (/
        t_2
        (sqrt
         (*
          (* 4.0 (* (fmax A C) F))
          (fma (* (fmax A C) -4.0) (fmin A C) t_1)))))
      (if (<= (fabs B) 7e+39)
        (/
         1.0
         (/
          t_2
          (*
           (sqrt (fma (* -4.0 (fmin A C)) (fmax A C) t_1))
           (sqrt
            (*
             (+ F F)
             (+
              (+ (fmax A C) (fmin A C))
              (sqrt (fma t_0 t_0 t_1))))))))
        (if (<= (fabs B) 8e+133)
          (*
           (/ 0.25 (fmin A C))
           (* (sqrt (* -16.0 (fmin A C))) (sqrt F)))
          (- (sqrt (fabs (* (/ -2.0 (fabs B)) F))))))))))
double code(double A, double B, double C, double F) {
	double t_0 = fmax(A, C) - fmin(A, C);
	double t_1 = fabs(B) * fabs(B);
	double t_2 = (fmax(A, C) * (fmin(A, C) * 4.0)) - t_1;
	double tmp;
	if (fabs(B) <= 1.7e-156) {
		tmp = 0.25 * (sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (fabs(B) <= 100000000.0) {
		tmp = 1.0 / (t_2 / sqrt(((4.0 * (fmax(A, C) * F)) * fma((fmax(A, C) * -4.0), fmin(A, C), t_1))));
	} else if (fabs(B) <= 7e+39) {
		tmp = 1.0 / (t_2 / (sqrt(fma((-4.0 * fmin(A, C)), fmax(A, C), t_1)) * sqrt(((F + F) * ((fmax(A, C) + fmin(A, C)) + sqrt(fma(t_0, t_0, t_1)))))));
	} else if (fabs(B) <= 8e+133) {
		tmp = (0.25 / fmin(A, C)) * (sqrt((-16.0 * fmin(A, C))) * sqrt(F));
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
function code(A, B, C, F)
	t_0 = Float64(fmax(A, C) - fmin(A, C))
	t_1 = Float64(abs(B) * abs(B))
	t_2 = Float64(Float64(fmax(A, C) * Float64(fmin(A, C) * 4.0)) - t_1)
	tmp = 0.0
	if (abs(B) <= 1.7e-156)
		tmp = Float64(0.25 * Float64(sqrt(Float64(-16.0 * Float64(fmin(A, C) * F))) / fmin(A, C)));
	elseif (abs(B) <= 100000000.0)
		tmp = Float64(1.0 / Float64(t_2 / sqrt(Float64(Float64(4.0 * Float64(fmax(A, C) * F)) * fma(Float64(fmax(A, C) * -4.0), fmin(A, C), t_1)))));
	elseif (abs(B) <= 7e+39)
		tmp = Float64(1.0 / Float64(t_2 / Float64(sqrt(fma(Float64(-4.0 * fmin(A, C)), fmax(A, C), t_1)) * sqrt(Float64(Float64(F + F) * Float64(Float64(fmax(A, C) + fmin(A, C)) + sqrt(fma(t_0, t_0, t_1))))))));
	elseif (abs(B) <= 8e+133)
		tmp = Float64(Float64(0.25 / fmin(A, C)) * Float64(sqrt(Float64(-16.0 * fmin(A, C))) * sqrt(F)));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Max[A, C], $MachinePrecision] - N[Min[A, C], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[B], $MachinePrecision] * N[Abs[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Max[A, C], $MachinePrecision] * N[(N[Min[A, C], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[N[Abs[B], $MachinePrecision], 1.7e-156], N[(0.25 * N[(N[Sqrt[N[(-16.0 * N[(N[Min[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 100000000.0], N[(1.0 / N[(t$95$2 / N[Sqrt[N[(N[(4.0 * N[(N[Max[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Max[A, C], $MachinePrecision] * -4.0), $MachinePrecision] * N[Min[A, C], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 7e+39], N[(1.0 / N[(t$95$2 / N[(N[Sqrt[N[(N[(-4.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[Max[A, C], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(F + F), $MachinePrecision] * N[(N[(N[Max[A, C], $MachinePrecision] + N[Min[A, C], $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(t$95$0 * t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], N[(N[(0.25 / N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(-16.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(A, C\right) - \mathsf{min}\left(A, C\right)\\
t_1 := \left|B\right| \cdot \left|B\right|\\
t_2 := \mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - t\_1\\
\mathbf{if}\;\left|B\right| \leq 1.7 \cdot 10^{-156}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\

\mathbf{elif}\;\left|B\right| \leq 100000000:\\
\;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{\left(4 \cdot \left(\mathsf{max}\left(A, C\right) \cdot F\right)\right) \cdot \mathsf{fma}\left(\mathsf{max}\left(A, C\right) \cdot -4, \mathsf{min}\left(A, C\right), t\_1\right)}}}\\

\mathbf{elif}\;\left|B\right| \leq 7 \cdot 10^{+39}:\\
\;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{\mathsf{fma}\left(-4 \cdot \mathsf{min}\left(A, C\right), \mathsf{max}\left(A, C\right), t\_1\right)} \cdot \sqrt{\left(F + F\right) \cdot \left(\left(\mathsf{max}\left(A, C\right) + \mathsf{min}\left(A, C\right)\right) + \sqrt{\mathsf{fma}\left(t\_0, t\_0, t\_1\right)}\right)}}}\\

\mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 1.7e-156

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

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

    if 1.7e-156 < B < 1e8

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

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

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

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

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

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

      \[\leadsto \frac{1}{\frac{C \cdot \left(A \cdot 4\right) - B \cdot B}{\sqrt{\color{blue}{\left(4 \cdot \left(C \cdot F\right)\right)} \cdot \mathsf{fma}\left(C \cdot -4, A, B \cdot B\right)}}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

    if 1e8 < B < 7.0000000000000003e39

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

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

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

    if 7.0000000000000003e39 < B < 8.0000000000000002e133

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      4. mult-flipN/A

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

        \[\leadsto \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \cdot \color{blue}{\frac{1}{A}} \]
      6. *-commutativeN/A

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

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

        \[\leadsto \left(\sqrt{-16 \cdot \left(A \cdot F\right)} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      9. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      10. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      11. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      12. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      13. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      14. lower-/.f6420.1%

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot 0.25\right) \cdot \frac{1}{\color{blue}{A}} \]
    6. Applied rewrites20.1%

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

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

        \[\leadsto \frac{1}{A} \cdot \color{blue}{\left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(A \cdot F\right) \cdot -16}\right) \]
      9. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{A} \cdot \frac{1}{4}\right) \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
      12. *-commutativeN/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{\color{blue}{-16 \cdot \left(A \cdot F\right)}} \]
      13. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{-16 \cdot \color{blue}{\left(A \cdot F\right)}} \]
      14. mult-flip-revN/A

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(A \cdot F\right) \cdot -16} \]
      17. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      20. lift-sqrt.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      21. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      22. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      23. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      24. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      25. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      26. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
    8. Applied rewrites20.1%

      \[\leadsto \frac{0.25}{A} \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
    9. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      4. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(-16 \cdot A\right) \cdot F} \]
      5. sqrt-prodN/A

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

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
      9. lower-unsound-sqrt.f6418.6%

        \[\leadsto \frac{0.25}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
    10. Applied rewrites18.6%

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

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

      \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 2: 48.9% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(A, C\right) - \mathsf{min}\left(A, C\right)\\ t_1 := \left|B\right| \cdot \left|B\right|\\ t_2 := \mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - t\_1\\ \mathbf{if}\;\left|B\right| \leq 1.7 \cdot 10^{-156}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{elif}\;\left|B\right| \leq 100000000:\\ \;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{\left(4 \cdot \left(\mathsf{max}\left(A, C\right) \cdot F\right)\right) \cdot \mathsf{fma}\left(\mathsf{max}\left(A, C\right) \cdot -4, \mathsf{min}\left(A, C\right), t\_1\right)}}}\\ \mathbf{elif}\;\left|B\right| \leq 7 \cdot 10^{+39}:\\ \;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{\left(\mathsf{max}\left(A, C\right) + \mathsf{min}\left(A, C\right)\right) + \sqrt{\mathsf{fma}\left(t\_0, t\_0, t\_1\right)}} \cdot \sqrt{\left(F + F\right) \cdot \mathsf{fma}\left(-4 \cdot \mathsf{min}\left(A, C\right), \mathsf{max}\left(A, C\right), t\_1\right)}}}\\ \mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (let* ((t_0 (- (fmax A C) (fmin A C)))
       (t_1 (* (fabs B) (fabs B)))
       (t_2 (- (* (fmax A C) (* (fmin A C) 4.0)) t_1)))
  (if (<= (fabs B) 1.7e-156)
    (* 0.25 (/ (sqrt (* -16.0 (* (fmin A C) F))) (fmin A C)))
    (if (<= (fabs B) 100000000.0)
      (/
       1.0
       (/
        t_2
        (sqrt
         (*
          (* 4.0 (* (fmax A C) F))
          (fma (* (fmax A C) -4.0) (fmin A C) t_1)))))
      (if (<= (fabs B) 7e+39)
        (/
         1.0
         (/
          t_2
          (*
           (sqrt
            (+ (+ (fmax A C) (fmin A C)) (sqrt (fma t_0 t_0 t_1))))
           (sqrt
            (* (+ F F) (fma (* -4.0 (fmin A C)) (fmax A C) t_1))))))
        (if (<= (fabs B) 8e+133)
          (*
           (/ 0.25 (fmin A C))
           (* (sqrt (* -16.0 (fmin A C))) (sqrt F)))
          (- (sqrt (fabs (* (/ -2.0 (fabs B)) F))))))))))
double code(double A, double B, double C, double F) {
	double t_0 = fmax(A, C) - fmin(A, C);
	double t_1 = fabs(B) * fabs(B);
	double t_2 = (fmax(A, C) * (fmin(A, C) * 4.0)) - t_1;
	double tmp;
	if (fabs(B) <= 1.7e-156) {
		tmp = 0.25 * (sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (fabs(B) <= 100000000.0) {
		tmp = 1.0 / (t_2 / sqrt(((4.0 * (fmax(A, C) * F)) * fma((fmax(A, C) * -4.0), fmin(A, C), t_1))));
	} else if (fabs(B) <= 7e+39) {
		tmp = 1.0 / (t_2 / (sqrt(((fmax(A, C) + fmin(A, C)) + sqrt(fma(t_0, t_0, t_1)))) * sqrt(((F + F) * fma((-4.0 * fmin(A, C)), fmax(A, C), t_1)))));
	} else if (fabs(B) <= 8e+133) {
		tmp = (0.25 / fmin(A, C)) * (sqrt((-16.0 * fmin(A, C))) * sqrt(F));
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
function code(A, B, C, F)
	t_0 = Float64(fmax(A, C) - fmin(A, C))
	t_1 = Float64(abs(B) * abs(B))
	t_2 = Float64(Float64(fmax(A, C) * Float64(fmin(A, C) * 4.0)) - t_1)
	tmp = 0.0
	if (abs(B) <= 1.7e-156)
		tmp = Float64(0.25 * Float64(sqrt(Float64(-16.0 * Float64(fmin(A, C) * F))) / fmin(A, C)));
	elseif (abs(B) <= 100000000.0)
		tmp = Float64(1.0 / Float64(t_2 / sqrt(Float64(Float64(4.0 * Float64(fmax(A, C) * F)) * fma(Float64(fmax(A, C) * -4.0), fmin(A, C), t_1)))));
	elseif (abs(B) <= 7e+39)
		tmp = Float64(1.0 / Float64(t_2 / Float64(sqrt(Float64(Float64(fmax(A, C) + fmin(A, C)) + sqrt(fma(t_0, t_0, t_1)))) * sqrt(Float64(Float64(F + F) * fma(Float64(-4.0 * fmin(A, C)), fmax(A, C), t_1))))));
	elseif (abs(B) <= 8e+133)
		tmp = Float64(Float64(0.25 / fmin(A, C)) * Float64(sqrt(Float64(-16.0 * fmin(A, C))) * sqrt(F)));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Max[A, C], $MachinePrecision] - N[Min[A, C], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[B], $MachinePrecision] * N[Abs[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Max[A, C], $MachinePrecision] * N[(N[Min[A, C], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[N[Abs[B], $MachinePrecision], 1.7e-156], N[(0.25 * N[(N[Sqrt[N[(-16.0 * N[(N[Min[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 100000000.0], N[(1.0 / N[(t$95$2 / N[Sqrt[N[(N[(4.0 * N[(N[Max[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Max[A, C], $MachinePrecision] * -4.0), $MachinePrecision] * N[Min[A, C], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 7e+39], N[(1.0 / N[(t$95$2 / N[(N[Sqrt[N[(N[(N[Max[A, C], $MachinePrecision] + N[Min[A, C], $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(t$95$0 * t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(F + F), $MachinePrecision] * N[(N[(-4.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[Max[A, C], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], N[(N[(0.25 / N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(-16.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(A, C\right) - \mathsf{min}\left(A, C\right)\\
t_1 := \left|B\right| \cdot \left|B\right|\\
t_2 := \mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - t\_1\\
\mathbf{if}\;\left|B\right| \leq 1.7 \cdot 10^{-156}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\

\mathbf{elif}\;\left|B\right| \leq 100000000:\\
\;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{\left(4 \cdot \left(\mathsf{max}\left(A, C\right) \cdot F\right)\right) \cdot \mathsf{fma}\left(\mathsf{max}\left(A, C\right) \cdot -4, \mathsf{min}\left(A, C\right), t\_1\right)}}}\\

\mathbf{elif}\;\left|B\right| \leq 7 \cdot 10^{+39}:\\
\;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{\left(\mathsf{max}\left(A, C\right) + \mathsf{min}\left(A, C\right)\right) + \sqrt{\mathsf{fma}\left(t\_0, t\_0, t\_1\right)}} \cdot \sqrt{\left(F + F\right) \cdot \mathsf{fma}\left(-4 \cdot \mathsf{min}\left(A, C\right), \mathsf{max}\left(A, C\right), t\_1\right)}}}\\

\mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 1.7e-156

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

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

    if 1.7e-156 < B < 1e8

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

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

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

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

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

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

      \[\leadsto \frac{1}{\frac{C \cdot \left(A \cdot 4\right) - B \cdot B}{\sqrt{\color{blue}{\left(4 \cdot \left(C \cdot F\right)\right)} \cdot \mathsf{fma}\left(C \cdot -4, A, B \cdot B\right)}}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

    if 1e8 < B < 7.0000000000000003e39

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

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

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

    if 7.0000000000000003e39 < B < 8.0000000000000002e133

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      4. mult-flipN/A

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

        \[\leadsto \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \cdot \color{blue}{\frac{1}{A}} \]
      6. *-commutativeN/A

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

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

        \[\leadsto \left(\sqrt{-16 \cdot \left(A \cdot F\right)} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      9. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      10. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      11. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      12. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      13. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      14. lower-/.f6420.1%

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot 0.25\right) \cdot \frac{1}{\color{blue}{A}} \]
    6. Applied rewrites20.1%

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

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

        \[\leadsto \frac{1}{A} \cdot \color{blue}{\left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(A \cdot F\right) \cdot -16}\right) \]
      9. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{A} \cdot \frac{1}{4}\right) \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
      12. *-commutativeN/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{\color{blue}{-16 \cdot \left(A \cdot F\right)}} \]
      13. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{-16 \cdot \color{blue}{\left(A \cdot F\right)}} \]
      14. mult-flip-revN/A

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(A \cdot F\right) \cdot -16} \]
      17. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      20. lift-sqrt.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      21. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      22. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      23. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      24. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      25. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      26. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
    8. Applied rewrites20.1%

      \[\leadsto \frac{0.25}{A} \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
    9. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      4. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(-16 \cdot A\right) \cdot F} \]
      5. sqrt-prodN/A

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

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
      9. lower-unsound-sqrt.f6418.6%

        \[\leadsto \frac{0.25}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
    10. Applied rewrites18.6%

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

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

      \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 3: 48.6% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(A, C\right) - \mathsf{min}\left(A, C\right)\\ t_1 := \left|B\right| \cdot \left|B\right|\\ t_2 := \mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - t\_1\\ \mathbf{if}\;\left|B\right| \leq 1.7 \cdot 10^{-156}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{elif}\;\left|B\right| \leq 100000000:\\ \;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{\left(4 \cdot \left(\mathsf{max}\left(A, C\right) \cdot F\right)\right) \cdot \mathsf{fma}\left(\mathsf{max}\left(A, C\right) \cdot -4, \mathsf{min}\left(A, C\right), t\_1\right)}}}\\ \mathbf{elif}\;\left|B\right| \leq 7 \cdot 10^{+39}:\\ \;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{F + F} \cdot \sqrt{\left(\left(\mathsf{max}\left(A, C\right) + \mathsf{min}\left(A, C\right)\right) + \sqrt{\mathsf{fma}\left(t\_0, t\_0, t\_1\right)}\right) \cdot \mathsf{fma}\left(-4 \cdot \mathsf{min}\left(A, C\right), \mathsf{max}\left(A, C\right), t\_1\right)}}}\\ \mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (let* ((t_0 (- (fmax A C) (fmin A C)))
       (t_1 (* (fabs B) (fabs B)))
       (t_2 (- (* (fmax A C) (* (fmin A C) 4.0)) t_1)))
  (if (<= (fabs B) 1.7e-156)
    (* 0.25 (/ (sqrt (* -16.0 (* (fmin A C) F))) (fmin A C)))
    (if (<= (fabs B) 100000000.0)
      (/
       1.0
       (/
        t_2
        (sqrt
         (*
          (* 4.0 (* (fmax A C) F))
          (fma (* (fmax A C) -4.0) (fmin A C) t_1)))))
      (if (<= (fabs B) 7e+39)
        (/
         1.0
         (/
          t_2
          (*
           (sqrt (+ F F))
           (sqrt
            (*
             (+ (+ (fmax A C) (fmin A C)) (sqrt (fma t_0 t_0 t_1)))
             (fma (* -4.0 (fmin A C)) (fmax A C) t_1))))))
        (if (<= (fabs B) 8e+133)
          (*
           (/ 0.25 (fmin A C))
           (* (sqrt (* -16.0 (fmin A C))) (sqrt F)))
          (- (sqrt (fabs (* (/ -2.0 (fabs B)) F))))))))))
double code(double A, double B, double C, double F) {
	double t_0 = fmax(A, C) - fmin(A, C);
	double t_1 = fabs(B) * fabs(B);
	double t_2 = (fmax(A, C) * (fmin(A, C) * 4.0)) - t_1;
	double tmp;
	if (fabs(B) <= 1.7e-156) {
		tmp = 0.25 * (sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (fabs(B) <= 100000000.0) {
		tmp = 1.0 / (t_2 / sqrt(((4.0 * (fmax(A, C) * F)) * fma((fmax(A, C) * -4.0), fmin(A, C), t_1))));
	} else if (fabs(B) <= 7e+39) {
		tmp = 1.0 / (t_2 / (sqrt((F + F)) * sqrt((((fmax(A, C) + fmin(A, C)) + sqrt(fma(t_0, t_0, t_1))) * fma((-4.0 * fmin(A, C)), fmax(A, C), t_1)))));
	} else if (fabs(B) <= 8e+133) {
		tmp = (0.25 / fmin(A, C)) * (sqrt((-16.0 * fmin(A, C))) * sqrt(F));
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
function code(A, B, C, F)
	t_0 = Float64(fmax(A, C) - fmin(A, C))
	t_1 = Float64(abs(B) * abs(B))
	t_2 = Float64(Float64(fmax(A, C) * Float64(fmin(A, C) * 4.0)) - t_1)
	tmp = 0.0
	if (abs(B) <= 1.7e-156)
		tmp = Float64(0.25 * Float64(sqrt(Float64(-16.0 * Float64(fmin(A, C) * F))) / fmin(A, C)));
	elseif (abs(B) <= 100000000.0)
		tmp = Float64(1.0 / Float64(t_2 / sqrt(Float64(Float64(4.0 * Float64(fmax(A, C) * F)) * fma(Float64(fmax(A, C) * -4.0), fmin(A, C), t_1)))));
	elseif (abs(B) <= 7e+39)
		tmp = Float64(1.0 / Float64(t_2 / Float64(sqrt(Float64(F + F)) * sqrt(Float64(Float64(Float64(fmax(A, C) + fmin(A, C)) + sqrt(fma(t_0, t_0, t_1))) * fma(Float64(-4.0 * fmin(A, C)), fmax(A, C), t_1))))));
	elseif (abs(B) <= 8e+133)
		tmp = Float64(Float64(0.25 / fmin(A, C)) * Float64(sqrt(Float64(-16.0 * fmin(A, C))) * sqrt(F)));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Max[A, C], $MachinePrecision] - N[Min[A, C], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[B], $MachinePrecision] * N[Abs[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Max[A, C], $MachinePrecision] * N[(N[Min[A, C], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[N[Abs[B], $MachinePrecision], 1.7e-156], N[(0.25 * N[(N[Sqrt[N[(-16.0 * N[(N[Min[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 100000000.0], N[(1.0 / N[(t$95$2 / N[Sqrt[N[(N[(4.0 * N[(N[Max[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Max[A, C], $MachinePrecision] * -4.0), $MachinePrecision] * N[Min[A, C], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 7e+39], N[(1.0 / N[(t$95$2 / N[(N[Sqrt[N[(F + F), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(N[(N[Max[A, C], $MachinePrecision] + N[Min[A, C], $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(t$95$0 * t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(-4.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[Max[A, C], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], N[(N[(0.25 / N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(-16.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(A, C\right) - \mathsf{min}\left(A, C\right)\\
t_1 := \left|B\right| \cdot \left|B\right|\\
t_2 := \mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - t\_1\\
\mathbf{if}\;\left|B\right| \leq 1.7 \cdot 10^{-156}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\

\mathbf{elif}\;\left|B\right| \leq 100000000:\\
\;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{\left(4 \cdot \left(\mathsf{max}\left(A, C\right) \cdot F\right)\right) \cdot \mathsf{fma}\left(\mathsf{max}\left(A, C\right) \cdot -4, \mathsf{min}\left(A, C\right), t\_1\right)}}}\\

\mathbf{elif}\;\left|B\right| \leq 7 \cdot 10^{+39}:\\
\;\;\;\;\frac{1}{\frac{t\_2}{\sqrt{F + F} \cdot \sqrt{\left(\left(\mathsf{max}\left(A, C\right) + \mathsf{min}\left(A, C\right)\right) + \sqrt{\mathsf{fma}\left(t\_0, t\_0, t\_1\right)}\right) \cdot \mathsf{fma}\left(-4 \cdot \mathsf{min}\left(A, C\right), \mathsf{max}\left(A, C\right), t\_1\right)}}}\\

\mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 1.7e-156

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

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

    if 1.7e-156 < B < 1e8

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

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

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

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

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

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

      \[\leadsto \frac{1}{\frac{C \cdot \left(A \cdot 4\right) - B \cdot B}{\sqrt{\color{blue}{\left(4 \cdot \left(C \cdot F\right)\right)} \cdot \mathsf{fma}\left(C \cdot -4, A, B \cdot B\right)}}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

    if 1e8 < B < 7.0000000000000003e39

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

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

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

    if 7.0000000000000003e39 < B < 8.0000000000000002e133

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      4. mult-flipN/A

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

        \[\leadsto \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \cdot \color{blue}{\frac{1}{A}} \]
      6. *-commutativeN/A

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

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

        \[\leadsto \left(\sqrt{-16 \cdot \left(A \cdot F\right)} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      9. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      10. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      11. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      12. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      13. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      14. lower-/.f6420.1%

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot 0.25\right) \cdot \frac{1}{\color{blue}{A}} \]
    6. Applied rewrites20.1%

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

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

        \[\leadsto \frac{1}{A} \cdot \color{blue}{\left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(A \cdot F\right) \cdot -16}\right) \]
      9. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{A} \cdot \frac{1}{4}\right) \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
      12. *-commutativeN/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{\color{blue}{-16 \cdot \left(A \cdot F\right)}} \]
      13. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{-16 \cdot \color{blue}{\left(A \cdot F\right)}} \]
      14. mult-flip-revN/A

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(A \cdot F\right) \cdot -16} \]
      17. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      20. lift-sqrt.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      21. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      22. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      23. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      24. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      25. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      26. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
    8. Applied rewrites20.1%

      \[\leadsto \frac{0.25}{A} \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
    9. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      4. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(-16 \cdot A\right) \cdot F} \]
      5. sqrt-prodN/A

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

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
      9. lower-unsound-sqrt.f6418.6%

        \[\leadsto \frac{0.25}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
    10. Applied rewrites18.6%

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

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

      \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 4: 48.6% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(A, C\right) - \mathsf{min}\left(A, C\right)\\ t_1 := {B}^{2} - \left(4 \cdot \mathsf{min}\left(A, C\right)\right) \cdot \mathsf{max}\left(A, C\right)\\ t_2 := \frac{-\sqrt{\left(2 \cdot \left(t\_1 \cdot F\right)\right) \cdot \left(\left(\mathsf{min}\left(A, C\right) + \mathsf{max}\left(A, C\right)\right) + \sqrt{{\left(\mathsf{min}\left(A, C\right) - \mathsf{max}\left(A, C\right)\right)}^{2} + {B}^{2}}\right)}}{t\_1}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{\mathsf{min}\left(A, C\right) \cdot -16} \cdot \sqrt{F}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-199}:\\ \;\;\;\;\frac{1}{\frac{\mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - B \cdot B}{\sqrt{\left(\left(\mathsf{max}\left(A, C\right) + \mathsf{min}\left(A, C\right)\right) + \sqrt{\mathsf{fma}\left(t\_0, t\_0, B \cdot B\right)}\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4 \cdot \mathsf{min}\left(A, C\right), \mathsf{max}\left(A, C\right), B \cdot B\right)\right)}}}\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;-0.25 \cdot \sqrt{-16 \cdot \frac{F}{\mathsf{min}\left(A, C\right)}}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot F} \cdot \sqrt{\mathsf{min}\left(A, C\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{B} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (let* ((t_0 (- (fmax A C) (fmin A C)))
       (t_1 (- (pow B 2.0) (* (* 4.0 (fmin A C)) (fmax A C))))
       (t_2
        (/
         (-
          (sqrt
           (*
            (* 2.0 (* t_1 F))
            (+
             (+ (fmin A C) (fmax A C))
             (sqrt
              (+ (pow (- (fmin A C) (fmax A C)) 2.0) (pow B 2.0)))))))
         t_1)))
  (if (<= t_2 (- INFINITY))
    (* 0.25 (/ (* (sqrt (* (fmin A C) -16.0)) (sqrt F)) (fmin A C)))
    (if (<= t_2 -1e-199)
      (/
       1.0
       (/
        (- (* (fmax A C) (* (fmin A C) 4.0)) (* B B))
        (sqrt
         (*
          (+ (+ (fmax A C) (fmin A C)) (sqrt (fma t_0 t_0 (* B B))))
          (* (+ F F) (fma (* -4.0 (fmin A C)) (fmax A C) (* B B)))))))
      (if (<= t_2 0.0)
        (* -0.25 (sqrt (* -16.0 (/ F (fmin A C)))))
        (if (<= t_2 INFINITY)
          (*
           (/ 0.25 (fmin A C))
           (* (sqrt (* -16.0 F)) (sqrt (fmin A C))))
          (- (sqrt (fabs (* (/ -2.0 B) F))))))))))
double code(double A, double B, double C, double F) {
	double t_0 = fmax(A, C) - fmin(A, C);
	double t_1 = pow(B, 2.0) - ((4.0 * fmin(A, C)) * fmax(A, C));
	double t_2 = -sqrt(((2.0 * (t_1 * F)) * ((fmin(A, C) + fmax(A, C)) + sqrt((pow((fmin(A, C) - fmax(A, C)), 2.0) + pow(B, 2.0)))))) / t_1;
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = 0.25 * ((sqrt((fmin(A, C) * -16.0)) * sqrt(F)) / fmin(A, C));
	} else if (t_2 <= -1e-199) {
		tmp = 1.0 / (((fmax(A, C) * (fmin(A, C) * 4.0)) - (B * B)) / sqrt((((fmax(A, C) + fmin(A, C)) + sqrt(fma(t_0, t_0, (B * B)))) * ((F + F) * fma((-4.0 * fmin(A, C)), fmax(A, C), (B * B))))));
	} else if (t_2 <= 0.0) {
		tmp = -0.25 * sqrt((-16.0 * (F / fmin(A, C))));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = (0.25 / fmin(A, C)) * (sqrt((-16.0 * F)) * sqrt(fmin(A, C)));
	} else {
		tmp = -sqrt(fabs(((-2.0 / B) * F)));
	}
	return tmp;
}
function code(A, B, C, F)
	t_0 = Float64(fmax(A, C) - fmin(A, C))
	t_1 = Float64((B ^ 2.0) - Float64(Float64(4.0 * fmin(A, C)) * fmax(A, C)))
	t_2 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(fmin(A, C) + fmax(A, C)) + sqrt(Float64((Float64(fmin(A, C) - fmax(A, C)) ^ 2.0) + (B ^ 2.0))))))) / t_1)
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(0.25 * Float64(Float64(sqrt(Float64(fmin(A, C) * -16.0)) * sqrt(F)) / fmin(A, C)));
	elseif (t_2 <= -1e-199)
		tmp = Float64(1.0 / Float64(Float64(Float64(fmax(A, C) * Float64(fmin(A, C) * 4.0)) - Float64(B * B)) / sqrt(Float64(Float64(Float64(fmax(A, C) + fmin(A, C)) + sqrt(fma(t_0, t_0, Float64(B * B)))) * Float64(Float64(F + F) * fma(Float64(-4.0 * fmin(A, C)), fmax(A, C), Float64(B * B)))))));
	elseif (t_2 <= 0.0)
		tmp = Float64(-0.25 * sqrt(Float64(-16.0 * Float64(F / fmin(A, C)))));
	elseif (t_2 <= Inf)
		tmp = Float64(Float64(0.25 / fmin(A, C)) * Float64(sqrt(Float64(-16.0 * F)) * sqrt(fmin(A, C))));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / B) * F))));
	end
	return tmp
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Max[A, C], $MachinePrecision] - N[Min[A, C], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[Max[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Min[A, C], $MachinePrecision] + N[Max[A, C], $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(N[Min[A, C], $MachinePrecision] - N[Max[A, C], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(0.25 * N[(N[(N[Sqrt[N[(N[Min[A, C], $MachinePrecision] * -16.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-199], N[(1.0 / N[(N[(N[(N[Max[A, C], $MachinePrecision] * N[(N[Min[A, C], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] - N[(B * B), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[Max[A, C], $MachinePrecision] + N[Min[A, C], $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(t$95$0 * t$95$0 + N[(B * B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(F + F), $MachinePrecision] * N[(N[(-4.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[Max[A, C], $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(-0.25 * N[Sqrt[N[(-16.0 * N[(F / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(0.25 / N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(-16.0 * F), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Min[A, C], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / B), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(A, C\right) - \mathsf{min}\left(A, C\right)\\
t_1 := {B}^{2} - \left(4 \cdot \mathsf{min}\left(A, C\right)\right) \cdot \mathsf{max}\left(A, C\right)\\
t_2 := \frac{-\sqrt{\left(2 \cdot \left(t\_1 \cdot F\right)\right) \cdot \left(\left(\mathsf{min}\left(A, C\right) + \mathsf{max}\left(A, C\right)\right) + \sqrt{{\left(\mathsf{min}\left(A, C\right) - \mathsf{max}\left(A, C\right)\right)}^{2} + {B}^{2}}\right)}}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{\mathsf{min}\left(A, C\right) \cdot -16} \cdot \sqrt{F}}{\mathsf{min}\left(A, C\right)}\\

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-199}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - B \cdot B}{\sqrt{\left(\left(\mathsf{max}\left(A, C\right) + \mathsf{min}\left(A, C\right)\right) + \sqrt{\mathsf{fma}\left(t\_0, t\_0, B \cdot B\right)}\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4 \cdot \mathsf{min}\left(A, C\right), \mathsf{max}\left(A, C\right), B \cdot B\right)\right)}}}\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;-0.25 \cdot \sqrt{-16 \cdot \frac{F}{\mathsf{min}\left(A, C\right)}}\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot F} \cdot \sqrt{\mathsf{min}\left(A, C\right)}\right)\\

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -inf.0

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. associate-*r*N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{\left(-16 \cdot A\right) \cdot F}}{A} \]
      5. sqrt-prodN/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot A} \cdot \sqrt{F}}{A} \]
      6. lower-unsound-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot A} \cdot \sqrt{F}}{A} \]
      7. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot A} \cdot \sqrt{F}}{A} \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]
      10. lower-unsound-sqrt.f6418.7%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]
    6. Applied rewrites18.7%

      \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]

    if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -9.9999999999999998e-200

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

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

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

    if -9.9999999999999998e-200 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -0.0

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Taylor expanded in A around -inf

      \[\leadsto \frac{-1}{4} \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{A}}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      4. lower-/.f6415.0%

        \[\leadsto -0.25 \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
    7. Applied rewrites15.0%

      \[\leadsto -0.25 \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{A}}} \]

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

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      4. mult-flipN/A

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

        \[\leadsto \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \cdot \color{blue}{\frac{1}{A}} \]
      6. *-commutativeN/A

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

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

        \[\leadsto \left(\sqrt{-16 \cdot \left(A \cdot F\right)} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      9. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      10. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      11. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      12. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      13. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      14. lower-/.f6420.1%

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot 0.25\right) \cdot \frac{1}{\color{blue}{A}} \]
    6. Applied rewrites20.1%

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

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

        \[\leadsto \frac{1}{A} \cdot \color{blue}{\left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(A \cdot F\right) \cdot -16}\right) \]
      9. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{A} \cdot \frac{1}{4}\right) \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
      12. *-commutativeN/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{\color{blue}{-16 \cdot \left(A \cdot F\right)}} \]
      13. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{-16 \cdot \color{blue}{\left(A \cdot F\right)}} \]
      14. mult-flip-revN/A

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(A \cdot F\right) \cdot -16} \]
      17. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      20. lift-sqrt.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      21. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      22. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      23. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      24. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      25. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      26. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
    8. Applied rewrites20.1%

      \[\leadsto \frac{0.25}{A} \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
    9. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      5. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(-16 \cdot F\right) \cdot A} \]
      6. sqrt-prodN/A

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

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \left(\sqrt{-16 \cdot F} \cdot \sqrt{A}\right) \]
      10. lower-unsound-sqrt.f646.4%

        \[\leadsto \frac{0.25}{A} \cdot \left(\sqrt{-16 \cdot F} \cdot \sqrt{A}\right) \]
    10. Applied rewrites6.4%

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

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

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

      \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 5: 47.2% accurate, 1.1× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(A, C\right) - \mathsf{min}\left(A, C\right)\\ t_1 := \left|B\right| \cdot \left|B\right|\\ t_2 := \mathsf{fma}\left(\mathsf{max}\left(A, C\right) \cdot -4, \mathsf{min}\left(A, C\right), t\_1\right)\\ t_3 := \mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - t\_1\\ \mathbf{if}\;\left|B\right| \leq 1.7 \cdot 10^{-156}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{elif}\;\left|B\right| \leq 100000000:\\ \;\;\;\;\frac{1}{\frac{t\_3}{\sqrt{\left(4 \cdot \left(\mathsf{max}\left(A, C\right) \cdot F\right)\right) \cdot t\_2}}}\\ \mathbf{elif}\;\left|B\right| \leq 7 \cdot 10^{+39}:\\ \;\;\;\;\frac{\sqrt{\left(\left(\sqrt{\mathsf{fma}\left(t\_0, t\_0, t\_1\right)} + \left(\mathsf{max}\left(A, C\right) + \mathsf{min}\left(A, C\right)\right)\right) \cdot \left(F + F\right)\right) \cdot t\_2}}{t\_3}\\ \mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (let* ((t_0 (- (fmax A C) (fmin A C)))
       (t_1 (* (fabs B) (fabs B)))
       (t_2 (fma (* (fmax A C) -4.0) (fmin A C) t_1))
       (t_3 (- (* (fmax A C) (* (fmin A C) 4.0)) t_1)))
  (if (<= (fabs B) 1.7e-156)
    (* 0.25 (/ (sqrt (* -16.0 (* (fmin A C) F))) (fmin A C)))
    (if (<= (fabs B) 100000000.0)
      (/ 1.0 (/ t_3 (sqrt (* (* 4.0 (* (fmax A C) F)) t_2))))
      (if (<= (fabs B) 7e+39)
        (/
         (sqrt
          (*
           (*
            (+ (sqrt (fma t_0 t_0 t_1)) (+ (fmax A C) (fmin A C)))
            (+ F F))
           t_2))
         t_3)
        (if (<= (fabs B) 8e+133)
          (*
           (/ 0.25 (fmin A C))
           (* (sqrt (* -16.0 (fmin A C))) (sqrt F)))
          (- (sqrt (fabs (* (/ -2.0 (fabs B)) F))))))))))
double code(double A, double B, double C, double F) {
	double t_0 = fmax(A, C) - fmin(A, C);
	double t_1 = fabs(B) * fabs(B);
	double t_2 = fma((fmax(A, C) * -4.0), fmin(A, C), t_1);
	double t_3 = (fmax(A, C) * (fmin(A, C) * 4.0)) - t_1;
	double tmp;
	if (fabs(B) <= 1.7e-156) {
		tmp = 0.25 * (sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (fabs(B) <= 100000000.0) {
		tmp = 1.0 / (t_3 / sqrt(((4.0 * (fmax(A, C) * F)) * t_2)));
	} else if (fabs(B) <= 7e+39) {
		tmp = sqrt((((sqrt(fma(t_0, t_0, t_1)) + (fmax(A, C) + fmin(A, C))) * (F + F)) * t_2)) / t_3;
	} else if (fabs(B) <= 8e+133) {
		tmp = (0.25 / fmin(A, C)) * (sqrt((-16.0 * fmin(A, C))) * sqrt(F));
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
function code(A, B, C, F)
	t_0 = Float64(fmax(A, C) - fmin(A, C))
	t_1 = Float64(abs(B) * abs(B))
	t_2 = fma(Float64(fmax(A, C) * -4.0), fmin(A, C), t_1)
	t_3 = Float64(Float64(fmax(A, C) * Float64(fmin(A, C) * 4.0)) - t_1)
	tmp = 0.0
	if (abs(B) <= 1.7e-156)
		tmp = Float64(0.25 * Float64(sqrt(Float64(-16.0 * Float64(fmin(A, C) * F))) / fmin(A, C)));
	elseif (abs(B) <= 100000000.0)
		tmp = Float64(1.0 / Float64(t_3 / sqrt(Float64(Float64(4.0 * Float64(fmax(A, C) * F)) * t_2))));
	elseif (abs(B) <= 7e+39)
		tmp = Float64(sqrt(Float64(Float64(Float64(sqrt(fma(t_0, t_0, t_1)) + Float64(fmax(A, C) + fmin(A, C))) * Float64(F + F)) * t_2)) / t_3);
	elseif (abs(B) <= 8e+133)
		tmp = Float64(Float64(0.25 / fmin(A, C)) * Float64(sqrt(Float64(-16.0 * fmin(A, C))) * sqrt(F)));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Max[A, C], $MachinePrecision] - N[Min[A, C], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[B], $MachinePrecision] * N[Abs[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Max[A, C], $MachinePrecision] * -4.0), $MachinePrecision] * N[Min[A, C], $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Max[A, C], $MachinePrecision] * N[(N[Min[A, C], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[N[Abs[B], $MachinePrecision], 1.7e-156], N[(0.25 * N[(N[Sqrt[N[(-16.0 * N[(N[Min[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 100000000.0], N[(1.0 / N[(t$95$3 / N[Sqrt[N[(N[(4.0 * N[(N[Max[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 7e+39], N[(N[Sqrt[N[(N[(N[(N[Sqrt[N[(t$95$0 * t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision] + N[(N[Max[A, C], $MachinePrecision] + N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F + F), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], N[(N[(0.25 / N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(-16.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]]]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(A, C\right) - \mathsf{min}\left(A, C\right)\\
t_1 := \left|B\right| \cdot \left|B\right|\\
t_2 := \mathsf{fma}\left(\mathsf{max}\left(A, C\right) \cdot -4, \mathsf{min}\left(A, C\right), t\_1\right)\\
t_3 := \mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - t\_1\\
\mathbf{if}\;\left|B\right| \leq 1.7 \cdot 10^{-156}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\

\mathbf{elif}\;\left|B\right| \leq 100000000:\\
\;\;\;\;\frac{1}{\frac{t\_3}{\sqrt{\left(4 \cdot \left(\mathsf{max}\left(A, C\right) \cdot F\right)\right) \cdot t\_2}}}\\

\mathbf{elif}\;\left|B\right| \leq 7 \cdot 10^{+39}:\\
\;\;\;\;\frac{\sqrt{\left(\left(\sqrt{\mathsf{fma}\left(t\_0, t\_0, t\_1\right)} + \left(\mathsf{max}\left(A, C\right) + \mathsf{min}\left(A, C\right)\right)\right) \cdot \left(F + F\right)\right) \cdot t\_2}}{t\_3}\\

\mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 1.7e-156

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

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

    if 1.7e-156 < B < 1e8

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

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

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

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

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

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

      \[\leadsto \frac{1}{\frac{C \cdot \left(A \cdot 4\right) - B \cdot B}{\sqrt{\color{blue}{\left(4 \cdot \left(C \cdot F\right)\right)} \cdot \mathsf{fma}\left(C \cdot -4, A, B \cdot B\right)}}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

    if 1e8 < B < 7.0000000000000003e39

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

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

    if 7.0000000000000003e39 < B < 8.0000000000000002e133

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      4. mult-flipN/A

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

        \[\leadsto \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \cdot \color{blue}{\frac{1}{A}} \]
      6. *-commutativeN/A

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

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

        \[\leadsto \left(\sqrt{-16 \cdot \left(A \cdot F\right)} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      9. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      10. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      11. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      12. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      13. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      14. lower-/.f6420.1%

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot 0.25\right) \cdot \frac{1}{\color{blue}{A}} \]
    6. Applied rewrites20.1%

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

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

        \[\leadsto \frac{1}{A} \cdot \color{blue}{\left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(A \cdot F\right) \cdot -16}\right) \]
      9. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{A} \cdot \frac{1}{4}\right) \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
      12. *-commutativeN/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{\color{blue}{-16 \cdot \left(A \cdot F\right)}} \]
      13. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{-16 \cdot \color{blue}{\left(A \cdot F\right)}} \]
      14. mult-flip-revN/A

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(A \cdot F\right) \cdot -16} \]
      17. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      20. lift-sqrt.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      21. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      22. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      23. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      24. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      25. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      26. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
    8. Applied rewrites20.1%

      \[\leadsto \frac{0.25}{A} \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
    9. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      4. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(-16 \cdot A\right) \cdot F} \]
      5. sqrt-prodN/A

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

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
      9. lower-unsound-sqrt.f6418.6%

        \[\leadsto \frac{0.25}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
    10. Applied rewrites18.6%

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

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

      \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 6: 46.6% accurate, 1.6× speedup?

\[\begin{array}{l} t_0 := \left|B\right| \cdot \left|B\right|\\ \mathbf{if}\;\left|B\right| \leq 1.7 \cdot 10^{-156}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{elif}\;\left|B\right| \leq 1.1 \cdot 10^{-37}:\\ \;\;\;\;\frac{1}{\frac{\mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - t\_0}{\sqrt{\left(4 \cdot \left(\mathsf{max}\left(A, C\right) \cdot F\right)\right) \cdot \mathsf{fma}\left(\mathsf{max}\left(A, C\right) \cdot -4, \mathsf{min}\left(A, C\right), t\_0\right)}}}\\ \mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (let* ((t_0 (* (fabs B) (fabs B))))
  (if (<= (fabs B) 1.7e-156)
    (* 0.25 (/ (sqrt (* -16.0 (* (fmin A C) F))) (fmin A C)))
    (if (<= (fabs B) 1.1e-37)
      (/
       1.0
       (/
        (- (* (fmax A C) (* (fmin A C) 4.0)) t_0)
        (sqrt
         (*
          (* 4.0 (* (fmax A C) F))
          (fma (* (fmax A C) -4.0) (fmin A C) t_0)))))
      (if (<= (fabs B) 8e+133)
        (*
         (/ 0.25 (fmin A C))
         (* (sqrt (* -16.0 (fmin A C))) (sqrt F)))
        (- (sqrt (fabs (* (/ -2.0 (fabs B)) F)))))))))
double code(double A, double B, double C, double F) {
	double t_0 = fabs(B) * fabs(B);
	double tmp;
	if (fabs(B) <= 1.7e-156) {
		tmp = 0.25 * (sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (fabs(B) <= 1.1e-37) {
		tmp = 1.0 / (((fmax(A, C) * (fmin(A, C) * 4.0)) - t_0) / sqrt(((4.0 * (fmax(A, C) * F)) * fma((fmax(A, C) * -4.0), fmin(A, C), t_0))));
	} else if (fabs(B) <= 8e+133) {
		tmp = (0.25 / fmin(A, C)) * (sqrt((-16.0 * fmin(A, C))) * sqrt(F));
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
function code(A, B, C, F)
	t_0 = Float64(abs(B) * abs(B))
	tmp = 0.0
	if (abs(B) <= 1.7e-156)
		tmp = Float64(0.25 * Float64(sqrt(Float64(-16.0 * Float64(fmin(A, C) * F))) / fmin(A, C)));
	elseif (abs(B) <= 1.1e-37)
		tmp = Float64(1.0 / Float64(Float64(Float64(fmax(A, C) * Float64(fmin(A, C) * 4.0)) - t_0) / sqrt(Float64(Float64(4.0 * Float64(fmax(A, C) * F)) * fma(Float64(fmax(A, C) * -4.0), fmin(A, C), t_0)))));
	elseif (abs(B) <= 8e+133)
		tmp = Float64(Float64(0.25 / fmin(A, C)) * Float64(sqrt(Float64(-16.0 * fmin(A, C))) * sqrt(F)));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Abs[B], $MachinePrecision] * N[Abs[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[B], $MachinePrecision], 1.7e-156], N[(0.25 * N[(N[Sqrt[N[(-16.0 * N[(N[Min[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 1.1e-37], N[(1.0 / N[(N[(N[(N[Max[A, C], $MachinePrecision] * N[(N[Min[A, C], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sqrt[N[(N[(4.0 * N[(N[Max[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Max[A, C], $MachinePrecision] * -4.0), $MachinePrecision] * N[Min[A, C], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], N[(N[(0.25 / N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(-16.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]]]
\begin{array}{l}
t_0 := \left|B\right| \cdot \left|B\right|\\
\mathbf{if}\;\left|B\right| \leq 1.7 \cdot 10^{-156}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\

\mathbf{elif}\;\left|B\right| \leq 1.1 \cdot 10^{-37}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{max}\left(A, C\right) \cdot \left(\mathsf{min}\left(A, C\right) \cdot 4\right) - t\_0}{\sqrt{\left(4 \cdot \left(\mathsf{max}\left(A, C\right) \cdot F\right)\right) \cdot \mathsf{fma}\left(\mathsf{max}\left(A, C\right) \cdot -4, \mathsf{min}\left(A, C\right), t\_0\right)}}}\\

\mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 1.7e-156

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

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

    if 1.7e-156 < B < 1.1e-37

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

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

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

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

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

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

      \[\leadsto \frac{1}{\frac{C \cdot \left(A \cdot 4\right) - B \cdot B}{\sqrt{\color{blue}{\left(4 \cdot \left(C \cdot F\right)\right)} \cdot \mathsf{fma}\left(C \cdot -4, A, B \cdot B\right)}}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

    if 1.1e-37 < B < 8.0000000000000002e133

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      4. mult-flipN/A

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

        \[\leadsto \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \cdot \color{blue}{\frac{1}{A}} \]
      6. *-commutativeN/A

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

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

        \[\leadsto \left(\sqrt{-16 \cdot \left(A \cdot F\right)} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      9. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      10. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      11. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      12. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      13. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      14. lower-/.f6420.1%

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot 0.25\right) \cdot \frac{1}{\color{blue}{A}} \]
    6. Applied rewrites20.1%

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

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

        \[\leadsto \frac{1}{A} \cdot \color{blue}{\left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(A \cdot F\right) \cdot -16}\right) \]
      9. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{A} \cdot \frac{1}{4}\right) \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
      12. *-commutativeN/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{\color{blue}{-16 \cdot \left(A \cdot F\right)}} \]
      13. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{-16 \cdot \color{blue}{\left(A \cdot F\right)}} \]
      14. mult-flip-revN/A

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(A \cdot F\right) \cdot -16} \]
      17. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      20. lift-sqrt.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      21. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      22. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      23. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      24. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      25. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      26. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
    8. Applied rewrites20.1%

      \[\leadsto \frac{0.25}{A} \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
    9. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      4. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(-16 \cdot A\right) \cdot F} \]
      5. sqrt-prodN/A

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

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
      9. lower-unsound-sqrt.f6418.6%

        \[\leadsto \frac{0.25}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
    10. Applied rewrites18.6%

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

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

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

Alternative 7: 46.5% accurate, 3.1× speedup?

\[\begin{array}{l} \mathbf{if}\;\mathsf{min}\left(A, C\right) \leq -3.2 \cdot 10^{-232}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{\mathsf{min}\left(A, C\right) \cdot -16} \cdot \sqrt{F}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{elif}\;\mathsf{min}\left(A, C\right) \leq 8.5 \cdot 10^{-293}:\\ \;\;\;\;-\sqrt{\left|-2 \cdot \frac{F}{B}\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot F} \cdot \sqrt{\mathsf{min}\left(A, C\right)}\right)\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (if (<= (fmin A C) -3.2e-232)
  (* 0.25 (/ (* (sqrt (* (fmin A C) -16.0)) (sqrt F)) (fmin A C)))
  (if (<= (fmin A C) 8.5e-293)
    (- (sqrt (fabs (* -2.0 (/ F B)))))
    (* (/ 0.25 (fmin A C)) (* (sqrt (* -16.0 F)) (sqrt (fmin A C)))))))
double code(double A, double B, double C, double F) {
	double tmp;
	if (fmin(A, C) <= -3.2e-232) {
		tmp = 0.25 * ((sqrt((fmin(A, C) * -16.0)) * sqrt(F)) / fmin(A, C));
	} else if (fmin(A, C) <= 8.5e-293) {
		tmp = -sqrt(fabs((-2.0 * (F / B))));
	} else {
		tmp = (0.25 / fmin(A, C)) * (sqrt((-16.0 * F)) * sqrt(fmin(A, C)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (fmin(a, c) <= (-3.2d-232)) then
        tmp = 0.25d0 * ((sqrt((fmin(a, c) * (-16.0d0))) * sqrt(f)) / fmin(a, c))
    else if (fmin(a, c) <= 8.5d-293) then
        tmp = -sqrt(abs(((-2.0d0) * (f / b))))
    else
        tmp = (0.25d0 / fmin(a, c)) * (sqrt(((-16.0d0) * f)) * sqrt(fmin(a, c)))
    end if
    code = tmp
end function
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (fmin(A, C) <= -3.2e-232) {
		tmp = 0.25 * ((Math.sqrt((fmin(A, C) * -16.0)) * Math.sqrt(F)) / fmin(A, C));
	} else if (fmin(A, C) <= 8.5e-293) {
		tmp = -Math.sqrt(Math.abs((-2.0 * (F / B))));
	} else {
		tmp = (0.25 / fmin(A, C)) * (Math.sqrt((-16.0 * F)) * Math.sqrt(fmin(A, C)));
	}
	return tmp;
}
def code(A, B, C, F):
	tmp = 0
	if fmin(A, C) <= -3.2e-232:
		tmp = 0.25 * ((math.sqrt((fmin(A, C) * -16.0)) * math.sqrt(F)) / fmin(A, C))
	elif fmin(A, C) <= 8.5e-293:
		tmp = -math.sqrt(math.fabs((-2.0 * (F / B))))
	else:
		tmp = (0.25 / fmin(A, C)) * (math.sqrt((-16.0 * F)) * math.sqrt(fmin(A, C)))
	return tmp
function code(A, B, C, F)
	tmp = 0.0
	if (fmin(A, C) <= -3.2e-232)
		tmp = Float64(0.25 * Float64(Float64(sqrt(Float64(fmin(A, C) * -16.0)) * sqrt(F)) / fmin(A, C)));
	elseif (fmin(A, C) <= 8.5e-293)
		tmp = Float64(-sqrt(abs(Float64(-2.0 * Float64(F / B)))));
	else
		tmp = Float64(Float64(0.25 / fmin(A, C)) * Float64(sqrt(Float64(-16.0 * F)) * sqrt(fmin(A, C))));
	end
	return tmp
end
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (min(A, C) <= -3.2e-232)
		tmp = 0.25 * ((sqrt((min(A, C) * -16.0)) * sqrt(F)) / min(A, C));
	elseif (min(A, C) <= 8.5e-293)
		tmp = -sqrt(abs((-2.0 * (F / B))));
	else
		tmp = (0.25 / min(A, C)) * (sqrt((-16.0 * F)) * sqrt(min(A, C)));
	end
	tmp_2 = tmp;
end
code[A_, B_, C_, F_] := If[LessEqual[N[Min[A, C], $MachinePrecision], -3.2e-232], N[(0.25 * N[(N[(N[Sqrt[N[(N[Min[A, C], $MachinePrecision] * -16.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[A, C], $MachinePrecision], 8.5e-293], (-N[Sqrt[N[Abs[N[(-2.0 * N[(F / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), N[(N[(0.25 / N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(-16.0 * F), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Min[A, C], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(A, C\right) \leq -3.2 \cdot 10^{-232}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{\mathsf{min}\left(A, C\right) \cdot -16} \cdot \sqrt{F}}{\mathsf{min}\left(A, C\right)}\\

\mathbf{elif}\;\mathsf{min}\left(A, C\right) \leq 8.5 \cdot 10^{-293}:\\
\;\;\;\;-\sqrt{\left|-2 \cdot \frac{F}{B}\right|}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot F} \cdot \sqrt{\mathsf{min}\left(A, C\right)}\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -3.1999999999999999e-232

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. associate-*r*N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{\left(-16 \cdot A\right) \cdot F}}{A} \]
      5. sqrt-prodN/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot A} \cdot \sqrt{F}}{A} \]
      6. lower-unsound-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot A} \cdot \sqrt{F}}{A} \]
      7. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot A} \cdot \sqrt{F}}{A} \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]
      10. lower-unsound-sqrt.f6418.7%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]
    6. Applied rewrites18.7%

      \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]

    if -3.1999999999999999e-232 < A < 8.5000000000000004e-293

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{\frac{F}{B} \cdot -2}\right| \cdot \left|\sqrt{\frac{F}{B} \cdot -2}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|\frac{F}{B} \cdot -2\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{F}{B} \cdot -2\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|\frac{F}{B} \cdot -2\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|-2 \cdot \frac{F}{B}\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|-2 \cdot \frac{F}{B}\right|} \]
    8. Applied rewrites26.7%

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

    if 8.5000000000000004e-293 < A

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      4. mult-flipN/A

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

        \[\leadsto \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \cdot \color{blue}{\frac{1}{A}} \]
      6. *-commutativeN/A

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

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

        \[\leadsto \left(\sqrt{-16 \cdot \left(A \cdot F\right)} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      9. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      10. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      11. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      12. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      13. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      14. lower-/.f6420.1%

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot 0.25\right) \cdot \frac{1}{\color{blue}{A}} \]
    6. Applied rewrites20.1%

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

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

        \[\leadsto \frac{1}{A} \cdot \color{blue}{\left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(A \cdot F\right) \cdot -16}\right) \]
      9. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{A} \cdot \frac{1}{4}\right) \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
      12. *-commutativeN/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{\color{blue}{-16 \cdot \left(A \cdot F\right)}} \]
      13. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{-16 \cdot \color{blue}{\left(A \cdot F\right)}} \]
      14. mult-flip-revN/A

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(A \cdot F\right) \cdot -16} \]
      17. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      20. lift-sqrt.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      21. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      22. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      23. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      24. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      25. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      26. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
    8. Applied rewrites20.1%

      \[\leadsto \frac{0.25}{A} \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
    9. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      5. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(-16 \cdot F\right) \cdot A} \]
      6. sqrt-prodN/A

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

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \left(\sqrt{-16 \cdot F} \cdot \sqrt{A}\right) \]
      10. lower-unsound-sqrt.f646.4%

        \[\leadsto \frac{0.25}{A} \cdot \left(\sqrt{-16 \cdot F} \cdot \sqrt{A}\right) \]
    10. Applied rewrites6.4%

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

Alternative 8: 46.5% accurate, 3.4× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|B\right| \leq 3.6 \cdot 10^{+30}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (if (<= (fabs B) 3.6e+30)
  (* 0.25 (/ (sqrt (* -16.0 (* (fmin A C) F))) (fmin A C)))
  (if (<= (fabs B) 8e+133)
    (* (/ 0.25 (fmin A C)) (* (sqrt (* -16.0 (fmin A C))) (sqrt F)))
    (- (sqrt (fabs (* (/ -2.0 (fabs B)) F)))))))
double code(double A, double B, double C, double F) {
	double tmp;
	if (fabs(B) <= 3.6e+30) {
		tmp = 0.25 * (sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (fabs(B) <= 8e+133) {
		tmp = (0.25 / fmin(A, C)) * (sqrt((-16.0 * fmin(A, C))) * sqrt(F));
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (abs(b) <= 3.6d+30) then
        tmp = 0.25d0 * (sqrt(((-16.0d0) * (fmin(a, c) * f))) / fmin(a, c))
    else if (abs(b) <= 8d+133) then
        tmp = (0.25d0 / fmin(a, c)) * (sqrt(((-16.0d0) * fmin(a, c))) * sqrt(f))
    else
        tmp = -sqrt(abs((((-2.0d0) / abs(b)) * f)))
    end if
    code = tmp
end function
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (Math.abs(B) <= 3.6e+30) {
		tmp = 0.25 * (Math.sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (Math.abs(B) <= 8e+133) {
		tmp = (0.25 / fmin(A, C)) * (Math.sqrt((-16.0 * fmin(A, C))) * Math.sqrt(F));
	} else {
		tmp = -Math.sqrt(Math.abs(((-2.0 / Math.abs(B)) * F)));
	}
	return tmp;
}
def code(A, B, C, F):
	tmp = 0
	if math.fabs(B) <= 3.6e+30:
		tmp = 0.25 * (math.sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C))
	elif math.fabs(B) <= 8e+133:
		tmp = (0.25 / fmin(A, C)) * (math.sqrt((-16.0 * fmin(A, C))) * math.sqrt(F))
	else:
		tmp = -math.sqrt(math.fabs(((-2.0 / math.fabs(B)) * F)))
	return tmp
function code(A, B, C, F)
	tmp = 0.0
	if (abs(B) <= 3.6e+30)
		tmp = Float64(0.25 * Float64(sqrt(Float64(-16.0 * Float64(fmin(A, C) * F))) / fmin(A, C)));
	elseif (abs(B) <= 8e+133)
		tmp = Float64(Float64(0.25 / fmin(A, C)) * Float64(sqrt(Float64(-16.0 * fmin(A, C))) * sqrt(F)));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (abs(B) <= 3.6e+30)
		tmp = 0.25 * (sqrt((-16.0 * (min(A, C) * F))) / min(A, C));
	elseif (abs(B) <= 8e+133)
		tmp = (0.25 / min(A, C)) * (sqrt((-16.0 * min(A, C))) * sqrt(F));
	else
		tmp = -sqrt(abs(((-2.0 / abs(B)) * F)));
	end
	tmp_2 = tmp;
end
code[A_, B_, C_, F_] := If[LessEqual[N[Abs[B], $MachinePrecision], 3.6e+30], N[(0.25 * N[(N[Sqrt[N[(-16.0 * N[(N[Min[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], N[(N[(0.25 / N[Min[A, C], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(-16.0 * N[Min[A, C], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 3.6 \cdot 10^{+30}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\

\mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;\frac{0.25}{\mathsf{min}\left(A, C\right)} \cdot \left(\sqrt{-16 \cdot \mathsf{min}\left(A, C\right)} \cdot \sqrt{F}\right)\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 3.6000000000000002e30

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

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

    if 3.6000000000000002e30 < B < 8.0000000000000002e133

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
      4. mult-flipN/A

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

        \[\leadsto \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \cdot \color{blue}{\frac{1}{A}} \]
      6. *-commutativeN/A

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

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

        \[\leadsto \left(\sqrt{-16 \cdot \left(A \cdot F\right)} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      9. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      10. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      11. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\left(A \cdot F\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      12. *-commutativeN/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      13. lower-*.f64N/A

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right) \cdot \frac{1}{A} \]
      14. lower-/.f6420.1%

        \[\leadsto \left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot 0.25\right) \cdot \frac{1}{\color{blue}{A}} \]
    6. Applied rewrites20.1%

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

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

        \[\leadsto \frac{1}{A} \cdot \color{blue}{\left(\sqrt{\left(F \cdot A\right) \cdot -16} \cdot \frac{1}{4}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(F \cdot A\right) \cdot -16}\right) \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{\left(A \cdot F\right) \cdot -16}\right) \]
      9. *-commutativeN/A

        \[\leadsto \frac{1}{A} \cdot \left(\frac{1}{4} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right) \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{A} \cdot \frac{1}{4}\right) \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
      12. *-commutativeN/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{\color{blue}{-16 \cdot \left(A \cdot F\right)}} \]
      13. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \frac{1}{A}\right) \cdot \sqrt{-16 \cdot \color{blue}{\left(A \cdot F\right)}} \]
      14. mult-flip-revN/A

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(A \cdot F\right) \cdot -16} \]
      17. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      20. lift-sqrt.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      21. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(F \cdot A\right) \cdot -16} \]
      22. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      23. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      24. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(F \cdot A\right)} \]
      25. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      26. lower-*.f6420.1%

        \[\leadsto \frac{0.25}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
    8. Applied rewrites20.1%

      \[\leadsto \frac{0.25}{A} \cdot \color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}} \]
    9. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)} \]
      4. associate-*r*N/A

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \sqrt{\left(-16 \cdot A\right) \cdot F} \]
      5. sqrt-prodN/A

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

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

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

        \[\leadsto \frac{\frac{1}{4}}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
      9. lower-unsound-sqrt.f6418.6%

        \[\leadsto \frac{0.25}{A} \cdot \left(\sqrt{-16 \cdot A} \cdot \sqrt{F}\right) \]
    10. Applied rewrites18.6%

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

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

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

Alternative 9: 46.4% accurate, 3.4× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|B\right| \leq 3.6 \cdot 10^{+30}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{\mathsf{min}\left(A, C\right) \cdot -16} \cdot \sqrt{F}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (if (<= (fabs B) 3.6e+30)
  (* 0.25 (/ (sqrt (* -16.0 (* (fmin A C) F))) (fmin A C)))
  (if (<= (fabs B) 8e+133)
    (* 0.25 (/ (* (sqrt (* (fmin A C) -16.0)) (sqrt F)) (fmin A C)))
    (- (sqrt (fabs (* (/ -2.0 (fabs B)) F)))))))
double code(double A, double B, double C, double F) {
	double tmp;
	if (fabs(B) <= 3.6e+30) {
		tmp = 0.25 * (sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (fabs(B) <= 8e+133) {
		tmp = 0.25 * ((sqrt((fmin(A, C) * -16.0)) * sqrt(F)) / fmin(A, C));
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (abs(b) <= 3.6d+30) then
        tmp = 0.25d0 * (sqrt(((-16.0d0) * (fmin(a, c) * f))) / fmin(a, c))
    else if (abs(b) <= 8d+133) then
        tmp = 0.25d0 * ((sqrt((fmin(a, c) * (-16.0d0))) * sqrt(f)) / fmin(a, c))
    else
        tmp = -sqrt(abs((((-2.0d0) / abs(b)) * f)))
    end if
    code = tmp
end function
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (Math.abs(B) <= 3.6e+30) {
		tmp = 0.25 * (Math.sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (Math.abs(B) <= 8e+133) {
		tmp = 0.25 * ((Math.sqrt((fmin(A, C) * -16.0)) * Math.sqrt(F)) / fmin(A, C));
	} else {
		tmp = -Math.sqrt(Math.abs(((-2.0 / Math.abs(B)) * F)));
	}
	return tmp;
}
def code(A, B, C, F):
	tmp = 0
	if math.fabs(B) <= 3.6e+30:
		tmp = 0.25 * (math.sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C))
	elif math.fabs(B) <= 8e+133:
		tmp = 0.25 * ((math.sqrt((fmin(A, C) * -16.0)) * math.sqrt(F)) / fmin(A, C))
	else:
		tmp = -math.sqrt(math.fabs(((-2.0 / math.fabs(B)) * F)))
	return tmp
function code(A, B, C, F)
	tmp = 0.0
	if (abs(B) <= 3.6e+30)
		tmp = Float64(0.25 * Float64(sqrt(Float64(-16.0 * Float64(fmin(A, C) * F))) / fmin(A, C)));
	elseif (abs(B) <= 8e+133)
		tmp = Float64(0.25 * Float64(Float64(sqrt(Float64(fmin(A, C) * -16.0)) * sqrt(F)) / fmin(A, C)));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (abs(B) <= 3.6e+30)
		tmp = 0.25 * (sqrt((-16.0 * (min(A, C) * F))) / min(A, C));
	elseif (abs(B) <= 8e+133)
		tmp = 0.25 * ((sqrt((min(A, C) * -16.0)) * sqrt(F)) / min(A, C));
	else
		tmp = -sqrt(abs(((-2.0 / abs(B)) * F)));
	end
	tmp_2 = tmp;
end
code[A_, B_, C_, F_] := If[LessEqual[N[Abs[B], $MachinePrecision], 3.6e+30], N[(0.25 * N[(N[Sqrt[N[(-16.0 * N[(N[Min[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], N[(0.25 * N[(N[(N[Sqrt[N[(N[Min[A, C], $MachinePrecision] * -16.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 3.6 \cdot 10^{+30}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\

\mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{\mathsf{min}\left(A, C\right) \cdot -16} \cdot \sqrt{F}}{\mathsf{min}\left(A, C\right)}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 3.6000000000000002e30

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

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

    if 3.6000000000000002e30 < B < 8.0000000000000002e133

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. associate-*r*N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{\left(-16 \cdot A\right) \cdot F}}{A} \]
      5. sqrt-prodN/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot A} \cdot \sqrt{F}}{A} \]
      6. lower-unsound-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot A} \cdot \sqrt{F}}{A} \]
      7. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot A} \cdot \sqrt{F}}{A} \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]
      10. lower-unsound-sqrt.f6418.7%

        \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]
    6. Applied rewrites18.7%

      \[\leadsto 0.25 \cdot \frac{\sqrt{A \cdot -16} \cdot \sqrt{F}}{A} \]

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

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

Alternative 10: 46.4% accurate, 4.3× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|B\right| \leq 5.2 \cdot 10^{+46}:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\ \mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;-0.25 \cdot \sqrt{-16 \cdot \frac{F}{\mathsf{min}\left(A, C\right)}}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (if (<= (fabs B) 5.2e+46)
  (* 0.25 (/ (sqrt (* -16.0 (* (fmin A C) F))) (fmin A C)))
  (if (<= (fabs B) 8e+133)
    (* -0.25 (sqrt (* -16.0 (/ F (fmin A C)))))
    (- (sqrt (fabs (* (/ -2.0 (fabs B)) F)))))))
double code(double A, double B, double C, double F) {
	double tmp;
	if (fabs(B) <= 5.2e+46) {
		tmp = 0.25 * (sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (fabs(B) <= 8e+133) {
		tmp = -0.25 * sqrt((-16.0 * (F / fmin(A, C))));
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (abs(b) <= 5.2d+46) then
        tmp = 0.25d0 * (sqrt(((-16.0d0) * (fmin(a, c) * f))) / fmin(a, c))
    else if (abs(b) <= 8d+133) then
        tmp = (-0.25d0) * sqrt(((-16.0d0) * (f / fmin(a, c))))
    else
        tmp = -sqrt(abs((((-2.0d0) / abs(b)) * f)))
    end if
    code = tmp
end function
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (Math.abs(B) <= 5.2e+46) {
		tmp = 0.25 * (Math.sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C));
	} else if (Math.abs(B) <= 8e+133) {
		tmp = -0.25 * Math.sqrt((-16.0 * (F / fmin(A, C))));
	} else {
		tmp = -Math.sqrt(Math.abs(((-2.0 / Math.abs(B)) * F)));
	}
	return tmp;
}
def code(A, B, C, F):
	tmp = 0
	if math.fabs(B) <= 5.2e+46:
		tmp = 0.25 * (math.sqrt((-16.0 * (fmin(A, C) * F))) / fmin(A, C))
	elif math.fabs(B) <= 8e+133:
		tmp = -0.25 * math.sqrt((-16.0 * (F / fmin(A, C))))
	else:
		tmp = -math.sqrt(math.fabs(((-2.0 / math.fabs(B)) * F)))
	return tmp
function code(A, B, C, F)
	tmp = 0.0
	if (abs(B) <= 5.2e+46)
		tmp = Float64(0.25 * Float64(sqrt(Float64(-16.0 * Float64(fmin(A, C) * F))) / fmin(A, C)));
	elseif (abs(B) <= 8e+133)
		tmp = Float64(-0.25 * sqrt(Float64(-16.0 * Float64(F / fmin(A, C)))));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (abs(B) <= 5.2e+46)
		tmp = 0.25 * (sqrt((-16.0 * (min(A, C) * F))) / min(A, C));
	elseif (abs(B) <= 8e+133)
		tmp = -0.25 * sqrt((-16.0 * (F / min(A, C))));
	else
		tmp = -sqrt(abs(((-2.0 / abs(B)) * F)));
	end
	tmp_2 = tmp;
end
code[A_, B_, C_, F_] := If[LessEqual[N[Abs[B], $MachinePrecision], 5.2e+46], N[(0.25 * N[(N[Sqrt[N[(-16.0 * N[(N[Min[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], N[(-0.25 * N[Sqrt[N[(-16.0 * N[(F / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 5.2 \cdot 10^{+46}:\\
\;\;\;\;0.25 \cdot \frac{\sqrt{-16 \cdot \left(\mathsf{min}\left(A, C\right) \cdot F\right)}}{\mathsf{min}\left(A, C\right)}\\

\mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;-0.25 \cdot \sqrt{-16 \cdot \frac{F}{\mathsf{min}\left(A, C\right)}}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 5.2000000000000003e46

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

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

    if 5.2000000000000003e46 < B < 8.0000000000000002e133

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Taylor expanded in A around -inf

      \[\leadsto \frac{-1}{4} \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{A}}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      4. lower-/.f6415.0%

        \[\leadsto -0.25 \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
    7. Applied rewrites15.0%

      \[\leadsto -0.25 \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{A}}} \]

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

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

Alternative 11: 46.3% accurate, 4.5× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|B\right| \leq 5.4 \cdot 10^{+20}:\\ \;\;\;\;-0.25 \cdot \left(F \cdot \sqrt{\frac{-16}{\mathsf{min}\left(A, C\right) \cdot F}}\right)\\ \mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;-0.25 \cdot \sqrt{-16 \cdot \frac{F}{\mathsf{min}\left(A, C\right)}}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (if (<= (fabs B) 5.4e+20)
  (* -0.25 (* F (sqrt (/ -16.0 (* (fmin A C) F)))))
  (if (<= (fabs B) 8e+133)
    (* -0.25 (sqrt (* -16.0 (/ F (fmin A C)))))
    (- (sqrt (fabs (* (/ -2.0 (fabs B)) F)))))))
double code(double A, double B, double C, double F) {
	double tmp;
	if (fabs(B) <= 5.4e+20) {
		tmp = -0.25 * (F * sqrt((-16.0 / (fmin(A, C) * F))));
	} else if (fabs(B) <= 8e+133) {
		tmp = -0.25 * sqrt((-16.0 * (F / fmin(A, C))));
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (abs(b) <= 5.4d+20) then
        tmp = (-0.25d0) * (f * sqrt(((-16.0d0) / (fmin(a, c) * f))))
    else if (abs(b) <= 8d+133) then
        tmp = (-0.25d0) * sqrt(((-16.0d0) * (f / fmin(a, c))))
    else
        tmp = -sqrt(abs((((-2.0d0) / abs(b)) * f)))
    end if
    code = tmp
end function
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (Math.abs(B) <= 5.4e+20) {
		tmp = -0.25 * (F * Math.sqrt((-16.0 / (fmin(A, C) * F))));
	} else if (Math.abs(B) <= 8e+133) {
		tmp = -0.25 * Math.sqrt((-16.0 * (F / fmin(A, C))));
	} else {
		tmp = -Math.sqrt(Math.abs(((-2.0 / Math.abs(B)) * F)));
	}
	return tmp;
}
def code(A, B, C, F):
	tmp = 0
	if math.fabs(B) <= 5.4e+20:
		tmp = -0.25 * (F * math.sqrt((-16.0 / (fmin(A, C) * F))))
	elif math.fabs(B) <= 8e+133:
		tmp = -0.25 * math.sqrt((-16.0 * (F / fmin(A, C))))
	else:
		tmp = -math.sqrt(math.fabs(((-2.0 / math.fabs(B)) * F)))
	return tmp
function code(A, B, C, F)
	tmp = 0.0
	if (abs(B) <= 5.4e+20)
		tmp = Float64(-0.25 * Float64(F * sqrt(Float64(-16.0 / Float64(fmin(A, C) * F)))));
	elseif (abs(B) <= 8e+133)
		tmp = Float64(-0.25 * sqrt(Float64(-16.0 * Float64(F / fmin(A, C)))));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (abs(B) <= 5.4e+20)
		tmp = -0.25 * (F * sqrt((-16.0 / (min(A, C) * F))));
	elseif (abs(B) <= 8e+133)
		tmp = -0.25 * sqrt((-16.0 * (F / min(A, C))));
	else
		tmp = -sqrt(abs(((-2.0 / abs(B)) * F)));
	end
	tmp_2 = tmp;
end
code[A_, B_, C_, F_] := If[LessEqual[N[Abs[B], $MachinePrecision], 5.4e+20], N[(-0.25 * N[(F * N[Sqrt[N[(-16.0 / N[(N[Min[A, C], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], N[(-0.25 * N[Sqrt[N[(-16.0 * N[(F / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 5.4 \cdot 10^{+20}:\\
\;\;\;\;-0.25 \cdot \left(F \cdot \sqrt{\frac{-16}{\mathsf{min}\left(A, C\right) \cdot F}}\right)\\

\mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;-0.25 \cdot \sqrt{-16 \cdot \frac{F}{\mathsf{min}\left(A, C\right)}}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 5.4e20

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Taylor expanded in F around -inf

      \[\leadsto \frac{-1}{4} \cdot \color{blue}{\frac{F \cdot \sqrt{-16 \cdot \frac{A}{F}}}{A}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \frac{F \cdot \sqrt{-16 \cdot \frac{A}{F}}}{\color{blue}{A}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \frac{F \cdot \sqrt{-16 \cdot \frac{A}{F}}}{A} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \frac{F \cdot \sqrt{-16 \cdot \frac{A}{F}}}{A} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \frac{F \cdot \sqrt{-16 \cdot \frac{A}{F}}}{A} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \frac{F \cdot \sqrt{-16 \cdot \frac{A}{F}}}{A} \]
      6. lower-/.f6410.8%

        \[\leadsto -0.25 \cdot \frac{F \cdot \sqrt{-16 \cdot \frac{A}{F}}}{A} \]
    7. Applied rewrites10.8%

      \[\leadsto -0.25 \cdot \color{blue}{\frac{F \cdot \sqrt{-16 \cdot \frac{A}{F}}}{A}} \]
    8. Taylor expanded in A around inf

      \[\leadsto -0.25 \cdot \left(F \cdot \sqrt{\frac{-16}{A \cdot F}}\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \frac{-1}{4} \cdot \left(F \cdot \sqrt{\frac{-16}{A \cdot F}}\right) \]
      3. lower-/.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \left(F \cdot \sqrt{\frac{-16}{A \cdot F}}\right) \]
      4. lower-*.f6419.7%

        \[\leadsto -0.25 \cdot \left(F \cdot \sqrt{\frac{-16}{A \cdot F}}\right) \]
    10. Applied rewrites19.7%

      \[\leadsto -0.25 \cdot \left(F \cdot \sqrt{\frac{-16}{A \cdot F}}\right) \]

    if 5.4e20 < B < 8.0000000000000002e133

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Taylor expanded in A around -inf

      \[\leadsto \frac{-1}{4} \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{A}}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      4. lower-/.f6415.0%

        \[\leadsto -0.25 \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
    7. Applied rewrites15.0%

      \[\leadsto -0.25 \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{A}}} \]

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

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

Alternative 12: 38.7% accurate, 3.8× speedup?

\[\begin{array}{l} t_0 := \sqrt{-16 \cdot \frac{F}{\mathsf{min}\left(A, C\right)}}\\ t_1 := -0.25 \cdot t\_0\\ \mathbf{if}\;\left|B\right| \leq 1.2 \cdot 10^{-156}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\left|B\right| \leq 2200000:\\ \;\;\;\;0.25 \cdot t\_0\\ \mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (let* ((t_0 (sqrt (* -16.0 (/ F (fmin A C))))) (t_1 (* -0.25 t_0)))
  (if (<= (fabs B) 1.2e-156)
    t_1
    (if (<= (fabs B) 2200000.0)
      (* 0.25 t_0)
      (if (<= (fabs B) 8e+133)
        t_1
        (- (sqrt (fabs (* (/ -2.0 (fabs B)) F)))))))))
double code(double A, double B, double C, double F) {
	double t_0 = sqrt((-16.0 * (F / fmin(A, C))));
	double t_1 = -0.25 * t_0;
	double tmp;
	if (fabs(B) <= 1.2e-156) {
		tmp = t_1;
	} else if (fabs(B) <= 2200000.0) {
		tmp = 0.25 * t_0;
	} else if (fabs(B) <= 8e+133) {
		tmp = t_1;
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sqrt(((-16.0d0) * (f / fmin(a, c))))
    t_1 = (-0.25d0) * t_0
    if (abs(b) <= 1.2d-156) then
        tmp = t_1
    else if (abs(b) <= 2200000.0d0) then
        tmp = 0.25d0 * t_0
    else if (abs(b) <= 8d+133) then
        tmp = t_1
    else
        tmp = -sqrt(abs((((-2.0d0) / abs(b)) * f)))
    end if
    code = tmp
end function
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.sqrt((-16.0 * (F / fmin(A, C))));
	double t_1 = -0.25 * t_0;
	double tmp;
	if (Math.abs(B) <= 1.2e-156) {
		tmp = t_1;
	} else if (Math.abs(B) <= 2200000.0) {
		tmp = 0.25 * t_0;
	} else if (Math.abs(B) <= 8e+133) {
		tmp = t_1;
	} else {
		tmp = -Math.sqrt(Math.abs(((-2.0 / Math.abs(B)) * F)));
	}
	return tmp;
}
def code(A, B, C, F):
	t_0 = math.sqrt((-16.0 * (F / fmin(A, C))))
	t_1 = -0.25 * t_0
	tmp = 0
	if math.fabs(B) <= 1.2e-156:
		tmp = t_1
	elif math.fabs(B) <= 2200000.0:
		tmp = 0.25 * t_0
	elif math.fabs(B) <= 8e+133:
		tmp = t_1
	else:
		tmp = -math.sqrt(math.fabs(((-2.0 / math.fabs(B)) * F)))
	return tmp
function code(A, B, C, F)
	t_0 = sqrt(Float64(-16.0 * Float64(F / fmin(A, C))))
	t_1 = Float64(-0.25 * t_0)
	tmp = 0.0
	if (abs(B) <= 1.2e-156)
		tmp = t_1;
	elseif (abs(B) <= 2200000.0)
		tmp = Float64(0.25 * t_0);
	elseif (abs(B) <= 8e+133)
		tmp = t_1;
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
function tmp_2 = code(A, B, C, F)
	t_0 = sqrt((-16.0 * (F / min(A, C))));
	t_1 = -0.25 * t_0;
	tmp = 0.0;
	if (abs(B) <= 1.2e-156)
		tmp = t_1;
	elseif (abs(B) <= 2200000.0)
		tmp = 0.25 * t_0;
	elseif (abs(B) <= 8e+133)
		tmp = t_1;
	else
		tmp = -sqrt(abs(((-2.0 / abs(B)) * F)));
	end
	tmp_2 = tmp;
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[Sqrt[N[(-16.0 * N[(F / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(-0.25 * t$95$0), $MachinePrecision]}, If[LessEqual[N[Abs[B], $MachinePrecision], 1.2e-156], t$95$1, If[LessEqual[N[Abs[B], $MachinePrecision], 2200000.0], N[(0.25 * t$95$0), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], t$95$1, (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]]]]]
\begin{array}{l}
t_0 := \sqrt{-16 \cdot \frac{F}{\mathsf{min}\left(A, C\right)}}\\
t_1 := -0.25 \cdot t\_0\\
\mathbf{if}\;\left|B\right| \leq 1.2 \cdot 10^{-156}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\left|B\right| \leq 2200000:\\
\;\;\;\;0.25 \cdot t\_0\\

\mathbf{elif}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 1.2e-156 or 2.2e6 < B < 8.0000000000000002e133

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Taylor expanded in A around -inf

      \[\leadsto \frac{-1}{4} \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{A}}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      4. lower-/.f6415.0%

        \[\leadsto -0.25 \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
    7. Applied rewrites15.0%

      \[\leadsto -0.25 \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{A}}} \]

    if 1.2e-156 < B < 2.2e6

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Taylor expanded in A around inf

      \[\leadsto 0.25 \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
    6. Step-by-step derivation
      1. lower-sqrt.f64N/A

        \[\leadsto \frac{1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      3. lower-/.f6411.2%

        \[\leadsto 0.25 \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
    7. Applied rewrites11.2%

      \[\leadsto 0.25 \cdot \sqrt{-16 \cdot \frac{F}{A}} \]

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

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

Alternative 13: 36.1% accurate, 5.6× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\ \;\;\;\;-0.25 \cdot \sqrt{-16 \cdot \frac{F}{\mathsf{min}\left(A, C\right)}}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\left|\frac{-2}{\left|B\right|} \cdot F\right|}\\ \end{array} \]
(FPCore (A B C F)
  :precision binary64
  (if (<= (fabs B) 8e+133)
  (* -0.25 (sqrt (* -16.0 (/ F (fmin A C)))))
  (- (sqrt (fabs (* (/ -2.0 (fabs B)) F))))))
double code(double A, double B, double C, double F) {
	double tmp;
	if (fabs(B) <= 8e+133) {
		tmp = -0.25 * sqrt((-16.0 * (F / fmin(A, C))));
	} else {
		tmp = -sqrt(fabs(((-2.0 / fabs(B)) * F)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (abs(b) <= 8d+133) then
        tmp = (-0.25d0) * sqrt(((-16.0d0) * (f / fmin(a, c))))
    else
        tmp = -sqrt(abs((((-2.0d0) / abs(b)) * f)))
    end if
    code = tmp
end function
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (Math.abs(B) <= 8e+133) {
		tmp = -0.25 * Math.sqrt((-16.0 * (F / fmin(A, C))));
	} else {
		tmp = -Math.sqrt(Math.abs(((-2.0 / Math.abs(B)) * F)));
	}
	return tmp;
}
def code(A, B, C, F):
	tmp = 0
	if math.fabs(B) <= 8e+133:
		tmp = -0.25 * math.sqrt((-16.0 * (F / fmin(A, C))))
	else:
		tmp = -math.sqrt(math.fabs(((-2.0 / math.fabs(B)) * F)))
	return tmp
function code(A, B, C, F)
	tmp = 0.0
	if (abs(B) <= 8e+133)
		tmp = Float64(-0.25 * sqrt(Float64(-16.0 * Float64(F / fmin(A, C)))));
	else
		tmp = Float64(-sqrt(abs(Float64(Float64(-2.0 / abs(B)) * F))));
	end
	return tmp
end
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (abs(B) <= 8e+133)
		tmp = -0.25 * sqrt((-16.0 * (F / min(A, C))));
	else
		tmp = -sqrt(abs(((-2.0 / abs(B)) * F)));
	end
	tmp_2 = tmp;
end
code[A_, B_, C_, F_] := If[LessEqual[N[Abs[B], $MachinePrecision], 8e+133], N[(-0.25 * N[Sqrt[N[(-16.0 * N[(F / N[Min[A, C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[Abs[N[(N[(-2.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 8 \cdot 10^{+133}:\\
\;\;\;\;-0.25 \cdot \sqrt{-16 \cdot \frac{F}{\mathsf{min}\left(A, C\right)}}\\

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


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

    1. Initial program 19.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. Taylor expanded in C around inf

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

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

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

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{4} \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
      5. lower-*.f6420.1%

        \[\leadsto 0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A} \]
    4. Applied rewrites20.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{A}} \]
    5. Taylor expanded in A around -inf

      \[\leadsto \frac{-1}{4} \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{A}}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{-1}{4} \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
      4. lower-/.f6415.0%

        \[\leadsto -0.25 \cdot \sqrt{-16 \cdot \frac{F}{A}} \]
    7. Applied rewrites15.0%

      \[\leadsto -0.25 \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{A}}} \]

    if 8.0000000000000002e133 < B

    1. Initial program 19.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. Taylor expanded in B around -inf

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
      4. lower-/.f6413.6%

        \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. Applied rewrites13.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
      3. lower-neg.f6413.6%

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      4. lift-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
      5. *-commutativeN/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      6. lower-*.f6413.6%

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. Applied rewrites13.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      5. lower-*.f64N/A

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
      6. lower-/.f6413.6%

        \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    8. Applied rewrites13.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
      4. sqr-abs-revN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
      5. mul-fabsN/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      6. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      7. lift-sqrt.f64N/A

        \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
      8. rem-square-sqrtN/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      9. lower-fabs.f6426.7%

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      10. lift-*.f64N/A

        \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
      11. *-commutativeN/A

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
      12. lower-*.f6426.7%

        \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    10. Applied rewrites26.7%

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

Alternative 14: 26.7% accurate, 9.7× speedup?

\[-\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
(FPCore (A B C F)
  :precision binary64
  (- (sqrt (fabs (* (/ -2.0 B) F)))))
double code(double A, double B, double C, double F) {
	return -sqrt(fabs(((-2.0 / B) * F)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = -sqrt(abs((((-2.0d0) / b) * f)))
end function
public static double code(double A, double B, double C, double F) {
	return -Math.sqrt(Math.abs(((-2.0 / B) * F)));
}
def code(A, B, C, F):
	return -math.sqrt(math.fabs(((-2.0 / B) * F)))
function code(A, B, C, F)
	return Float64(-sqrt(abs(Float64(Float64(-2.0 / B) * F))))
end
function tmp = code(A, B, C, F)
	tmp = -sqrt(abs(((-2.0 / B) * F)));
end
code[A_, B_, C_, F_] := (-N[Sqrt[N[Abs[N[(N[(-2.0 / B), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])
-\sqrt{\left|\frac{-2}{B} \cdot F\right|}
Derivation
  1. Initial program 19.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. Taylor expanded in B around -inf

    \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
    2. lower-sqrt.f64N/A

      \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    3. lower-*.f64N/A

      \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. lower-/.f6413.6%

      \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
  4. Applied rewrites13.6%

    \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
    2. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
    3. lower-neg.f6413.6%

      \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
    4. lift-*.f64N/A

      \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
    5. *-commutativeN/A

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. lower-*.f6413.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
  6. Applied rewrites13.6%

    \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    2. lift-/.f64N/A

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

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

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    5. lower-*.f64N/A

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    6. lower-/.f6413.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
  8. Applied rewrites13.6%

    \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
  9. Step-by-step derivation
    1. rem-square-sqrtN/A

      \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
    2. lift-sqrt.f64N/A

      \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
    3. lift-sqrt.f64N/A

      \[\leadsto -\sqrt{\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}} \]
    4. sqr-abs-revN/A

      \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}}\right| \cdot \left|\sqrt{F \cdot \frac{-2}{B}}\right|} \]
    5. mul-fabsN/A

      \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
    6. lift-sqrt.f64N/A

      \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
    7. lift-sqrt.f64N/A

      \[\leadsto -\sqrt{\left|\sqrt{F \cdot \frac{-2}{B}} \cdot \sqrt{F \cdot \frac{-2}{B}}\right|} \]
    8. rem-square-sqrtN/A

      \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
    9. lower-fabs.f6426.7%

      \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
    10. lift-*.f64N/A

      \[\leadsto -\sqrt{\left|F \cdot \frac{-2}{B}\right|} \]
    11. *-commutativeN/A

      \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
    12. lower-*.f6426.7%

      \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
  10. Applied rewrites26.7%

    \[\leadsto -\sqrt{\left|\frac{-2}{B} \cdot F\right|} \]
  11. Add Preprocessing

Alternative 15: 26.7% accurate, 9.7× speedup?

\[-\sqrt{\left|-2 \cdot \frac{F}{B}\right|} \]
(FPCore (A B C F)
  :precision binary64
  (- (sqrt (fabs (* -2.0 (/ F B))))))
double code(double A, double B, double C, double F) {
	return -sqrt(fabs((-2.0 * (F / B))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = -sqrt(abs(((-2.0d0) * (f / b))))
end function
public static double code(double A, double B, double C, double F) {
	return -Math.sqrt(Math.abs((-2.0 * (F / B))));
}
def code(A, B, C, F):
	return -math.sqrt(math.fabs((-2.0 * (F / B))))
function code(A, B, C, F)
	return Float64(-sqrt(abs(Float64(-2.0 * Float64(F / B)))))
end
function tmp = code(A, B, C, F)
	tmp = -sqrt(abs((-2.0 * (F / B))));
end
code[A_, B_, C_, F_] := (-N[Sqrt[N[Abs[N[(-2.0 * N[(F / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])
-\sqrt{\left|-2 \cdot \frac{F}{B}\right|}
Derivation
  1. Initial program 19.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. Taylor expanded in B around -inf

    \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
    2. lower-sqrt.f64N/A

      \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    3. lower-*.f64N/A

      \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. lower-/.f6413.6%

      \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
  4. Applied rewrites13.6%

    \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
    2. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
    3. lower-neg.f6413.6%

      \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
    4. lift-*.f64N/A

      \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
    5. *-commutativeN/A

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. lower-*.f6413.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
  6. Applied rewrites13.6%

    \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
  7. Step-by-step derivation
    1. rem-square-sqrtN/A

      \[\leadsto -\sqrt{\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}} \]
    2. lift-sqrt.f64N/A

      \[\leadsto -\sqrt{\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}} \]
    3. lift-sqrt.f64N/A

      \[\leadsto -\sqrt{\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}} \]
    4. sqr-abs-revN/A

      \[\leadsto -\sqrt{\left|\sqrt{\frac{F}{B} \cdot -2}\right| \cdot \left|\sqrt{\frac{F}{B} \cdot -2}\right|} \]
    5. mul-fabsN/A

      \[\leadsto -\sqrt{\left|\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}\right|} \]
    6. lift-sqrt.f64N/A

      \[\leadsto -\sqrt{\left|\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}\right|} \]
    7. lift-sqrt.f64N/A

      \[\leadsto -\sqrt{\left|\sqrt{\frac{F}{B} \cdot -2} \cdot \sqrt{\frac{F}{B} \cdot -2}\right|} \]
    8. rem-square-sqrtN/A

      \[\leadsto -\sqrt{\left|\frac{F}{B} \cdot -2\right|} \]
    9. lower-fabs.f6426.7%

      \[\leadsto -\sqrt{\left|\frac{F}{B} \cdot -2\right|} \]
    10. lift-*.f64N/A

      \[\leadsto -\sqrt{\left|\frac{F}{B} \cdot -2\right|} \]
    11. *-commutativeN/A

      \[\leadsto -\sqrt{\left|-2 \cdot \frac{F}{B}\right|} \]
    12. lower-*.f6426.7%

      \[\leadsto -\sqrt{\left|-2 \cdot \frac{F}{B}\right|} \]
  8. Applied rewrites26.7%

    \[\leadsto -\sqrt{\left|-2 \cdot \frac{F}{B}\right|} \]
  9. Add Preprocessing

Alternative 16: 13.6% accurate, 10.6× speedup?

\[-\sqrt{F \cdot \frac{-2}{B}} \]
(FPCore (A B C F)
  :precision binary64
  (- (sqrt (* F (/ -2.0 B)))))
double code(double A, double B, double C, double F) {
	return -sqrt((F * (-2.0 / B)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    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
public static double code(double A, double B, double C, double F) {
	return -Math.sqrt((F * (-2.0 / B)));
}
def code(A, B, C, F):
	return -math.sqrt((F * (-2.0 / B)))
function code(A, B, C, F)
	return Float64(-sqrt(Float64(F * Float64(-2.0 / B))))
end
function tmp = code(A, B, C, F)
	tmp = -sqrt((F * (-2.0 / B)));
end
code[A_, B_, C_, F_] := (-N[Sqrt[N[(F * N[(-2.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])
-\sqrt{F \cdot \frac{-2}{B}}
Derivation
  1. Initial program 19.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. Taylor expanded in B around -inf

    \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
    2. lower-sqrt.f64N/A

      \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    3. lower-*.f64N/A

      \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
    4. lower-/.f6413.6%

      \[\leadsto -1 \cdot \sqrt{-2 \cdot \frac{F}{B}} \]
  4. Applied rewrites13.6%

    \[\leadsto \color{blue}{-1 \cdot \sqrt{-2 \cdot \frac{F}{B}}} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto -1 \cdot \color{blue}{\sqrt{-2 \cdot \frac{F}{B}}} \]
    2. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\sqrt{-2 \cdot \frac{F}{B}}\right) \]
    3. lower-neg.f6413.6%

      \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
    4. lift-*.f64N/A

      \[\leadsto -\sqrt{-2 \cdot \frac{F}{B}} \]
    5. *-commutativeN/A

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    6. lower-*.f6413.6%

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
  6. Applied rewrites13.6%

    \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto -\sqrt{\frac{F}{B} \cdot -2} \]
    2. lift-/.f64N/A

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

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

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    5. lower-*.f64N/A

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
    6. lower-/.f6413.6%

      \[\leadsto -\sqrt{F \cdot \frac{-2}{B}} \]
  8. Applied rewrites13.6%

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

Reproduce

?
herbie shell --seed 2025212 
(FPCore (A B C F)
  :name "ABCF->ab-angle a"
  :precision binary64
  (/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))