Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.2% → 90.6%
Time: 4.7s
Alternatives: 9
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \end{array} \]
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (V * l)));
}
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(c0, a, v, l)
use fmin_fmax_functions
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (V * l)));
end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 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: 73.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \end{array} \]
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (V * l)));
}
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(c0, a, v, l)
use fmin_fmax_functions
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (V * l)));
end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}

Alternative 1: 90.6% accurate, 0.3× speedup?

\[\begin{array}{l} A_m = \left|A\right| \\ V_m = \left|V\right| \\ l_m = \left|\ell\right| \\ [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\ \;\;\;\;\frac{\left(A\_m \cdot c0\right) \cdot \sqrt{\frac{V\_m}{A\_m \cdot l\_m}}}{V\_m}\\ \mathbf{elif}\;t\_0 \leq 10^{+103}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{l\_m}}{V\_m} \cdot A\_m}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{V\_m \cdot \frac{A\_m}{l\_m}}}{V\_m}\\ \end{array} \end{array} \]
A_m = (fabs.f64 A)
V_m = (fabs.f64 V)
l_m = (fabs.f64 l)
NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
(FPCore (c0 A_m V_m l_m)
 :precision binary64
 (let* ((t_0 (sqrt (/ A_m (* V_m l_m)))))
   (if (<= t_0 2e-157)
     (/ (* (* A_m c0) (sqrt (/ V_m (* A_m l_m)))) V_m)
     (if (<= t_0 1e+103)
       (* c0 (sqrt (* (/ (/ 1.0 l_m) V_m) A_m)))
       (* c0 (/ (sqrt (* V_m (/ A_m l_m))) V_m))))))
A_m = fabs(A);
V_m = fabs(V);
l_m = fabs(l);
assert(c0 < A_m && A_m < V_m && V_m < l_m);
double code(double c0, double A_m, double V_m, double l_m) {
	double t_0 = sqrt((A_m / (V_m * l_m)));
	double tmp;
	if (t_0 <= 2e-157) {
		tmp = ((A_m * c0) * sqrt((V_m / (A_m * l_m)))) / V_m;
	} else if (t_0 <= 1e+103) {
		tmp = c0 * sqrt((((1.0 / l_m) / V_m) * A_m));
	} else {
		tmp = c0 * (sqrt((V_m * (A_m / l_m))) / V_m);
	}
	return tmp;
}
A_m =     private
V_m =     private
l_m =     private
NOTE: c0, A_m, V_m, and l_m 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(c0, a_m, v_m, l_m)
use fmin_fmax_functions
    real(8), intent (in) :: c0
    real(8), intent (in) :: a_m
    real(8), intent (in) :: v_m
    real(8), intent (in) :: l_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((a_m / (v_m * l_m)))
    if (t_0 <= 2d-157) then
        tmp = ((a_m * c0) * sqrt((v_m / (a_m * l_m)))) / v_m
    else if (t_0 <= 1d+103) then
        tmp = c0 * sqrt((((1.0d0 / l_m) / v_m) * a_m))
    else
        tmp = c0 * (sqrt((v_m * (a_m / l_m))) / v_m)
    end if
    code = tmp
end function
A_m = Math.abs(A);
V_m = Math.abs(V);
l_m = Math.abs(l);
assert c0 < A_m && A_m < V_m && V_m < l_m;
public static double code(double c0, double A_m, double V_m, double l_m) {
	double t_0 = Math.sqrt((A_m / (V_m * l_m)));
	double tmp;
	if (t_0 <= 2e-157) {
		tmp = ((A_m * c0) * Math.sqrt((V_m / (A_m * l_m)))) / V_m;
	} else if (t_0 <= 1e+103) {
		tmp = c0 * Math.sqrt((((1.0 / l_m) / V_m) * A_m));
	} else {
		tmp = c0 * (Math.sqrt((V_m * (A_m / l_m))) / V_m);
	}
	return tmp;
}
A_m = math.fabs(A)
V_m = math.fabs(V)
l_m = math.fabs(l)
[c0, A_m, V_m, l_m] = sort([c0, A_m, V_m, l_m])
def code(c0, A_m, V_m, l_m):
	t_0 = math.sqrt((A_m / (V_m * l_m)))
	tmp = 0
	if t_0 <= 2e-157:
		tmp = ((A_m * c0) * math.sqrt((V_m / (A_m * l_m)))) / V_m
	elif t_0 <= 1e+103:
		tmp = c0 * math.sqrt((((1.0 / l_m) / V_m) * A_m))
	else:
		tmp = c0 * (math.sqrt((V_m * (A_m / l_m))) / V_m)
	return tmp
A_m = abs(A)
V_m = abs(V)
l_m = abs(l)
c0, A_m, V_m, l_m = sort([c0, A_m, V_m, l_m])
function code(c0, A_m, V_m, l_m)
	t_0 = sqrt(Float64(A_m / Float64(V_m * l_m)))
	tmp = 0.0
	if (t_0 <= 2e-157)
		tmp = Float64(Float64(Float64(A_m * c0) * sqrt(Float64(V_m / Float64(A_m * l_m)))) / V_m);
	elseif (t_0 <= 1e+103)
		tmp = Float64(c0 * sqrt(Float64(Float64(Float64(1.0 / l_m) / V_m) * A_m)));
	else
		tmp = Float64(c0 * Float64(sqrt(Float64(V_m * Float64(A_m / l_m))) / V_m));
	end
	return tmp
end
A_m = abs(A);
V_m = abs(V);
l_m = abs(l);
c0, A_m, V_m, l_m = num2cell(sort([c0, A_m, V_m, l_m])){:}
function tmp_2 = code(c0, A_m, V_m, l_m)
	t_0 = sqrt((A_m / (V_m * l_m)));
	tmp = 0.0;
	if (t_0 <= 2e-157)
		tmp = ((A_m * c0) * sqrt((V_m / (A_m * l_m)))) / V_m;
	elseif (t_0 <= 1e+103)
		tmp = c0 * sqrt((((1.0 / l_m) / V_m) * A_m));
	else
		tmp = c0 * (sqrt((V_m * (A_m / l_m))) / V_m);
	end
	tmp_2 = tmp;
end
A_m = N[Abs[A], $MachinePrecision]
V_m = N[Abs[V], $MachinePrecision]
l_m = N[Abs[l], $MachinePrecision]
NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
code[c0_, A$95$m_, V$95$m_, l$95$m_] := Block[{t$95$0 = N[Sqrt[N[(A$95$m / N[(V$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 2e-157], N[(N[(N[(A$95$m * c0), $MachinePrecision] * N[Sqrt[N[(V$95$m / N[(A$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / V$95$m), $MachinePrecision], If[LessEqual[t$95$0, 1e+103], N[(c0 * N[Sqrt[N[(N[(N[(1.0 / l$95$m), $MachinePrecision] / V$95$m), $MachinePrecision] * A$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(V$95$m * N[(A$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / V$95$m), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
A_m = \left|A\right|
\\
V_m = \left|V\right|
\\
l_m = \left|\ell\right|
\\
[c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\
\;\;\;\;\frac{\left(A\_m \cdot c0\right) \cdot \sqrt{\frac{V\_m}{A\_m \cdot l\_m}}}{V\_m}\\

\mathbf{elif}\;t\_0 \leq 10^{+103}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{l\_m}}{V\_m} \cdot A\_m}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{V\_m \cdot \frac{A\_m}{l\_m}}}{V\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (sqrt.f64 (/.f64 A (*.f64 V l))) < 1.99999999999999989e-157

    1. Initial program 73.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
      2. lift-/.f64N/A

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
      3. associate-/r*N/A

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      4. lower-/.f64N/A

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      5. lower-/.f6472.8

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{V}}}{\ell}} \]
    3. Applied rewrites72.8%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
    4. Taylor expanded in V around 0

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A \cdot V}{\ell}}}{V}} \]
    5. Step-by-step derivation
      1. Applied rewrites65.5%

        \[\leadsto \color{blue}{\sqrt{V \cdot \frac{A}{\ell}} \cdot \frac{c0}{V}} \]
      2. Taylor expanded in A around inf

        \[\leadsto \frac{A \cdot \left(c0 \cdot \sqrt{\frac{V}{A \cdot \ell}}\right)}{\color{blue}{V}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{A \cdot \left(c0 \cdot \sqrt{\frac{V}{A \cdot \ell}}\right)}{V} \]
        2. associate-*r*N/A

          \[\leadsto \frac{\left(A \cdot c0\right) \cdot \sqrt{\frac{V}{A \cdot \ell}}}{V} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{\left(A \cdot c0\right) \cdot \sqrt{\frac{V}{A \cdot \ell}}}{V} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{\left(A \cdot c0\right) \cdot \sqrt{\frac{V}{A \cdot \ell}}}{V} \]
        5. lower-sqrt.f64N/A

          \[\leadsto \frac{\left(A \cdot c0\right) \cdot \sqrt{\frac{V}{A \cdot \ell}}}{V} \]
        6. *-commutativeN/A

          \[\leadsto \frac{\left(A \cdot c0\right) \cdot \sqrt{\frac{V}{\ell \cdot A}}}{V} \]
        7. lower-/.f64N/A

          \[\leadsto \frac{\left(A \cdot c0\right) \cdot \sqrt{\frac{V}{\ell \cdot A}}}{V} \]
        8. *-commutativeN/A

          \[\leadsto \frac{\left(A \cdot c0\right) \cdot \sqrt{\frac{V}{A \cdot \ell}}}{V} \]
        9. lower-*.f6455.9

          \[\leadsto \frac{\left(A \cdot c0\right) \cdot \sqrt{\frac{V}{A \cdot \ell}}}{V} \]
      4. Applied rewrites55.9%

        \[\leadsto \frac{\left(A \cdot c0\right) \cdot \sqrt{\frac{V}{A \cdot \ell}}}{\color{blue}{V}} \]

      if 1.99999999999999989e-157 < (sqrt.f64 (/.f64 A (*.f64 V l))) < 1e103

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
        3. mult-flipN/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{A \cdot \frac{1}{V \cdot \ell}}} \]
        4. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
        5. lower-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
        6. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell}} \cdot A} \]
        7. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
        8. lower-*.f6472.9

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
      3. Applied rewrites72.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot V} \cdot A}} \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot V}} \cdot A} \]
        3. associate-/r*N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{V}} \cdot A} \]
        4. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{V}} \cdot A} \]
        5. lower-/.f6473.1

          \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{1}{\ell}}}{V} \cdot A} \]
      5. Applied rewrites73.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{V}} \cdot A} \]

      if 1e103 < (sqrt.f64 (/.f64 A (*.f64 V l)))

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
        3. associate-/r*N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        4. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        5. lower-/.f6472.8

          \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{V}}}{\ell}} \]
      3. Applied rewrites72.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      4. Taylor expanded in V around 0

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A \cdot V}{\ell}}}{V}} \]
      5. Step-by-step derivation
        1. pow1/2N/A

          \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A \cdot V}{\ell}}}}{V} \]
        2. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        3. *-commutativeN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\color{blue}{\ell}}}}{V} \]
        4. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        5. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        6. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        7. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        8. mult-flip-revN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        9. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\color{blue}{\ell}}}}{V} \]
        10. lift-*.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        11. lift-*.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        12. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        13. associate-*l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        14. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot \color{blue}{V}}{\ell}}}{V} \]
        15. mult-flipN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        16. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        17. pow1/2N/A

          \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A \cdot V}{\ell}}}}{V} \]
        18. lower-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\ell}}}{\color{blue}{V}} \]
        19. lower-sqrt.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\ell}}}{V} \]
        20. *-commutativeN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{V \cdot A}{\ell}}}{V} \]
        21. associate-/l*N/A

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
        22. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
        23. lower-*.f6469.8

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
      6. Applied rewrites69.8%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{V \cdot \frac{A}{\ell}}}{V}} \]
    6. Recombined 3 regimes into one program.
    7. Add Preprocessing

    Alternative 2: 90.4% accurate, 0.3× speedup?

    \[\begin{array}{l} A_m = \left|A\right| \\ V_m = \left|V\right| \\ l_m = \left|\ell\right| \\ [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\ \;\;\;\;\frac{\sqrt{\frac{A\_m}{V\_m} \cdot l\_m} \cdot c0}{l\_m}\\ \mathbf{elif}\;t\_0 \leq 10^{+103}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{l\_m}}{V\_m} \cdot A\_m}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{V\_m \cdot \frac{A\_m}{l\_m}}}{V\_m}\\ \end{array} \end{array} \]
    A_m = (fabs.f64 A)
    V_m = (fabs.f64 V)
    l_m = (fabs.f64 l)
    NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
    (FPCore (c0 A_m V_m l_m)
     :precision binary64
     (let* ((t_0 (sqrt (/ A_m (* V_m l_m)))))
       (if (<= t_0 2e-157)
         (/ (* (sqrt (* (/ A_m V_m) l_m)) c0) l_m)
         (if (<= t_0 1e+103)
           (* c0 (sqrt (* (/ (/ 1.0 l_m) V_m) A_m)))
           (* c0 (/ (sqrt (* V_m (/ A_m l_m))) V_m))))))
    A_m = fabs(A);
    V_m = fabs(V);
    l_m = fabs(l);
    assert(c0 < A_m && A_m < V_m && V_m < l_m);
    double code(double c0, double A_m, double V_m, double l_m) {
    	double t_0 = sqrt((A_m / (V_m * l_m)));
    	double tmp;
    	if (t_0 <= 2e-157) {
    		tmp = (sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	} else if (t_0 <= 1e+103) {
    		tmp = c0 * sqrt((((1.0 / l_m) / V_m) * A_m));
    	} else {
    		tmp = c0 * (sqrt((V_m * (A_m / l_m))) / V_m);
    	}
    	return tmp;
    }
    
    A_m =     private
    V_m =     private
    l_m =     private
    NOTE: c0, A_m, V_m, and l_m 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(c0, a_m, v_m, l_m)
    use fmin_fmax_functions
        real(8), intent (in) :: c0
        real(8), intent (in) :: a_m
        real(8), intent (in) :: v_m
        real(8), intent (in) :: l_m
        real(8) :: t_0
        real(8) :: tmp
        t_0 = sqrt((a_m / (v_m * l_m)))
        if (t_0 <= 2d-157) then
            tmp = (sqrt(((a_m / v_m) * l_m)) * c0) / l_m
        else if (t_0 <= 1d+103) then
            tmp = c0 * sqrt((((1.0d0 / l_m) / v_m) * a_m))
        else
            tmp = c0 * (sqrt((v_m * (a_m / l_m))) / v_m)
        end if
        code = tmp
    end function
    
    A_m = Math.abs(A);
    V_m = Math.abs(V);
    l_m = Math.abs(l);
    assert c0 < A_m && A_m < V_m && V_m < l_m;
    public static double code(double c0, double A_m, double V_m, double l_m) {
    	double t_0 = Math.sqrt((A_m / (V_m * l_m)));
    	double tmp;
    	if (t_0 <= 2e-157) {
    		tmp = (Math.sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	} else if (t_0 <= 1e+103) {
    		tmp = c0 * Math.sqrt((((1.0 / l_m) / V_m) * A_m));
    	} else {
    		tmp = c0 * (Math.sqrt((V_m * (A_m / l_m))) / V_m);
    	}
    	return tmp;
    }
    
    A_m = math.fabs(A)
    V_m = math.fabs(V)
    l_m = math.fabs(l)
    [c0, A_m, V_m, l_m] = sort([c0, A_m, V_m, l_m])
    def code(c0, A_m, V_m, l_m):
    	t_0 = math.sqrt((A_m / (V_m * l_m)))
    	tmp = 0
    	if t_0 <= 2e-157:
    		tmp = (math.sqrt(((A_m / V_m) * l_m)) * c0) / l_m
    	elif t_0 <= 1e+103:
    		tmp = c0 * math.sqrt((((1.0 / l_m) / V_m) * A_m))
    	else:
    		tmp = c0 * (math.sqrt((V_m * (A_m / l_m))) / V_m)
    	return tmp
    
    A_m = abs(A)
    V_m = abs(V)
    l_m = abs(l)
    c0, A_m, V_m, l_m = sort([c0, A_m, V_m, l_m])
    function code(c0, A_m, V_m, l_m)
    	t_0 = sqrt(Float64(A_m / Float64(V_m * l_m)))
    	tmp = 0.0
    	if (t_0 <= 2e-157)
    		tmp = Float64(Float64(sqrt(Float64(Float64(A_m / V_m) * l_m)) * c0) / l_m);
    	elseif (t_0 <= 1e+103)
    		tmp = Float64(c0 * sqrt(Float64(Float64(Float64(1.0 / l_m) / V_m) * A_m)));
    	else
    		tmp = Float64(c0 * Float64(sqrt(Float64(V_m * Float64(A_m / l_m))) / V_m));
    	end
    	return tmp
    end
    
    A_m = abs(A);
    V_m = abs(V);
    l_m = abs(l);
    c0, A_m, V_m, l_m = num2cell(sort([c0, A_m, V_m, l_m])){:}
    function tmp_2 = code(c0, A_m, V_m, l_m)
    	t_0 = sqrt((A_m / (V_m * l_m)));
    	tmp = 0.0;
    	if (t_0 <= 2e-157)
    		tmp = (sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	elseif (t_0 <= 1e+103)
    		tmp = c0 * sqrt((((1.0 / l_m) / V_m) * A_m));
    	else
    		tmp = c0 * (sqrt((V_m * (A_m / l_m))) / V_m);
    	end
    	tmp_2 = tmp;
    end
    
    A_m = N[Abs[A], $MachinePrecision]
    V_m = N[Abs[V], $MachinePrecision]
    l_m = N[Abs[l], $MachinePrecision]
    NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
    code[c0_, A$95$m_, V$95$m_, l$95$m_] := Block[{t$95$0 = N[Sqrt[N[(A$95$m / N[(V$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 2e-157], N[(N[(N[Sqrt[N[(N[(A$95$m / V$95$m), $MachinePrecision] * l$95$m), $MachinePrecision]], $MachinePrecision] * c0), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[t$95$0, 1e+103], N[(c0 * N[Sqrt[N[(N[(N[(1.0 / l$95$m), $MachinePrecision] / V$95$m), $MachinePrecision] * A$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(V$95$m * N[(A$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / V$95$m), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    A_m = \left|A\right|
    \\
    V_m = \left|V\right|
    \\
    l_m = \left|\ell\right|
    \\
    [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\
    \\
    \begin{array}{l}
    t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\
    \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\
    \;\;\;\;\frac{\sqrt{\frac{A\_m}{V\_m} \cdot l\_m} \cdot c0}{l\_m}\\
    
    \mathbf{elif}\;t\_0 \leq 10^{+103}:\\
    \;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{l\_m}}{V\_m} \cdot A\_m}\\
    
    \mathbf{else}:\\
    \;\;\;\;c0 \cdot \frac{\sqrt{V\_m \cdot \frac{A\_m}{l\_m}}}{V\_m}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (sqrt.f64 (/.f64 A (*.f64 V l))) < 1.99999999999999989e-157

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Taylor expanded in l around 0

        \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\ell}} \]
      3. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A \cdot \ell}{V}}}{\ell}} \]
        2. mult-flipN/A

          \[\leadsto c0 \cdot \left(\sqrt{\frac{A \cdot \ell}{V}} \cdot \color{blue}{\frac{1}{\ell}}\right) \]
        3. *-commutativeN/A

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

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

          \[\leadsto \left(c0 \cdot \frac{1}{\ell}\right) \cdot \color{blue}{\sqrt{\frac{A \cdot \ell}{V}}} \]
        6. mult-flip-revN/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{A \cdot \ell}{V}}} \]
        7. lower-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{A \cdot \ell}{V}}} \]
        8. lower-sqrt.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{A \cdot \ell}{V}} \]
        9. lower-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{A \cdot \ell}{V}} \]
        10. *-commutativeN/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        11. lower-*.f6462.2

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
      4. Applied rewrites62.2%

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

          \[\leadsto \frac{c0}{\ell} \cdot \color{blue}{\sqrt{\frac{\ell \cdot A}{V}}} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{\ell \cdot A}{V}}} \]
        3. lift-sqrt.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        5. lift-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        6. associate-*l/N/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{\ell \cdot A}{V}}}{\color{blue}{\ell}} \]
        7. mult-flipN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\left(\ell \cdot A\right) \cdot \frac{1}{V}}}{\ell} \]
        8. *-commutativeN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\left(A \cdot \ell\right) \cdot \frac{1}{V}}}{\ell} \]
        9. mult-flipN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\ell} \]
        10. lower-/.f64N/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\color{blue}{\ell}} \]
      6. Applied rewrites64.0%

        \[\leadsto \frac{\sqrt{\frac{A}{V} \cdot \ell} \cdot c0}{\color{blue}{\ell}} \]

      if 1.99999999999999989e-157 < (sqrt.f64 (/.f64 A (*.f64 V l))) < 1e103

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
        3. mult-flipN/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{A \cdot \frac{1}{V \cdot \ell}}} \]
        4. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
        5. lower-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
        6. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell}} \cdot A} \]
        7. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
        8. lower-*.f6472.9

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
      3. Applied rewrites72.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot V} \cdot A}} \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot V}} \cdot A} \]
        3. associate-/r*N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{V}} \cdot A} \]
        4. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{V}} \cdot A} \]
        5. lower-/.f6473.1

          \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{1}{\ell}}}{V} \cdot A} \]
      5. Applied rewrites73.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{V}} \cdot A} \]

      if 1e103 < (sqrt.f64 (/.f64 A (*.f64 V l)))

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
        3. associate-/r*N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        4. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        5. lower-/.f6472.8

          \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{V}}}{\ell}} \]
      3. Applied rewrites72.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      4. Taylor expanded in V around 0

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A \cdot V}{\ell}}}{V}} \]
      5. Step-by-step derivation
        1. pow1/2N/A

          \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A \cdot V}{\ell}}}}{V} \]
        2. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        3. *-commutativeN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\color{blue}{\ell}}}}{V} \]
        4. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        5. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        6. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        7. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        8. mult-flip-revN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        9. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\color{blue}{\ell}}}}{V} \]
        10. lift-*.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        11. lift-*.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        12. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        13. associate-*l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        14. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot \color{blue}{V}}{\ell}}}{V} \]
        15. mult-flipN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        16. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        17. pow1/2N/A

          \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A \cdot V}{\ell}}}}{V} \]
        18. lower-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\ell}}}{\color{blue}{V}} \]
        19. lower-sqrt.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\ell}}}{V} \]
        20. *-commutativeN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{V \cdot A}{\ell}}}{V} \]
        21. associate-/l*N/A

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
        22. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
        23. lower-*.f6469.8

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
      6. Applied rewrites69.8%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{V \cdot \frac{A}{\ell}}}{V}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 3: 90.2% accurate, 0.3× speedup?

    \[\begin{array}{l} A_m = \left|A\right| \\ V_m = \left|V\right| \\ l_m = \left|\ell\right| \\ [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\ \;\;\;\;\frac{\sqrt{\frac{A\_m}{V\_m} \cdot l\_m} \cdot c0}{l\_m}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+117}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{V\_m}}{l\_m} \cdot A\_m}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{V\_m \cdot \frac{A\_m}{l\_m}}}{V\_m}\\ \end{array} \end{array} \]
    A_m = (fabs.f64 A)
    V_m = (fabs.f64 V)
    l_m = (fabs.f64 l)
    NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
    (FPCore (c0 A_m V_m l_m)
     :precision binary64
     (let* ((t_0 (sqrt (/ A_m (* V_m l_m)))))
       (if (<= t_0 2e-157)
         (/ (* (sqrt (* (/ A_m V_m) l_m)) c0) l_m)
         (if (<= t_0 5e+117)
           (* c0 (sqrt (* (/ (/ 1.0 V_m) l_m) A_m)))
           (* c0 (/ (sqrt (* V_m (/ A_m l_m))) V_m))))))
    A_m = fabs(A);
    V_m = fabs(V);
    l_m = fabs(l);
    assert(c0 < A_m && A_m < V_m && V_m < l_m);
    double code(double c0, double A_m, double V_m, double l_m) {
    	double t_0 = sqrt((A_m / (V_m * l_m)));
    	double tmp;
    	if (t_0 <= 2e-157) {
    		tmp = (sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	} else if (t_0 <= 5e+117) {
    		tmp = c0 * sqrt((((1.0 / V_m) / l_m) * A_m));
    	} else {
    		tmp = c0 * (sqrt((V_m * (A_m / l_m))) / V_m);
    	}
    	return tmp;
    }
    
    A_m =     private
    V_m =     private
    l_m =     private
    NOTE: c0, A_m, V_m, and l_m 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(c0, a_m, v_m, l_m)
    use fmin_fmax_functions
        real(8), intent (in) :: c0
        real(8), intent (in) :: a_m
        real(8), intent (in) :: v_m
        real(8), intent (in) :: l_m
        real(8) :: t_0
        real(8) :: tmp
        t_0 = sqrt((a_m / (v_m * l_m)))
        if (t_0 <= 2d-157) then
            tmp = (sqrt(((a_m / v_m) * l_m)) * c0) / l_m
        else if (t_0 <= 5d+117) then
            tmp = c0 * sqrt((((1.0d0 / v_m) / l_m) * a_m))
        else
            tmp = c0 * (sqrt((v_m * (a_m / l_m))) / v_m)
        end if
        code = tmp
    end function
    
    A_m = Math.abs(A);
    V_m = Math.abs(V);
    l_m = Math.abs(l);
    assert c0 < A_m && A_m < V_m && V_m < l_m;
    public static double code(double c0, double A_m, double V_m, double l_m) {
    	double t_0 = Math.sqrt((A_m / (V_m * l_m)));
    	double tmp;
    	if (t_0 <= 2e-157) {
    		tmp = (Math.sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	} else if (t_0 <= 5e+117) {
    		tmp = c0 * Math.sqrt((((1.0 / V_m) / l_m) * A_m));
    	} else {
    		tmp = c0 * (Math.sqrt((V_m * (A_m / l_m))) / V_m);
    	}
    	return tmp;
    }
    
    A_m = math.fabs(A)
    V_m = math.fabs(V)
    l_m = math.fabs(l)
    [c0, A_m, V_m, l_m] = sort([c0, A_m, V_m, l_m])
    def code(c0, A_m, V_m, l_m):
    	t_0 = math.sqrt((A_m / (V_m * l_m)))
    	tmp = 0
    	if t_0 <= 2e-157:
    		tmp = (math.sqrt(((A_m / V_m) * l_m)) * c0) / l_m
    	elif t_0 <= 5e+117:
    		tmp = c0 * math.sqrt((((1.0 / V_m) / l_m) * A_m))
    	else:
    		tmp = c0 * (math.sqrt((V_m * (A_m / l_m))) / V_m)
    	return tmp
    
    A_m = abs(A)
    V_m = abs(V)
    l_m = abs(l)
    c0, A_m, V_m, l_m = sort([c0, A_m, V_m, l_m])
    function code(c0, A_m, V_m, l_m)
    	t_0 = sqrt(Float64(A_m / Float64(V_m * l_m)))
    	tmp = 0.0
    	if (t_0 <= 2e-157)
    		tmp = Float64(Float64(sqrt(Float64(Float64(A_m / V_m) * l_m)) * c0) / l_m);
    	elseif (t_0 <= 5e+117)
    		tmp = Float64(c0 * sqrt(Float64(Float64(Float64(1.0 / V_m) / l_m) * A_m)));
    	else
    		tmp = Float64(c0 * Float64(sqrt(Float64(V_m * Float64(A_m / l_m))) / V_m));
    	end
    	return tmp
    end
    
    A_m = abs(A);
    V_m = abs(V);
    l_m = abs(l);
    c0, A_m, V_m, l_m = num2cell(sort([c0, A_m, V_m, l_m])){:}
    function tmp_2 = code(c0, A_m, V_m, l_m)
    	t_0 = sqrt((A_m / (V_m * l_m)));
    	tmp = 0.0;
    	if (t_0 <= 2e-157)
    		tmp = (sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	elseif (t_0 <= 5e+117)
    		tmp = c0 * sqrt((((1.0 / V_m) / l_m) * A_m));
    	else
    		tmp = c0 * (sqrt((V_m * (A_m / l_m))) / V_m);
    	end
    	tmp_2 = tmp;
    end
    
    A_m = N[Abs[A], $MachinePrecision]
    V_m = N[Abs[V], $MachinePrecision]
    l_m = N[Abs[l], $MachinePrecision]
    NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
    code[c0_, A$95$m_, V$95$m_, l$95$m_] := Block[{t$95$0 = N[Sqrt[N[(A$95$m / N[(V$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 2e-157], N[(N[(N[Sqrt[N[(N[(A$95$m / V$95$m), $MachinePrecision] * l$95$m), $MachinePrecision]], $MachinePrecision] * c0), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[t$95$0, 5e+117], N[(c0 * N[Sqrt[N[(N[(N[(1.0 / V$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * A$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(V$95$m * N[(A$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / V$95$m), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    A_m = \left|A\right|
    \\
    V_m = \left|V\right|
    \\
    l_m = \left|\ell\right|
    \\
    [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\
    \\
    \begin{array}{l}
    t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\
    \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\
    \;\;\;\;\frac{\sqrt{\frac{A\_m}{V\_m} \cdot l\_m} \cdot c0}{l\_m}\\
    
    \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+117}:\\
    \;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{V\_m}}{l\_m} \cdot A\_m}\\
    
    \mathbf{else}:\\
    \;\;\;\;c0 \cdot \frac{\sqrt{V\_m \cdot \frac{A\_m}{l\_m}}}{V\_m}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (sqrt.f64 (/.f64 A (*.f64 V l))) < 1.99999999999999989e-157

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Taylor expanded in l around 0

        \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\ell}} \]
      3. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A \cdot \ell}{V}}}{\ell}} \]
        2. mult-flipN/A

          \[\leadsto c0 \cdot \left(\sqrt{\frac{A \cdot \ell}{V}} \cdot \color{blue}{\frac{1}{\ell}}\right) \]
        3. *-commutativeN/A

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

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

          \[\leadsto \left(c0 \cdot \frac{1}{\ell}\right) \cdot \color{blue}{\sqrt{\frac{A \cdot \ell}{V}}} \]
        6. mult-flip-revN/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{A \cdot \ell}{V}}} \]
        7. lower-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{A \cdot \ell}{V}}} \]
        8. lower-sqrt.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{A \cdot \ell}{V}} \]
        9. lower-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{A \cdot \ell}{V}} \]
        10. *-commutativeN/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        11. lower-*.f6462.2

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
      4. Applied rewrites62.2%

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

          \[\leadsto \frac{c0}{\ell} \cdot \color{blue}{\sqrt{\frac{\ell \cdot A}{V}}} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{\ell \cdot A}{V}}} \]
        3. lift-sqrt.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        5. lift-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        6. associate-*l/N/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{\ell \cdot A}{V}}}{\color{blue}{\ell}} \]
        7. mult-flipN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\left(\ell \cdot A\right) \cdot \frac{1}{V}}}{\ell} \]
        8. *-commutativeN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\left(A \cdot \ell\right) \cdot \frac{1}{V}}}{\ell} \]
        9. mult-flipN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\ell} \]
        10. lower-/.f64N/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\color{blue}{\ell}} \]
      6. Applied rewrites64.0%

        \[\leadsto \frac{\sqrt{\frac{A}{V} \cdot \ell} \cdot c0}{\color{blue}{\ell}} \]

      if 1.99999999999999989e-157 < (sqrt.f64 (/.f64 A (*.f64 V l))) < 4.99999999999999983e117

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
        3. mult-flipN/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{A \cdot \frac{1}{V \cdot \ell}}} \]
        4. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
        5. lower-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
        6. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell}} \cdot A} \]
        7. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
        8. lower-*.f6472.9

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
      3. Applied rewrites72.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot V} \cdot A}} \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
        2. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{V \cdot \ell}} \cdot A} \]
        3. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell}} \cdot A} \]
        4. associate-/r*N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
        5. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
        6. lift-/.f6473.1

          \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{1}{V}}}{\ell} \cdot A} \]
      5. Applied rewrites73.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]

      if 4.99999999999999983e117 < (sqrt.f64 (/.f64 A (*.f64 V l)))

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
        3. associate-/r*N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        4. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        5. lower-/.f6472.8

          \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{V}}}{\ell}} \]
      3. Applied rewrites72.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      4. Taylor expanded in V around 0

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A \cdot V}{\ell}}}{V}} \]
      5. Step-by-step derivation
        1. pow1/2N/A

          \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A \cdot V}{\ell}}}}{V} \]
        2. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        3. *-commutativeN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\color{blue}{\ell}}}}{V} \]
        4. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        5. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        6. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        7. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        8. mult-flip-revN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        9. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\color{blue}{\ell}}}}{V} \]
        10. lift-*.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        11. lift-*.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        12. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        13. associate-*l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        14. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot \color{blue}{V}}{\ell}}}{V} \]
        15. mult-flipN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        16. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        17. pow1/2N/A

          \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A \cdot V}{\ell}}}}{V} \]
        18. lower-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\ell}}}{\color{blue}{V}} \]
        19. lower-sqrt.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\ell}}}{V} \]
        20. *-commutativeN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{V \cdot A}{\ell}}}{V} \]
        21. associate-/l*N/A

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
        22. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
        23. lower-*.f6469.8

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
      6. Applied rewrites69.8%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{V \cdot \frac{A}{\ell}}}{V}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 4: 90.0% accurate, 0.3× speedup?

    \[\begin{array}{l} A_m = \left|A\right| \\ V_m = \left|V\right| \\ l_m = \left|\ell\right| \\ [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\ \;\;\;\;\frac{\sqrt{\frac{A\_m}{V\_m} \cdot l\_m} \cdot c0}{l\_m}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+130}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{l\_m \cdot V\_m} \cdot A\_m}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{V\_m \cdot \frac{A\_m}{l\_m}}}{V\_m}\\ \end{array} \end{array} \]
    A_m = (fabs.f64 A)
    V_m = (fabs.f64 V)
    l_m = (fabs.f64 l)
    NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
    (FPCore (c0 A_m V_m l_m)
     :precision binary64
     (let* ((t_0 (sqrt (/ A_m (* V_m l_m)))))
       (if (<= t_0 2e-157)
         (/ (* (sqrt (* (/ A_m V_m) l_m)) c0) l_m)
         (if (<= t_0 2e+130)
           (* c0 (sqrt (* (/ 1.0 (* l_m V_m)) A_m)))
           (* c0 (/ (sqrt (* V_m (/ A_m l_m))) V_m))))))
    A_m = fabs(A);
    V_m = fabs(V);
    l_m = fabs(l);
    assert(c0 < A_m && A_m < V_m && V_m < l_m);
    double code(double c0, double A_m, double V_m, double l_m) {
    	double t_0 = sqrt((A_m / (V_m * l_m)));
    	double tmp;
    	if (t_0 <= 2e-157) {
    		tmp = (sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	} else if (t_0 <= 2e+130) {
    		tmp = c0 * sqrt(((1.0 / (l_m * V_m)) * A_m));
    	} else {
    		tmp = c0 * (sqrt((V_m * (A_m / l_m))) / V_m);
    	}
    	return tmp;
    }
    
    A_m =     private
    V_m =     private
    l_m =     private
    NOTE: c0, A_m, V_m, and l_m 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(c0, a_m, v_m, l_m)
    use fmin_fmax_functions
        real(8), intent (in) :: c0
        real(8), intent (in) :: a_m
        real(8), intent (in) :: v_m
        real(8), intent (in) :: l_m
        real(8) :: t_0
        real(8) :: tmp
        t_0 = sqrt((a_m / (v_m * l_m)))
        if (t_0 <= 2d-157) then
            tmp = (sqrt(((a_m / v_m) * l_m)) * c0) / l_m
        else if (t_0 <= 2d+130) then
            tmp = c0 * sqrt(((1.0d0 / (l_m * v_m)) * a_m))
        else
            tmp = c0 * (sqrt((v_m * (a_m / l_m))) / v_m)
        end if
        code = tmp
    end function
    
    A_m = Math.abs(A);
    V_m = Math.abs(V);
    l_m = Math.abs(l);
    assert c0 < A_m && A_m < V_m && V_m < l_m;
    public static double code(double c0, double A_m, double V_m, double l_m) {
    	double t_0 = Math.sqrt((A_m / (V_m * l_m)));
    	double tmp;
    	if (t_0 <= 2e-157) {
    		tmp = (Math.sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	} else if (t_0 <= 2e+130) {
    		tmp = c0 * Math.sqrt(((1.0 / (l_m * V_m)) * A_m));
    	} else {
    		tmp = c0 * (Math.sqrt((V_m * (A_m / l_m))) / V_m);
    	}
    	return tmp;
    }
    
    A_m = math.fabs(A)
    V_m = math.fabs(V)
    l_m = math.fabs(l)
    [c0, A_m, V_m, l_m] = sort([c0, A_m, V_m, l_m])
    def code(c0, A_m, V_m, l_m):
    	t_0 = math.sqrt((A_m / (V_m * l_m)))
    	tmp = 0
    	if t_0 <= 2e-157:
    		tmp = (math.sqrt(((A_m / V_m) * l_m)) * c0) / l_m
    	elif t_0 <= 2e+130:
    		tmp = c0 * math.sqrt(((1.0 / (l_m * V_m)) * A_m))
    	else:
    		tmp = c0 * (math.sqrt((V_m * (A_m / l_m))) / V_m)
    	return tmp
    
    A_m = abs(A)
    V_m = abs(V)
    l_m = abs(l)
    c0, A_m, V_m, l_m = sort([c0, A_m, V_m, l_m])
    function code(c0, A_m, V_m, l_m)
    	t_0 = sqrt(Float64(A_m / Float64(V_m * l_m)))
    	tmp = 0.0
    	if (t_0 <= 2e-157)
    		tmp = Float64(Float64(sqrt(Float64(Float64(A_m / V_m) * l_m)) * c0) / l_m);
    	elseif (t_0 <= 2e+130)
    		tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / Float64(l_m * V_m)) * A_m)));
    	else
    		tmp = Float64(c0 * Float64(sqrt(Float64(V_m * Float64(A_m / l_m))) / V_m));
    	end
    	return tmp
    end
    
    A_m = abs(A);
    V_m = abs(V);
    l_m = abs(l);
    c0, A_m, V_m, l_m = num2cell(sort([c0, A_m, V_m, l_m])){:}
    function tmp_2 = code(c0, A_m, V_m, l_m)
    	t_0 = sqrt((A_m / (V_m * l_m)));
    	tmp = 0.0;
    	if (t_0 <= 2e-157)
    		tmp = (sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	elseif (t_0 <= 2e+130)
    		tmp = c0 * sqrt(((1.0 / (l_m * V_m)) * A_m));
    	else
    		tmp = c0 * (sqrt((V_m * (A_m / l_m))) / V_m);
    	end
    	tmp_2 = tmp;
    end
    
    A_m = N[Abs[A], $MachinePrecision]
    V_m = N[Abs[V], $MachinePrecision]
    l_m = N[Abs[l], $MachinePrecision]
    NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
    code[c0_, A$95$m_, V$95$m_, l$95$m_] := Block[{t$95$0 = N[Sqrt[N[(A$95$m / N[(V$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 2e-157], N[(N[(N[Sqrt[N[(N[(A$95$m / V$95$m), $MachinePrecision] * l$95$m), $MachinePrecision]], $MachinePrecision] * c0), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[t$95$0, 2e+130], N[(c0 * N[Sqrt[N[(N[(1.0 / N[(l$95$m * V$95$m), $MachinePrecision]), $MachinePrecision] * A$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(V$95$m * N[(A$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / V$95$m), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    A_m = \left|A\right|
    \\
    V_m = \left|V\right|
    \\
    l_m = \left|\ell\right|
    \\
    [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\
    \\
    \begin{array}{l}
    t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\
    \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\
    \;\;\;\;\frac{\sqrt{\frac{A\_m}{V\_m} \cdot l\_m} \cdot c0}{l\_m}\\
    
    \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+130}:\\
    \;\;\;\;c0 \cdot \sqrt{\frac{1}{l\_m \cdot V\_m} \cdot A\_m}\\
    
    \mathbf{else}:\\
    \;\;\;\;c0 \cdot \frac{\sqrt{V\_m \cdot \frac{A\_m}{l\_m}}}{V\_m}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (sqrt.f64 (/.f64 A (*.f64 V l))) < 1.99999999999999989e-157

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Taylor expanded in l around 0

        \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\ell}} \]
      3. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A \cdot \ell}{V}}}{\ell}} \]
        2. mult-flipN/A

          \[\leadsto c0 \cdot \left(\sqrt{\frac{A \cdot \ell}{V}} \cdot \color{blue}{\frac{1}{\ell}}\right) \]
        3. *-commutativeN/A

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

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

          \[\leadsto \left(c0 \cdot \frac{1}{\ell}\right) \cdot \color{blue}{\sqrt{\frac{A \cdot \ell}{V}}} \]
        6. mult-flip-revN/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{A \cdot \ell}{V}}} \]
        7. lower-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{A \cdot \ell}{V}}} \]
        8. lower-sqrt.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{A \cdot \ell}{V}} \]
        9. lower-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{A \cdot \ell}{V}} \]
        10. *-commutativeN/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        11. lower-*.f6462.2

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
      4. Applied rewrites62.2%

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

          \[\leadsto \frac{c0}{\ell} \cdot \color{blue}{\sqrt{\frac{\ell \cdot A}{V}}} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{\ell \cdot A}{V}}} \]
        3. lift-sqrt.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        5. lift-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        6. associate-*l/N/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{\ell \cdot A}{V}}}{\color{blue}{\ell}} \]
        7. mult-flipN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\left(\ell \cdot A\right) \cdot \frac{1}{V}}}{\ell} \]
        8. *-commutativeN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\left(A \cdot \ell\right) \cdot \frac{1}{V}}}{\ell} \]
        9. mult-flipN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\ell} \]
        10. lower-/.f64N/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\color{blue}{\ell}} \]
      6. Applied rewrites64.0%

        \[\leadsto \frac{\sqrt{\frac{A}{V} \cdot \ell} \cdot c0}{\color{blue}{\ell}} \]

      if 1.99999999999999989e-157 < (sqrt.f64 (/.f64 A (*.f64 V l))) < 2.0000000000000001e130

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
        3. mult-flipN/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{A \cdot \frac{1}{V \cdot \ell}}} \]
        4. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
        5. lower-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
        6. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell}} \cdot A} \]
        7. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
        8. lower-*.f6472.9

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
      3. Applied rewrites72.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot V} \cdot A}} \]

      if 2.0000000000000001e130 < (sqrt.f64 (/.f64 A (*.f64 V l)))

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
        3. associate-/r*N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        4. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        5. lower-/.f6472.8

          \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{V}}}{\ell}} \]
      3. Applied rewrites72.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      4. Taylor expanded in V around 0

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A \cdot V}{\ell}}}{V}} \]
      5. Step-by-step derivation
        1. pow1/2N/A

          \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A \cdot V}{\ell}}}}{V} \]
        2. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        3. *-commutativeN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\color{blue}{\ell}}}}{V} \]
        4. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        5. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        6. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        7. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        8. mult-flip-revN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        9. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\color{blue}{\ell}}}}{V} \]
        10. lift-*.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        11. lift-*.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        12. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        13. associate-*l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        14. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot \color{blue}{V}}{\ell}}}{V} \]
        15. mult-flipN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A \cdot V}}{\ell}}}{V} \]
        16. associate-/l/N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A \cdot V}{\ell}}}}{V} \]
        17. pow1/2N/A

          \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A \cdot V}{\ell}}}}{V} \]
        18. lower-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\ell}}}{\color{blue}{V}} \]
        19. lower-sqrt.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{A \cdot V}{\ell}}}{V} \]
        20. *-commutativeN/A

          \[\leadsto c0 \cdot \frac{\sqrt{\frac{V \cdot A}{\ell}}}{V} \]
        21. associate-/l*N/A

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
        22. lift-/.f64N/A

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
        23. lower-*.f6469.8

          \[\leadsto c0 \cdot \frac{\sqrt{V \cdot \frac{A}{\ell}}}{V} \]
      6. Applied rewrites69.8%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{V \cdot \frac{A}{\ell}}}{V}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 5: 89.0% accurate, 0.3× speedup?

    \[\begin{array}{l} A_m = \left|A\right| \\ V_m = \left|V\right| \\ l_m = \left|\ell\right| \\ [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\ \;\;\;\;\frac{\sqrt{\frac{A\_m}{V\_m} \cdot l\_m} \cdot c0}{l\_m}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+130}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{l\_m \cdot V\_m} \cdot A\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{V\_m \cdot \frac{A\_m}{l\_m}} \cdot \frac{c0}{V\_m}\\ \end{array} \end{array} \]
    A_m = (fabs.f64 A)
    V_m = (fabs.f64 V)
    l_m = (fabs.f64 l)
    NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
    (FPCore (c0 A_m V_m l_m)
     :precision binary64
     (let* ((t_0 (sqrt (/ A_m (* V_m l_m)))))
       (if (<= t_0 2e-157)
         (/ (* (sqrt (* (/ A_m V_m) l_m)) c0) l_m)
         (if (<= t_0 2e+130)
           (* c0 (sqrt (* (/ 1.0 (* l_m V_m)) A_m)))
           (* (sqrt (* V_m (/ A_m l_m))) (/ c0 V_m))))))
    A_m = fabs(A);
    V_m = fabs(V);
    l_m = fabs(l);
    assert(c0 < A_m && A_m < V_m && V_m < l_m);
    double code(double c0, double A_m, double V_m, double l_m) {
    	double t_0 = sqrt((A_m / (V_m * l_m)));
    	double tmp;
    	if (t_0 <= 2e-157) {
    		tmp = (sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	} else if (t_0 <= 2e+130) {
    		tmp = c0 * sqrt(((1.0 / (l_m * V_m)) * A_m));
    	} else {
    		tmp = sqrt((V_m * (A_m / l_m))) * (c0 / V_m);
    	}
    	return tmp;
    }
    
    A_m =     private
    V_m =     private
    l_m =     private
    NOTE: c0, A_m, V_m, and l_m 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(c0, a_m, v_m, l_m)
    use fmin_fmax_functions
        real(8), intent (in) :: c0
        real(8), intent (in) :: a_m
        real(8), intent (in) :: v_m
        real(8), intent (in) :: l_m
        real(8) :: t_0
        real(8) :: tmp
        t_0 = sqrt((a_m / (v_m * l_m)))
        if (t_0 <= 2d-157) then
            tmp = (sqrt(((a_m / v_m) * l_m)) * c0) / l_m
        else if (t_0 <= 2d+130) then
            tmp = c0 * sqrt(((1.0d0 / (l_m * v_m)) * a_m))
        else
            tmp = sqrt((v_m * (a_m / l_m))) * (c0 / v_m)
        end if
        code = tmp
    end function
    
    A_m = Math.abs(A);
    V_m = Math.abs(V);
    l_m = Math.abs(l);
    assert c0 < A_m && A_m < V_m && V_m < l_m;
    public static double code(double c0, double A_m, double V_m, double l_m) {
    	double t_0 = Math.sqrt((A_m / (V_m * l_m)));
    	double tmp;
    	if (t_0 <= 2e-157) {
    		tmp = (Math.sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	} else if (t_0 <= 2e+130) {
    		tmp = c0 * Math.sqrt(((1.0 / (l_m * V_m)) * A_m));
    	} else {
    		tmp = Math.sqrt((V_m * (A_m / l_m))) * (c0 / V_m);
    	}
    	return tmp;
    }
    
    A_m = math.fabs(A)
    V_m = math.fabs(V)
    l_m = math.fabs(l)
    [c0, A_m, V_m, l_m] = sort([c0, A_m, V_m, l_m])
    def code(c0, A_m, V_m, l_m):
    	t_0 = math.sqrt((A_m / (V_m * l_m)))
    	tmp = 0
    	if t_0 <= 2e-157:
    		tmp = (math.sqrt(((A_m / V_m) * l_m)) * c0) / l_m
    	elif t_0 <= 2e+130:
    		tmp = c0 * math.sqrt(((1.0 / (l_m * V_m)) * A_m))
    	else:
    		tmp = math.sqrt((V_m * (A_m / l_m))) * (c0 / V_m)
    	return tmp
    
    A_m = abs(A)
    V_m = abs(V)
    l_m = abs(l)
    c0, A_m, V_m, l_m = sort([c0, A_m, V_m, l_m])
    function code(c0, A_m, V_m, l_m)
    	t_0 = sqrt(Float64(A_m / Float64(V_m * l_m)))
    	tmp = 0.0
    	if (t_0 <= 2e-157)
    		tmp = Float64(Float64(sqrt(Float64(Float64(A_m / V_m) * l_m)) * c0) / l_m);
    	elseif (t_0 <= 2e+130)
    		tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / Float64(l_m * V_m)) * A_m)));
    	else
    		tmp = Float64(sqrt(Float64(V_m * Float64(A_m / l_m))) * Float64(c0 / V_m));
    	end
    	return tmp
    end
    
    A_m = abs(A);
    V_m = abs(V);
    l_m = abs(l);
    c0, A_m, V_m, l_m = num2cell(sort([c0, A_m, V_m, l_m])){:}
    function tmp_2 = code(c0, A_m, V_m, l_m)
    	t_0 = sqrt((A_m / (V_m * l_m)));
    	tmp = 0.0;
    	if (t_0 <= 2e-157)
    		tmp = (sqrt(((A_m / V_m) * l_m)) * c0) / l_m;
    	elseif (t_0 <= 2e+130)
    		tmp = c0 * sqrt(((1.0 / (l_m * V_m)) * A_m));
    	else
    		tmp = sqrt((V_m * (A_m / l_m))) * (c0 / V_m);
    	end
    	tmp_2 = tmp;
    end
    
    A_m = N[Abs[A], $MachinePrecision]
    V_m = N[Abs[V], $MachinePrecision]
    l_m = N[Abs[l], $MachinePrecision]
    NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
    code[c0_, A$95$m_, V$95$m_, l$95$m_] := Block[{t$95$0 = N[Sqrt[N[(A$95$m / N[(V$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 2e-157], N[(N[(N[Sqrt[N[(N[(A$95$m / V$95$m), $MachinePrecision] * l$95$m), $MachinePrecision]], $MachinePrecision] * c0), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[t$95$0, 2e+130], N[(c0 * N[Sqrt[N[(N[(1.0 / N[(l$95$m * V$95$m), $MachinePrecision]), $MachinePrecision] * A$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(V$95$m * N[(A$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(c0 / V$95$m), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    A_m = \left|A\right|
    \\
    V_m = \left|V\right|
    \\
    l_m = \left|\ell\right|
    \\
    [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\
    \\
    \begin{array}{l}
    t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\
    \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\
    \;\;\;\;\frac{\sqrt{\frac{A\_m}{V\_m} \cdot l\_m} \cdot c0}{l\_m}\\
    
    \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+130}:\\
    \;\;\;\;c0 \cdot \sqrt{\frac{1}{l\_m \cdot V\_m} \cdot A\_m}\\
    
    \mathbf{else}:\\
    \;\;\;\;\sqrt{V\_m \cdot \frac{A\_m}{l\_m}} \cdot \frac{c0}{V\_m}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (sqrt.f64 (/.f64 A (*.f64 V l))) < 1.99999999999999989e-157

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Taylor expanded in l around 0

        \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\ell}} \]
      3. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A \cdot \ell}{V}}}{\ell}} \]
        2. mult-flipN/A

          \[\leadsto c0 \cdot \left(\sqrt{\frac{A \cdot \ell}{V}} \cdot \color{blue}{\frac{1}{\ell}}\right) \]
        3. *-commutativeN/A

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

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

          \[\leadsto \left(c0 \cdot \frac{1}{\ell}\right) \cdot \color{blue}{\sqrt{\frac{A \cdot \ell}{V}}} \]
        6. mult-flip-revN/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{A \cdot \ell}{V}}} \]
        7. lower-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{A \cdot \ell}{V}}} \]
        8. lower-sqrt.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{A \cdot \ell}{V}} \]
        9. lower-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{A \cdot \ell}{V}} \]
        10. *-commutativeN/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        11. lower-*.f6462.2

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
      4. Applied rewrites62.2%

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

          \[\leadsto \frac{c0}{\ell} \cdot \color{blue}{\sqrt{\frac{\ell \cdot A}{V}}} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\color{blue}{\frac{\ell \cdot A}{V}}} \]
        3. lift-sqrt.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        5. lift-/.f64N/A

          \[\leadsto \frac{c0}{\ell} \cdot \sqrt{\frac{\ell \cdot A}{V}} \]
        6. associate-*l/N/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{\ell \cdot A}{V}}}{\color{blue}{\ell}} \]
        7. mult-flipN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\left(\ell \cdot A\right) \cdot \frac{1}{V}}}{\ell} \]
        8. *-commutativeN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\left(A \cdot \ell\right) \cdot \frac{1}{V}}}{\ell} \]
        9. mult-flipN/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\ell} \]
        10. lower-/.f64N/A

          \[\leadsto \frac{c0 \cdot \sqrt{\frac{A \cdot \ell}{V}}}{\color{blue}{\ell}} \]
      6. Applied rewrites64.0%

        \[\leadsto \frac{\sqrt{\frac{A}{V} \cdot \ell} \cdot c0}{\color{blue}{\ell}} \]

      if 1.99999999999999989e-157 < (sqrt.f64 (/.f64 A (*.f64 V l))) < 2.0000000000000001e130

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
        3. mult-flipN/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{A \cdot \frac{1}{V \cdot \ell}}} \]
        4. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
        5. lower-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
        6. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell}} \cdot A} \]
        7. *-commutativeN/A

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
        8. lower-*.f6472.9

          \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
      3. Applied rewrites72.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot V} \cdot A}} \]

      if 2.0000000000000001e130 < (sqrt.f64 (/.f64 A (*.f64 V l)))

      1. Initial program 73.2%

        \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
        2. lift-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
        3. associate-/r*N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        4. lower-/.f64N/A

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        5. lower-/.f6472.8

          \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{V}}}{\ell}} \]
      3. Applied rewrites72.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      4. Taylor expanded in V around 0

        \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A \cdot V}{\ell}}}{V}} \]
      5. Step-by-step derivation
        1. Applied rewrites65.5%

          \[\leadsto \color{blue}{\sqrt{V \cdot \frac{A}{\ell}} \cdot \frac{c0}{V}} \]
      6. Recombined 3 regimes into one program.
      7. Add Preprocessing

      Alternative 6: 86.9% accurate, 0.3× speedup?

      \[\begin{array}{l} A_m = \left|A\right| \\ V_m = \left|V\right| \\ l_m = \left|\ell\right| \\ [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\ t_1 := \sqrt{V\_m \cdot \frac{A\_m}{l\_m}} \cdot \frac{c0}{V\_m}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+130}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{l\_m \cdot V\_m} \cdot A\_m}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      A_m = (fabs.f64 A)
      V_m = (fabs.f64 V)
      l_m = (fabs.f64 l)
      NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
      (FPCore (c0 A_m V_m l_m)
       :precision binary64
       (let* ((t_0 (sqrt (/ A_m (* V_m l_m))))
              (t_1 (* (sqrt (* V_m (/ A_m l_m))) (/ c0 V_m))))
         (if (<= t_0 2e-157)
           t_1
           (if (<= t_0 2e+130) (* c0 (sqrt (* (/ 1.0 (* l_m V_m)) A_m))) t_1))))
      A_m = fabs(A);
      V_m = fabs(V);
      l_m = fabs(l);
      assert(c0 < A_m && A_m < V_m && V_m < l_m);
      double code(double c0, double A_m, double V_m, double l_m) {
      	double t_0 = sqrt((A_m / (V_m * l_m)));
      	double t_1 = sqrt((V_m * (A_m / l_m))) * (c0 / V_m);
      	double tmp;
      	if (t_0 <= 2e-157) {
      		tmp = t_1;
      	} else if (t_0 <= 2e+130) {
      		tmp = c0 * sqrt(((1.0 / (l_m * V_m)) * A_m));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      A_m =     private
      V_m =     private
      l_m =     private
      NOTE: c0, A_m, V_m, and l_m 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(c0, a_m, v_m, l_m)
      use fmin_fmax_functions
          real(8), intent (in) :: c0
          real(8), intent (in) :: a_m
          real(8), intent (in) :: v_m
          real(8), intent (in) :: l_m
          real(8) :: t_0
          real(8) :: t_1
          real(8) :: tmp
          t_0 = sqrt((a_m / (v_m * l_m)))
          t_1 = sqrt((v_m * (a_m / l_m))) * (c0 / v_m)
          if (t_0 <= 2d-157) then
              tmp = t_1
          else if (t_0 <= 2d+130) then
              tmp = c0 * sqrt(((1.0d0 / (l_m * v_m)) * a_m))
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      A_m = Math.abs(A);
      V_m = Math.abs(V);
      l_m = Math.abs(l);
      assert c0 < A_m && A_m < V_m && V_m < l_m;
      public static double code(double c0, double A_m, double V_m, double l_m) {
      	double t_0 = Math.sqrt((A_m / (V_m * l_m)));
      	double t_1 = Math.sqrt((V_m * (A_m / l_m))) * (c0 / V_m);
      	double tmp;
      	if (t_0 <= 2e-157) {
      		tmp = t_1;
      	} else if (t_0 <= 2e+130) {
      		tmp = c0 * Math.sqrt(((1.0 / (l_m * V_m)) * A_m));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      A_m = math.fabs(A)
      V_m = math.fabs(V)
      l_m = math.fabs(l)
      [c0, A_m, V_m, l_m] = sort([c0, A_m, V_m, l_m])
      def code(c0, A_m, V_m, l_m):
      	t_0 = math.sqrt((A_m / (V_m * l_m)))
      	t_1 = math.sqrt((V_m * (A_m / l_m))) * (c0 / V_m)
      	tmp = 0
      	if t_0 <= 2e-157:
      		tmp = t_1
      	elif t_0 <= 2e+130:
      		tmp = c0 * math.sqrt(((1.0 / (l_m * V_m)) * A_m))
      	else:
      		tmp = t_1
      	return tmp
      
      A_m = abs(A)
      V_m = abs(V)
      l_m = abs(l)
      c0, A_m, V_m, l_m = sort([c0, A_m, V_m, l_m])
      function code(c0, A_m, V_m, l_m)
      	t_0 = sqrt(Float64(A_m / Float64(V_m * l_m)))
      	t_1 = Float64(sqrt(Float64(V_m * Float64(A_m / l_m))) * Float64(c0 / V_m))
      	tmp = 0.0
      	if (t_0 <= 2e-157)
      		tmp = t_1;
      	elseif (t_0 <= 2e+130)
      		tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / Float64(l_m * V_m)) * A_m)));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      A_m = abs(A);
      V_m = abs(V);
      l_m = abs(l);
      c0, A_m, V_m, l_m = num2cell(sort([c0, A_m, V_m, l_m])){:}
      function tmp_2 = code(c0, A_m, V_m, l_m)
      	t_0 = sqrt((A_m / (V_m * l_m)));
      	t_1 = sqrt((V_m * (A_m / l_m))) * (c0 / V_m);
      	tmp = 0.0;
      	if (t_0 <= 2e-157)
      		tmp = t_1;
      	elseif (t_0 <= 2e+130)
      		tmp = c0 * sqrt(((1.0 / (l_m * V_m)) * A_m));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      A_m = N[Abs[A], $MachinePrecision]
      V_m = N[Abs[V], $MachinePrecision]
      l_m = N[Abs[l], $MachinePrecision]
      NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
      code[c0_, A$95$m_, V$95$m_, l$95$m_] := Block[{t$95$0 = N[Sqrt[N[(A$95$m / N[(V$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(V$95$m * N[(A$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(c0 / V$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-157], t$95$1, If[LessEqual[t$95$0, 2e+130], N[(c0 * N[Sqrt[N[(N[(1.0 / N[(l$95$m * V$95$m), $MachinePrecision]), $MachinePrecision] * A$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      A_m = \left|A\right|
      \\
      V_m = \left|V\right|
      \\
      l_m = \left|\ell\right|
      \\
      [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\
      \\
      \begin{array}{l}
      t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\
      t_1 := \sqrt{V\_m \cdot \frac{A\_m}{l\_m}} \cdot \frac{c0}{V\_m}\\
      \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+130}:\\
      \;\;\;\;c0 \cdot \sqrt{\frac{1}{l\_m \cdot V\_m} \cdot A\_m}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (sqrt.f64 (/.f64 A (*.f64 V l))) < 1.99999999999999989e-157 or 2.0000000000000001e130 < (sqrt.f64 (/.f64 A (*.f64 V l)))

        1. Initial program 73.2%

          \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
          2. lift-/.f64N/A

            \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
          3. associate-/r*N/A

            \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
          4. lower-/.f64N/A

            \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
          5. lower-/.f6472.8

            \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{V}}}{\ell}} \]
        3. Applied rewrites72.8%

          \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
        4. Taylor expanded in V around 0

          \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A \cdot V}{\ell}}}{V}} \]
        5. Step-by-step derivation
          1. Applied rewrites65.5%

            \[\leadsto \color{blue}{\sqrt{V \cdot \frac{A}{\ell}} \cdot \frac{c0}{V}} \]

          if 1.99999999999999989e-157 < (sqrt.f64 (/.f64 A (*.f64 V l))) < 2.0000000000000001e130

          1. Initial program 73.2%

            \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
            2. lift-/.f64N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
            3. mult-flipN/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{A \cdot \frac{1}{V \cdot \ell}}} \]
            4. *-commutativeN/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
            5. lower-*.f64N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
            6. lower-/.f64N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell}} \cdot A} \]
            7. *-commutativeN/A

              \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
            8. lower-*.f6472.9

              \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot V}} \cdot A} \]
          3. Applied rewrites72.9%

            \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot V} \cdot A}} \]
        6. Recombined 2 regimes into one program.
        7. Add Preprocessing

        Alternative 7: 78.9% accurate, 0.7× speedup?

        \[\begin{array}{l} A_m = \left|A\right| \\ V_m = \left|V\right| \\ l_m = \left|\ell\right| \\ [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\ \\ \begin{array}{l} \mathbf{if}\;A\_m \leq 1.1 \cdot 10^{-88}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A\_m}{V\_m}}{l\_m}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A\_m}{l\_m}}{V\_m}}\\ \end{array} \end{array} \]
        A_m = (fabs.f64 A)
        V_m = (fabs.f64 V)
        l_m = (fabs.f64 l)
        NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
        (FPCore (c0 A_m V_m l_m)
         :precision binary64
         (if (<= A_m 1.1e-88)
           (* c0 (sqrt (/ (/ A_m V_m) l_m)))
           (* c0 (sqrt (/ (/ A_m l_m) V_m)))))
        A_m = fabs(A);
        V_m = fabs(V);
        l_m = fabs(l);
        assert(c0 < A_m && A_m < V_m && V_m < l_m);
        double code(double c0, double A_m, double V_m, double l_m) {
        	double tmp;
        	if (A_m <= 1.1e-88) {
        		tmp = c0 * sqrt(((A_m / V_m) / l_m));
        	} else {
        		tmp = c0 * sqrt(((A_m / l_m) / V_m));
        	}
        	return tmp;
        }
        
        A_m =     private
        V_m =     private
        l_m =     private
        NOTE: c0, A_m, V_m, and l_m 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(c0, a_m, v_m, l_m)
        use fmin_fmax_functions
            real(8), intent (in) :: c0
            real(8), intent (in) :: a_m
            real(8), intent (in) :: v_m
            real(8), intent (in) :: l_m
            real(8) :: tmp
            if (a_m <= 1.1d-88) then
                tmp = c0 * sqrt(((a_m / v_m) / l_m))
            else
                tmp = c0 * sqrt(((a_m / l_m) / v_m))
            end if
            code = tmp
        end function
        
        A_m = Math.abs(A);
        V_m = Math.abs(V);
        l_m = Math.abs(l);
        assert c0 < A_m && A_m < V_m && V_m < l_m;
        public static double code(double c0, double A_m, double V_m, double l_m) {
        	double tmp;
        	if (A_m <= 1.1e-88) {
        		tmp = c0 * Math.sqrt(((A_m / V_m) / l_m));
        	} else {
        		tmp = c0 * Math.sqrt(((A_m / l_m) / V_m));
        	}
        	return tmp;
        }
        
        A_m = math.fabs(A)
        V_m = math.fabs(V)
        l_m = math.fabs(l)
        [c0, A_m, V_m, l_m] = sort([c0, A_m, V_m, l_m])
        def code(c0, A_m, V_m, l_m):
        	tmp = 0
        	if A_m <= 1.1e-88:
        		tmp = c0 * math.sqrt(((A_m / V_m) / l_m))
        	else:
        		tmp = c0 * math.sqrt(((A_m / l_m) / V_m))
        	return tmp
        
        A_m = abs(A)
        V_m = abs(V)
        l_m = abs(l)
        c0, A_m, V_m, l_m = sort([c0, A_m, V_m, l_m])
        function code(c0, A_m, V_m, l_m)
        	tmp = 0.0
        	if (A_m <= 1.1e-88)
        		tmp = Float64(c0 * sqrt(Float64(Float64(A_m / V_m) / l_m)));
        	else
        		tmp = Float64(c0 * sqrt(Float64(Float64(A_m / l_m) / V_m)));
        	end
        	return tmp
        end
        
        A_m = abs(A);
        V_m = abs(V);
        l_m = abs(l);
        c0, A_m, V_m, l_m = num2cell(sort([c0, A_m, V_m, l_m])){:}
        function tmp_2 = code(c0, A_m, V_m, l_m)
        	tmp = 0.0;
        	if (A_m <= 1.1e-88)
        		tmp = c0 * sqrt(((A_m / V_m) / l_m));
        	else
        		tmp = c0 * sqrt(((A_m / l_m) / V_m));
        	end
        	tmp_2 = tmp;
        end
        
        A_m = N[Abs[A], $MachinePrecision]
        V_m = N[Abs[V], $MachinePrecision]
        l_m = N[Abs[l], $MachinePrecision]
        NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
        code[c0_, A$95$m_, V$95$m_, l$95$m_] := If[LessEqual[A$95$m, 1.1e-88], N[(c0 * N[Sqrt[N[(N[(A$95$m / V$95$m), $MachinePrecision] / l$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A$95$m / l$95$m), $MachinePrecision] / V$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        A_m = \left|A\right|
        \\
        V_m = \left|V\right|
        \\
        l_m = \left|\ell\right|
        \\
        [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;A\_m \leq 1.1 \cdot 10^{-88}:\\
        \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A\_m}{V\_m}}{l\_m}}\\
        
        \mathbf{else}:\\
        \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A\_m}{l\_m}}{V\_m}}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if A < 1.10000000000000002e-88

          1. Initial program 73.2%

            \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
            2. lift-/.f64N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
            3. associate-/r*N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
            4. lower-/.f64N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
            5. lower-/.f6472.8

              \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{V}}}{\ell}} \]
          3. Applied rewrites72.8%

            \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]

          if 1.10000000000000002e-88 < A

          1. Initial program 73.2%

            \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
            2. lift-/.f64N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
            3. *-commutativeN/A

              \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{\ell \cdot V}}} \]
            4. associate-/r*N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \]
            5. lower-/.f64N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \]
            6. lower-/.f6473.1

              \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{\ell}}}{V}} \]
          3. Applied rewrites73.1%

            \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 8: 78.8% accurate, 0.3× speedup?

        \[\begin{array}{l} A_m = \left|A\right| \\ V_m = \left|V\right| \\ l_m = \left|\ell\right| \\ [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\ t_1 := c0 \cdot \sqrt{\frac{\frac{A\_m}{V\_m}}{l\_m}}\\ \mathbf{if}\;t\_0 \leq 5 \cdot 10^{-10}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+146}:\\ \;\;\;\;c0 \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        A_m = (fabs.f64 A)
        V_m = (fabs.f64 V)
        l_m = (fabs.f64 l)
        NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
        (FPCore (c0 A_m V_m l_m)
         :precision binary64
         (let* ((t_0 (sqrt (/ A_m (* V_m l_m))))
                (t_1 (* c0 (sqrt (/ (/ A_m V_m) l_m)))))
           (if (<= t_0 5e-10) t_1 (if (<= t_0 5e+146) (* c0 t_0) t_1))))
        A_m = fabs(A);
        V_m = fabs(V);
        l_m = fabs(l);
        assert(c0 < A_m && A_m < V_m && V_m < l_m);
        double code(double c0, double A_m, double V_m, double l_m) {
        	double t_0 = sqrt((A_m / (V_m * l_m)));
        	double t_1 = c0 * sqrt(((A_m / V_m) / l_m));
        	double tmp;
        	if (t_0 <= 5e-10) {
        		tmp = t_1;
        	} else if (t_0 <= 5e+146) {
        		tmp = c0 * t_0;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        A_m =     private
        V_m =     private
        l_m =     private
        NOTE: c0, A_m, V_m, and l_m 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(c0, a_m, v_m, l_m)
        use fmin_fmax_functions
            real(8), intent (in) :: c0
            real(8), intent (in) :: a_m
            real(8), intent (in) :: v_m
            real(8), intent (in) :: l_m
            real(8) :: t_0
            real(8) :: t_1
            real(8) :: tmp
            t_0 = sqrt((a_m / (v_m * l_m)))
            t_1 = c0 * sqrt(((a_m / v_m) / l_m))
            if (t_0 <= 5d-10) then
                tmp = t_1
            else if (t_0 <= 5d+146) then
                tmp = c0 * t_0
            else
                tmp = t_1
            end if
            code = tmp
        end function
        
        A_m = Math.abs(A);
        V_m = Math.abs(V);
        l_m = Math.abs(l);
        assert c0 < A_m && A_m < V_m && V_m < l_m;
        public static double code(double c0, double A_m, double V_m, double l_m) {
        	double t_0 = Math.sqrt((A_m / (V_m * l_m)));
        	double t_1 = c0 * Math.sqrt(((A_m / V_m) / l_m));
        	double tmp;
        	if (t_0 <= 5e-10) {
        		tmp = t_1;
        	} else if (t_0 <= 5e+146) {
        		tmp = c0 * t_0;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        A_m = math.fabs(A)
        V_m = math.fabs(V)
        l_m = math.fabs(l)
        [c0, A_m, V_m, l_m] = sort([c0, A_m, V_m, l_m])
        def code(c0, A_m, V_m, l_m):
        	t_0 = math.sqrt((A_m / (V_m * l_m)))
        	t_1 = c0 * math.sqrt(((A_m / V_m) / l_m))
        	tmp = 0
        	if t_0 <= 5e-10:
        		tmp = t_1
        	elif t_0 <= 5e+146:
        		tmp = c0 * t_0
        	else:
        		tmp = t_1
        	return tmp
        
        A_m = abs(A)
        V_m = abs(V)
        l_m = abs(l)
        c0, A_m, V_m, l_m = sort([c0, A_m, V_m, l_m])
        function code(c0, A_m, V_m, l_m)
        	t_0 = sqrt(Float64(A_m / Float64(V_m * l_m)))
        	t_1 = Float64(c0 * sqrt(Float64(Float64(A_m / V_m) / l_m)))
        	tmp = 0.0
        	if (t_0 <= 5e-10)
        		tmp = t_1;
        	elseif (t_0 <= 5e+146)
        		tmp = Float64(c0 * t_0);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        A_m = abs(A);
        V_m = abs(V);
        l_m = abs(l);
        c0, A_m, V_m, l_m = num2cell(sort([c0, A_m, V_m, l_m])){:}
        function tmp_2 = code(c0, A_m, V_m, l_m)
        	t_0 = sqrt((A_m / (V_m * l_m)));
        	t_1 = c0 * sqrt(((A_m / V_m) / l_m));
        	tmp = 0.0;
        	if (t_0 <= 5e-10)
        		tmp = t_1;
        	elseif (t_0 <= 5e+146)
        		tmp = c0 * t_0;
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        A_m = N[Abs[A], $MachinePrecision]
        V_m = N[Abs[V], $MachinePrecision]
        l_m = N[Abs[l], $MachinePrecision]
        NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
        code[c0_, A$95$m_, V$95$m_, l$95$m_] := Block[{t$95$0 = N[Sqrt[N[(A$95$m / N[(V$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[Sqrt[N[(N[(A$95$m / V$95$m), $MachinePrecision] / l$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-10], t$95$1, If[LessEqual[t$95$0, 5e+146], N[(c0 * t$95$0), $MachinePrecision], t$95$1]]]]
        
        \begin{array}{l}
        A_m = \left|A\right|
        \\
        V_m = \left|V\right|
        \\
        l_m = \left|\ell\right|
        \\
        [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\
        \\
        \begin{array}{l}
        t_0 := \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}\\
        t_1 := c0 \cdot \sqrt{\frac{\frac{A\_m}{V\_m}}{l\_m}}\\
        \mathbf{if}\;t\_0 \leq 5 \cdot 10^{-10}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+146}:\\
        \;\;\;\;c0 \cdot t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (sqrt.f64 (/.f64 A (*.f64 V l))) < 5.00000000000000031e-10 or 4.9999999999999999e146 < (sqrt.f64 (/.f64 A (*.f64 V l)))

          1. Initial program 73.2%

            \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
            2. lift-/.f64N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell}}} \]
            3. associate-/r*N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
            4. lower-/.f64N/A

              \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
            5. lower-/.f6472.8

              \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{V}}}{\ell}} \]
          3. Applied rewrites72.8%

            \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]

          if 5.00000000000000031e-10 < (sqrt.f64 (/.f64 A (*.f64 V l))) < 4.9999999999999999e146

          1. Initial program 73.2%

            \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 9: 73.2% accurate, 1.0× speedup?

        \[\begin{array}{l} A_m = \left|A\right| \\ V_m = \left|V\right| \\ l_m = \left|\ell\right| \\ [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\ \\ c0 \cdot \sqrt{\frac{A\_m}{V\_m \cdot l\_m}} \end{array} \]
        A_m = (fabs.f64 A)
        V_m = (fabs.f64 V)
        l_m = (fabs.f64 l)
        NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
        (FPCore (c0 A_m V_m l_m) :precision binary64 (* c0 (sqrt (/ A_m (* V_m l_m)))))
        A_m = fabs(A);
        V_m = fabs(V);
        l_m = fabs(l);
        assert(c0 < A_m && A_m < V_m && V_m < l_m);
        double code(double c0, double A_m, double V_m, double l_m) {
        	return c0 * sqrt((A_m / (V_m * l_m)));
        }
        
        A_m =     private
        V_m =     private
        l_m =     private
        NOTE: c0, A_m, V_m, and l_m 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(c0, a_m, v_m, l_m)
        use fmin_fmax_functions
            real(8), intent (in) :: c0
            real(8), intent (in) :: a_m
            real(8), intent (in) :: v_m
            real(8), intent (in) :: l_m
            code = c0 * sqrt((a_m / (v_m * l_m)))
        end function
        
        A_m = Math.abs(A);
        V_m = Math.abs(V);
        l_m = Math.abs(l);
        assert c0 < A_m && A_m < V_m && V_m < l_m;
        public static double code(double c0, double A_m, double V_m, double l_m) {
        	return c0 * Math.sqrt((A_m / (V_m * l_m)));
        }
        
        A_m = math.fabs(A)
        V_m = math.fabs(V)
        l_m = math.fabs(l)
        [c0, A_m, V_m, l_m] = sort([c0, A_m, V_m, l_m])
        def code(c0, A_m, V_m, l_m):
        	return c0 * math.sqrt((A_m / (V_m * l_m)))
        
        A_m = abs(A)
        V_m = abs(V)
        l_m = abs(l)
        c0, A_m, V_m, l_m = sort([c0, A_m, V_m, l_m])
        function code(c0, A_m, V_m, l_m)
        	return Float64(c0 * sqrt(Float64(A_m / Float64(V_m * l_m))))
        end
        
        A_m = abs(A);
        V_m = abs(V);
        l_m = abs(l);
        c0, A_m, V_m, l_m = num2cell(sort([c0, A_m, V_m, l_m])){:}
        function tmp = code(c0, A_m, V_m, l_m)
        	tmp = c0 * sqrt((A_m / (V_m * l_m)));
        end
        
        A_m = N[Abs[A], $MachinePrecision]
        V_m = N[Abs[V], $MachinePrecision]
        l_m = N[Abs[l], $MachinePrecision]
        NOTE: c0, A_m, V_m, and l_m should be sorted in increasing order before calling this function.
        code[c0_, A$95$m_, V$95$m_, l$95$m_] := N[(c0 * N[Sqrt[N[(A$95$m / N[(V$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        A_m = \left|A\right|
        \\
        V_m = \left|V\right|
        \\
        l_m = \left|\ell\right|
        \\
        [c0, A_m, V_m, l_m] = \mathsf{sort}([c0, A_m, V_m, l_m])\\
        \\
        c0 \cdot \sqrt{\frac{A\_m}{V\_m \cdot l\_m}}
        \end{array}
        
        Derivation
        1. Initial program 73.2%

          \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
        2. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2025134 
        (FPCore (c0 A V l)
          :name "Henrywood and Agarwal, Equation (3)"
          :precision binary64
          (* c0 (sqrt (/ A (* V l)))))