ABCF->ab-angle b

Percentage Accurate: 19.4% → 48.1%
Time: 12.7s
Alternatives: 11
Speedup: 14.4×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0} \end{array} \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
   (/
    (-
     (sqrt
      (*
       (* 2.0 (* t_0 F))
       (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
    t_0)))
double code(double A, double B, double C, double F) {
	double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
	return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
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}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 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.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0} \end{array} \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
   (/
    (-
     (sqrt
      (*
       (* 2.0 (* t_0 F))
       (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
    t_0)))
double code(double A, double B, double C, double F) {
	double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
	return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
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}

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

Alternative 1: 48.1% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(-4 \cdot A, C, B\_m \cdot B\_m\right)\\ \mathbf{if}\;B\_m \leq 7.4 \cdot 10^{-65}:\\ \;\;\;\;\frac{\sqrt{\left(\left(-8 \cdot A\right) \cdot C\right) \cdot \left(\left(A + A\right) \cdot F\right)}}{-t\_0}\\ \mathbf{elif}\;B\_m \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;-\sqrt{\frac{\left(A + C\right) - \mathsf{hypot}\left(B\_m, A - C\right)}{t\_0} \cdot \left(F \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \frac{\frac{A + C}{B\_m} - 1}{B\_m}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma (* -4.0 A) C (* B_m B_m))))
   (if (<= B_m 7.4e-65)
     (/ (sqrt (* (* (* -8.0 A) C) (* (+ A A) F))) (- t_0))
     (if (<= B_m 1.4e+154)
       (- (sqrt (* (/ (- (+ A C) (hypot B_m (- A C))) t_0) (* F 2.0))))
       (* (sqrt (* F (/ (- (/ (+ A C) B_m) 1.0) B_m))) (- (sqrt 2.0)))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma((-4.0 * A), C, (B_m * B_m));
	double tmp;
	if (B_m <= 7.4e-65) {
		tmp = sqrt((((-8.0 * A) * C) * ((A + A) * F))) / -t_0;
	} else if (B_m <= 1.4e+154) {
		tmp = -sqrt(((((A + C) - hypot(B_m, (A - C))) / t_0) * (F * 2.0)));
	} else {
		tmp = sqrt((F * ((((A + C) / B_m) - 1.0) / B_m))) * -sqrt(2.0);
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = fma(Float64(-4.0 * A), C, Float64(B_m * B_m))
	tmp = 0.0
	if (B_m <= 7.4e-65)
		tmp = Float64(sqrt(Float64(Float64(Float64(-8.0 * A) * C) * Float64(Float64(A + A) * F))) / Float64(-t_0));
	elseif (B_m <= 1.4e+154)
		tmp = Float64(-sqrt(Float64(Float64(Float64(Float64(A + C) - hypot(B_m, Float64(A - C))) / t_0) * Float64(F * 2.0))));
	else
		tmp = Float64(sqrt(Float64(F * Float64(Float64(Float64(Float64(A + C) / B_m) - 1.0) / B_m))) * Float64(-sqrt(2.0)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(-4.0 * A), $MachinePrecision] * C + N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 7.4e-65], N[(N[Sqrt[N[(N[(N[(-8.0 * A), $MachinePrecision] * C), $MachinePrecision] * N[(N[(A + A), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], If[LessEqual[B$95$m, 1.4e+154], (-N[Sqrt[N[(N[(N[(N[(A + C), $MachinePrecision] - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), N[(N[Sqrt[N[(F * N[(N[(N[(N[(A + C), $MachinePrecision] / B$95$m), $MachinePrecision] - 1.0), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(-4 \cdot A, C, B\_m \cdot B\_m\right)\\
\mathbf{if}\;B\_m \leq 7.4 \cdot 10^{-65}:\\
\;\;\;\;\frac{\sqrt{\left(\left(-8 \cdot A\right) \cdot C\right) \cdot \left(\left(A + A\right) \cdot F\right)}}{-t\_0}\\

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

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


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

    1. Initial program 18.3%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\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. lift-neg.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      3. distribute-frac-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
      4. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
    4. Applied rewrites24.5%

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

      \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites14.7%

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

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

        if 7.4e-65 < B < 1.4e154

        1. Initial program 27.8%

          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\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. lift-neg.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          3. distribute-frac-negN/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
          4. distribute-neg-frac2N/A

            \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
          5. lower-/.f64N/A

            \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        4. Applied rewrites29.9%

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

          \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites4.5%

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

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

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

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

            if 1.4e154 < B

            1. Initial program 0.0%

              \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
              3. distribute-frac-negN/A

                \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
              4. distribute-neg-frac2N/A

                \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
              5. lower-/.f64N/A

                \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
            4. Applied rewrites0.0%

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

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

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

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

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

                \[\leadsto -\sqrt{F \cdot \frac{\left(\frac{A}{B} + \frac{C}{B}\right) - 1}{B}} \cdot \sqrt{2} \]
              5. Step-by-step derivation
                1. Applied rewrites73.3%

                  \[\leadsto -\sqrt{F \cdot \frac{\frac{A + C}{B} - 1}{B}} \cdot \sqrt{2} \]
              6. Recombined 3 regimes into one program.
              7. Final simplification30.1%

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

              Alternative 2: 42.7% accurate, 5.3× speedup?

              \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(-4 \cdot A, C, B\_m \cdot B\_m\right)\\ t_1 := -\sqrt{2}\\ \mathbf{if}\;B\_m \leq 10^{-234}:\\ \;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(\left(A \cdot C\right) \cdot F\right) \cdot \left(A + A\right)\right)}}{\left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;B\_m \leq 6 \cdot 10^{-126}:\\ \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot t\_1\\ \mathbf{elif}\;B\_m \leq 7.4 \cdot 10^{-14}:\\ \;\;\;\;\frac{\sqrt{\left(A + A\right) \cdot \left(\left(2 \cdot F\right) \cdot t\_0\right)}}{-t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \frac{\frac{A + C}{B\_m} - 1}{B\_m}} \cdot t\_1\\ \end{array} \end{array} \]
              B_m = (fabs.f64 B)
              NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
              (FPCore (A B_m C F)
               :precision binary64
               (let* ((t_0 (fma (* -4.0 A) C (* B_m B_m))) (t_1 (- (sqrt 2.0))))
                 (if (<= B_m 1e-234)
                   (/ (sqrt (* -8.0 (* (* (* A C) F) (+ A A)))) (* (* 4.0 A) C))
                   (if (<= B_m 6e-126)
                     (* (sqrt (* F (/ -0.5 C))) t_1)
                     (if (<= B_m 7.4e-14)
                       (/ (sqrt (* (+ A A) (* (* 2.0 F) t_0))) (- t_0))
                       (* (sqrt (* F (/ (- (/ (+ A C) B_m) 1.0) B_m))) t_1))))))
              B_m = fabs(B);
              assert(A < B_m && B_m < C && C < F);
              double code(double A, double B_m, double C, double F) {
              	double t_0 = fma((-4.0 * A), C, (B_m * B_m));
              	double t_1 = -sqrt(2.0);
              	double tmp;
              	if (B_m <= 1e-234) {
              		tmp = sqrt((-8.0 * (((A * C) * F) * (A + A)))) / ((4.0 * A) * C);
              	} else if (B_m <= 6e-126) {
              		tmp = sqrt((F * (-0.5 / C))) * t_1;
              	} else if (B_m <= 7.4e-14) {
              		tmp = sqrt(((A + A) * ((2.0 * F) * t_0))) / -t_0;
              	} else {
              		tmp = sqrt((F * ((((A + C) / B_m) - 1.0) / B_m))) * t_1;
              	}
              	return tmp;
              }
              
              B_m = abs(B)
              A, B_m, C, F = sort([A, B_m, C, F])
              function code(A, B_m, C, F)
              	t_0 = fma(Float64(-4.0 * A), C, Float64(B_m * B_m))
              	t_1 = Float64(-sqrt(2.0))
              	tmp = 0.0
              	if (B_m <= 1e-234)
              		tmp = Float64(sqrt(Float64(-8.0 * Float64(Float64(Float64(A * C) * F) * Float64(A + A)))) / Float64(Float64(4.0 * A) * C));
              	elseif (B_m <= 6e-126)
              		tmp = Float64(sqrt(Float64(F * Float64(-0.5 / C))) * t_1);
              	elseif (B_m <= 7.4e-14)
              		tmp = Float64(sqrt(Float64(Float64(A + A) * Float64(Float64(2.0 * F) * t_0))) / Float64(-t_0));
              	else
              		tmp = Float64(sqrt(Float64(F * Float64(Float64(Float64(Float64(A + C) / B_m) - 1.0) / B_m))) * t_1);
              	end
              	return tmp
              end
              
              B_m = N[Abs[B], $MachinePrecision]
              NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
              code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(-4.0 * A), $MachinePrecision] * C + N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[B$95$m, 1e-234], N[(N[Sqrt[N[(-8.0 * N[(N[(N[(A * C), $MachinePrecision] * F), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 6e-126], N[(N[Sqrt[N[(F * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 7.4e-14], N[(N[Sqrt[N[(N[(A + A), $MachinePrecision] * N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(N[Sqrt[N[(F * N[(N[(N[(N[(A + C), $MachinePrecision] / B$95$m), $MachinePrecision] - 1.0), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]
              
              \begin{array}{l}
              B_m = \left|B\right|
              \\
              [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
              \\
              \begin{array}{l}
              t_0 := \mathsf{fma}\left(-4 \cdot A, C, B\_m \cdot B\_m\right)\\
              t_1 := -\sqrt{2}\\
              \mathbf{if}\;B\_m \leq 10^{-234}:\\
              \;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(\left(A \cdot C\right) \cdot F\right) \cdot \left(A + A\right)\right)}}{\left(4 \cdot A\right) \cdot C}\\
              
              \mathbf{elif}\;B\_m \leq 6 \cdot 10^{-126}:\\
              \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot t\_1\\
              
              \mathbf{elif}\;B\_m \leq 7.4 \cdot 10^{-14}:\\
              \;\;\;\;\frac{\sqrt{\left(A + A\right) \cdot \left(\left(2 \cdot F\right) \cdot t\_0\right)}}{-t\_0}\\
              
              \mathbf{else}:\\
              \;\;\;\;\sqrt{F \cdot \frac{\frac{A + C}{B\_m} - 1}{B\_m}} \cdot t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if B < 9.9999999999999996e-235

                1. Initial program 18.3%

                  \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                    \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                  3. distribute-frac-negN/A

                    \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                  4. distribute-neg-frac2N/A

                    \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                  5. lower-/.f64N/A

                    \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                4. Applied rewrites23.8%

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

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

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

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

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

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

                      if 9.9999999999999996e-235 < B < 6.0000000000000003e-126

                      1. Initial program 21.5%

                        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                      2. Add Preprocessing
                      3. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                        3. distribute-frac-negN/A

                          \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                        4. distribute-neg-frac2N/A

                          \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                        5. lower-/.f64N/A

                          \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                      4. Applied rewrites21.7%

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

                        \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites21.0%

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

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

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

                          \[\leadsto -\sqrt{F \cdot \frac{\frac{-1}{2}}{C}} \cdot \sqrt{2} \]
                        5. Step-by-step derivation
                          1. Applied rewrites47.1%

                            \[\leadsto -\sqrt{F \cdot \frac{-0.5}{C}} \cdot \sqrt{2} \]

                          if 6.0000000000000003e-126 < B < 7.40000000000000002e-14

                          1. Initial program 25.7%

                            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                              \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                            3. distribute-frac-negN/A

                              \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                            4. distribute-neg-frac2N/A

                              \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                            5. lower-/.f64N/A

                              \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                          4. Applied rewrites39.4%

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

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

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

                            if 7.40000000000000002e-14 < B

                            1. Initial program 15.7%

                              \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                            2. Add Preprocessing
                            3. Step-by-step derivation
                              1. lift-/.f64N/A

                                \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                              3. distribute-frac-negN/A

                                \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                              4. distribute-neg-frac2N/A

                                \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                              5. lower-/.f64N/A

                                \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                            4. Applied rewrites15.8%

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

                              \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
                            6. Step-by-step derivation
                              1. Applied rewrites2.5%

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

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

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

                                \[\leadsto -\sqrt{F \cdot \frac{\left(\frac{A}{B} + \frac{C}{B}\right) - 1}{B}} \cdot \sqrt{2} \]
                              5. Step-by-step derivation
                                1. Applied rewrites55.5%

                                  \[\leadsto -\sqrt{F \cdot \frac{\frac{A + C}{B} - 1}{B}} \cdot \sqrt{2} \]
                              6. Recombined 4 regimes into one program.
                              7. Final simplification26.2%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 10^{-234}:\\ \;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(\left(A \cdot C\right) \cdot F\right) \cdot \left(A + A\right)\right)}}{\left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;B \leq 6 \cdot 10^{-126}:\\ \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq 7.4 \cdot 10^{-14}:\\ \;\;\;\;\frac{\sqrt{\left(A + A\right) \cdot \left(\left(2 \cdot F\right) \cdot \mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)\right)}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \frac{\frac{A + C}{B} - 1}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]
                              8. Add Preprocessing

                              Alternative 3: 40.7% accurate, 6.7× speedup?

                              \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := -\sqrt{2}\\ \mathbf{if}\;B\_m \leq 10^{-234}:\\ \;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(\left(A \cdot C\right) \cdot F\right) \cdot \left(A + A\right)\right)}}{\left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;B\_m \leq 0.011:\\ \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \frac{\frac{A + C}{B\_m} - 1}{B\_m}} \cdot t\_0\\ \end{array} \end{array} \]
                              B_m = (fabs.f64 B)
                              NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                              (FPCore (A B_m C F)
                               :precision binary64
                               (let* ((t_0 (- (sqrt 2.0))))
                                 (if (<= B_m 1e-234)
                                   (/ (sqrt (* -8.0 (* (* (* A C) F) (+ A A)))) (* (* 4.0 A) C))
                                   (if (<= B_m 0.011)
                                     (* (sqrt (* F (/ -0.5 C))) t_0)
                                     (* (sqrt (* F (/ (- (/ (+ A C) B_m) 1.0) B_m))) t_0)))))
                              B_m = fabs(B);
                              assert(A < B_m && B_m < C && C < F);
                              double code(double A, double B_m, double C, double F) {
                              	double t_0 = -sqrt(2.0);
                              	double tmp;
                              	if (B_m <= 1e-234) {
                              		tmp = sqrt((-8.0 * (((A * C) * F) * (A + A)))) / ((4.0 * A) * C);
                              	} else if (B_m <= 0.011) {
                              		tmp = sqrt((F * (-0.5 / C))) * t_0;
                              	} else {
                              		tmp = sqrt((F * ((((A + C) / B_m) - 1.0) / B_m))) * t_0;
                              	}
                              	return tmp;
                              }
                              
                              B_m =     private
                              NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                              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_m, c, f)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: a
                                  real(8), intent (in) :: b_m
                                  real(8), intent (in) :: c
                                  real(8), intent (in) :: f
                                  real(8) :: t_0
                                  real(8) :: tmp
                                  t_0 = -sqrt(2.0d0)
                                  if (b_m <= 1d-234) then
                                      tmp = sqrt(((-8.0d0) * (((a * c) * f) * (a + a)))) / ((4.0d0 * a) * c)
                                  else if (b_m <= 0.011d0) then
                                      tmp = sqrt((f * ((-0.5d0) / c))) * t_0
                                  else
                                      tmp = sqrt((f * ((((a + c) / b_m) - 1.0d0) / b_m))) * t_0
                                  end if
                                  code = tmp
                              end function
                              
                              B_m = Math.abs(B);
                              assert A < B_m && B_m < C && C < F;
                              public static double code(double A, double B_m, double C, double F) {
                              	double t_0 = -Math.sqrt(2.0);
                              	double tmp;
                              	if (B_m <= 1e-234) {
                              		tmp = Math.sqrt((-8.0 * (((A * C) * F) * (A + A)))) / ((4.0 * A) * C);
                              	} else if (B_m <= 0.011) {
                              		tmp = Math.sqrt((F * (-0.5 / C))) * t_0;
                              	} else {
                              		tmp = Math.sqrt((F * ((((A + C) / B_m) - 1.0) / B_m))) * t_0;
                              	}
                              	return tmp;
                              }
                              
                              B_m = math.fabs(B)
                              [A, B_m, C, F] = sort([A, B_m, C, F])
                              def code(A, B_m, C, F):
                              	t_0 = -math.sqrt(2.0)
                              	tmp = 0
                              	if B_m <= 1e-234:
                              		tmp = math.sqrt((-8.0 * (((A * C) * F) * (A + A)))) / ((4.0 * A) * C)
                              	elif B_m <= 0.011:
                              		tmp = math.sqrt((F * (-0.5 / C))) * t_0
                              	else:
                              		tmp = math.sqrt((F * ((((A + C) / B_m) - 1.0) / B_m))) * t_0
                              	return tmp
                              
                              B_m = abs(B)
                              A, B_m, C, F = sort([A, B_m, C, F])
                              function code(A, B_m, C, F)
                              	t_0 = Float64(-sqrt(2.0))
                              	tmp = 0.0
                              	if (B_m <= 1e-234)
                              		tmp = Float64(sqrt(Float64(-8.0 * Float64(Float64(Float64(A * C) * F) * Float64(A + A)))) / Float64(Float64(4.0 * A) * C));
                              	elseif (B_m <= 0.011)
                              		tmp = Float64(sqrt(Float64(F * Float64(-0.5 / C))) * t_0);
                              	else
                              		tmp = Float64(sqrt(Float64(F * Float64(Float64(Float64(Float64(A + C) / B_m) - 1.0) / B_m))) * t_0);
                              	end
                              	return tmp
                              end
                              
                              B_m = abs(B);
                              A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
                              function tmp_2 = code(A, B_m, C, F)
                              	t_0 = -sqrt(2.0);
                              	tmp = 0.0;
                              	if (B_m <= 1e-234)
                              		tmp = sqrt((-8.0 * (((A * C) * F) * (A + A)))) / ((4.0 * A) * C);
                              	elseif (B_m <= 0.011)
                              		tmp = sqrt((F * (-0.5 / C))) * t_0;
                              	else
                              		tmp = sqrt((F * ((((A + C) / B_m) - 1.0) / B_m))) * t_0;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              B_m = N[Abs[B], $MachinePrecision]
                              NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                              code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = (-N[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[B$95$m, 1e-234], N[(N[Sqrt[N[(-8.0 * N[(N[(N[(A * C), $MachinePrecision] * F), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 0.011], N[(N[Sqrt[N[(F * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F * N[(N[(N[(N[(A + C), $MachinePrecision] / B$95$m), $MachinePrecision] - 1.0), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
                              
                              \begin{array}{l}
                              B_m = \left|B\right|
                              \\
                              [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
                              \\
                              \begin{array}{l}
                              t_0 := -\sqrt{2}\\
                              \mathbf{if}\;B\_m \leq 10^{-234}:\\
                              \;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(\left(A \cdot C\right) \cdot F\right) \cdot \left(A + A\right)\right)}}{\left(4 \cdot A\right) \cdot C}\\
                              
                              \mathbf{elif}\;B\_m \leq 0.011:\\
                              \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot t\_0\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\sqrt{F \cdot \frac{\frac{A + C}{B\_m} - 1}{B\_m}} \cdot t\_0\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if B < 9.9999999999999996e-235

                                1. Initial program 18.3%

                                  \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. lift-/.f64N/A

                                    \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                    \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                  3. distribute-frac-negN/A

                                    \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                  4. distribute-neg-frac2N/A

                                    \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                  5. lower-/.f64N/A

                                    \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                4. Applied rewrites23.8%

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

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

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

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

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

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

                                      if 9.9999999999999996e-235 < B < 0.010999999999999999

                                      1. Initial program 23.3%

                                        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                      2. Add Preprocessing
                                      3. Step-by-step derivation
                                        1. lift-/.f64N/A

                                          \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                        3. distribute-frac-negN/A

                                          \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                        4. distribute-neg-frac2N/A

                                          \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                        5. lower-/.f64N/A

                                          \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                      4. Applied rewrites32.0%

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

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

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

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

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

                                          \[\leadsto -\sqrt{F \cdot \frac{\frac{-1}{2}}{C}} \cdot \sqrt{2} \]
                                        5. Step-by-step derivation
                                          1. Applied rewrites27.0%

                                            \[\leadsto -\sqrt{F \cdot \frac{-0.5}{C}} \cdot \sqrt{2} \]

                                          if 0.010999999999999999 < B

                                          1. Initial program 16.1%

                                            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                          2. Add Preprocessing
                                          3. Step-by-step derivation
                                            1. lift-/.f64N/A

                                              \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                              \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                            3. distribute-frac-negN/A

                                              \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                            4. distribute-neg-frac2N/A

                                              \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                            5. lower-/.f64N/A

                                              \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                          4. Applied rewrites16.2%

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

                                            \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites2.3%

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

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

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

                                              \[\leadsto -\sqrt{F \cdot \frac{\left(\frac{A}{B} + \frac{C}{B}\right) - 1}{B}} \cdot \sqrt{2} \]
                                            5. Step-by-step derivation
                                              1. Applied rewrites57.3%

                                                \[\leadsto -\sqrt{F \cdot \frac{\frac{A + C}{B} - 1}{B}} \cdot \sqrt{2} \]
                                            6. Recombined 3 regimes into one program.
                                            7. Final simplification25.8%

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

                                            Alternative 4: 40.5% accurate, 8.0× speedup?

                                            \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := -\sqrt{2}\\ \mathbf{if}\;B\_m \leq 10^{-234}:\\ \;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(\left(A \cdot C\right) \cdot F\right) \cdot \left(A + A\right)\right)}}{\left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;B\_m \leq 6.8 \cdot 10^{+58}:\\ \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{B\_m}} \cdot t\_0\\ \end{array} \end{array} \]
                                            B_m = (fabs.f64 B)
                                            NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                            (FPCore (A B_m C F)
                                             :precision binary64
                                             (let* ((t_0 (- (sqrt 2.0))))
                                               (if (<= B_m 1e-234)
                                                 (/ (sqrt (* -8.0 (* (* (* A C) F) (+ A A)))) (* (* 4.0 A) C))
                                                 (if (<= B_m 6.8e+58)
                                                   (* (sqrt (* F (/ -0.5 C))) t_0)
                                                   (* (sqrt (/ (- F) B_m)) t_0)))))
                                            B_m = fabs(B);
                                            assert(A < B_m && B_m < C && C < F);
                                            double code(double A, double B_m, double C, double F) {
                                            	double t_0 = -sqrt(2.0);
                                            	double tmp;
                                            	if (B_m <= 1e-234) {
                                            		tmp = sqrt((-8.0 * (((A * C) * F) * (A + A)))) / ((4.0 * A) * C);
                                            	} else if (B_m <= 6.8e+58) {
                                            		tmp = sqrt((F * (-0.5 / C))) * t_0;
                                            	} else {
                                            		tmp = sqrt((-F / B_m)) * t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            B_m =     private
                                            NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                            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_m, c, f)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: a
                                                real(8), intent (in) :: b_m
                                                real(8), intent (in) :: c
                                                real(8), intent (in) :: f
                                                real(8) :: t_0
                                                real(8) :: tmp
                                                t_0 = -sqrt(2.0d0)
                                                if (b_m <= 1d-234) then
                                                    tmp = sqrt(((-8.0d0) * (((a * c) * f) * (a + a)))) / ((4.0d0 * a) * c)
                                                else if (b_m <= 6.8d+58) then
                                                    tmp = sqrt((f * ((-0.5d0) / c))) * t_0
                                                else
                                                    tmp = sqrt((-f / b_m)) * t_0
                                                end if
                                                code = tmp
                                            end function
                                            
                                            B_m = Math.abs(B);
                                            assert A < B_m && B_m < C && C < F;
                                            public static double code(double A, double B_m, double C, double F) {
                                            	double t_0 = -Math.sqrt(2.0);
                                            	double tmp;
                                            	if (B_m <= 1e-234) {
                                            		tmp = Math.sqrt((-8.0 * (((A * C) * F) * (A + A)))) / ((4.0 * A) * C);
                                            	} else if (B_m <= 6.8e+58) {
                                            		tmp = Math.sqrt((F * (-0.5 / C))) * t_0;
                                            	} else {
                                            		tmp = Math.sqrt((-F / B_m)) * t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            B_m = math.fabs(B)
                                            [A, B_m, C, F] = sort([A, B_m, C, F])
                                            def code(A, B_m, C, F):
                                            	t_0 = -math.sqrt(2.0)
                                            	tmp = 0
                                            	if B_m <= 1e-234:
                                            		tmp = math.sqrt((-8.0 * (((A * C) * F) * (A + A)))) / ((4.0 * A) * C)
                                            	elif B_m <= 6.8e+58:
                                            		tmp = math.sqrt((F * (-0.5 / C))) * t_0
                                            	else:
                                            		tmp = math.sqrt((-F / B_m)) * t_0
                                            	return tmp
                                            
                                            B_m = abs(B)
                                            A, B_m, C, F = sort([A, B_m, C, F])
                                            function code(A, B_m, C, F)
                                            	t_0 = Float64(-sqrt(2.0))
                                            	tmp = 0.0
                                            	if (B_m <= 1e-234)
                                            		tmp = Float64(sqrt(Float64(-8.0 * Float64(Float64(Float64(A * C) * F) * Float64(A + A)))) / Float64(Float64(4.0 * A) * C));
                                            	elseif (B_m <= 6.8e+58)
                                            		tmp = Float64(sqrt(Float64(F * Float64(-0.5 / C))) * t_0);
                                            	else
                                            		tmp = Float64(sqrt(Float64(Float64(-F) / B_m)) * t_0);
                                            	end
                                            	return tmp
                                            end
                                            
                                            B_m = abs(B);
                                            A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
                                            function tmp_2 = code(A, B_m, C, F)
                                            	t_0 = -sqrt(2.0);
                                            	tmp = 0.0;
                                            	if (B_m <= 1e-234)
                                            		tmp = sqrt((-8.0 * (((A * C) * F) * (A + A)))) / ((4.0 * A) * C);
                                            	elseif (B_m <= 6.8e+58)
                                            		tmp = sqrt((F * (-0.5 / C))) * t_0;
                                            	else
                                            		tmp = sqrt((-F / B_m)) * t_0;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            B_m = N[Abs[B], $MachinePrecision]
                                            NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                            code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = (-N[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[B$95$m, 1e-234], N[(N[Sqrt[N[(-8.0 * N[(N[(N[(A * C), $MachinePrecision] * F), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 6.8e+58], N[(N[Sqrt[N[(F * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[((-F) / B$95$m), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
                                            
                                            \begin{array}{l}
                                            B_m = \left|B\right|
                                            \\
                                            [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
                                            \\
                                            \begin{array}{l}
                                            t_0 := -\sqrt{2}\\
                                            \mathbf{if}\;B\_m \leq 10^{-234}:\\
                                            \;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(\left(A \cdot C\right) \cdot F\right) \cdot \left(A + A\right)\right)}}{\left(4 \cdot A\right) \cdot C}\\
                                            
                                            \mathbf{elif}\;B\_m \leq 6.8 \cdot 10^{+58}:\\
                                            \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot t\_0\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\sqrt{\frac{-F}{B\_m}} \cdot t\_0\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if B < 9.9999999999999996e-235

                                              1. Initial program 18.3%

                                                \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                              2. Add Preprocessing
                                              3. Step-by-step derivation
                                                1. lift-/.f64N/A

                                                  \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                  \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                3. distribute-frac-negN/A

                                                  \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                4. distribute-neg-frac2N/A

                                                  \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                5. lower-/.f64N/A

                                                  \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                              4. Applied rewrites23.8%

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

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

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

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

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

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

                                                    if 9.9999999999999996e-235 < B < 6.8000000000000001e58

                                                    1. Initial program 23.5%

                                                      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                    2. Add Preprocessing
                                                    3. Step-by-step derivation
                                                      1. lift-/.f64N/A

                                                        \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                      3. distribute-frac-negN/A

                                                        \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                      4. distribute-neg-frac2N/A

                                                        \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                      5. lower-/.f64N/A

                                                        \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                    4. Applied rewrites30.2%

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

                                                      \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites15.3%

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

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

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

                                                        \[\leadsto -\sqrt{F \cdot \frac{\frac{-1}{2}}{C}} \cdot \sqrt{2} \]
                                                      5. Step-by-step derivation
                                                        1. Applied rewrites26.1%

                                                          \[\leadsto -\sqrt{F \cdot \frac{-0.5}{C}} \cdot \sqrt{2} \]

                                                        if 6.8000000000000001e58 < B

                                                        1. Initial program 13.8%

                                                          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                        2. Add Preprocessing
                                                        3. Step-by-step derivation
                                                          1. lift-/.f64N/A

                                                            \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                          3. distribute-frac-negN/A

                                                            \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                          4. distribute-neg-frac2N/A

                                                            \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                          5. lower-/.f64N/A

                                                            \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                        4. Applied rewrites13.8%

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

                                                          \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
                                                        6. Step-by-step derivation
                                                          1. Applied rewrites1.9%

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

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

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

                                                            \[\leadsto -\sqrt{-1 \cdot \frac{F}{B}} \cdot \sqrt{2} \]
                                                          5. Step-by-step derivation
                                                            1. Applied rewrites64.3%

                                                              \[\leadsto -\sqrt{-\frac{F}{B}} \cdot \sqrt{2} \]
                                                          6. Recombined 3 regimes into one program.
                                                          7. Final simplification25.2%

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

                                                          Alternative 5: 40.3% accurate, 8.0× speedup?

                                                          \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := -\sqrt{2}\\ \mathbf{if}\;B\_m \leq 9.2 \cdot 10^{-235}:\\ \;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;B\_m \leq 6.8 \cdot 10^{+58}:\\ \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{B\_m}} \cdot t\_0\\ \end{array} \end{array} \]
                                                          B_m = (fabs.f64 B)
                                                          NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                          (FPCore (A B_m C F)
                                                           :precision binary64
                                                           (let* ((t_0 (- (sqrt 2.0))))
                                                             (if (<= B_m 9.2e-235)
                                                               (/ (sqrt (* -8.0 (* A (* C (* F (+ A A)))))) (* (* 4.0 A) C))
                                                               (if (<= B_m 6.8e+58)
                                                                 (* (sqrt (* F (/ -0.5 C))) t_0)
                                                                 (* (sqrt (/ (- F) B_m)) t_0)))))
                                                          B_m = fabs(B);
                                                          assert(A < B_m && B_m < C && C < F);
                                                          double code(double A, double B_m, double C, double F) {
                                                          	double t_0 = -sqrt(2.0);
                                                          	double tmp;
                                                          	if (B_m <= 9.2e-235) {
                                                          		tmp = sqrt((-8.0 * (A * (C * (F * (A + A)))))) / ((4.0 * A) * C);
                                                          	} else if (B_m <= 6.8e+58) {
                                                          		tmp = sqrt((F * (-0.5 / C))) * t_0;
                                                          	} else {
                                                          		tmp = sqrt((-F / B_m)) * t_0;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          B_m =     private
                                                          NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                          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_m, c, f)
                                                          use fmin_fmax_functions
                                                              real(8), intent (in) :: a
                                                              real(8), intent (in) :: b_m
                                                              real(8), intent (in) :: c
                                                              real(8), intent (in) :: f
                                                              real(8) :: t_0
                                                              real(8) :: tmp
                                                              t_0 = -sqrt(2.0d0)
                                                              if (b_m <= 9.2d-235) then
                                                                  tmp = sqrt(((-8.0d0) * (a * (c * (f * (a + a)))))) / ((4.0d0 * a) * c)
                                                              else if (b_m <= 6.8d+58) then
                                                                  tmp = sqrt((f * ((-0.5d0) / c))) * t_0
                                                              else
                                                                  tmp = sqrt((-f / b_m)) * t_0
                                                              end if
                                                              code = tmp
                                                          end function
                                                          
                                                          B_m = Math.abs(B);
                                                          assert A < B_m && B_m < C && C < F;
                                                          public static double code(double A, double B_m, double C, double F) {
                                                          	double t_0 = -Math.sqrt(2.0);
                                                          	double tmp;
                                                          	if (B_m <= 9.2e-235) {
                                                          		tmp = Math.sqrt((-8.0 * (A * (C * (F * (A + A)))))) / ((4.0 * A) * C);
                                                          	} else if (B_m <= 6.8e+58) {
                                                          		tmp = Math.sqrt((F * (-0.5 / C))) * t_0;
                                                          	} else {
                                                          		tmp = Math.sqrt((-F / B_m)) * t_0;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          B_m = math.fabs(B)
                                                          [A, B_m, C, F] = sort([A, B_m, C, F])
                                                          def code(A, B_m, C, F):
                                                          	t_0 = -math.sqrt(2.0)
                                                          	tmp = 0
                                                          	if B_m <= 9.2e-235:
                                                          		tmp = math.sqrt((-8.0 * (A * (C * (F * (A + A)))))) / ((4.0 * A) * C)
                                                          	elif B_m <= 6.8e+58:
                                                          		tmp = math.sqrt((F * (-0.5 / C))) * t_0
                                                          	else:
                                                          		tmp = math.sqrt((-F / B_m)) * t_0
                                                          	return tmp
                                                          
                                                          B_m = abs(B)
                                                          A, B_m, C, F = sort([A, B_m, C, F])
                                                          function code(A, B_m, C, F)
                                                          	t_0 = Float64(-sqrt(2.0))
                                                          	tmp = 0.0
                                                          	if (B_m <= 9.2e-235)
                                                          		tmp = Float64(sqrt(Float64(-8.0 * Float64(A * Float64(C * Float64(F * Float64(A + A)))))) / Float64(Float64(4.0 * A) * C));
                                                          	elseif (B_m <= 6.8e+58)
                                                          		tmp = Float64(sqrt(Float64(F * Float64(-0.5 / C))) * t_0);
                                                          	else
                                                          		tmp = Float64(sqrt(Float64(Float64(-F) / B_m)) * t_0);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          B_m = abs(B);
                                                          A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
                                                          function tmp_2 = code(A, B_m, C, F)
                                                          	t_0 = -sqrt(2.0);
                                                          	tmp = 0.0;
                                                          	if (B_m <= 9.2e-235)
                                                          		tmp = sqrt((-8.0 * (A * (C * (F * (A + A)))))) / ((4.0 * A) * C);
                                                          	elseif (B_m <= 6.8e+58)
                                                          		tmp = sqrt((F * (-0.5 / C))) * t_0;
                                                          	else
                                                          		tmp = sqrt((-F / B_m)) * t_0;
                                                          	end
                                                          	tmp_2 = tmp;
                                                          end
                                                          
                                                          B_m = N[Abs[B], $MachinePrecision]
                                                          NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                          code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = (-N[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[B$95$m, 9.2e-235], N[(N[Sqrt[N[(-8.0 * N[(A * N[(C * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 6.8e+58], N[(N[Sqrt[N[(F * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[((-F) / B$95$m), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
                                                          
                                                          \begin{array}{l}
                                                          B_m = \left|B\right|
                                                          \\
                                                          [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
                                                          \\
                                                          \begin{array}{l}
                                                          t_0 := -\sqrt{2}\\
                                                          \mathbf{if}\;B\_m \leq 9.2 \cdot 10^{-235}:\\
                                                          \;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C}\\
                                                          
                                                          \mathbf{elif}\;B\_m \leq 6.8 \cdot 10^{+58}:\\
                                                          \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot t\_0\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\sqrt{\frac{-F}{B\_m}} \cdot t\_0\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 3 regimes
                                                          2. if B < 9.19999999999999989e-235

                                                            1. Initial program 18.3%

                                                              \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                            2. Add Preprocessing
                                                            3. Step-by-step derivation
                                                              1. lift-/.f64N/A

                                                                \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                                \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                              3. distribute-frac-negN/A

                                                                \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                              4. distribute-neg-frac2N/A

                                                                \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                              5. lower-/.f64N/A

                                                                \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                            4. Applied rewrites23.8%

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

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

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

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

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

                                                                if 9.19999999999999989e-235 < B < 6.8000000000000001e58

                                                                1. Initial program 23.5%

                                                                  \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                2. Add Preprocessing
                                                                3. Step-by-step derivation
                                                                  1. lift-/.f64N/A

                                                                    \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                                    \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                  3. distribute-frac-negN/A

                                                                    \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                                  4. distribute-neg-frac2N/A

                                                                    \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                  5. lower-/.f64N/A

                                                                    \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                4. Applied rewrites30.2%

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

                                                                  \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
                                                                6. Step-by-step derivation
                                                                  1. Applied rewrites15.3%

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

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

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

                                                                    \[\leadsto -\sqrt{F \cdot \frac{\frac{-1}{2}}{C}} \cdot \sqrt{2} \]
                                                                  5. Step-by-step derivation
                                                                    1. Applied rewrites26.1%

                                                                      \[\leadsto -\sqrt{F \cdot \frac{-0.5}{C}} \cdot \sqrt{2} \]

                                                                    if 6.8000000000000001e58 < B

                                                                    1. Initial program 13.8%

                                                                      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                    2. Add Preprocessing
                                                                    3. Step-by-step derivation
                                                                      1. lift-/.f64N/A

                                                                        \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                                        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                      3. distribute-frac-negN/A

                                                                        \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                                      4. distribute-neg-frac2N/A

                                                                        \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                      5. lower-/.f64N/A

                                                                        \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                    4. Applied rewrites13.8%

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

                                                                      \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
                                                                    6. Step-by-step derivation
                                                                      1. Applied rewrites1.9%

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

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

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

                                                                        \[\leadsto -\sqrt{-1 \cdot \frac{F}{B}} \cdot \sqrt{2} \]
                                                                      5. Step-by-step derivation
                                                                        1. Applied rewrites64.3%

                                                                          \[\leadsto -\sqrt{-\frac{F}{B}} \cdot \sqrt{2} \]
                                                                      6. Recombined 3 regimes into one program.
                                                                      7. Final simplification25.3%

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

                                                                      Alternative 6: 39.5% accurate, 9.8× speedup?

                                                                      \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := -\sqrt{2}\\ \mathbf{if}\;B\_m \leq 6.8 \cdot 10^{+58}:\\ \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{B\_m}} \cdot t\_0\\ \end{array} \end{array} \]
                                                                      B_m = (fabs.f64 B)
                                                                      NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                                      (FPCore (A B_m C F)
                                                                       :precision binary64
                                                                       (let* ((t_0 (- (sqrt 2.0))))
                                                                         (if (<= B_m 6.8e+58)
                                                                           (* (sqrt (* F (/ -0.5 C))) t_0)
                                                                           (* (sqrt (/ (- F) B_m)) t_0))))
                                                                      B_m = fabs(B);
                                                                      assert(A < B_m && B_m < C && C < F);
                                                                      double code(double A, double B_m, double C, double F) {
                                                                      	double t_0 = -sqrt(2.0);
                                                                      	double tmp;
                                                                      	if (B_m <= 6.8e+58) {
                                                                      		tmp = sqrt((F * (-0.5 / C))) * t_0;
                                                                      	} else {
                                                                      		tmp = sqrt((-F / B_m)) * t_0;
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      B_m =     private
                                                                      NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                                      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_m, c, f)
                                                                      use fmin_fmax_functions
                                                                          real(8), intent (in) :: a
                                                                          real(8), intent (in) :: b_m
                                                                          real(8), intent (in) :: c
                                                                          real(8), intent (in) :: f
                                                                          real(8) :: t_0
                                                                          real(8) :: tmp
                                                                          t_0 = -sqrt(2.0d0)
                                                                          if (b_m <= 6.8d+58) then
                                                                              tmp = sqrt((f * ((-0.5d0) / c))) * t_0
                                                                          else
                                                                              tmp = sqrt((-f / b_m)) * t_0
                                                                          end if
                                                                          code = tmp
                                                                      end function
                                                                      
                                                                      B_m = Math.abs(B);
                                                                      assert A < B_m && B_m < C && C < F;
                                                                      public static double code(double A, double B_m, double C, double F) {
                                                                      	double t_0 = -Math.sqrt(2.0);
                                                                      	double tmp;
                                                                      	if (B_m <= 6.8e+58) {
                                                                      		tmp = Math.sqrt((F * (-0.5 / C))) * t_0;
                                                                      	} else {
                                                                      		tmp = Math.sqrt((-F / B_m)) * t_0;
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      B_m = math.fabs(B)
                                                                      [A, B_m, C, F] = sort([A, B_m, C, F])
                                                                      def code(A, B_m, C, F):
                                                                      	t_0 = -math.sqrt(2.0)
                                                                      	tmp = 0
                                                                      	if B_m <= 6.8e+58:
                                                                      		tmp = math.sqrt((F * (-0.5 / C))) * t_0
                                                                      	else:
                                                                      		tmp = math.sqrt((-F / B_m)) * t_0
                                                                      	return tmp
                                                                      
                                                                      B_m = abs(B)
                                                                      A, B_m, C, F = sort([A, B_m, C, F])
                                                                      function code(A, B_m, C, F)
                                                                      	t_0 = Float64(-sqrt(2.0))
                                                                      	tmp = 0.0
                                                                      	if (B_m <= 6.8e+58)
                                                                      		tmp = Float64(sqrt(Float64(F * Float64(-0.5 / C))) * t_0);
                                                                      	else
                                                                      		tmp = Float64(sqrt(Float64(Float64(-F) / B_m)) * t_0);
                                                                      	end
                                                                      	return tmp
                                                                      end
                                                                      
                                                                      B_m = abs(B);
                                                                      A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
                                                                      function tmp_2 = code(A, B_m, C, F)
                                                                      	t_0 = -sqrt(2.0);
                                                                      	tmp = 0.0;
                                                                      	if (B_m <= 6.8e+58)
                                                                      		tmp = sqrt((F * (-0.5 / C))) * t_0;
                                                                      	else
                                                                      		tmp = sqrt((-F / B_m)) * t_0;
                                                                      	end
                                                                      	tmp_2 = tmp;
                                                                      end
                                                                      
                                                                      B_m = N[Abs[B], $MachinePrecision]
                                                                      NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                                      code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = (-N[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[B$95$m, 6.8e+58], N[(N[Sqrt[N[(F * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[((-F) / B$95$m), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
                                                                      
                                                                      \begin{array}{l}
                                                                      B_m = \left|B\right|
                                                                      \\
                                                                      [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
                                                                      \\
                                                                      \begin{array}{l}
                                                                      t_0 := -\sqrt{2}\\
                                                                      \mathbf{if}\;B\_m \leq 6.8 \cdot 10^{+58}:\\
                                                                      \;\;\;\;\sqrt{F \cdot \frac{-0.5}{C}} \cdot t\_0\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;\sqrt{\frac{-F}{B\_m}} \cdot t\_0\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 2 regimes
                                                                      2. if B < 6.8000000000000001e58

                                                                        1. Initial program 19.8%

                                                                          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                        2. Add Preprocessing
                                                                        3. Step-by-step derivation
                                                                          1. lift-/.f64N/A

                                                                            \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                                            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                          3. distribute-frac-negN/A

                                                                            \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                                          4. distribute-neg-frac2N/A

                                                                            \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                          5. lower-/.f64N/A

                                                                            \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                        4. Applied rewrites25.6%

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

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

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

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

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

                                                                            \[\leadsto -\sqrt{F \cdot \frac{\frac{-1}{2}}{C}} \cdot \sqrt{2} \]
                                                                          5. Step-by-step derivation
                                                                            1. Applied rewrites17.4%

                                                                              \[\leadsto -\sqrt{F \cdot \frac{-0.5}{C}} \cdot \sqrt{2} \]

                                                                            if 6.8000000000000001e58 < B

                                                                            1. Initial program 13.8%

                                                                              \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                            2. Add Preprocessing
                                                                            3. Step-by-step derivation
                                                                              1. lift-/.f64N/A

                                                                                \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                                                \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                              3. distribute-frac-negN/A

                                                                                \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                                              4. distribute-neg-frac2N/A

                                                                                \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                              5. lower-/.f64N/A

                                                                                \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                            4. Applied rewrites13.8%

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

                                                                              \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
                                                                            6. Step-by-step derivation
                                                                              1. Applied rewrites1.9%

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

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

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

                                                                                \[\leadsto -\sqrt{-1 \cdot \frac{F}{B}} \cdot \sqrt{2} \]
                                                                              5. Step-by-step derivation
                                                                                1. Applied rewrites64.3%

                                                                                  \[\leadsto -\sqrt{-\frac{F}{B}} \cdot \sqrt{2} \]
                                                                              6. Recombined 2 regimes into one program.
                                                                              7. Final simplification26.0%

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

                                                                              Alternative 7: 39.5% accurate, 9.8× speedup?

                                                                              \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := -\sqrt{2}\\ \mathbf{if}\;B\_m \leq 6.8 \cdot 10^{+58}:\\ \;\;\;\;\sqrt{-0.5 \cdot \frac{F}{C}} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{B\_m}} \cdot t\_0\\ \end{array} \end{array} \]
                                                                              B_m = (fabs.f64 B)
                                                                              NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                                              (FPCore (A B_m C F)
                                                                               :precision binary64
                                                                               (let* ((t_0 (- (sqrt 2.0))))
                                                                                 (if (<= B_m 6.8e+58)
                                                                                   (* (sqrt (* -0.5 (/ F C))) t_0)
                                                                                   (* (sqrt (/ (- F) B_m)) t_0))))
                                                                              B_m = fabs(B);
                                                                              assert(A < B_m && B_m < C && C < F);
                                                                              double code(double A, double B_m, double C, double F) {
                                                                              	double t_0 = -sqrt(2.0);
                                                                              	double tmp;
                                                                              	if (B_m <= 6.8e+58) {
                                                                              		tmp = sqrt((-0.5 * (F / C))) * t_0;
                                                                              	} else {
                                                                              		tmp = sqrt((-F / B_m)) * t_0;
                                                                              	}
                                                                              	return tmp;
                                                                              }
                                                                              
                                                                              B_m =     private
                                                                              NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                                              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_m, c, f)
                                                                              use fmin_fmax_functions
                                                                                  real(8), intent (in) :: a
                                                                                  real(8), intent (in) :: b_m
                                                                                  real(8), intent (in) :: c
                                                                                  real(8), intent (in) :: f
                                                                                  real(8) :: t_0
                                                                                  real(8) :: tmp
                                                                                  t_0 = -sqrt(2.0d0)
                                                                                  if (b_m <= 6.8d+58) then
                                                                                      tmp = sqrt(((-0.5d0) * (f / c))) * t_0
                                                                                  else
                                                                                      tmp = sqrt((-f / b_m)) * t_0
                                                                                  end if
                                                                                  code = tmp
                                                                              end function
                                                                              
                                                                              B_m = Math.abs(B);
                                                                              assert A < B_m && B_m < C && C < F;
                                                                              public static double code(double A, double B_m, double C, double F) {
                                                                              	double t_0 = -Math.sqrt(2.0);
                                                                              	double tmp;
                                                                              	if (B_m <= 6.8e+58) {
                                                                              		tmp = Math.sqrt((-0.5 * (F / C))) * t_0;
                                                                              	} else {
                                                                              		tmp = Math.sqrt((-F / B_m)) * t_0;
                                                                              	}
                                                                              	return tmp;
                                                                              }
                                                                              
                                                                              B_m = math.fabs(B)
                                                                              [A, B_m, C, F] = sort([A, B_m, C, F])
                                                                              def code(A, B_m, C, F):
                                                                              	t_0 = -math.sqrt(2.0)
                                                                              	tmp = 0
                                                                              	if B_m <= 6.8e+58:
                                                                              		tmp = math.sqrt((-0.5 * (F / C))) * t_0
                                                                              	else:
                                                                              		tmp = math.sqrt((-F / B_m)) * t_0
                                                                              	return tmp
                                                                              
                                                                              B_m = abs(B)
                                                                              A, B_m, C, F = sort([A, B_m, C, F])
                                                                              function code(A, B_m, C, F)
                                                                              	t_0 = Float64(-sqrt(2.0))
                                                                              	tmp = 0.0
                                                                              	if (B_m <= 6.8e+58)
                                                                              		tmp = Float64(sqrt(Float64(-0.5 * Float64(F / C))) * t_0);
                                                                              	else
                                                                              		tmp = Float64(sqrt(Float64(Float64(-F) / B_m)) * t_0);
                                                                              	end
                                                                              	return tmp
                                                                              end
                                                                              
                                                                              B_m = abs(B);
                                                                              A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
                                                                              function tmp_2 = code(A, B_m, C, F)
                                                                              	t_0 = -sqrt(2.0);
                                                                              	tmp = 0.0;
                                                                              	if (B_m <= 6.8e+58)
                                                                              		tmp = sqrt((-0.5 * (F / C))) * t_0;
                                                                              	else
                                                                              		tmp = sqrt((-F / B_m)) * t_0;
                                                                              	end
                                                                              	tmp_2 = tmp;
                                                                              end
                                                                              
                                                                              B_m = N[Abs[B], $MachinePrecision]
                                                                              NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                                              code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = (-N[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[B$95$m, 6.8e+58], N[(N[Sqrt[N[(-0.5 * N[(F / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[((-F) / B$95$m), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
                                                                              
                                                                              \begin{array}{l}
                                                                              B_m = \left|B\right|
                                                                              \\
                                                                              [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
                                                                              \\
                                                                              \begin{array}{l}
                                                                              t_0 := -\sqrt{2}\\
                                                                              \mathbf{if}\;B\_m \leq 6.8 \cdot 10^{+58}:\\
                                                                              \;\;\;\;\sqrt{-0.5 \cdot \frac{F}{C}} \cdot t\_0\\
                                                                              
                                                                              \mathbf{else}:\\
                                                                              \;\;\;\;\sqrt{\frac{-F}{B\_m}} \cdot t\_0\\
                                                                              
                                                                              
                                                                              \end{array}
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Split input into 2 regimes
                                                                              2. if B < 6.8000000000000001e58

                                                                                1. Initial program 19.8%

                                                                                  \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                                2. Add Preprocessing
                                                                                3. Step-by-step derivation
                                                                                  1. lift-/.f64N/A

                                                                                    \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                                                    \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                                  3. distribute-frac-negN/A

                                                                                    \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                                                  4. distribute-neg-frac2N/A

                                                                                    \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                                  5. lower-/.f64N/A

                                                                                    \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                                4. Applied rewrites25.6%

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

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

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

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

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

                                                                                    \[\leadsto -\sqrt{\frac{-1}{2} \cdot \frac{F}{C}} \cdot \sqrt{2} \]
                                                                                  5. Step-by-step derivation
                                                                                    1. Applied rewrites17.4%

                                                                                      \[\leadsto -\sqrt{-0.5 \cdot \frac{F}{C}} \cdot \sqrt{2} \]

                                                                                    if 6.8000000000000001e58 < B

                                                                                    1. Initial program 13.8%

                                                                                      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                                    2. Add Preprocessing
                                                                                    3. Step-by-step derivation
                                                                                      1. lift-/.f64N/A

                                                                                        \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                                                        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                                      3. distribute-frac-negN/A

                                                                                        \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                                                      4. distribute-neg-frac2N/A

                                                                                        \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                                      5. lower-/.f64N/A

                                                                                        \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                                    4. Applied rewrites13.8%

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

                                                                                      \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}}{-\mathsf{fma}\left(-4 \cdot A, C, B \cdot B\right)} \]
                                                                                    6. Step-by-step derivation
                                                                                      1. Applied rewrites1.9%

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

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

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

                                                                                        \[\leadsto -\sqrt{-1 \cdot \frac{F}{B}} \cdot \sqrt{2} \]
                                                                                      5. Step-by-step derivation
                                                                                        1. Applied rewrites64.3%

                                                                                          \[\leadsto -\sqrt{-\frac{F}{B}} \cdot \sqrt{2} \]
                                                                                      6. Recombined 2 regimes into one program.
                                                                                      7. Final simplification26.0%

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

                                                                                      Alternative 8: 34.3% accurate, 10.4× speedup?

                                                                                      \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;F \leq -2.35 \cdot 10^{+62}:\\ \;\;\;\;\sqrt{\frac{-F}{B\_m}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(A - B\_m\right) \cdot F\right)}}{-B\_m}\\ \end{array} \end{array} \]
                                                                                      B_m = (fabs.f64 B)
                                                                                      NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                                                      (FPCore (A B_m C F)
                                                                                       :precision binary64
                                                                                       (if (<= F -2.35e+62)
                                                                                         (* (sqrt (/ (- F) B_m)) (- (sqrt 2.0)))
                                                                                         (/ (sqrt (* 2.0 (* (- A B_m) F))) (- B_m))))
                                                                                      B_m = fabs(B);
                                                                                      assert(A < B_m && B_m < C && C < F);
                                                                                      double code(double A, double B_m, double C, double F) {
                                                                                      	double tmp;
                                                                                      	if (F <= -2.35e+62) {
                                                                                      		tmp = sqrt((-F / B_m)) * -sqrt(2.0);
                                                                                      	} else {
                                                                                      		tmp = sqrt((2.0 * ((A - B_m) * F))) / -B_m;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      B_m =     private
                                                                                      NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                                                      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_m, c, f)
                                                                                      use fmin_fmax_functions
                                                                                          real(8), intent (in) :: a
                                                                                          real(8), intent (in) :: b_m
                                                                                          real(8), intent (in) :: c
                                                                                          real(8), intent (in) :: f
                                                                                          real(8) :: tmp
                                                                                          if (f <= (-2.35d+62)) then
                                                                                              tmp = sqrt((-f / b_m)) * -sqrt(2.0d0)
                                                                                          else
                                                                                              tmp = sqrt((2.0d0 * ((a - b_m) * f))) / -b_m
                                                                                          end if
                                                                                          code = tmp
                                                                                      end function
                                                                                      
                                                                                      B_m = Math.abs(B);
                                                                                      assert A < B_m && B_m < C && C < F;
                                                                                      public static double code(double A, double B_m, double C, double F) {
                                                                                      	double tmp;
                                                                                      	if (F <= -2.35e+62) {
                                                                                      		tmp = Math.sqrt((-F / B_m)) * -Math.sqrt(2.0);
                                                                                      	} else {
                                                                                      		tmp = Math.sqrt((2.0 * ((A - B_m) * F))) / -B_m;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      B_m = math.fabs(B)
                                                                                      [A, B_m, C, F] = sort([A, B_m, C, F])
                                                                                      def code(A, B_m, C, F):
                                                                                      	tmp = 0
                                                                                      	if F <= -2.35e+62:
                                                                                      		tmp = math.sqrt((-F / B_m)) * -math.sqrt(2.0)
                                                                                      	else:
                                                                                      		tmp = math.sqrt((2.0 * ((A - B_m) * F))) / -B_m
                                                                                      	return tmp
                                                                                      
                                                                                      B_m = abs(B)
                                                                                      A, B_m, C, F = sort([A, B_m, C, F])
                                                                                      function code(A, B_m, C, F)
                                                                                      	tmp = 0.0
                                                                                      	if (F <= -2.35e+62)
                                                                                      		tmp = Float64(sqrt(Float64(Float64(-F) / B_m)) * Float64(-sqrt(2.0)));
                                                                                      	else
                                                                                      		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(A - B_m) * F))) / Float64(-B_m));
                                                                                      	end
                                                                                      	return tmp
                                                                                      end
                                                                                      
                                                                                      B_m = abs(B);
                                                                                      A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
                                                                                      function tmp_2 = code(A, B_m, C, F)
                                                                                      	tmp = 0.0;
                                                                                      	if (F <= -2.35e+62)
                                                                                      		tmp = sqrt((-F / B_m)) * -sqrt(2.0);
                                                                                      	else
                                                                                      		tmp = sqrt((2.0 * ((A - B_m) * F))) / -B_m;
                                                                                      	end
                                                                                      	tmp_2 = tmp;
                                                                                      end
                                                                                      
                                                                                      B_m = N[Abs[B], $MachinePrecision]
                                                                                      NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
                                                                                      code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -2.35e+62], N[(N[Sqrt[N[((-F) / B$95$m), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(A - B$95$m), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      B_m = \left|B\right|
                                                                                      \\
                                                                                      [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      \mathbf{if}\;F \leq -2.35 \cdot 10^{+62}:\\
                                                                                      \;\;\;\;\sqrt{\frac{-F}{B\_m}} \cdot \left(-\sqrt{2}\right)\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(A - B\_m\right) \cdot F\right)}}{-B\_m}\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 2 regimes
                                                                                      2. if F < -2.3500000000000001e62

                                                                                        1. Initial program 13.4%

                                                                                          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                                        2. Add Preprocessing
                                                                                        3. Step-by-step derivation
                                                                                          1. lift-/.f64N/A

                                                                                            \[\leadsto \color{blue}{\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. lift-neg.f64N/A

                                                                                            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                                                                          3. distribute-frac-negN/A

                                                                                            \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
                                                                                          4. distribute-neg-frac2N/A

                                                                                            \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                                          5. lower-/.f64N/A

                                                                                            \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
                                                                                        4. Applied rewrites14.3%

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

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

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

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

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

                                                                                            \[\leadsto -\sqrt{-1 \cdot \frac{F}{B}} \cdot \sqrt{2} \]
                                                                                          5. Step-by-step derivation
                                                                                            1. Applied rewrites19.7%

                                                                                              \[\leadsto -\sqrt{-\frac{F}{B}} \cdot \sqrt{2} \]

                                                                                            if -2.3500000000000001e62 < F

                                                                                            1. Initial program 21.9%

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

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

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

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

                                                                                                  \[\leadsto \frac{\sqrt{2 \cdot \left(\left(A - B\right) \cdot F\right)}}{-B} \]
                                                                                                3. Step-by-step derivation
                                                                                                  1. Applied rewrites15.0%

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

                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.35 \cdot 10^{+62}:\\ \;\;\;\;\sqrt{\frac{-F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(A - B\right) \cdot F\right)}}{-B}\\ \end{array} \]
                                                                                                6. Add Preprocessing

                                                                                                Alternative 9: 27.2% accurate, 13.3× speedup?

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

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

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

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

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

                                                                                                      \[\leadsto \frac{\sqrt{2 \cdot \left(\left(A - B\right) \cdot F\right)}}{-B} \]
                                                                                                    3. Step-by-step derivation
                                                                                                      1. Applied rewrites12.6%

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

                                                                                                      Alternative 10: 27.0% accurate, 14.4× speedup?

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

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

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

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

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

                                                                                                            \[\leadsto \frac{\sqrt{-2 \cdot \left(B \cdot F\right)}}{-B} \]
                                                                                                          3. Step-by-step derivation
                                                                                                            1. Applied rewrites13.2%

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

                                                                                                            Alternative 11: 1.6% accurate, 18.2× speedup?

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

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

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

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

                                                                                                                  \[\leadsto \color{blue}{\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
                                                                                                                2. Step-by-step derivation
                                                                                                                  1. Applied rewrites1.5%

                                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
                                                                                                                  2. Step-by-step derivation
                                                                                                                    1. Applied rewrites1.5%

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

                                                                                                                    Reproduce

                                                                                                                    ?
                                                                                                                    herbie shell --seed 2025018 
                                                                                                                    (FPCore (A B C F)
                                                                                                                      :name "ABCF->ab-angle b"
                                                                                                                      :precision binary64
                                                                                                                      (/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))