Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.3% → 87.8%
Time: 10.8s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 73.3% 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: 87.8% accurate, 0.4× 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^{+253}:\\ \;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-307}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{0 - A}}{\sqrt{0 - V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-305}:\\ \;\;\;\;\frac{c0}{\sqrt{0 - V} \cdot \sqrt{0 - \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+280}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{0 - \frac{A}{\ell}}}{{\left(0 - V\right)}^{0.5}}\\ \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+253)
   (/ (sqrt (/ A V)) (/ (sqrt l) c0))
   (if (<= (* V l) -1e-307)
     (/ (* c0 (sqrt (- 0.0 A))) (sqrt (- 0.0 (* V l))))
     (if (<= (* V l) 1e-305)
       (/ c0 (* (sqrt (- 0.0 V)) (sqrt (- 0.0 (/ l A)))))
       (if (<= (* V l) 2e+280)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* c0 (/ (sqrt (- 0.0 (/ A l))) (pow (- 0.0 V) 0.5))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+253) {
		tmp = sqrt((A / V)) / (sqrt(l) / c0);
	} else if ((V * l) <= -1e-307) {
		tmp = (c0 * sqrt((0.0 - A))) / sqrt((0.0 - (V * l)));
	} else if ((V * l) <= 1e-305) {
		tmp = c0 / (sqrt((0.0 - V)) * sqrt((0.0 - (l / A))));
	} else if ((V * l) <= 2e+280) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * (sqrt((0.0 - (A / l))) / pow((0.0 - V), 0.5));
	}
	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+253)) then
        tmp = sqrt((a / v)) / (sqrt(l) / c0)
    else if ((v * l) <= (-1d-307)) then
        tmp = (c0 * sqrt((0.0d0 - a))) / sqrt((0.0d0 - (v * l)))
    else if ((v * l) <= 1d-305) then
        tmp = c0 / (sqrt((0.0d0 - v)) * sqrt((0.0d0 - (l / a))))
    else if ((v * l) <= 2d+280) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 * (sqrt((0.0d0 - (a / l))) / ((0.0d0 - v) ** 0.5d0))
    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+253) {
		tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
	} else if ((V * l) <= -1e-307) {
		tmp = (c0 * Math.sqrt((0.0 - A))) / Math.sqrt((0.0 - (V * l)));
	} else if ((V * l) <= 1e-305) {
		tmp = c0 / (Math.sqrt((0.0 - V)) * Math.sqrt((0.0 - (l / A))));
	} else if ((V * l) <= 2e+280) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * (Math.sqrt((0.0 - (A / l))) / Math.pow((0.0 - V), 0.5));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -1e+253:
		tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0)
	elif (V * l) <= -1e-307:
		tmp = (c0 * math.sqrt((0.0 - A))) / math.sqrt((0.0 - (V * l)))
	elif (V * l) <= 1e-305:
		tmp = c0 / (math.sqrt((0.0 - V)) * math.sqrt((0.0 - (l / A))))
	elif (V * l) <= 2e+280:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 * (math.sqrt((0.0 - (A / l))) / math.pow((0.0 - V), 0.5))
	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+253)
		tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0));
	elseif (Float64(V * l) <= -1e-307)
		tmp = Float64(Float64(c0 * sqrt(Float64(0.0 - A))) / sqrt(Float64(0.0 - Float64(V * l))));
	elseif (Float64(V * l) <= 1e-305)
		tmp = Float64(c0 / Float64(sqrt(Float64(0.0 - V)) * sqrt(Float64(0.0 - Float64(l / A)))));
	elseif (Float64(V * l) <= 2e+280)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - Float64(A / l))) / (Float64(0.0 - V) ^ 0.5)));
	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+253)
		tmp = sqrt((A / V)) / (sqrt(l) / c0);
	elseif ((V * l) <= -1e-307)
		tmp = (c0 * sqrt((0.0 - A))) / sqrt((0.0 - (V * l)));
	elseif ((V * l) <= 1e-305)
		tmp = c0 / (sqrt((0.0 - V)) * sqrt((0.0 - (l / A))));
	elseif ((V * l) <= 2e+280)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 * (sqrt((0.0 - (A / l))) / ((0.0 - V) ^ 0.5));
	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+253], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-307], N[(N[(c0 * N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-305], N[(c0 / N[(N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+280], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Power[N[(0.0 - V), $MachinePrecision], 0.5], $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^{+253}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - \frac{A}{\ell}}}{{\left(0 - V\right)}^{0.5}}\\


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

    1. Initial program 36.5%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6436.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr36.5%

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(\frac{A}{V}\right)}}} \]
      2. sub0-negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{0 - \ell}{\mathsf{neg}\left(\frac{A}{V}\right)}}} \]
      3. sub0-negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{0 - \ell}{0 - \frac{A}{V}}}} \]
      4. sqrt-divN/A

        \[\leadsto \frac{c0}{\frac{\sqrt{0 - \ell}}{\color{blue}{\sqrt{0 - \frac{A}{V}}}}} \]
      5. unpow1/2N/A

        \[\leadsto \frac{c0}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{\sqrt{\color{blue}{0 - \frac{A}{V}}}}} \]
      6. unpow1/2N/A

        \[\leadsto \frac{c0}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{{\left(0 - \frac{A}{V}\right)}^{\color{blue}{\frac{1}{2}}}}} \]
      7. associate-/r/N/A

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

        \[\leadsto {\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}} \cdot \color{blue}{\frac{c0}{{\left(0 - \ell\right)}^{\frac{1}{2}}}} \]
      9. clear-numN/A

        \[\leadsto {\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{1}{\color{blue}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{c0}}} \]
      10. un-div-invN/A

        \[\leadsto \frac{{\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{c0}}} \]
      11. sqr-powN/A

        \[\leadsto \frac{{\left(0 - \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(0 - \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      12. pow-prod-downN/A

        \[\leadsto \frac{{\left(\left(0 - \frac{A}{V}\right) \cdot \left(0 - \frac{A}{V}\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      13. sub0-negN/A

        \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right) \cdot \left(0 - \frac{A}{V}\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\left(\color{blue}{0} - \ell\right)}^{\frac{1}{2}}}{c0}} \]
      14. sub0-negN/A

        \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{A}{V}\right)\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\left(0 - \color{blue}{\ell}\right)}^{\frac{1}{2}}}{c0}} \]
      15. sqr-negN/A

        \[\leadsto \frac{{\left(\frac{A}{V} \cdot \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\color{blue}{\left(0 - \ell\right)}}^{\frac{1}{2}}}{c0}} \]
      16. pow-prod-downN/A

        \[\leadsto \frac{{\left(\frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(\frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      17. sqr-powN/A

        \[\leadsto \frac{{\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      18. pow1/2N/A

        \[\leadsto \frac{\sqrt{\frac{A}{V}}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
    8. Applied egg-rr47.7%

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

    if -9.9999999999999994e252 < (*.f64 V l) < -9.99999999999999909e-308

    1. Initial program 81.7%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V \cdot \ell\right)}} \]
      2. sqrt-divN/A

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

        \[\leadsto \frac{c0 \cdot \sqrt{\mathsf{neg}\left(A\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \sqrt{\mathsf{neg}\left(A\right)}\right), \color{blue}{\left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(V \cdot \ell\right)}}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      7. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(0 - A\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      12. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(0 - \ell\right)\right)\right)\right) \]
      13. --lowering--.f6498.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr98.2%

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{0 - A}}{\sqrt{V \cdot \left(0 - \ell\right)}}} \]
    5. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\left(\mathsf{neg}\left(\ell\right)\right) \cdot V\right)\right)\right) \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\ell \cdot V\right)\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\left(\ell \cdot V\right)\right)\right)\right) \]
      5. *-lowering-*.f6498.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\ell, V\right)\right)\right)\right) \]
    6. Applied egg-rr98.2%

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

    if -9.99999999999999909e-308 < (*.f64 V l) < 9.99999999999999996e-306

    1. Initial program 41.0%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6441.0%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr41.0%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\ell}{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V\right)}}}\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\ell}{\mathsf{neg}\left(A\right)} \cdot \left(\mathsf{neg}\left(V\right)\right)}\right)\right) \]
      3. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\ell}{\mathsf{neg}\left(A\right)}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(V\right)}}\right)\right) \]
      4. distribute-frac-neg2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(\frac{\ell}{A}\right)} \cdot \sqrt{\mathsf{neg}\left(\color{blue}{V}\right)}\right)\right) \]
      5. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(\frac{\ell}{A}\right)} \cdot {\left(\mathsf{neg}\left(V\right)\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left(\sqrt{\mathsf{neg}\left(\frac{\ell}{A}\right)}\right), \color{blue}{\left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)}\right)\right) \]
      7. distribute-frac-neg2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left(\sqrt{\frac{\ell}{\mathsf{neg}\left(A\right)}}\right), \left({\left(\mathsf{neg}\left(\color{blue}{V}\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      8. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\ell}{\mathsf{neg}\left(A\right)}\right)\right), \left({\color{blue}{\left(\mathsf{neg}\left(V\right)\right)}}^{\frac{1}{2}}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)}\right)\right), \left({\left(\mathsf{neg}\left(\color{blue}{V}\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      10. sub0-negN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{0 - \ell}{\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)}\right)\right), \left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      11. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{0 - \ell}{A}\right)\right), \left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(0 - \ell\right), A\right)\right), \left({\left(\mathsf{neg}\left(\color{blue}{V}\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      13. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), A\right)\right), \left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      14. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), A\right)\right), \left(\sqrt{\mathsf{neg}\left(V\right)}\right)\right)\right) \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), A\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V\right)\right)\right)\right)\right) \]
      16. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), A\right)\right), \mathsf{sqrt.f64}\left(\left(0 - V\right)\right)\right)\right) \]
      17. --lowering--.f6448.6%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, V\right)\right)\right)\right) \]
    8. Applied egg-rr48.6%

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

    if 9.99999999999999996e-306 < (*.f64 V l) < 2.0000000000000001e280

    1. Initial program 91.6%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr99.7%

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

    if 2.0000000000000001e280 < (*.f64 V l)

    1. Initial program 34.3%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\frac{A}{\ell}}{V}}\right)\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\mathsf{neg}\left(\frac{A}{\ell}\right)}{\mathsf{neg}\left(V\right)}}\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\mathsf{neg}\left(\frac{A}{\ell}\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(V\right)}}}\right)\right) \]
      4. distribute-frac-neg2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}}{\sqrt{\mathsf{neg}\left(\color{blue}{V}\right)}}\right)\right) \]
      5. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}}{{\left(\mathsf{neg}\left(V\right)\right)}^{\color{blue}{\frac{1}{2}}}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}\right), \color{blue}{\left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{A}{\mathsf{neg}\left(\ell\right)}\right)\right), \left({\color{blue}{\left(\mathsf{neg}\left(V\right)\right)}}^{\frac{1}{2}}\right)\right)\right) \]
      8. remove-double-negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)}{\mathsf{neg}\left(\ell\right)}\right)\right), \left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(A\right)}{\ell}\right)\right), \left({\left(\mathsf{neg}\left(\color{blue}{V}\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(A\right)\right), \ell\right)\right), \left({\left(\mathsf{neg}\left(\color{blue}{V}\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(0 - A\right), \ell\right)\right), \left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, A\right), \ell\right)\right), \left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, A\right), \ell\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(V\right)\right), \color{blue}{\frac{1}{2}}\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, A\right), \ell\right)\right), \mathsf{pow.f64}\left(\left(0 - V\right), \frac{1}{2}\right)\right)\right) \]
      15. --lowering--.f6456.4%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, A\right), \ell\right)\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, V\right), \frac{1}{2}\right)\right)\right) \]
    4. Applied egg-rr56.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{0 - A}{\ell}}}{{\left(0 - V\right)}^{0.5}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification86.0%

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

Alternative 2: 89.7% accurate, 0.3× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;A \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\left({\left(0 - A\right)}^{0.5} \cdot \sqrt{\frac{-1}{V}}\right) \cdot \left({\ell}^{-0.5} \cdot c0\right)\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \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 (<= A -1e-310)
   (* (* (pow (- 0.0 A) 0.5) (sqrt (/ -1.0 V))) (* (pow l -0.5) c0))
   (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if (A <= -1e-310) {
		tmp = (pow((0.0 - A), 0.5) * sqrt((-1.0 / V))) * (pow(l, -0.5) * c0);
	} else {
		tmp = c0 * (sqrt(A) / sqrt((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 (a <= (-1d-310)) then
        tmp = (((0.0d0 - a) ** 0.5d0) * sqrt(((-1.0d0) / v))) * ((l ** (-0.5d0)) * c0)
    else
        tmp = c0 * (sqrt(a) / sqrt((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 (A <= -1e-310) {
		tmp = (Math.pow((0.0 - A), 0.5) * Math.sqrt((-1.0 / V))) * (Math.pow(l, -0.5) * c0);
	} else {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if A <= -1e-310:
		tmp = (math.pow((0.0 - A), 0.5) * math.sqrt((-1.0 / V))) * (math.pow(l, -0.5) * c0)
	else:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (A <= -1e-310)
		tmp = Float64(Float64((Float64(0.0 - A) ^ 0.5) * sqrt(Float64(-1.0 / V))) * Float64((l ^ -0.5) * c0));
	else
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 (A <= -1e-310)
		tmp = (((0.0 - A) ^ 0.5) * sqrt((-1.0 / V))) * ((l ^ -0.5) * c0);
	else
		tmp = c0 * (sqrt(A) / sqrt((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[A, -1e-310], N[(N[(N[Power[N[(0.0 - A), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Power[l, -0.5], $MachinePrecision] * c0), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left({\left(0 - A\right)}^{0.5} \cdot \sqrt{\frac{-1}{V}}\right) \cdot \left({\ell}^{-0.5} \cdot c0\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -9.999999999999969e-311

    1. Initial program 70.8%

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

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

        \[\leadsto \sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0 \]
      3. div-invN/A

        \[\leadsto \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}} \cdot c0 \]
      4. sqrt-prodN/A

        \[\leadsto \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right) \cdot c0 \]
      5. pow1/2N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{A}{V}}\right), \color{blue}{\left({\left(\frac{1}{\ell}\right)}^{\frac{1}{2}} \cdot c0\right)}\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{A}{V}\right)}^{\frac{1}{2}}\right), \left(\color{blue}{{\left(\frac{1}{\ell}\right)}^{\frac{1}{2}}} \cdot c0\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{1}{\frac{V}{A}}\right)}^{\frac{1}{2}}\right), \left({\color{blue}{\left(\frac{1}{\ell}\right)}}^{\frac{1}{2}} \cdot c0\right)\right) \]
      10. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(\frac{V}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right), \left({\color{blue}{\left(\frac{1}{\ell}\right)}}^{\frac{1}{2}} \cdot c0\right)\right) \]
      11. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{V}{A}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), \left(\color{blue}{{\left(\frac{1}{\ell}\right)}^{\frac{1}{2}}} \cdot c0\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{V}{A}\right), \left(-1 \cdot \frac{1}{2}\right)\right), \left(\color{blue}{{\left(\frac{1}{\ell}\right)}^{\frac{1}{2}}} \cdot c0\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \left(-1 \cdot \frac{1}{2}\right)\right), \left({\color{blue}{\left(\frac{1}{\ell}\right)}}^{\frac{1}{2}} \cdot c0\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \left({\left(\frac{1}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \cdot c0\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(\left({\left(\frac{1}{\ell}\right)}^{\frac{1}{2}}\right), \color{blue}{c0}\right)\right) \]
      16. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(\left({\left({\ell}^{-1}\right)}^{\frac{1}{2}}\right), c0\right)\right) \]
      17. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(\left({\ell}^{\left(-1 \cdot \frac{1}{2}\right)}\right), c0\right)\right) \]
      18. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \left(-1 \cdot \frac{1}{2}\right)\right), c0\right)\right) \]
      19. metadata-eval43.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right), c0\right)\right) \]
    4. Applied egg-rr43.4%

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

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{V}{A}\right)}^{\left(\frac{-1}{2}\right)}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \color{blue}{\frac{-1}{2}}\right), c0\right)\right) \]
      2. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\frac{V}{A}\right)}^{-1}}\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right)}, c0\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\frac{V}{A}}}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\ell}, \frac{-1}{2}\right), c0\right)\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{A}{V}}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\ell}, \frac{-1}{2}\right), c0\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V\right)}}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\ell}, \frac{-1}{2}\right), c0\right)\right) \]
      6. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\mathsf{neg}\left(A\right)\right) \cdot \frac{1}{\mathsf{neg}\left(V\right)}}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\ell}, \frac{-1}{2}\right), c0\right)\right) \]
      7. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(V\right)}}\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right)}, c0\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\mathsf{neg}\left(A\right)\right)}^{\frac{1}{2}} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(V\right)}}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\ell}, \frac{-1}{2}\right), c0\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\mathsf{neg}\left(A\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{\frac{1}{\mathsf{neg}\left(V\right)}}\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right)}, c0\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(A\right)\right), \frac{1}{2}\right), \left(\sqrt{\frac{1}{\mathsf{neg}\left(V\right)}}\right)\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\ell}, \frac{-1}{2}\right), c0\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(0 - A\right), \frac{1}{2}\right), \left(\sqrt{\frac{1}{\mathsf{neg}\left(V\right)}}\right)\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right), c0\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, A\right), \frac{1}{2}\right), \left(\sqrt{\frac{1}{\mathsf{neg}\left(V\right)}}\right)\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right), c0\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, A\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\left(\frac{1}{\mathsf{neg}\left(V\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \color{blue}{\frac{-1}{2}}\right), c0\right)\right) \]
      14. distribute-frac-neg2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, A\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\frac{1}{V}\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right), c0\right)\right) \]
      15. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, A\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{V}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right), c0\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, A\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\left(\frac{-1}{V}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right), c0\right)\right) \]
      17. /-lowering-/.f6451.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, A\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right)\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right), c0\right)\right) \]
    6. Applied egg-rr51.2%

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

    if -9.999999999999969e-311 < A

    1. Initial program 76.7%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f6483.6%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr83.6%

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

Alternative 3: 89.7% accurate, 0.3× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;A \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\frac{c0}{\sqrt{0 - V} \cdot \sqrt{\ell}} \cdot \sqrt{0 - A}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \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 (<= A -1e-310)
   (* (/ c0 (* (sqrt (- 0.0 V)) (sqrt l))) (sqrt (- 0.0 A)))
   (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if (A <= -1e-310) {
		tmp = (c0 / (sqrt((0.0 - V)) * sqrt(l))) * sqrt((0.0 - A));
	} else {
		tmp = c0 * (sqrt(A) / sqrt((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 (a <= (-1d-310)) then
        tmp = (c0 / (sqrt((0.0d0 - v)) * sqrt(l))) * sqrt((0.0d0 - a))
    else
        tmp = c0 * (sqrt(a) / sqrt((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 (A <= -1e-310) {
		tmp = (c0 / (Math.sqrt((0.0 - V)) * Math.sqrt(l))) * Math.sqrt((0.0 - A));
	} else {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if A <= -1e-310:
		tmp = (c0 / (math.sqrt((0.0 - V)) * math.sqrt(l))) * math.sqrt((0.0 - A))
	else:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (A <= -1e-310)
		tmp = Float64(Float64(c0 / Float64(sqrt(Float64(0.0 - V)) * sqrt(l))) * sqrt(Float64(0.0 - A)));
	else
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 (A <= -1e-310)
		tmp = (c0 / (sqrt((0.0 - V)) * sqrt(l))) * sqrt((0.0 - A));
	else
		tmp = c0 * (sqrt(A) / sqrt((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[A, -1e-310], N[(N[(c0 / N[(N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{0 - V} \cdot \sqrt{\ell}} \cdot \sqrt{0 - A}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -9.999999999999969e-311

    1. Initial program 70.8%

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

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(A\right)}} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}\right), \color{blue}{\left(\sqrt{\mathsf{neg}\left(A\right)}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(A\right)}}\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(0 - \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      14. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) \]
      16. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(0 - A\right)\right)\right) \]
      17. --lowering--.f6480.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
    4. Applied egg-rr80.2%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \left(0 - \ell\right)}} \cdot \sqrt{0 - A}} \]
    5. Step-by-step derivation
      1. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{1} \cdot \left(0 - \ell\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      2. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{1} \cdot \left(\mathsf{neg}\left(\ell\right)\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{\frac{1}{\mathsf{neg}\left(\ell\right)}}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\ell\right)}}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{\frac{-1}{\ell}}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      6. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{-1} \cdot \ell}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      7. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{-1}} \cdot \sqrt{\ell}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, \color{blue}{A}\right)\right)\right) \]
      8. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{\frac{-1}{V}}} \cdot \sqrt{\ell}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{\frac{\mathsf{neg}\left(1\right)}{V}}} \cdot \sqrt{\ell}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      10. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{\mathsf{neg}\left(\frac{1}{V}\right)}} \cdot \sqrt{\ell}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      11. distribute-frac-neg2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(\frac{1}{\frac{1}{V}}\right)} \cdot \sqrt{\ell}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      12. remove-double-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(V\right)} \cdot \sqrt{\ell}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      13. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{\ell}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, \color{blue}{A}\right)\right)\right) \]
      15. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left(\sqrt{\mathsf{neg}\left(V\right)}\right), \left(\sqrt{\ell}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      16. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V\right)\right)\right), \left(\sqrt{\ell}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(0 - V\right)\right), \left(\sqrt{\ell}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, V\right)\right), \left(\sqrt{\ell}\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      19. sqrt-lowering-sqrt.f6449.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, V\right)\right), \mathsf{sqrt.f64}\left(\ell\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
    6. Applied egg-rr49.3%

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

    if -9.999999999999969e-311 < A

    1. Initial program 76.7%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f6483.6%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr83.6%

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

Alternative 4: 86.6% accurate, 0.3× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{-1}{V}} \cdot \sqrt{\frac{-1}{\ell}}\right) \cdot \left(c0 \cdot \sqrt{A}\right)\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\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 (<= l -2e-310)
   (* (* (sqrt (/ -1.0 V)) (sqrt (/ -1.0 l))) (* c0 (sqrt A)))
   (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -2e-310) {
		tmp = (sqrt((-1.0 / V)) * sqrt((-1.0 / l))) * (c0 * sqrt(A));
	} else {
		tmp = c0 * (sqrt((A / V)) / sqrt(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 (l <= (-2d-310)) then
        tmp = (sqrt(((-1.0d0) / v)) * sqrt(((-1.0d0) / l))) * (c0 * sqrt(a))
    else
        tmp = c0 * (sqrt((a / v)) / sqrt(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 (l <= -2e-310) {
		tmp = (Math.sqrt((-1.0 / V)) * Math.sqrt((-1.0 / l))) * (c0 * Math.sqrt(A));
	} else {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if l <= -2e-310:
		tmp = (math.sqrt((-1.0 / V)) * math.sqrt((-1.0 / l))) * (c0 * math.sqrt(A))
	else:
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (l <= -2e-310)
		tmp = Float64(Float64(sqrt(Float64(-1.0 / V)) * sqrt(Float64(-1.0 / l))) * Float64(c0 * sqrt(A)));
	else
		tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 (l <= -2e-310)
		tmp = (sqrt((-1.0 / V)) * sqrt((-1.0 / l))) * (c0 * sqrt(A));
	else
		tmp = c0 * (sqrt((A / V)) / sqrt(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[l, -2e-310], N[(N[(N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{-1}{V}} \cdot \sqrt{\frac{-1}{\ell}}\right) \cdot \left(c0 \cdot \sqrt{A}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.999999999999994e-310

    1. Initial program 70.7%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6470.7%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr70.7%

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

      \[\leadsto \color{blue}{{\left(\ell \cdot V\right)}^{-0.5} \cdot \left(c0 \cdot \sqrt{A}\right)} \]
    6. Applied egg-rr51.5%

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

    if -1.999999999999994e-310 < l

    1. Initial program 76.8%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6476.8%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr76.8%

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

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

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

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

Alternative 5: 87.8% accurate, 0.4× 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^{+253}:\\ \;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-307}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{0 - A}}{\sqrt{0 - V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-305}:\\ \;\;\;\;\frac{c0}{\sqrt{0 - V} \cdot \sqrt{0 - \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+280}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{-1}{V}} \cdot \sqrt{0 - \frac{A}{\ell}}\right)\\ \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+253)
   (/ (sqrt (/ A V)) (/ (sqrt l) c0))
   (if (<= (* V l) -1e-307)
     (/ (* c0 (sqrt (- 0.0 A))) (sqrt (- 0.0 (* V l))))
     (if (<= (* V l) 1e-305)
       (/ c0 (* (sqrt (- 0.0 V)) (sqrt (- 0.0 (/ l A)))))
       (if (<= (* V l) 2e+280)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* c0 (* (sqrt (/ -1.0 V)) (sqrt (- 0.0 (/ A l))))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+253) {
		tmp = sqrt((A / V)) / (sqrt(l) / c0);
	} else if ((V * l) <= -1e-307) {
		tmp = (c0 * sqrt((0.0 - A))) / sqrt((0.0 - (V * l)));
	} else if ((V * l) <= 1e-305) {
		tmp = c0 / (sqrt((0.0 - V)) * sqrt((0.0 - (l / A))));
	} else if ((V * l) <= 2e+280) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * (sqrt((-1.0 / V)) * sqrt((0.0 - (A / 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+253)) then
        tmp = sqrt((a / v)) / (sqrt(l) / c0)
    else if ((v * l) <= (-1d-307)) then
        tmp = (c0 * sqrt((0.0d0 - a))) / sqrt((0.0d0 - (v * l)))
    else if ((v * l) <= 1d-305) then
        tmp = c0 / (sqrt((0.0d0 - v)) * sqrt((0.0d0 - (l / a))))
    else if ((v * l) <= 2d+280) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 * (sqrt(((-1.0d0) / v)) * sqrt((0.0d0 - (a / 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+253) {
		tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
	} else if ((V * l) <= -1e-307) {
		tmp = (c0 * Math.sqrt((0.0 - A))) / Math.sqrt((0.0 - (V * l)));
	} else if ((V * l) <= 1e-305) {
		tmp = c0 / (Math.sqrt((0.0 - V)) * Math.sqrt((0.0 - (l / A))));
	} else if ((V * l) <= 2e+280) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * (Math.sqrt((-1.0 / V)) * Math.sqrt((0.0 - (A / l))));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -1e+253:
		tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0)
	elif (V * l) <= -1e-307:
		tmp = (c0 * math.sqrt((0.0 - A))) / math.sqrt((0.0 - (V * l)))
	elif (V * l) <= 1e-305:
		tmp = c0 / (math.sqrt((0.0 - V)) * math.sqrt((0.0 - (l / A))))
	elif (V * l) <= 2e+280:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 * (math.sqrt((-1.0 / V)) * math.sqrt((0.0 - (A / 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+253)
		tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0));
	elseif (Float64(V * l) <= -1e-307)
		tmp = Float64(Float64(c0 * sqrt(Float64(0.0 - A))) / sqrt(Float64(0.0 - Float64(V * l))));
	elseif (Float64(V * l) <= 1e-305)
		tmp = Float64(c0 / Float64(sqrt(Float64(0.0 - V)) * sqrt(Float64(0.0 - Float64(l / A)))));
	elseif (Float64(V * l) <= 2e+280)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * Float64(sqrt(Float64(-1.0 / V)) * sqrt(Float64(0.0 - Float64(A / 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+253)
		tmp = sqrt((A / V)) / (sqrt(l) / c0);
	elseif ((V * l) <= -1e-307)
		tmp = (c0 * sqrt((0.0 - A))) / sqrt((0.0 - (V * l)));
	elseif ((V * l) <= 1e-305)
		tmp = c0 / (sqrt((0.0 - V)) * sqrt((0.0 - (l / A))));
	elseif ((V * l) <= 2e+280)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 * (sqrt((-1.0 / V)) * sqrt((0.0 - (A / 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+253], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-307], N[(N[(c0 * N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-305], N[(c0 / N[(N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+280], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $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^{+253}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{-1}{V}} \cdot \sqrt{0 - \frac{A}{\ell}}\right)\\


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

    1. Initial program 36.5%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6436.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr36.5%

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(\frac{A}{V}\right)}}} \]
      2. sub0-negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{0 - \ell}{\mathsf{neg}\left(\frac{A}{V}\right)}}} \]
      3. sub0-negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{0 - \ell}{0 - \frac{A}{V}}}} \]
      4. sqrt-divN/A

        \[\leadsto \frac{c0}{\frac{\sqrt{0 - \ell}}{\color{blue}{\sqrt{0 - \frac{A}{V}}}}} \]
      5. unpow1/2N/A

        \[\leadsto \frac{c0}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{\sqrt{\color{blue}{0 - \frac{A}{V}}}}} \]
      6. unpow1/2N/A

        \[\leadsto \frac{c0}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{{\left(0 - \frac{A}{V}\right)}^{\color{blue}{\frac{1}{2}}}}} \]
      7. associate-/r/N/A

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

        \[\leadsto {\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}} \cdot \color{blue}{\frac{c0}{{\left(0 - \ell\right)}^{\frac{1}{2}}}} \]
      9. clear-numN/A

        \[\leadsto {\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{1}{\color{blue}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{c0}}} \]
      10. un-div-invN/A

        \[\leadsto \frac{{\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{c0}}} \]
      11. sqr-powN/A

        \[\leadsto \frac{{\left(0 - \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(0 - \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      12. pow-prod-downN/A

        \[\leadsto \frac{{\left(\left(0 - \frac{A}{V}\right) \cdot \left(0 - \frac{A}{V}\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      13. sub0-negN/A

        \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right) \cdot \left(0 - \frac{A}{V}\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\left(\color{blue}{0} - \ell\right)}^{\frac{1}{2}}}{c0}} \]
      14. sub0-negN/A

        \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{A}{V}\right)\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\left(0 - \color{blue}{\ell}\right)}^{\frac{1}{2}}}{c0}} \]
      15. sqr-negN/A

        \[\leadsto \frac{{\left(\frac{A}{V} \cdot \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\color{blue}{\left(0 - \ell\right)}}^{\frac{1}{2}}}{c0}} \]
      16. pow-prod-downN/A

        \[\leadsto \frac{{\left(\frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(\frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      17. sqr-powN/A

        \[\leadsto \frac{{\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      18. pow1/2N/A

        \[\leadsto \frac{\sqrt{\frac{A}{V}}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
    8. Applied egg-rr47.7%

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

    if -9.9999999999999994e252 < (*.f64 V l) < -9.99999999999999909e-308

    1. Initial program 81.7%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V \cdot \ell\right)}} \]
      2. sqrt-divN/A

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

        \[\leadsto \frac{c0 \cdot \sqrt{\mathsf{neg}\left(A\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \sqrt{\mathsf{neg}\left(A\right)}\right), \color{blue}{\left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(V \cdot \ell\right)}}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      7. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(0 - A\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      12. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(0 - \ell\right)\right)\right)\right) \]
      13. --lowering--.f6498.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr98.2%

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{0 - A}}{\sqrt{V \cdot \left(0 - \ell\right)}}} \]
    5. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\left(\mathsf{neg}\left(\ell\right)\right) \cdot V\right)\right)\right) \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\ell \cdot V\right)\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\left(\ell \cdot V\right)\right)\right)\right) \]
      5. *-lowering-*.f6498.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\ell, V\right)\right)\right)\right) \]
    6. Applied egg-rr98.2%

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

    if -9.99999999999999909e-308 < (*.f64 V l) < 9.99999999999999996e-306

    1. Initial program 41.0%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6441.0%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr41.0%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\ell}{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V\right)}}}\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\ell}{\mathsf{neg}\left(A\right)} \cdot \left(\mathsf{neg}\left(V\right)\right)}\right)\right) \]
      3. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\ell}{\mathsf{neg}\left(A\right)}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(V\right)}}\right)\right) \]
      4. distribute-frac-neg2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(\frac{\ell}{A}\right)} \cdot \sqrt{\mathsf{neg}\left(\color{blue}{V}\right)}\right)\right) \]
      5. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(\frac{\ell}{A}\right)} \cdot {\left(\mathsf{neg}\left(V\right)\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left(\sqrt{\mathsf{neg}\left(\frac{\ell}{A}\right)}\right), \color{blue}{\left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)}\right)\right) \]
      7. distribute-frac-neg2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left(\sqrt{\frac{\ell}{\mathsf{neg}\left(A\right)}}\right), \left({\left(\mathsf{neg}\left(\color{blue}{V}\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      8. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\ell}{\mathsf{neg}\left(A\right)}\right)\right), \left({\color{blue}{\left(\mathsf{neg}\left(V\right)\right)}}^{\frac{1}{2}}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)}\right)\right), \left({\left(\mathsf{neg}\left(\color{blue}{V}\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      10. sub0-negN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{0 - \ell}{\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)}\right)\right), \left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      11. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{0 - \ell}{A}\right)\right), \left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(0 - \ell\right), A\right)\right), \left({\left(\mathsf{neg}\left(\color{blue}{V}\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      13. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), A\right)\right), \left({\left(\mathsf{neg}\left(V\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      14. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), A\right)\right), \left(\sqrt{\mathsf{neg}\left(V\right)}\right)\right)\right) \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), A\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V\right)\right)\right)\right)\right) \]
      16. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), A\right)\right), \mathsf{sqrt.f64}\left(\left(0 - V\right)\right)\right)\right) \]
      17. --lowering--.f6448.6%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, V\right)\right)\right)\right) \]
    8. Applied egg-rr48.6%

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

    if 9.99999999999999996e-306 < (*.f64 V l) < 2.0000000000000001e280

    1. Initial program 91.6%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr99.7%

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

    if 2.0000000000000001e280 < (*.f64 V l)

    1. Initial program 34.3%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V \cdot \ell\right)}}\right)\right) \]
      2. neg-mul-1N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{-1 \cdot A}{\mathsf{neg}\left(V \cdot \ell\right)}}\right)\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{-1 \cdot A}{V \cdot \left(\mathsf{neg}\left(\ell\right)\right)}}\right)\right) \]
      4. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{-1}{V} \cdot \frac{A}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{-1}{V}} \cdot \color{blue}{\sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}}\right)\right) \]
      6. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(V\right)}} \cdot \sqrt{\frac{\color{blue}{A}}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{1}{\mathsf{neg}\left(V\right)}} \cdot \sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\mathsf{neg}\left(V\right)}}\right), \color{blue}{\left(\sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}\right)}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{\mathsf{neg}\left(V\right)}\right)\right), \left(\sqrt{\color{blue}{\frac{A}{\mathsf{neg}\left(\ell\right)}}}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(V\right)}\right)\right), \left(\sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}\right)\right)\right) \]
      11. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{-1}{V}\right)\right), \left(\sqrt{\frac{\color{blue}{A}}{\mathsf{neg}\left(\ell\right)}}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \left(\sqrt{\frac{\color{blue}{A}}{\mathsf{neg}\left(\ell\right)}}\right)\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{A}{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right) \]
      14. remove-double-negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)}{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right) \]
      15. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(A\right)}{\ell}\right)\right)\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(A\right)\right), \ell\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(0 - A\right), \ell\right)\right)\right)\right) \]
      18. --lowering--.f6456.1%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, A\right), \ell\right)\right)\right)\right) \]
    4. Applied egg-rr56.1%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{-1}{V}} \cdot \sqrt{\frac{0 - A}{\ell}}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification86.0%

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

Alternative 6: 87.6% accurate, 0.4× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := c0 \cdot \left(\sqrt{\frac{-1}{V}} \cdot \sqrt{0 - \frac{A}{\ell}}\right)\\ \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+253}:\\ \;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-296}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{0 - A}}{\sqrt{0 - V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-305}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+280}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \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 (/ -1.0 V)) (sqrt (- 0.0 (/ A l)))))))
   (if (<= (* V l) -1e+253)
     (/ (sqrt (/ A V)) (/ (sqrt l) c0))
     (if (<= (* V l) -2e-296)
       (/ (* c0 (sqrt (- 0.0 A))) (sqrt (- 0.0 (* V l))))
       (if (<= (* V l) 1e-305)
         t_0
         (if (<= (* V l) 2e+280) (* c0 (/ (sqrt A) (sqrt (* 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((-1.0 / V)) * sqrt((0.0 - (A / l))));
	double tmp;
	if ((V * l) <= -1e+253) {
		tmp = sqrt((A / V)) / (sqrt(l) / c0);
	} else if ((V * l) <= -2e-296) {
		tmp = (c0 * sqrt((0.0 - A))) / sqrt((0.0 - (V * l)));
	} else if ((V * l) <= 1e-305) {
		tmp = t_0;
	} else if ((V * l) <= 2e+280) {
		tmp = c0 * (sqrt(A) / sqrt((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(((-1.0d0) / v)) * sqrt((0.0d0 - (a / l))))
    if ((v * l) <= (-1d+253)) then
        tmp = sqrt((a / v)) / (sqrt(l) / c0)
    else if ((v * l) <= (-2d-296)) then
        tmp = (c0 * sqrt((0.0d0 - a))) / sqrt((0.0d0 - (v * l)))
    else if ((v * l) <= 1d-305) then
        tmp = t_0
    else if ((v * l) <= 2d+280) then
        tmp = c0 * (sqrt(a) / sqrt((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((-1.0 / V)) * Math.sqrt((0.0 - (A / l))));
	double tmp;
	if ((V * l) <= -1e+253) {
		tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
	} else if ((V * l) <= -2e-296) {
		tmp = (c0 * Math.sqrt((0.0 - A))) / Math.sqrt((0.0 - (V * l)));
	} else if ((V * l) <= 1e-305) {
		tmp = t_0;
	} else if ((V * l) <= 2e+280) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((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((-1.0 / V)) * math.sqrt((0.0 - (A / l))))
	tmp = 0
	if (V * l) <= -1e+253:
		tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0)
	elif (V * l) <= -2e-296:
		tmp = (c0 * math.sqrt((0.0 - A))) / math.sqrt((0.0 - (V * l)))
	elif (V * l) <= 1e-305:
		tmp = t_0
	elif (V * l) <= 2e+280:
		tmp = c0 * (math.sqrt(A) / math.sqrt((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 * Float64(sqrt(Float64(-1.0 / V)) * sqrt(Float64(0.0 - Float64(A / l)))))
	tmp = 0.0
	if (Float64(V * l) <= -1e+253)
		tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0));
	elseif (Float64(V * l) <= -2e-296)
		tmp = Float64(Float64(c0 * sqrt(Float64(0.0 - A))) / sqrt(Float64(0.0 - Float64(V * l))));
	elseif (Float64(V * l) <= 1e-305)
		tmp = t_0;
	elseif (Float64(V * l) <= 2e+280)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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((-1.0 / V)) * sqrt((0.0 - (A / l))));
	tmp = 0.0;
	if ((V * l) <= -1e+253)
		tmp = sqrt((A / V)) / (sqrt(l) / c0);
	elseif ((V * l) <= -2e-296)
		tmp = (c0 * sqrt((0.0 - A))) / sqrt((0.0 - (V * l)));
	elseif ((V * l) <= 1e-305)
		tmp = t_0;
	elseif ((V * l) <= 2e+280)
		tmp = c0 * (sqrt(A) / sqrt((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[(N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+253], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-296], N[(N[(c0 * N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-305], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 2e+280], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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 \left(\sqrt{\frac{-1}{V}} \cdot \sqrt{0 - \frac{A}{\ell}}\right)\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+253}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 10^{-305}:\\
\;\;\;\;t\_0\\

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

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


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

    1. Initial program 36.5%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6436.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr36.5%

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(\frac{A}{V}\right)}}} \]
      2. sub0-negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{0 - \ell}{\mathsf{neg}\left(\frac{A}{V}\right)}}} \]
      3. sub0-negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{0 - \ell}{0 - \frac{A}{V}}}} \]
      4. sqrt-divN/A

        \[\leadsto \frac{c0}{\frac{\sqrt{0 - \ell}}{\color{blue}{\sqrt{0 - \frac{A}{V}}}}} \]
      5. unpow1/2N/A

        \[\leadsto \frac{c0}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{\sqrt{\color{blue}{0 - \frac{A}{V}}}}} \]
      6. unpow1/2N/A

        \[\leadsto \frac{c0}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{{\left(0 - \frac{A}{V}\right)}^{\color{blue}{\frac{1}{2}}}}} \]
      7. associate-/r/N/A

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

        \[\leadsto {\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}} \cdot \color{blue}{\frac{c0}{{\left(0 - \ell\right)}^{\frac{1}{2}}}} \]
      9. clear-numN/A

        \[\leadsto {\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{1}{\color{blue}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{c0}}} \]
      10. un-div-invN/A

        \[\leadsto \frac{{\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{c0}}} \]
      11. sqr-powN/A

        \[\leadsto \frac{{\left(0 - \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(0 - \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      12. pow-prod-downN/A

        \[\leadsto \frac{{\left(\left(0 - \frac{A}{V}\right) \cdot \left(0 - \frac{A}{V}\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      13. sub0-negN/A

        \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right) \cdot \left(0 - \frac{A}{V}\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\left(\color{blue}{0} - \ell\right)}^{\frac{1}{2}}}{c0}} \]
      14. sub0-negN/A

        \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{A}{V}\right)\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\left(0 - \color{blue}{\ell}\right)}^{\frac{1}{2}}}{c0}} \]
      15. sqr-negN/A

        \[\leadsto \frac{{\left(\frac{A}{V} \cdot \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\color{blue}{\left(0 - \ell\right)}}^{\frac{1}{2}}}{c0}} \]
      16. pow-prod-downN/A

        \[\leadsto \frac{{\left(\frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(\frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      17. sqr-powN/A

        \[\leadsto \frac{{\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      18. pow1/2N/A

        \[\leadsto \frac{\sqrt{\frac{A}{V}}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
    8. Applied egg-rr47.7%

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

    if -9.9999999999999994e252 < (*.f64 V l) < -2e-296

    1. Initial program 81.5%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V \cdot \ell\right)}} \]
      2. sqrt-divN/A

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

        \[\leadsto \frac{c0 \cdot \sqrt{\mathsf{neg}\left(A\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \sqrt{\mathsf{neg}\left(A\right)}\right), \color{blue}{\left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(V \cdot \ell\right)}}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      7. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(0 - A\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      12. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(0 - \ell\right)\right)\right)\right) \]
      13. --lowering--.f6498.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr98.2%

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{0 - A}}{\sqrt{V \cdot \left(0 - \ell\right)}}} \]
    5. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\left(\mathsf{neg}\left(\ell\right)\right) \cdot V\right)\right)\right) \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\ell \cdot V\right)\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\left(\ell \cdot V\right)\right)\right)\right) \]
      5. *-lowering-*.f6498.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\ell, V\right)\right)\right)\right) \]
    6. Applied egg-rr98.2%

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

    if -2e-296 < (*.f64 V l) < 9.99999999999999996e-306 or 2.0000000000000001e280 < (*.f64 V l)

    1. Initial program 40.0%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V \cdot \ell\right)}}\right)\right) \]
      2. neg-mul-1N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{-1 \cdot A}{\mathsf{neg}\left(V \cdot \ell\right)}}\right)\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{-1 \cdot A}{V \cdot \left(\mathsf{neg}\left(\ell\right)\right)}}\right)\right) \]
      4. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{-1}{V} \cdot \frac{A}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{-1}{V}} \cdot \color{blue}{\sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}}\right)\right) \]
      6. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(V\right)}} \cdot \sqrt{\frac{\color{blue}{A}}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{1}{\mathsf{neg}\left(V\right)}} \cdot \sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\mathsf{neg}\left(V\right)}}\right), \color{blue}{\left(\sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}\right)}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{\mathsf{neg}\left(V\right)}\right)\right), \left(\sqrt{\color{blue}{\frac{A}{\mathsf{neg}\left(\ell\right)}}}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(V\right)}\right)\right), \left(\sqrt{\frac{A}{\mathsf{neg}\left(\ell\right)}}\right)\right)\right) \]
      11. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{-1}{V}\right)\right), \left(\sqrt{\frac{\color{blue}{A}}{\mathsf{neg}\left(\ell\right)}}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \left(\sqrt{\frac{\color{blue}{A}}{\mathsf{neg}\left(\ell\right)}}\right)\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{A}{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right) \]
      14. remove-double-negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)}{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right) \]
      15. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(A\right)}{\ell}\right)\right)\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(A\right)\right), \ell\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(0 - A\right), \ell\right)\right)\right)\right) \]
      18. --lowering--.f6450.0%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, V\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, A\right), \ell\right)\right)\right)\right) \]
    4. Applied egg-rr50.0%

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

    if 9.99999999999999996e-306 < (*.f64 V l) < 2.0000000000000001e280

    1. Initial program 91.6%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr99.7%

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

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

Alternative 7: 88.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^{+253}:\\ \;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-307}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{0 - A}}{\sqrt{0 - V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\left({\ell}^{-0.5} \cdot c0\right) \cdot {\left(\frac{V}{A}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \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+253)
   (/ (sqrt (/ A V)) (/ (sqrt l) c0))
   (if (<= (* V l) -1e-307)
     (/ (* c0 (sqrt (- 0.0 A))) (sqrt (- 0.0 (* V l))))
     (if (<= (* V l) 0.0)
       (* (* (pow l -0.5) c0) (pow (/ V A) -0.5))
       (* c0 (/ (sqrt A) (sqrt (* 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+253) {
		tmp = sqrt((A / V)) / (sqrt(l) / c0);
	} else if ((V * l) <= -1e-307) {
		tmp = (c0 * sqrt((0.0 - A))) / sqrt((0.0 - (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = (pow(l, -0.5) * c0) * pow((V / A), -0.5);
	} else {
		tmp = c0 * (sqrt(A) / sqrt((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+253)) then
        tmp = sqrt((a / v)) / (sqrt(l) / c0)
    else if ((v * l) <= (-1d-307)) then
        tmp = (c0 * sqrt((0.0d0 - a))) / sqrt((0.0d0 - (v * l)))
    else if ((v * l) <= 0.0d0) then
        tmp = ((l ** (-0.5d0)) * c0) * ((v / a) ** (-0.5d0))
    else
        tmp = c0 * (sqrt(a) / sqrt((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+253) {
		tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
	} else if ((V * l) <= -1e-307) {
		tmp = (c0 * Math.sqrt((0.0 - A))) / Math.sqrt((0.0 - (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = (Math.pow(l, -0.5) * c0) * Math.pow((V / A), -0.5);
	} else {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((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+253:
		tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0)
	elif (V * l) <= -1e-307:
		tmp = (c0 * math.sqrt((0.0 - A))) / math.sqrt((0.0 - (V * l)))
	elif (V * l) <= 0.0:
		tmp = (math.pow(l, -0.5) * c0) * math.pow((V / A), -0.5)
	else:
		tmp = c0 * (math.sqrt(A) / math.sqrt((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+253)
		tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0));
	elseif (Float64(V * l) <= -1e-307)
		tmp = Float64(Float64(c0 * sqrt(Float64(0.0 - A))) / sqrt(Float64(0.0 - Float64(V * l))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(Float64((l ^ -0.5) * c0) * (Float64(V / A) ^ -0.5));
	else
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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+253)
		tmp = sqrt((A / V)) / (sqrt(l) / c0);
	elseif ((V * l) <= -1e-307)
		tmp = (c0 * sqrt((0.0 - A))) / sqrt((0.0 - (V * l)));
	elseif ((V * l) <= 0.0)
		tmp = ((l ^ -0.5) * c0) * ((V / A) ^ -0.5);
	else
		tmp = c0 * (sqrt(A) / sqrt((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+253], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-307], N[(N[(c0 * N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(N[Power[l, -0.5], $MachinePrecision] * c0), $MachinePrecision] * N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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^{+253}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\left({\ell}^{-0.5} \cdot c0\right) \cdot {\left(\frac{V}{A}\right)}^{-0.5}\\

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


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

    1. Initial program 36.5%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6436.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr36.5%

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(\frac{A}{V}\right)}}} \]
      2. sub0-negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{0 - \ell}{\mathsf{neg}\left(\frac{A}{V}\right)}}} \]
      3. sub0-negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{0 - \ell}{0 - \frac{A}{V}}}} \]
      4. sqrt-divN/A

        \[\leadsto \frac{c0}{\frac{\sqrt{0 - \ell}}{\color{blue}{\sqrt{0 - \frac{A}{V}}}}} \]
      5. unpow1/2N/A

        \[\leadsto \frac{c0}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{\sqrt{\color{blue}{0 - \frac{A}{V}}}}} \]
      6. unpow1/2N/A

        \[\leadsto \frac{c0}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{{\left(0 - \frac{A}{V}\right)}^{\color{blue}{\frac{1}{2}}}}} \]
      7. associate-/r/N/A

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

        \[\leadsto {\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}} \cdot \color{blue}{\frac{c0}{{\left(0 - \ell\right)}^{\frac{1}{2}}}} \]
      9. clear-numN/A

        \[\leadsto {\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{1}{\color{blue}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{c0}}} \]
      10. un-div-invN/A

        \[\leadsto \frac{{\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{c0}}} \]
      11. sqr-powN/A

        \[\leadsto \frac{{\left(0 - \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(0 - \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      12. pow-prod-downN/A

        \[\leadsto \frac{{\left(\left(0 - \frac{A}{V}\right) \cdot \left(0 - \frac{A}{V}\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      13. sub0-negN/A

        \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right) \cdot \left(0 - \frac{A}{V}\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\left(\color{blue}{0} - \ell\right)}^{\frac{1}{2}}}{c0}} \]
      14. sub0-negN/A

        \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{A}{V}\right)\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\left(0 - \color{blue}{\ell}\right)}^{\frac{1}{2}}}{c0}} \]
      15. sqr-negN/A

        \[\leadsto \frac{{\left(\frac{A}{V} \cdot \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\color{blue}{\left(0 - \ell\right)}}^{\frac{1}{2}}}{c0}} \]
      16. pow-prod-downN/A

        \[\leadsto \frac{{\left(\frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(\frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      17. sqr-powN/A

        \[\leadsto \frac{{\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      18. pow1/2N/A

        \[\leadsto \frac{\sqrt{\frac{A}{V}}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
    8. Applied egg-rr47.7%

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

    if -9.9999999999999994e252 < (*.f64 V l) < -9.99999999999999909e-308

    1. Initial program 81.7%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V \cdot \ell\right)}} \]
      2. sqrt-divN/A

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

        \[\leadsto \frac{c0 \cdot \sqrt{\mathsf{neg}\left(A\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \sqrt{\mathsf{neg}\left(A\right)}\right), \color{blue}{\left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(V \cdot \ell\right)}}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      7. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(0 - A\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      12. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(0 - \ell\right)\right)\right)\right) \]
      13. --lowering--.f6498.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr98.2%

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{0 - A}}{\sqrt{V \cdot \left(0 - \ell\right)}}} \]
    5. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\left(\mathsf{neg}\left(\ell\right)\right) \cdot V\right)\right)\right) \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\ell \cdot V\right)\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\left(\ell \cdot V\right)\right)\right)\right) \]
      5. *-lowering-*.f6498.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\ell, V\right)\right)\right)\right) \]
    6. Applied egg-rr98.2%

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

    if -9.99999999999999909e-308 < (*.f64 V l) < -0.0

    1. Initial program 42.3%

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

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

        \[\leadsto \sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0 \]
      3. div-invN/A

        \[\leadsto \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}} \cdot c0 \]
      4. sqrt-prodN/A

        \[\leadsto \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right) \cdot c0 \]
      5. pow1/2N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{A}{V}}\right), \color{blue}{\left({\left(\frac{1}{\ell}\right)}^{\frac{1}{2}} \cdot c0\right)}\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{A}{V}\right)}^{\frac{1}{2}}\right), \left(\color{blue}{{\left(\frac{1}{\ell}\right)}^{\frac{1}{2}}} \cdot c0\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{1}{\frac{V}{A}}\right)}^{\frac{1}{2}}\right), \left({\color{blue}{\left(\frac{1}{\ell}\right)}}^{\frac{1}{2}} \cdot c0\right)\right) \]
      10. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(\frac{V}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right), \left({\color{blue}{\left(\frac{1}{\ell}\right)}}^{\frac{1}{2}} \cdot c0\right)\right) \]
      11. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{V}{A}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), \left(\color{blue}{{\left(\frac{1}{\ell}\right)}^{\frac{1}{2}}} \cdot c0\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{V}{A}\right), \left(-1 \cdot \frac{1}{2}\right)\right), \left(\color{blue}{{\left(\frac{1}{\ell}\right)}^{\frac{1}{2}}} \cdot c0\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \left(-1 \cdot \frac{1}{2}\right)\right), \left({\color{blue}{\left(\frac{1}{\ell}\right)}}^{\frac{1}{2}} \cdot c0\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \left({\left(\frac{1}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \cdot c0\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(\left({\left(\frac{1}{\ell}\right)}^{\frac{1}{2}}\right), \color{blue}{c0}\right)\right) \]
      16. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(\left({\left({\ell}^{-1}\right)}^{\frac{1}{2}}\right), c0\right)\right) \]
      17. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(\left({\ell}^{\left(-1 \cdot \frac{1}{2}\right)}\right), c0\right)\right) \]
      18. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \left(-1 \cdot \frac{1}{2}\right)\right), c0\right)\right) \]
      19. metadata-eval41.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \frac{-1}{2}\right), c0\right)\right) \]
    4. Applied egg-rr41.5%

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

    if -0.0 < (*.f64 V l)

    1. Initial program 82.4%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f6490.2%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr90.2%

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

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

Alternative 8: 88.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^{+253}:\\ \;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-272}:\\ \;\;\;\;\sqrt{0 - A} \cdot \frac{c0}{\sqrt{0 - V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{{\ell}^{-0.5}}{\sqrt{\frac{V}{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \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+253)
   (/ (sqrt (/ A V)) (/ (sqrt l) c0))
   (if (<= (* V l) -5e-272)
     (* (sqrt (- 0.0 A)) (/ c0 (sqrt (- 0.0 (* V l)))))
     (if (<= (* V l) 0.0)
       (* c0 (/ (pow l -0.5) (sqrt (/ V A))))
       (* c0 (/ (sqrt A) (sqrt (* 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+253) {
		tmp = sqrt((A / V)) / (sqrt(l) / c0);
	} else if ((V * l) <= -5e-272) {
		tmp = sqrt((0.0 - A)) * (c0 / sqrt((0.0 - (V * l))));
	} else if ((V * l) <= 0.0) {
		tmp = c0 * (pow(l, -0.5) / sqrt((V / A)));
	} else {
		tmp = c0 * (sqrt(A) / sqrt((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+253)) then
        tmp = sqrt((a / v)) / (sqrt(l) / c0)
    else if ((v * l) <= (-5d-272)) then
        tmp = sqrt((0.0d0 - a)) * (c0 / sqrt((0.0d0 - (v * l))))
    else if ((v * l) <= 0.0d0) then
        tmp = c0 * ((l ** (-0.5d0)) / sqrt((v / a)))
    else
        tmp = c0 * (sqrt(a) / sqrt((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+253) {
		tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
	} else if ((V * l) <= -5e-272) {
		tmp = Math.sqrt((0.0 - A)) * (c0 / Math.sqrt((0.0 - (V * l))));
	} else if ((V * l) <= 0.0) {
		tmp = c0 * (Math.pow(l, -0.5) / Math.sqrt((V / A)));
	} else {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((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+253:
		tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0)
	elif (V * l) <= -5e-272:
		tmp = math.sqrt((0.0 - A)) * (c0 / math.sqrt((0.0 - (V * l))))
	elif (V * l) <= 0.0:
		tmp = c0 * (math.pow(l, -0.5) / math.sqrt((V / A)))
	else:
		tmp = c0 * (math.sqrt(A) / math.sqrt((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+253)
		tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0));
	elseif (Float64(V * l) <= -5e-272)
		tmp = Float64(sqrt(Float64(0.0 - A)) * Float64(c0 / sqrt(Float64(0.0 - Float64(V * l)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(c0 * Float64((l ^ -0.5) / sqrt(Float64(V / A))));
	else
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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+253)
		tmp = sqrt((A / V)) / (sqrt(l) / c0);
	elseif ((V * l) <= -5e-272)
		tmp = sqrt((0.0 - A)) * (c0 / sqrt((0.0 - (V * l))));
	elseif ((V * l) <= 0.0)
		tmp = c0 * ((l ^ -0.5) / sqrt((V / A)));
	else
		tmp = c0 * (sqrt(A) / sqrt((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+253], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-272], N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[N[(0.0 - N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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^{+253}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\

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

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

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


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

    1. Initial program 36.5%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6436.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr36.5%

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(\frac{A}{V}\right)}}} \]
      2. sub0-negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{0 - \ell}{\mathsf{neg}\left(\frac{A}{V}\right)}}} \]
      3. sub0-negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{0 - \ell}{0 - \frac{A}{V}}}} \]
      4. sqrt-divN/A

        \[\leadsto \frac{c0}{\frac{\sqrt{0 - \ell}}{\color{blue}{\sqrt{0 - \frac{A}{V}}}}} \]
      5. unpow1/2N/A

        \[\leadsto \frac{c0}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{\sqrt{\color{blue}{0 - \frac{A}{V}}}}} \]
      6. unpow1/2N/A

        \[\leadsto \frac{c0}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{{\left(0 - \frac{A}{V}\right)}^{\color{blue}{\frac{1}{2}}}}} \]
      7. associate-/r/N/A

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

        \[\leadsto {\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}} \cdot \color{blue}{\frac{c0}{{\left(0 - \ell\right)}^{\frac{1}{2}}}} \]
      9. clear-numN/A

        \[\leadsto {\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{1}{\color{blue}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{c0}}} \]
      10. un-div-invN/A

        \[\leadsto \frac{{\left(0 - \frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\frac{{\left(0 - \ell\right)}^{\frac{1}{2}}}{c0}}} \]
      11. sqr-powN/A

        \[\leadsto \frac{{\left(0 - \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(0 - \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      12. pow-prod-downN/A

        \[\leadsto \frac{{\left(\left(0 - \frac{A}{V}\right) \cdot \left(0 - \frac{A}{V}\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      13. sub0-negN/A

        \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right) \cdot \left(0 - \frac{A}{V}\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\left(\color{blue}{0} - \ell\right)}^{\frac{1}{2}}}{c0}} \]
      14. sub0-negN/A

        \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{A}{V}\right)\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\left(0 - \color{blue}{\ell}\right)}^{\frac{1}{2}}}{c0}} \]
      15. sqr-negN/A

        \[\leadsto \frac{{\left(\frac{A}{V} \cdot \frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{{\color{blue}{\left(0 - \ell\right)}}^{\frac{1}{2}}}{c0}} \]
      16. pow-prod-downN/A

        \[\leadsto \frac{{\left(\frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(\frac{A}{V}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      17. sqr-powN/A

        \[\leadsto \frac{{\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
      18. pow1/2N/A

        \[\leadsto \frac{\sqrt{\frac{A}{V}}}{\frac{\color{blue}{{\left(0 - \ell\right)}^{\frac{1}{2}}}}{c0}} \]
    8. Applied egg-rr47.7%

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

    if -9.9999999999999994e252 < (*.f64 V l) < -4.99999999999999982e-272

    1. Initial program 82.4%

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

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(A\right)}} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}\right), \color{blue}{\left(\sqrt{\mathsf{neg}\left(A\right)}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(A\right)}}\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(0 - \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      14. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) \]
      16. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(0 - A\right)\right)\right) \]
      17. --lowering--.f6497.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
    4. Applied egg-rr97.4%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \left(0 - \ell\right)}} \cdot \sqrt{0 - A}} \]
    5. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      2. distribute-rgt-neg-outN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      3. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\left(V \cdot \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\left(\ell \cdot V\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      5. *-lowering-*.f6497.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\ell, V\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
    6. Applied egg-rr97.4%

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

    if -4.99999999999999982e-272 < (*.f64 V l) < -0.0

    1. Initial program 48.1%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6448.0%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr48.0%

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

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

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

    if -0.0 < (*.f64 V l)

    1. Initial program 82.4%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f6490.2%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr90.2%

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

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

Alternative 9: 79.5% 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 0:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \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) 0.0)
   (/ c0 (sqrt (/ l (/ A V))))
   (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= 0.0) {
		tmp = c0 / sqrt((l / (A / V)));
	} else {
		tmp = c0 * (sqrt(A) / sqrt((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) <= 0.0d0) then
        tmp = c0 / sqrt((l / (a / v)))
    else
        tmp = c0 * (sqrt(a) / sqrt((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) <= 0.0) {
		tmp = c0 / Math.sqrt((l / (A / V)));
	} else {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= 0.0:
		tmp = c0 / math.sqrt((l / (A / V)))
	else:
		tmp = c0 * (math.sqrt(A) / math.sqrt((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) <= 0.0)
		tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V))));
	else
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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) <= 0.0)
		tmp = c0 / sqrt((l / (A / V)));
	else
		tmp = c0 * (sqrt(A) / sqrt((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], 0.0], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\

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


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

    1. Initial program 67.1%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6467.1%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr67.1%

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

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

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

    if -0.0 < (*.f64 V l)

    1. Initial program 82.4%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f6490.2%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr90.2%

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

Alternative 10: 83.6% accurate, 0.5× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\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 (<= l -2e-310)
   (* c0 (/ (sqrt A) (sqrt (* V l))))
   (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -2e-310) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * (sqrt((A / V)) / sqrt(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 (l <= (-2d-310)) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 * (sqrt((a / v)) / sqrt(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 (l <= -2e-310) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if l <= -2e-310:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (l <= -2e-310)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 (l <= -2e-310)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 * (sqrt((A / V)) / sqrt(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[l, -2e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.999999999999994e-310

    1. Initial program 70.7%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f6443.8%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr43.8%

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

    if -1.999999999999994e-310 < l

    1. Initial program 76.8%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6476.8%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr76.8%

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

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

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

Alternative 11: 79.9% accurate, 0.9× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+307}:\\ \;\;\;\;c0 \cdot \sqrt{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \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 (/ A (* V l))))
   (if (<= t_0 0.0)
     (* c0 (sqrt (/ (/ A V) l)))
     (if (<= t_0 4e+307) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ l (/ A V))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if (t_0 <= 4e+307) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 / sqrt((l / (A / V)));
	}
	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 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = c0 * sqrt(((a / v) / l))
    else if (t_0 <= 4d+307) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 / sqrt((l / (a / v)))
    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 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 4e+307) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 / Math.sqrt((l / (A / V)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif t_0 <= 4e+307:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 / math.sqrt((l / (A / V)))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 4e+307)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V))));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * sqrt(((A / V) / l));
	elseif (t_0 <= 4e+307)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 / sqrt((l / (A / V)));
	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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+307], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\

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


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

    1. Initial program 28.0%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right)\right)\right) \]
      3. /-lowering-/.f6440.9%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right)\right)\right) \]
    4. Applied egg-rr40.9%

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 3.99999999999999994e307

    1. Initial program 99.6%

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

    if 3.99999999999999994e307 < (/.f64 A (*.f64 V l))

    1. Initial program 38.6%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6438.6%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr38.6%

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

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

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

Alternative 12: 79.8% accurate, 0.9× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+300}:\\ \;\;\;\;c0 \cdot \sqrt{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 (/ A (* V l))))
   (if (<= t_0 0.0)
     (* c0 (sqrt (/ (/ A V) l)))
     (if (<= t_0 2e+300) (* c0 (sqrt 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 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if (t_0 <= 2e+300) {
		tmp = c0 * sqrt(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 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = c0 * sqrt(((a / v) / l))
    else if (t_0 <= 2d+300) then
        tmp = c0 * sqrt(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 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 2e+300) {
		tmp = c0 * Math.sqrt(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 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif t_0 <= 2e+300:
		tmp = c0 * math.sqrt(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(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 2e+300)
		tmp = Float64(c0 * sqrt(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 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * sqrt(((A / V) / l));
	elseif (t_0 <= 2e+300)
		tmp = c0 * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+300], N[(c0 * N[Sqrt[t$95$0], $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 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \sqrt{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 A (*.f64 V l)) < 0.0

    1. Initial program 28.0%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right)\right)\right) \]
      3. /-lowering-/.f6440.9%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right)\right)\right) \]
    4. Applied egg-rr40.9%

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e300

    1. Initial program 99.6%

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

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

    1. Initial program 41.7%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6441.7%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr41.7%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{A} \cdot V\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{\ell}{A}\right), V\right)\right)\right) \]
      3. /-lowering-/.f6452.1%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, A\right), V\right)\right)\right) \]
    8. Applied egg-rr52.1%

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

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

Alternative 13: 79.6% accurate, 0.9× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ t_1 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+307}:\\ \;\;\;\;c0 \cdot \sqrt{t\_0}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (/ A (* V l))) (t_1 (* c0 (sqrt (/ (/ A V) l)))))
   (if (<= t_0 0.0) t_1 (if (<= t_0 4e+307) (* c0 (sqrt t_0)) t_1))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double t_1 = c0 * sqrt(((A / V) / l));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = t_1;
	} else if (t_0 <= 4e+307) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = a / (v * l)
    t_1 = c0 * sqrt(((a / v) / l))
    if (t_0 <= 0.0d0) then
        tmp = t_1
    else if (t_0 <= 4d+307) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = t_1
    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 = A / (V * l);
	double t_1 = c0 * Math.sqrt(((A / V) / l));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = t_1;
	} else if (t_0 <= 4e+307) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	t_1 = c0 * math.sqrt(((A / V) / l))
	tmp = 0
	if t_0 <= 0.0:
		tmp = t_1
	elif t_0 <= 4e+307:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = t_1
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	t_1 = Float64(c0 * sqrt(Float64(Float64(A / V) / l)))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = t_1;
	elseif (t_0 <= 4e+307)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = t_1;
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	t_1 = c0 * sqrt(((A / V) / l));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = t_1;
	elseif (t_0 <= 4e+307)
		tmp = c0 * sqrt(t_0);
	else
		tmp = t_1;
	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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 4e+307], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
t_1 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 A (*.f64 V l)) < 0.0 or 3.99999999999999994e307 < (/.f64 A (*.f64 V l))

    1. Initial program 33.9%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right)\right)\right) \]
      3. /-lowering-/.f6445.3%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right)\right)\right) \]
    4. Applied egg-rr45.3%

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 3.99999999999999994e307

    1. Initial program 99.6%

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

Alternative 14: 73.3% 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.7%

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

Reproduce

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