Henrywood and Agarwal, Equation (3)

Percentage Accurate: 74.2% → 89.6%
Time: 9.7s
Alternatives: 10
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)));
}
real(8) function code(c0, a, v, l)
    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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 74.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)));
}
real(8) function code(c0, a, v, l)
    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: 89.6% accurate, 0.5× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+167}:\\ \;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-260}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -2e+167)
   (* (sqrt (/ A V)) (/ c0 (sqrt l)))
   (if (<= (* V l) -5e-260)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (<= (* V l) 0.0)
       (* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
       (if (<= (* V l) 1e+206)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* c0 (sqrt (/ (/ A V) l))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -2e+167) {
		tmp = sqrt((A / V)) * (c0 / sqrt(l));
	} else if ((V * l) <= -5e-260) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
	} else if ((V * l) <= 1e+206) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * sqrt(((A / V) / l));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-2d+167)) then
        tmp = sqrt((a / v)) * (c0 / sqrt(l))
    else if ((v * l) <= (-5d-260)) then
        tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
    else if ((v * l) <= 0.0d0) then
        tmp = c0 * (sqrt((a / -l)) / sqrt(-v))
    else if ((v * l) <= 1d+206) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 * sqrt(((a / v) / l))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -2e+167) {
		tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
	} else if ((V * l) <= -5e-260) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
	} else if ((V * l) <= 1e+206) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * Math.sqrt(((A / V) / l));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -2e+167:
		tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l))
	elif (V * l) <= -5e-260:
		tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 0.0:
		tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V))
	elif (V * l) <= 1e+206:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 * math.sqrt(((A / V) / l))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -2e+167)
		tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l)));
	elseif (Float64(V * l) <= -5e-260)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V))));
	elseif (Float64(V * l) <= 1e+206)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -2e+167)
		tmp = sqrt((A / V)) * (c0 / sqrt(l));
	elseif ((V * l) <= -5e-260)
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 0.0)
		tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
	elseif ((V * l) <= 1e+206)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 * sqrt(((A / V) / l));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+167], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-260], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+206], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+167}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-260}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -2.0000000000000001e167

    1. Initial program 54.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg54.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. div-inv54.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(-A\right) \cdot \frac{1}{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in54.8%

        \[\leadsto c0 \cdot \sqrt{\left(-A\right) \cdot \frac{1}{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr54.8%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt54.7%

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

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

        \[\leadsto \left(c0 \cdot \sqrt{\color{blue}{{\left(\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}\right)}^{0.5}}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      4. sqrt-pow154.7%

        \[\leadsto \left(c0 \cdot \color{blue}{{\left(\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}\right)}^{\left(\frac{0.5}{2}\right)}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      5. associate-*r/54.7%

        \[\leadsto \left(c0 \cdot {\color{blue}{\left(\frac{\left(-A\right) \cdot 1}{V \cdot \left(-\ell\right)}\right)}}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      6. distribute-rgt-neg-out54.7%

        \[\leadsto \left(c0 \cdot {\left(\frac{\left(-A\right) \cdot 1}{\color{blue}{-V \cdot \ell}}\right)}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      7. distribute-lft-neg-in54.7%

        \[\leadsto \left(c0 \cdot {\left(\frac{\left(-A\right) \cdot 1}{\color{blue}{\left(-V\right) \cdot \ell}}\right)}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      8. frac-times54.7%

        \[\leadsto \left(c0 \cdot {\color{blue}{\left(\frac{-A}{-V} \cdot \frac{1}{\ell}\right)}}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      9. frac-2neg54.7%

        \[\leadsto \left(c0 \cdot {\left(\color{blue}{\frac{A}{V}} \cdot \frac{1}{\ell}\right)}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      10. sqrt-pow154.7%

        \[\leadsto \left(c0 \cdot \color{blue}{\sqrt{{\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{0.5}}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      11. pow1/254.7%

        \[\leadsto \left(c0 \cdot \sqrt{\color{blue}{\sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
    6. Applied egg-rr28.8%

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
    7. Step-by-step derivation
      1. *-commutative28.8%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
    8. Simplified28.9%

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

    if -2.0000000000000001e167 < (*.f64 V l) < -5.0000000000000003e-260

    1. Initial program 85.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg85.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. sqrt-div99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr99.4%

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

    if -5.0000000000000003e-260 < (*.f64 V l) < -0.0

    1. Initial program 46.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg46.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. div-inv46.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(-A\right) \cdot \frac{1}{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in46.8%

        \[\leadsto c0 \cdot \sqrt{\left(-A\right) \cdot \frac{1}{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr46.8%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
    5. Taylor expanded in c0 around 0 46.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \cdot c0 \]
    7. Simplified66.9%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{\ell}}{V}} \cdot c0} \]
    8. Step-by-step derivation
      1. frac-2neg66.9%

        \[\leadsto \sqrt{\color{blue}{\frac{-\frac{A}{\ell}}{-V}}} \cdot c0 \]
      2. sqrt-div52.7%

        \[\leadsto \color{blue}{\frac{\sqrt{-\frac{A}{\ell}}}{\sqrt{-V}}} \cdot c0 \]
      3. distribute-neg-frac252.7%

        \[\leadsto \frac{\sqrt{\color{blue}{\frac{A}{-\ell}}}}{\sqrt{-V}} \cdot c0 \]
    9. Applied egg-rr52.7%

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

    if -0.0 < (*.f64 V l) < 1e206

    1. Initial program 88.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv98.8%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr98.8%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity98.9%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified98.9%

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

    if 1e206 < (*.f64 V l)

    1. Initial program 52.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*76.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
    3. Simplified76.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+167}:\\ \;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-260}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 76.8% accurate, 0.3× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-228}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\ \;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
   (if (<= t_0 2e-228)
     (* c0 (sqrt (/ (/ A V) l)))
     (if (<= t_0 2e+273)
       (* c0 (sqrt (* A (/ (/ 1.0 V) l))))
       (/ c0 (sqrt (* V (/ l A))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = c0 * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 2e-228) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if (t_0 <= 2e+273) {
		tmp = c0 * sqrt((A * ((1.0 / V) / l)));
	} else {
		tmp = c0 / sqrt((V * (l / A)));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0 * sqrt((a / (v * l)))
    if (t_0 <= 2d-228) then
        tmp = c0 * sqrt(((a / v) / l))
    else if (t_0 <= 2d+273) then
        tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
    else
        tmp = c0 / sqrt((v * (l / a)))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = c0 * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 2e-228) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 2e+273) {
		tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
	} else {
		tmp = c0 / Math.sqrt((V * (l / A)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = c0 * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 2e-228:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif t_0 <= 2e+273:
		tmp = c0 * math.sqrt((A * ((1.0 / V) / l)))
	else:
		tmp = c0 / math.sqrt((V * (l / A)))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 2e-228)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 2e+273)
		tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l))));
	else
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = c0 * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 2e-228)
		tmp = c0 * sqrt(((A / V) / l));
	elseif (t_0 <= 2e+273)
		tmp = c0 * sqrt((A * ((1.0 / V) / l)));
	else
		tmp = c0 / sqrt((V * (l / A)));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-228], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+273], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-228}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\

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


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

    1. Initial program 68.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*74.3%

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

      \[\leadsto \color{blue}{c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}} \]
    4. Add Preprocessing

    if 2.00000000000000007e-228 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999989e273

    1. Initial program 99.5%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/99.5%

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr99.6%

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

    if 1.99999999999999989e273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 50.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative50.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \cdot c0 \]
      3. sqrt-div45.9%

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

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    4. Applied egg-rr46.0%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
      2. *-commutative43.4%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]
      3. clear-num43.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \]
      4. sqrt-div43.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}} \]
      5. metadata-eval43.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}} \]
      6. times-frac46.0%

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}} \]
      7. sqrt-prod58.1%

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

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

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

        \[\leadsto \frac{c0 \cdot 1}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      11. *-rgt-identity61.1%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      12. add-cube-cbrt61.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \sqrt[3]{c0}}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      13. associate-/l*61.0%

        \[\leadsto \color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      14. pow261.0%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2}} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    6. Applied egg-rr61.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    7. Step-by-step derivation
      1. associate-*r/61.0%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      2. unpow261.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right)} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      3. rem-3cbrt-lft61.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 2 \cdot 10^{-228}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 2 \cdot 10^{+273}:\\ \;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 76.8% accurate, 0.3× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-228}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\ \;\;\;\;c0 \cdot \sqrt{A \cdot \frac{1}{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
   (if (<= t_0 2e-228)
     (* c0 (sqrt (/ (/ A V) l)))
     (if (<= t_0 2e+273)
       (* c0 (sqrt (* A (/ 1.0 (* V l)))))
       (/ c0 (sqrt (* V (/ l A))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = c0 * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 2e-228) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if (t_0 <= 2e+273) {
		tmp = c0 * sqrt((A * (1.0 / (V * l))));
	} else {
		tmp = c0 / sqrt((V * (l / A)));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0 * sqrt((a / (v * l)))
    if (t_0 <= 2d-228) then
        tmp = c0 * sqrt(((a / v) / l))
    else if (t_0 <= 2d+273) then
        tmp = c0 * sqrt((a * (1.0d0 / (v * l))))
    else
        tmp = c0 / sqrt((v * (l / a)))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = c0 * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 2e-228) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 2e+273) {
		tmp = c0 * Math.sqrt((A * (1.0 / (V * l))));
	} else {
		tmp = c0 / Math.sqrt((V * (l / A)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = c0 * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 2e-228:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif t_0 <= 2e+273:
		tmp = c0 * math.sqrt((A * (1.0 / (V * l))))
	else:
		tmp = c0 / math.sqrt((V * (l / A)))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 2e-228)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 2e+273)
		tmp = Float64(c0 * sqrt(Float64(A * Float64(1.0 / Float64(V * l)))));
	else
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = c0 * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 2e-228)
		tmp = c0 * sqrt(((A / V) / l));
	elseif (t_0 <= 2e+273)
		tmp = c0 * sqrt((A * (1.0 / (V * l))));
	else
		tmp = c0 / sqrt((V * (l / A)));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-228], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+273], N[(c0 * N[Sqrt[N[(A * N[(1.0 / N[(V * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-228}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{1}{V \cdot \ell}}\\

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


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

    1. Initial program 68.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*74.3%

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

      \[\leadsto \color{blue}{c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}} \]
    4. Add Preprocessing

    if 2.00000000000000007e-228 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999989e273

    1. Initial program 99.5%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*85.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
    3. Simplified85.0%

      \[\leadsto \color{blue}{c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num83.4%

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{1}{\frac{V}{A}}}}{\ell}} \]
      2. associate-/r/85.1%

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{1}{V} \cdot A}}{\ell}} \]
    6. Applied egg-rr85.1%

      \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{1}{V} \cdot A}}{\ell}} \]
    7. Step-by-step derivation
      1. frac-2neg85.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-\frac{1}{V} \cdot A}{-\ell}}} \]
      2. distribute-rgt-neg-in85.1%

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \left(-\ell\right)}} \cdot \left(-A\right)} \]
      5. add-sqr-sqrt41.4%

        \[\leadsto c0 \cdot \sqrt{\frac{1}{V \cdot \left(-\ell\right)} \cdot \color{blue}{\left(\sqrt{-A} \cdot \sqrt{-A}\right)}} \]
      6. add-sqr-sqrt19.8%

        \[\leadsto c0 \cdot \sqrt{\frac{1}{V \cdot \color{blue}{\left(\sqrt{-\ell} \cdot \sqrt{-\ell}\right)}} \cdot \left(\sqrt{-A} \cdot \sqrt{-A}\right)} \]
      7. sqrt-unprod10.6%

        \[\leadsto c0 \cdot \sqrt{\frac{1}{V \cdot \color{blue}{\sqrt{\left(-\ell\right) \cdot \left(-\ell\right)}}} \cdot \left(\sqrt{-A} \cdot \sqrt{-A}\right)} \]
      8. sqr-neg10.6%

        \[\leadsto c0 \cdot \sqrt{\frac{1}{V \cdot \sqrt{\color{blue}{\ell \cdot \ell}}} \cdot \left(\sqrt{-A} \cdot \sqrt{-A}\right)} \]
      9. sqrt-unprod0.0%

        \[\leadsto c0 \cdot \sqrt{\frac{1}{V \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}} \cdot \left(\sqrt{-A} \cdot \sqrt{-A}\right)} \]
      10. add-sqr-sqrt0.0%

        \[\leadsto c0 \cdot \sqrt{\frac{1}{V \cdot \color{blue}{\ell}} \cdot \left(\sqrt{-A} \cdot \sqrt{-A}\right)} \]
      11. sqrt-unprod33.9%

        \[\leadsto c0 \cdot \sqrt{\frac{1}{V \cdot \ell} \cdot \color{blue}{\sqrt{\left(-A\right) \cdot \left(-A\right)}}} \]
      12. sqr-neg33.9%

        \[\leadsto c0 \cdot \sqrt{\frac{1}{V \cdot \ell} \cdot \sqrt{\color{blue}{A \cdot A}}} \]
      13. sqrt-unprod57.9%

        \[\leadsto c0 \cdot \sqrt{\frac{1}{V \cdot \ell} \cdot \color{blue}{\left(\sqrt{A} \cdot \sqrt{A}\right)}} \]
      14. add-sqr-sqrt99.5%

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

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

    if 1.99999999999999989e273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 50.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative50.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \cdot c0 \]
      3. sqrt-div45.9%

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

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    4. Applied egg-rr46.0%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
      2. *-commutative43.4%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]
      3. clear-num43.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \]
      4. sqrt-div43.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}} \]
      5. metadata-eval43.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}} \]
      6. times-frac46.0%

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}} \]
      7. sqrt-prod58.1%

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

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

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

        \[\leadsto \frac{c0 \cdot 1}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      11. *-rgt-identity61.1%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      12. add-cube-cbrt61.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \sqrt[3]{c0}}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      13. associate-/l*61.0%

        \[\leadsto \color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      14. pow261.0%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2}} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    6. Applied egg-rr61.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    7. Step-by-step derivation
      1. associate-*r/61.0%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      2. unpow261.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right)} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      3. rem-3cbrt-lft61.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 2 \cdot 10^{-228}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 2 \cdot 10^{+273}:\\ \;\;\;\;c0 \cdot \sqrt{A \cdot \frac{1}{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 76.8% accurate, 0.3× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-228} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+302}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
   (if (or (<= t_0 2e-228) (not (<= t_0 4e+302)))
     (* c0 (sqrt (/ (/ A V) l)))
     t_0)))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = c0 * sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= 2e-228) || !(t_0 <= 4e+302)) {
		tmp = c0 * sqrt(((A / V) / l));
	} else {
		tmp = t_0;
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0 * sqrt((a / (v * l)))
    if ((t_0 <= 2d-228) .or. (.not. (t_0 <= 4d+302))) then
        tmp = c0 * sqrt(((a / v) / l))
    else
        tmp = t_0
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = c0 * Math.sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= 2e-228) || !(t_0 <= 4e+302)) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else {
		tmp = t_0;
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = c0 * math.sqrt((A / (V * l)))
	tmp = 0
	if (t_0 <= 2e-228) or not (t_0 <= 4e+302):
		tmp = c0 * math.sqrt(((A / V) / l))
	else:
		tmp = t_0
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if ((t_0 <= 2e-228) || !(t_0 <= 4e+302))
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	else
		tmp = t_0;
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = c0 * sqrt((A / (V * l)));
	tmp = 0.0;
	if ((t_0 <= 2e-228) || ~((t_0 <= 4e+302)))
		tmp = c0 * sqrt(((A / V) / l));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-228], N[Not[LessEqual[t$95$0, 4e+302]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-228} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+302}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000007e-228 or 4.0000000000000003e302 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 64.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*70.8%

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

      \[\leadsto \color{blue}{c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}} \]
    4. Add Preprocessing

    if 2.00000000000000007e-228 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000003e302

    1. Initial program 99.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 2 \cdot 10^{-228} \lor \neg \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 4 \cdot 10^{+302}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 77.0% accurate, 0.3× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-228}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
   (if (<= t_0 2e-228)
     (* c0 (sqrt (/ (/ A V) l)))
     (if (<= t_0 2e+273) t_0 (/ c0 (sqrt (* V (/ l A))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = c0 * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 2e-228) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if (t_0 <= 2e+273) {
		tmp = t_0;
	} else {
		tmp = c0 / sqrt((V * (l / A)));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0 * sqrt((a / (v * l)))
    if (t_0 <= 2d-228) then
        tmp = c0 * sqrt(((a / v) / l))
    else if (t_0 <= 2d+273) then
        tmp = t_0
    else
        tmp = c0 / sqrt((v * (l / a)))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = c0 * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 2e-228) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 2e+273) {
		tmp = t_0;
	} else {
		tmp = c0 / Math.sqrt((V * (l / A)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = c0 * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 2e-228:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif t_0 <= 2e+273:
		tmp = t_0
	else:
		tmp = c0 / math.sqrt((V * (l / A)))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 2e-228)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 2e+273)
		tmp = t_0;
	else
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = c0 * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 2e-228)
		tmp = c0 * sqrt(((A / V) / l));
	elseif (t_0 <= 2e+273)
		tmp = t_0;
	else
		tmp = c0 / sqrt((V * (l / A)));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-228], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+273], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-228}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 68.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*74.3%

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

      \[\leadsto \color{blue}{c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}} \]
    4. Add Preprocessing

    if 2.00000000000000007e-228 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999989e273

    1. Initial program 99.5%

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

    if 1.99999999999999989e273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 50.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative50.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \cdot c0 \]
      3. sqrt-div45.9%

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

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    4. Applied egg-rr46.0%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
      2. *-commutative43.4%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]
      3. clear-num43.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \]
      4. sqrt-div43.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}} \]
      5. metadata-eval43.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}} \]
      6. times-frac46.0%

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}} \]
      7. sqrt-prod58.1%

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

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

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

        \[\leadsto \frac{c0 \cdot 1}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      11. *-rgt-identity61.1%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      12. add-cube-cbrt61.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \sqrt[3]{c0}}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      13. associate-/l*61.0%

        \[\leadsto \color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      14. pow261.0%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2}} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    6. Applied egg-rr61.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    7. Step-by-step derivation
      1. associate-*r/61.0%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      2. unpow261.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right)} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      3. rem-3cbrt-lft61.1%

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

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

Alternative 6: 89.0% accurate, 0.5× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+167}:\\ \;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-260}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -2e+167)
   (* (sqrt (/ A V)) (/ c0 (sqrt l)))
   (if (<= (* V l) -5e-260)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (<= (* V l) 5e-315)
       (/ c0 (sqrt (* V (/ l A))))
       (if (<= (* V l) 1e+206)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* c0 (sqrt (/ (/ A V) l))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -2e+167) {
		tmp = sqrt((A / V)) * (c0 / sqrt(l));
	} else if ((V * l) <= -5e-260) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 5e-315) {
		tmp = c0 / sqrt((V * (l / A)));
	} else if ((V * l) <= 1e+206) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * sqrt(((A / V) / l));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-2d+167)) then
        tmp = sqrt((a / v)) * (c0 / sqrt(l))
    else if ((v * l) <= (-5d-260)) then
        tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
    else if ((v * l) <= 5d-315) then
        tmp = c0 / sqrt((v * (l / a)))
    else if ((v * l) <= 1d+206) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 * sqrt(((a / v) / l))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -2e+167) {
		tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
	} else if ((V * l) <= -5e-260) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 5e-315) {
		tmp = c0 / Math.sqrt((V * (l / A)));
	} else if ((V * l) <= 1e+206) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * Math.sqrt(((A / V) / l));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -2e+167:
		tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l))
	elif (V * l) <= -5e-260:
		tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 5e-315:
		tmp = c0 / math.sqrt((V * (l / A)))
	elif (V * l) <= 1e+206:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 * math.sqrt(((A / V) / l))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -2e+167)
		tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l)));
	elseif (Float64(V * l) <= -5e-260)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 5e-315)
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	elseif (Float64(V * l) <= 1e+206)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -2e+167)
		tmp = sqrt((A / V)) * (c0 / sqrt(l));
	elseif ((V * l) <= -5e-260)
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 5e-315)
		tmp = c0 / sqrt((V * (l / A)));
	elseif ((V * l) <= 1e+206)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 * sqrt(((A / V) / l));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+167], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-260], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-315], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+206], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+167}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-260}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -2.0000000000000001e167

    1. Initial program 54.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg54.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. div-inv54.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(-A\right) \cdot \frac{1}{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in54.8%

        \[\leadsto c0 \cdot \sqrt{\left(-A\right) \cdot \frac{1}{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr54.8%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt54.7%

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

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

        \[\leadsto \left(c0 \cdot \sqrt{\color{blue}{{\left(\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}\right)}^{0.5}}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      4. sqrt-pow154.7%

        \[\leadsto \left(c0 \cdot \color{blue}{{\left(\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}\right)}^{\left(\frac{0.5}{2}\right)}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      5. associate-*r/54.7%

        \[\leadsto \left(c0 \cdot {\color{blue}{\left(\frac{\left(-A\right) \cdot 1}{V \cdot \left(-\ell\right)}\right)}}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      6. distribute-rgt-neg-out54.7%

        \[\leadsto \left(c0 \cdot {\left(\frac{\left(-A\right) \cdot 1}{\color{blue}{-V \cdot \ell}}\right)}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      7. distribute-lft-neg-in54.7%

        \[\leadsto \left(c0 \cdot {\left(\frac{\left(-A\right) \cdot 1}{\color{blue}{\left(-V\right) \cdot \ell}}\right)}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      8. frac-times54.7%

        \[\leadsto \left(c0 \cdot {\color{blue}{\left(\frac{-A}{-V} \cdot \frac{1}{\ell}\right)}}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      9. frac-2neg54.7%

        \[\leadsto \left(c0 \cdot {\left(\color{blue}{\frac{A}{V}} \cdot \frac{1}{\ell}\right)}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      10. sqrt-pow154.7%

        \[\leadsto \left(c0 \cdot \color{blue}{\sqrt{{\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{0.5}}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      11. pow1/254.7%

        \[\leadsto \left(c0 \cdot \sqrt{\color{blue}{\sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
    6. Applied egg-rr28.8%

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
    7. Step-by-step derivation
      1. *-commutative28.8%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
    8. Simplified28.9%

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

    if -2.0000000000000001e167 < (*.f64 V l) < -5.0000000000000003e-260

    1. Initial program 85.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg85.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. sqrt-div99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr99.4%

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

    if -5.0000000000000003e-260 < (*.f64 V l) < 5.0000000023e-315

    1. Initial program 47.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative47.4%

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    4. Applied egg-rr31.0%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
      2. *-commutative35.9%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]
      3. clear-num35.9%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \]
      4. sqrt-div35.7%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}} \]
      5. metadata-eval35.7%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}} \]
      6. times-frac35.8%

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}} \]
      7. sqrt-prod69.4%

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

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

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

        \[\leadsto \frac{c0 \cdot 1}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      11. *-rgt-identity69.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      12. add-cube-cbrt69.2%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \sqrt[3]{c0}}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      13. associate-/l*69.2%

        \[\leadsto \color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      14. pow269.2%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2}} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    6. Applied egg-rr69.2%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    7. Step-by-step derivation
      1. associate-*r/69.2%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      2. unpow269.2%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right)} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      3. rem-3cbrt-lft69.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    8. Simplified69.4%

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

    if 5.0000000023e-315 < (*.f64 V l) < 1e206

    1. Initial program 88.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div99.3%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv99.1%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr99.1%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/99.3%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity99.3%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified99.3%

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

    if 1e206 < (*.f64 V l)

    1. Initial program 52.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*76.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
    3. Simplified76.0%

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

Alternative 7: 86.1% accurate, 0.5× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+163}:\\ \;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-230}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -1e+163)
   (* (sqrt (/ A V)) (/ c0 (sqrt l)))
   (if (<= (* V l) -2e-230)
     (/ c0 (sqrt (/ (* V l) A)))
     (if (<= (* V l) 5e-315)
       (/ c0 (sqrt (* V (/ l A))))
       (if (<= (* V l) 1e+206)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* c0 (sqrt (/ (/ A V) l))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+163) {
		tmp = sqrt((A / V)) * (c0 / sqrt(l));
	} else if ((V * l) <= -2e-230) {
		tmp = c0 / sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-315) {
		tmp = c0 / sqrt((V * (l / A)));
	} else if ((V * l) <= 1e+206) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * sqrt(((A / V) / l));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-1d+163)) then
        tmp = sqrt((a / v)) * (c0 / sqrt(l))
    else if ((v * l) <= (-2d-230)) then
        tmp = c0 / sqrt(((v * l) / a))
    else if ((v * l) <= 5d-315) then
        tmp = c0 / sqrt((v * (l / a)))
    else if ((v * l) <= 1d+206) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 * sqrt(((a / v) / l))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+163) {
		tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
	} else if ((V * l) <= -2e-230) {
		tmp = c0 / Math.sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-315) {
		tmp = c0 / Math.sqrt((V * (l / A)));
	} else if ((V * l) <= 1e+206) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * Math.sqrt(((A / V) / l));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -1e+163:
		tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l))
	elif (V * l) <= -2e-230:
		tmp = c0 / math.sqrt(((V * l) / A))
	elif (V * l) <= 5e-315:
		tmp = c0 / math.sqrt((V * (l / A)))
	elif (V * l) <= 1e+206:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 * math.sqrt(((A / V) / l))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -1e+163)
		tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l)));
	elseif (Float64(V * l) <= -2e-230)
		tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A)));
	elseif (Float64(V * l) <= 5e-315)
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	elseif (Float64(V * l) <= 1e+206)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -1e+163)
		tmp = sqrt((A / V)) * (c0 / sqrt(l));
	elseif ((V * l) <= -2e-230)
		tmp = c0 / sqrt(((V * l) / A));
	elseif ((V * l) <= 5e-315)
		tmp = c0 / sqrt((V * (l / A)));
	elseif ((V * l) <= 1e+206)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 * sqrt(((A / V) / l));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+163], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-230], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-315], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+206], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+163}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-230}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -9.9999999999999994e162

    1. Initial program 53.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg53.4%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. div-inv53.4%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(-A\right) \cdot \frac{1}{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in53.4%

        \[\leadsto c0 \cdot \sqrt{\left(-A\right) \cdot \frac{1}{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr53.4%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt53.3%

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

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

        \[\leadsto \left(c0 \cdot \sqrt{\color{blue}{{\left(\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}\right)}^{0.5}}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      4. sqrt-pow153.3%

        \[\leadsto \left(c0 \cdot \color{blue}{{\left(\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}\right)}^{\left(\frac{0.5}{2}\right)}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      5. associate-*r/53.4%

        \[\leadsto \left(c0 \cdot {\color{blue}{\left(\frac{\left(-A\right) \cdot 1}{V \cdot \left(-\ell\right)}\right)}}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      6. distribute-rgt-neg-out53.4%

        \[\leadsto \left(c0 \cdot {\left(\frac{\left(-A\right) \cdot 1}{\color{blue}{-V \cdot \ell}}\right)}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      7. distribute-lft-neg-in53.4%

        \[\leadsto \left(c0 \cdot {\left(\frac{\left(-A\right) \cdot 1}{\color{blue}{\left(-V\right) \cdot \ell}}\right)}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      8. frac-times53.4%

        \[\leadsto \left(c0 \cdot {\color{blue}{\left(\frac{-A}{-V} \cdot \frac{1}{\ell}\right)}}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      9. frac-2neg53.4%

        \[\leadsto \left(c0 \cdot {\left(\color{blue}{\frac{A}{V}} \cdot \frac{1}{\ell}\right)}^{\left(\frac{0.5}{2}\right)}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      10. sqrt-pow153.3%

        \[\leadsto \left(c0 \cdot \color{blue}{\sqrt{{\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{0.5}}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
      11. pow1/253.3%

        \[\leadsto \left(c0 \cdot \sqrt{\color{blue}{\sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}}}\right) \cdot \sqrt{\sqrt{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
    6. Applied egg-rr28.2%

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
    7. Step-by-step derivation
      1. *-commutative28.2%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
    8. Simplified28.2%

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

    if -9.9999999999999994e162 < (*.f64 V l) < -2.00000000000000009e-230

    1. Initial program 87.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative87.3%

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    4. Applied egg-rr41.7%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
      2. *-commutative39.6%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]
      3. clear-num38.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \]
      4. sqrt-div38.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}} \]
      5. metadata-eval38.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}} \]
      6. times-frac40.8%

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}} \]
      7. sqrt-prod73.3%

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

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

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

        \[\leadsto \frac{c0 \cdot 1}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      11. *-rgt-identity71.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      12. add-cube-cbrt70.4%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \sqrt[3]{c0}}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      13. associate-/l*70.3%

        \[\leadsto \color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      14. pow270.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2}} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    6. Applied egg-rr70.3%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    7. Step-by-step derivation
      1. associate-*r/70.4%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      2. unpow270.4%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right)} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      3. rem-3cbrt-lft71.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    8. Simplified71.4%

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

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

    if -2.00000000000000009e-230 < (*.f64 V l) < 5.0000000023e-315

    1. Initial program 48.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative48.9%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \cdot c0 \]
      3. sqrt-div35.6%

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

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    4. Applied egg-rr29.0%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
      2. *-commutative35.7%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]
      3. clear-num35.7%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \]
      4. sqrt-div35.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}} \]
      5. metadata-eval35.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}} \]
      6. times-frac35.7%

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}} \]
      7. sqrt-prod69.4%

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

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

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

        \[\leadsto \frac{c0 \cdot 1}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      11. *-rgt-identity69.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      12. add-cube-cbrt69.1%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \sqrt[3]{c0}}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      13. associate-/l*69.0%

        \[\leadsto \color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      14. pow269.0%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2}} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    6. Applied egg-rr69.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    7. Step-by-step derivation
      1. associate-*r/69.1%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      2. unpow269.1%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right)} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      3. rem-3cbrt-lft69.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    8. Simplified69.4%

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

    if 5.0000000023e-315 < (*.f64 V l) < 1e206

    1. Initial program 88.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div99.3%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv99.1%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr99.1%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/99.3%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity99.3%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified99.3%

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

    if 1e206 < (*.f64 V l)

    1. Initial program 52.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*76.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
    3. Simplified76.0%

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

Alternative 8: 86.3% accurate, 0.5× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+163}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-230}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -1e+163)
   (* c0 (/ (sqrt (/ A V)) (sqrt l)))
   (if (<= (* V l) -2e-230)
     (/ c0 (sqrt (/ (* V l) A)))
     (if (<= (* V l) 5e-315)
       (/ c0 (sqrt (* V (/ l A))))
       (if (<= (* V l) 1e+206)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* c0 (sqrt (/ (/ A V) l))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+163) {
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	} else if ((V * l) <= -2e-230) {
		tmp = c0 / sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-315) {
		tmp = c0 / sqrt((V * (l / A)));
	} else if ((V * l) <= 1e+206) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * sqrt(((A / V) / l));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-1d+163)) then
        tmp = c0 * (sqrt((a / v)) / sqrt(l))
    else if ((v * l) <= (-2d-230)) then
        tmp = c0 / sqrt(((v * l) / a))
    else if ((v * l) <= 5d-315) then
        tmp = c0 / sqrt((v * (l / a)))
    else if ((v * l) <= 1d+206) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 * sqrt(((a / v) / l))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+163) {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else if ((V * l) <= -2e-230) {
		tmp = c0 / Math.sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-315) {
		tmp = c0 / Math.sqrt((V * (l / A)));
	} else if ((V * l) <= 1e+206) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * Math.sqrt(((A / V) / l));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -1e+163:
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	elif (V * l) <= -2e-230:
		tmp = c0 / math.sqrt(((V * l) / A))
	elif (V * l) <= 5e-315:
		tmp = c0 / math.sqrt((V * (l / A)))
	elif (V * l) <= 1e+206:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 * math.sqrt(((A / V) / l))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -1e+163)
		tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	elseif (Float64(V * l) <= -2e-230)
		tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A)));
	elseif (Float64(V * l) <= 5e-315)
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	elseif (Float64(V * l) <= 1e+206)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -1e+163)
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	elseif ((V * l) <= -2e-230)
		tmp = c0 / sqrt(((V * l) / A));
	elseif ((V * l) <= 5e-315)
		tmp = c0 / sqrt((V * (l / A)));
	elseif ((V * l) <= 1e+206)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 * sqrt(((A / V) / l));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+163], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-230], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-315], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+206], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+163}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-230}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -9.9999999999999994e162

    1. Initial program 53.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*68.7%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      2. sqrt-div28.2%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
      3. div-inv28.2%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    4. Applied egg-rr28.2%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/28.2%

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

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A}{V}}}}{\sqrt{\ell}} \]
    6. Simplified28.2%

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

    if -9.9999999999999994e162 < (*.f64 V l) < -2.00000000000000009e-230

    1. Initial program 87.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative87.3%

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    4. Applied egg-rr41.7%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
      2. *-commutative39.6%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]
      3. clear-num38.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \]
      4. sqrt-div38.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}} \]
      5. metadata-eval38.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}} \]
      6. times-frac40.8%

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}} \]
      7. sqrt-prod73.3%

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

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

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

        \[\leadsto \frac{c0 \cdot 1}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      11. *-rgt-identity71.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      12. add-cube-cbrt70.4%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \sqrt[3]{c0}}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      13. associate-/l*70.3%

        \[\leadsto \color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      14. pow270.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2}} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    6. Applied egg-rr70.3%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    7. Step-by-step derivation
      1. associate-*r/70.4%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      2. unpow270.4%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right)} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      3. rem-3cbrt-lft71.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    8. Simplified71.4%

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

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

    if -2.00000000000000009e-230 < (*.f64 V l) < 5.0000000023e-315

    1. Initial program 48.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative48.9%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \cdot c0 \]
      3. sqrt-div35.6%

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

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    4. Applied egg-rr29.0%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
      2. *-commutative35.7%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]
      3. clear-num35.7%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \]
      4. sqrt-div35.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}} \]
      5. metadata-eval35.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}} \]
      6. times-frac35.7%

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}} \]
      7. sqrt-prod69.4%

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

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

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

        \[\leadsto \frac{c0 \cdot 1}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      11. *-rgt-identity69.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      12. add-cube-cbrt69.1%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \sqrt[3]{c0}}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      13. associate-/l*69.0%

        \[\leadsto \color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      14. pow269.0%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2}} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    6. Applied egg-rr69.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    7. Step-by-step derivation
      1. associate-*r/69.1%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      2. unpow269.1%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right)} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      3. rem-3cbrt-lft69.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    8. Simplified69.4%

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

    if 5.0000000023e-315 < (*.f64 V l) < 1e206

    1. Initial program 88.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div99.3%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv99.1%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr99.1%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/99.3%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity99.3%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified99.3%

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

    if 1e206 < (*.f64 V l)

    1. Initial program 52.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*76.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
    3. Simplified76.0%

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

Alternative 9: 84.0% accurate, 0.5× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+147}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-230}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -1e+147)
   (/ c0 (sqrt (/ l (/ A V))))
   (if (<= (* V l) -2e-230)
     (/ c0 (sqrt (/ (* V l) A)))
     (if (<= (* V l) 5e-315)
       (/ c0 (sqrt (* V (/ l A))))
       (if (<= (* V l) 1e+206)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* c0 (sqrt (/ (/ A V) l))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+147) {
		tmp = c0 / sqrt((l / (A / V)));
	} else if ((V * l) <= -2e-230) {
		tmp = c0 / sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-315) {
		tmp = c0 / sqrt((V * (l / A)));
	} else if ((V * l) <= 1e+206) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * sqrt(((A / V) / l));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-1d+147)) then
        tmp = c0 / sqrt((l / (a / v)))
    else if ((v * l) <= (-2d-230)) then
        tmp = c0 / sqrt(((v * l) / a))
    else if ((v * l) <= 5d-315) then
        tmp = c0 / sqrt((v * (l / a)))
    else if ((v * l) <= 1d+206) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 * sqrt(((a / v) / l))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+147) {
		tmp = c0 / Math.sqrt((l / (A / V)));
	} else if ((V * l) <= -2e-230) {
		tmp = c0 / Math.sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-315) {
		tmp = c0 / Math.sqrt((V * (l / A)));
	} else if ((V * l) <= 1e+206) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * Math.sqrt(((A / V) / l));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -1e+147:
		tmp = c0 / math.sqrt((l / (A / V)))
	elif (V * l) <= -2e-230:
		tmp = c0 / math.sqrt(((V * l) / A))
	elif (V * l) <= 5e-315:
		tmp = c0 / math.sqrt((V * (l / A)))
	elif (V * l) <= 1e+206:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 * math.sqrt(((A / V) / l))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -1e+147)
		tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V))));
	elseif (Float64(V * l) <= -2e-230)
		tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A)));
	elseif (Float64(V * l) <= 5e-315)
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	elseif (Float64(V * l) <= 1e+206)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -1e+147)
		tmp = c0 / sqrt((l / (A / V)));
	elseif ((V * l) <= -2e-230)
		tmp = c0 / sqrt(((V * l) / A));
	elseif ((V * l) <= 5e-315)
		tmp = c0 / sqrt((V * (l / A)));
	elseif ((V * l) <= 1e+206)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 * sqrt(((A / V) / l));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+147], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-230], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-315], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+206], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+147}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\

\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-230}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -9.9999999999999998e146

    1. Initial program 57.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg57.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. div-inv57.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(-A\right) \cdot \frac{1}{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in57.9%

        \[\leadsto c0 \cdot \sqrt{\left(-A\right) \cdot \frac{1}{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr57.9%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(-A\right) \cdot \frac{1}{V \cdot \left(-\ell\right)}}} \]
    5. Taylor expanded in c0 around 0 57.9%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \cdot c0 \]
    7. Simplified69.5%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{\ell}}{V}} \cdot c0} \]
    8. Step-by-step derivation
      1. clear-num69.4%

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{V \cdot \frac{\ell}{A}}}} \cdot c0 \]
      4. metadata-eval69.3%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{V \cdot \frac{\ell}{A}}} \cdot c0 \]
      5. inv-pow69.3%

        \[\leadsto \color{blue}{{\left(\sqrt{V \cdot \frac{\ell}{A}}\right)}^{-1}} \cdot c0 \]
      6. sqrt-pow269.4%

        \[\leadsto \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{\left(\frac{-1}{2}\right)}} \cdot c0 \]
      7. metadata-eval69.4%

        \[\leadsto {\left(V \cdot \frac{\ell}{A}\right)}^{\color{blue}{-0.5}} \cdot c0 \]
    9. Applied egg-rr69.4%

      \[\leadsto \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \cdot c0 \]
    10. Step-by-step derivation
      1. metadata-eval69.4%

        \[\leadsto {\left(V \cdot \frac{\ell}{A}\right)}^{\color{blue}{\left(-0.5\right)}} \cdot c0 \]
      2. pow-flip69.3%

        \[\leadsto \color{blue}{\frac{1}{{\left(V \cdot \frac{\ell}{A}\right)}^{0.5}}} \cdot c0 \]
      3. pow1/269.3%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{V \cdot \frac{\ell}{A}}}{c0}}} \]
      5. clear-num69.5%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      6. *-commutative69.5%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{\ell}{A} \cdot V}}} \]
      7. sqrt-prod53.5%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{A}} \cdot \sqrt{V}}} \]
      8. sqrt-div0.0%

        \[\leadsto \frac{c0}{\color{blue}{\frac{\sqrt{\ell}}{\sqrt{A}}} \cdot \sqrt{V}} \]
      9. associate-/r/0.0%

        \[\leadsto \frac{c0}{\color{blue}{\frac{\sqrt{\ell}}{\frac{\sqrt{A}}{\sqrt{V}}}}} \]
      10. sqrt-div35.1%

        \[\leadsto \frac{c0}{\frac{\sqrt{\ell}}{\color{blue}{\sqrt{\frac{A}{V}}}}} \]
      11. sqrt-undiv71.8%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
    11. Applied egg-rr71.8%

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

    if -9.9999999999999998e146 < (*.f64 V l) < -2.00000000000000009e-230

    1. Initial program 86.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative86.4%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \cdot c0 \]
      3. sqrt-div37.9%

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

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    4. Applied egg-rr37.8%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
      2. *-commutative35.4%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]
      3. clear-num34.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \]
      4. sqrt-div34.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}} \]
      5. metadata-eval34.4%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}} \]
      6. times-frac36.7%

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}} \]
      7. sqrt-prod71.4%

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

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

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

        \[\leadsto \frac{c0 \cdot 1}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      11. *-rgt-identity71.1%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      12. add-cube-cbrt70.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \sqrt[3]{c0}}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      13. associate-/l*70.0%

        \[\leadsto \color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      14. pow270.0%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2}} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    6. Applied egg-rr70.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    7. Step-by-step derivation
      1. associate-*r/70.0%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      2. unpow270.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right)} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      3. rem-3cbrt-lft71.1%

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

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

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

    if -2.00000000000000009e-230 < (*.f64 V l) < 5.0000000023e-315

    1. Initial program 48.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative48.9%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \cdot c0 \]
      3. sqrt-div35.6%

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

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}} \]
    4. Applied egg-rr29.0%

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

        \[\leadsto \color{blue}{\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}} \]
      2. *-commutative35.7%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]
      3. clear-num35.7%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \]
      4. sqrt-div35.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}} \]
      5. metadata-eval35.6%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}} \]
      6. times-frac35.7%

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}} \]
      7. sqrt-prod69.4%

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

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

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

        \[\leadsto \frac{c0 \cdot 1}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      11. *-rgt-identity69.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      12. add-cube-cbrt69.1%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \sqrt[3]{c0}}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      13. associate-/l*69.0%

        \[\leadsto \color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right) \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      14. pow269.0%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2}} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    6. Applied egg-rr69.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \frac{\sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    7. Step-by-step derivation
      1. associate-*r/69.1%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{c0}\right)}^{2} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
      2. unpow269.1%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{c0} \cdot \sqrt[3]{c0}\right)} \cdot \sqrt[3]{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      3. rem-3cbrt-lft69.4%

        \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
    8. Simplified69.4%

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

    if 5.0000000023e-315 < (*.f64 V l) < 1e206

    1. Initial program 88.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div99.3%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv99.1%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr99.1%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/99.3%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity99.3%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified99.3%

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

    if 1e206 < (*.f64 V l)

    1. Initial program 52.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*76.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
    3. Simplified76.0%

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

Alternative 10: 74.2% accurate, 1.0× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    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
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Derivation
  1. Initial program 73.3%

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

Reproduce

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