Henrywood and Agarwal, Equation (3)

Percentage Accurate: 72.8% → 89.9%
Time: 8.3s
Alternatives: 13
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 13 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: 72.8% accurate, 1.0× speedup?

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

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

Alternative 1: 89.9% 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^{+305}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-315}:\\ \;\;\;\;c0 \cdot \left(\sqrt{-A} \cdot \frac{1}{\sqrt{-V \cdot \ell}}\right)\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-241}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+274}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \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+305)
   (* (/ c0 (sqrt l)) (sqrt (/ A V)))
   (if (<= (* V l) -4e-315)
     (* c0 (* (sqrt (- A)) (/ 1.0 (sqrt (- (* V l))))))
     (if (<= (* V l) 1e-241)
       (/ c0 (sqrt (* l (/ V A))))
       (if (<= (* V l) 5e+274)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* A (/ c0 (sqrt (* V (* 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+305) {
		tmp = (c0 / sqrt(l)) * sqrt((A / V));
	} else if ((V * l) <= -4e-315) {
		tmp = c0 * (sqrt(-A) * (1.0 / sqrt(-(V * l))));
	} else if ((V * l) <= 1e-241) {
		tmp = c0 / sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+274) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = A * (c0 / sqrt((V * (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+305)) then
        tmp = (c0 / sqrt(l)) * sqrt((a / v))
    else if ((v * l) <= (-4d-315)) then
        tmp = c0 * (sqrt(-a) * (1.0d0 / sqrt(-(v * l))))
    else if ((v * l) <= 1d-241) then
        tmp = c0 / sqrt((l * (v / a)))
    else if ((v * l) <= 5d+274) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = a * (c0 / sqrt((v * (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+305) {
		tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
	} else if ((V * l) <= -4e-315) {
		tmp = c0 * (Math.sqrt(-A) * (1.0 / Math.sqrt(-(V * l))));
	} else if ((V * l) <= 1e-241) {
		tmp = c0 / Math.sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+274) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = A * (c0 / Math.sqrt((V * (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+305:
		tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V))
	elif (V * l) <= -4e-315:
		tmp = c0 * (math.sqrt(-A) * (1.0 / math.sqrt(-(V * l))))
	elif (V * l) <= 1e-241:
		tmp = c0 / math.sqrt((l * (V / A)))
	elif (V * l) <= 5e+274:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = A * (c0 / math.sqrt((V * (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+305)
		tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V)));
	elseif (Float64(V * l) <= -4e-315)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) * Float64(1.0 / sqrt(Float64(-Float64(V * l))))));
	elseif (Float64(V * l) <= 1e-241)
		tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A))));
	elseif (Float64(V * l) <= 5e+274)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(A * Float64(c0 / sqrt(Float64(V * 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+305)
		tmp = (c0 / sqrt(l)) * sqrt((A / V));
	elseif ((V * l) <= -4e-315)
		tmp = c0 * (sqrt(-A) * (1.0 / sqrt(-(V * l))));
	elseif ((V * l) <= 1e-241)
		tmp = c0 / sqrt((l * (V / A)));
	elseif ((V * l) <= 5e+274)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = A * (c0 / sqrt((V * (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+305], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-315], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] * N[(1.0 / N[Sqrt[(-N[(V * l), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-241], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+274], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(A * N[(c0 / N[Sqrt[N[(V * 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^{+305}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\

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

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

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

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


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

    1. Initial program 31.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\sqrt{\frac{A}{V}}} \]
      9. /-lowering-/.f6440.0

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

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

    if -9.9999999999999994e304 < (*.f64 V l) < -3.9999999989e-315

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\color{blue}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}}\right) \]
      12. distribute-rgt-neg-inN/A

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

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\color{blue}{V \cdot \left(\mathsf{neg}\left(\ell\right)\right)}}}\right) \]
      14. neg-lowering-neg.f6499.0

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

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

    if -3.9999999989e-315 < (*.f64 V l) < 9.9999999999999997e-242

    1. Initial program 54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{\ell \cdot V}{\ell \cdot A} \cdot \ell}}} \]
      11. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{1}{\frac{\ell \cdot A}{\ell \cdot V}}} \cdot \ell}} \]
      12. times-fracN/A

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{1}{\color{blue}{\frac{A}{V}}} \cdot \ell}} \]
      15. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A}} \cdot \ell}} \]
      16. /-lowering-/.f6473.9

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

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

    if 9.9999999999999997e-242 < (*.f64 V l) < 4.9999999999999998e274

    1. Initial program 88.7%

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

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

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

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

        \[\leadsto c0 \cdot \frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      5. *-lowering-*.f6499.4

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

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

    if 4.9999999999999998e274 < (*.f64 V l)

    1. Initial program 44.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 31.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\sqrt{\frac{A}{V}}} \]
      9. /-lowering-/.f6440.0

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

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

    if -9.9999999999999994e304 < (*.f64 V l) < -1.99999999999999982e-307

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999982e-307 < (*.f64 V l) < 9.9999999999999997e-242

    1. Initial program 53.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{\ell \cdot V}{\ell \cdot A} \cdot \ell}}} \]
      11. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{1}{\frac{\ell \cdot A}{\ell \cdot V}}} \cdot \ell}} \]
      12. times-fracN/A

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{1}{\color{blue}{\frac{A}{V}}} \cdot \ell}} \]
      15. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A}} \cdot \ell}} \]
      16. /-lowering-/.f6472.6

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

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

    if 9.9999999999999997e-242 < (*.f64 V l) < 4.9999999999999998e274

    1. Initial program 88.7%

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

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

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

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

        \[\leadsto c0 \cdot \frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      5. *-lowering-*.f6499.4

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

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

    if 4.9999999999999998e274 < (*.f64 V l)

    1. Initial program 44.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.7% 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^{+305}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-315}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{-A}}{\sqrt{-V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-241}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+274}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \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+305)
   (* (/ c0 (sqrt l)) (sqrt (/ A V)))
   (if (<= (* V l) -4e-315)
     (/ (* c0 (sqrt (- A))) (sqrt (- (* V l))))
     (if (<= (* V l) 1e-241)
       (/ c0 (sqrt (* l (/ V A))))
       (if (<= (* V l) 5e+274)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* A (/ c0 (sqrt (* V (* 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+305) {
		tmp = (c0 / sqrt(l)) * sqrt((A / V));
	} else if ((V * l) <= -4e-315) {
		tmp = (c0 * sqrt(-A)) / sqrt(-(V * l));
	} else if ((V * l) <= 1e-241) {
		tmp = c0 / sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+274) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = A * (c0 / sqrt((V * (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+305)) then
        tmp = (c0 / sqrt(l)) * sqrt((a / v))
    else if ((v * l) <= (-4d-315)) then
        tmp = (c0 * sqrt(-a)) / sqrt(-(v * l))
    else if ((v * l) <= 1d-241) then
        tmp = c0 / sqrt((l * (v / a)))
    else if ((v * l) <= 5d+274) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = a * (c0 / sqrt((v * (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+305) {
		tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
	} else if ((V * l) <= -4e-315) {
		tmp = (c0 * Math.sqrt(-A)) / Math.sqrt(-(V * l));
	} else if ((V * l) <= 1e-241) {
		tmp = c0 / Math.sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+274) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = A * (c0 / Math.sqrt((V * (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+305:
		tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V))
	elif (V * l) <= -4e-315:
		tmp = (c0 * math.sqrt(-A)) / math.sqrt(-(V * l))
	elif (V * l) <= 1e-241:
		tmp = c0 / math.sqrt((l * (V / A)))
	elif (V * l) <= 5e+274:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = A * (c0 / math.sqrt((V * (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+305)
		tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V)));
	elseif (Float64(V * l) <= -4e-315)
		tmp = Float64(Float64(c0 * sqrt(Float64(-A))) / sqrt(Float64(-Float64(V * l))));
	elseif (Float64(V * l) <= 1e-241)
		tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A))));
	elseif (Float64(V * l) <= 5e+274)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(A * Float64(c0 / sqrt(Float64(V * 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+305)
		tmp = (c0 / sqrt(l)) * sqrt((A / V));
	elseif ((V * l) <= -4e-315)
		tmp = (c0 * sqrt(-A)) / sqrt(-(V * l));
	elseif ((V * l) <= 1e-241)
		tmp = c0 / sqrt((l * (V / A)));
	elseif ((V * l) <= 5e+274)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = A * (c0 / sqrt((V * (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+305], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-315], N[(N[(c0 * N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-N[(V * l), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-241], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+274], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(A * N[(c0 / N[Sqrt[N[(V * 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^{+305}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\

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

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

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

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


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

    1. Initial program 31.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\sqrt{\frac{A}{V}}} \]
      9. /-lowering-/.f6440.0

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

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

    if -9.9999999999999994e304 < (*.f64 V l) < -3.9999999989e-315

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\mathsf{neg}\left(A\right)} \cdot c0}{\color{blue}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}} \]
      13. distribute-rgt-neg-inN/A

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

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

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

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

    if -3.9999999989e-315 < (*.f64 V l) < 9.9999999999999997e-242

    1. Initial program 54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{\ell \cdot V}{\ell \cdot A} \cdot \ell}}} \]
      11. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{1}{\frac{\ell \cdot A}{\ell \cdot V}}} \cdot \ell}} \]
      12. times-fracN/A

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{1}{\color{blue}{\frac{A}{V}}} \cdot \ell}} \]
      15. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A}} \cdot \ell}} \]
      16. /-lowering-/.f6473.9

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

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

    if 9.9999999999999997e-242 < (*.f64 V l) < 4.9999999999999998e274

    1. Initial program 88.7%

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

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

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

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

        \[\leadsto c0 \cdot \frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      5. *-lowering-*.f6499.4

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

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

    if 4.9999999999999998e274 < (*.f64 V l)

    1. Initial program 44.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 87.6% 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^{+305}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-315}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{-A}}{\sqrt{-V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-241}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+274}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \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+305)
   (* c0 (sqrt (/ (/ A V) l)))
   (if (<= (* V l) -4e-315)
     (/ (* c0 (sqrt (- A))) (sqrt (- (* V l))))
     (if (<= (* V l) 1e-241)
       (/ c0 (sqrt (* l (/ V A))))
       (if (<= (* V l) 5e+274)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* A (/ c0 (sqrt (* V (* 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+305) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if ((V * l) <= -4e-315) {
		tmp = (c0 * sqrt(-A)) / sqrt(-(V * l));
	} else if ((V * l) <= 1e-241) {
		tmp = c0 / sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+274) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = A * (c0 / sqrt((V * (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+305)) then
        tmp = c0 * sqrt(((a / v) / l))
    else if ((v * l) <= (-4d-315)) then
        tmp = (c0 * sqrt(-a)) / sqrt(-(v * l))
    else if ((v * l) <= 1d-241) then
        tmp = c0 / sqrt((l * (v / a)))
    else if ((v * l) <= 5d+274) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = a * (c0 / sqrt((v * (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+305) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if ((V * l) <= -4e-315) {
		tmp = (c0 * Math.sqrt(-A)) / Math.sqrt(-(V * l));
	} else if ((V * l) <= 1e-241) {
		tmp = c0 / Math.sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+274) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = A * (c0 / Math.sqrt((V * (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+305:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif (V * l) <= -4e-315:
		tmp = (c0 * math.sqrt(-A)) / math.sqrt(-(V * l))
	elif (V * l) <= 1e-241:
		tmp = c0 / math.sqrt((l * (V / A)))
	elif (V * l) <= 5e+274:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = A * (c0 / math.sqrt((V * (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+305)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (Float64(V * l) <= -4e-315)
		tmp = Float64(Float64(c0 * sqrt(Float64(-A))) / sqrt(Float64(-Float64(V * l))));
	elseif (Float64(V * l) <= 1e-241)
		tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A))));
	elseif (Float64(V * l) <= 5e+274)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(A * Float64(c0 / sqrt(Float64(V * 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+305)
		tmp = c0 * sqrt(((A / V) / l));
	elseif ((V * l) <= -4e-315)
		tmp = (c0 * sqrt(-A)) / sqrt(-(V * l));
	elseif ((V * l) <= 1e-241)
		tmp = c0 / sqrt((l * (V / A)));
	elseif ((V * l) <= 5e+274)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = A * (c0 / sqrt((V * (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+305], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-315], N[(N[(c0 * N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-N[(V * l), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-241], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+274], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(A * N[(c0 / N[Sqrt[N[(V * 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^{+305}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

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

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

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

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


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

    1. Initial program 31.6%

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      3. /-lowering-/.f6470.2

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

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

    if -9.9999999999999994e304 < (*.f64 V l) < -3.9999999989e-315

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\mathsf{neg}\left(A\right)} \cdot c0}{\color{blue}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}} \]
      13. distribute-rgt-neg-inN/A

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

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

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

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

    if -3.9999999989e-315 < (*.f64 V l) < 9.9999999999999997e-242

    1. Initial program 54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{\ell \cdot V}{\ell \cdot A} \cdot \ell}}} \]
      11. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{1}{\frac{\ell \cdot A}{\ell \cdot V}}} \cdot \ell}} \]
      12. times-fracN/A

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{1}{\color{blue}{\frac{A}{V}}} \cdot \ell}} \]
      15. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A}} \cdot \ell}} \]
      16. /-lowering-/.f6473.9

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

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

    if 9.9999999999999997e-242 < (*.f64 V l) < 4.9999999999999998e274

    1. Initial program 88.7%

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

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

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

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

        \[\leadsto c0 \cdot \frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      5. *-lowering-*.f6499.4

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

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

    if 4.9999999999999998e274 < (*.f64 V l)

    1. Initial program 44.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.2% accurate, 0.4× 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:\\ \;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+291}:\\ \;\;\;\;c0 \cdot \sqrt{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{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)
     (* A (/ c0 (sqrt (* V (* A l)))))
     (if (<= t_0 4e+291) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V 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 = A * (c0 / sqrt((V * (A * l))));
	} else if (t_0 <= 4e+291) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 / sqrt((l * (V / 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 = a * (c0 / sqrt((v * (a * l))))
    else if (t_0 <= 4d+291) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 / sqrt((l * (v / 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 = A * (c0 / Math.sqrt((V * (A * l))));
	} else if (t_0 <= 4e+291) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 / Math.sqrt((l * (V / 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 = A * (c0 / math.sqrt((V * (A * l))))
	elif t_0 <= 4e+291:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 / math.sqrt((l * (V / 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(A * Float64(c0 / sqrt(Float64(V * Float64(A * l)))));
	elseif (t_0 <= 4e+291)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 / sqrt(Float64(l * Float64(V / 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 = A * (c0 / sqrt((V * (A * l))));
	elseif (t_0 <= 4e+291)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 / sqrt((l * (V / 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[(A * N[(c0 / N[Sqrt[N[(V * N[(A * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+291], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / 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:\\
\;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\

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

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


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

    1. Initial program 33.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 3.9999999999999998e291

    1. Initial program 98.8%

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

    if 3.9999999999999998e291 < (/.f64 A (*.f64 V l))

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{\ell \cdot V}{\ell \cdot A} \cdot \ell}}} \]
      11. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{1}{\frac{\ell \cdot A}{\ell \cdot V}}} \cdot \ell}} \]
      12. times-fracN/A

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{1}{\color{blue}{\frac{A}{V}}} \cdot \ell}} \]
      15. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A}} \cdot \ell}} \]
      16. /-lowering-/.f6458.9

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

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

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

Alternative 6: 79.3% accurate, 0.4× 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:\\ \;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+296}:\\ \;\;\;\;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)
     (* A (/ c0 (sqrt (* V (* A l)))))
     (if (<= t_0 2e+296) (* 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 = A * (c0 / sqrt((V * (A * l))));
	} else if (t_0 <= 2e+296) {
		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 = a * (c0 / sqrt((v * (a * l))))
    else if (t_0 <= 2d+296) 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 = A * (c0 / Math.sqrt((V * (A * l))));
	} else if (t_0 <= 2e+296) {
		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 = A * (c0 / math.sqrt((V * (A * l))))
	elif t_0 <= 2e+296:
		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(A * Float64(c0 / sqrt(Float64(V * Float64(A * l)))));
	elseif (t_0 <= 2e+296)
		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 = A * (c0 / sqrt((V * (A * l))));
	elseif (t_0 <= 2e+296)
		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[(A * N[(c0 / N[Sqrt[N[(V * N[(A * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+296], 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:\\
\;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+296}:\\
\;\;\;\;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 33.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.99999999999999996e296

    1. Initial program 98.8%

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

    if 1.99999999999999996e296 < (/.f64 A (*.f64 V l))

    1. Initial program 46.5%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
      9. /-lowering-/.f6459.7

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

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

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

Alternative 7: 78.8% accurate, 0.4× 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:\\ \;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+296}:\\ \;\;\;\;c0 \cdot \sqrt{t\_0}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{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)
     (* A (/ c0 (sqrt (* V (* A l)))))
     (if (<= t_0 2e+296) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A l) 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 = A * (c0 / sqrt((V * (A * l))));
	} else if (t_0 <= 2e+296) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 * sqrt(((A / l) / 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 = a * (c0 / sqrt((v * (a * l))))
    else if (t_0 <= 2d+296) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 * sqrt(((a / l) / 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 = A * (c0 / Math.sqrt((V * (A * l))));
	} else if (t_0 <= 2e+296) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 * Math.sqrt(((A / l) / 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 = A * (c0 / math.sqrt((V * (A * l))))
	elif t_0 <= 2e+296:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 * math.sqrt(((A / l) / 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(A * Float64(c0 / sqrt(Float64(V * Float64(A * l)))));
	elseif (t_0 <= 2e+296)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / 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 = A * (c0 / sqrt((V * (A * l))));
	elseif (t_0 <= 2e+296)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 * sqrt(((A / l) / 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[(A * N[(c0 / N[Sqrt[N[(V * N[(A * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+296], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $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:\\
\;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\

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

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


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

    1. Initial program 33.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.99999999999999996e296

    1. Initial program 98.8%

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

    if 1.99999999999999996e296 < (/.f64 A (*.f64 V l))

    1. Initial program 46.5%

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \]
      3. /-lowering-/.f6457.9

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

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

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

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

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

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


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

    1. Initial program 33.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 3.9999999999999998e291

    1. Initial program 98.8%

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

    if 3.9999999999999998e291 < (/.f64 A (*.f64 V l))

    1. Initial program 47.3%

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

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

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

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

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

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

Alternative 9: 85.7% 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 -4 \cdot 10^{-315}:\\ \;\;\;\;\sqrt{-A} \cdot \frac{c0}{\sqrt{-V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-241}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+274}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \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) -4e-315)
   (* (sqrt (- A)) (/ c0 (sqrt (- (* V l)))))
   (if (<= (* V l) 1e-241)
     (/ c0 (sqrt (* l (/ V A))))
     (if (<= (* V l) 5e+274)
       (* c0 (/ (sqrt A) (sqrt (* V l))))
       (* A (/ c0 (sqrt (* V (* A l)))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -4e-315) {
		tmp = sqrt(-A) * (c0 / sqrt(-(V * l)));
	} else if ((V * l) <= 1e-241) {
		tmp = c0 / sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+274) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = A * (c0 / sqrt((V * (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) <= (-4d-315)) then
        tmp = sqrt(-a) * (c0 / sqrt(-(v * l)))
    else if ((v * l) <= 1d-241) then
        tmp = c0 / sqrt((l * (v / a)))
    else if ((v * l) <= 5d+274) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = a * (c0 / sqrt((v * (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) <= -4e-315) {
		tmp = Math.sqrt(-A) * (c0 / Math.sqrt(-(V * l)));
	} else if ((V * l) <= 1e-241) {
		tmp = c0 / Math.sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+274) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = A * (c0 / Math.sqrt((V * (A * l))));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -4e-315:
		tmp = math.sqrt(-A) * (c0 / math.sqrt(-(V * l)))
	elif (V * l) <= 1e-241:
		tmp = c0 / math.sqrt((l * (V / A)))
	elif (V * l) <= 5e+274:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = A * (c0 / math.sqrt((V * (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) <= -4e-315)
		tmp = Float64(sqrt(Float64(-A)) * Float64(c0 / sqrt(Float64(-Float64(V * l)))));
	elseif (Float64(V * l) <= 1e-241)
		tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A))));
	elseif (Float64(V * l) <= 5e+274)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(A * Float64(c0 / sqrt(Float64(V * 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) <= -4e-315)
		tmp = sqrt(-A) * (c0 / sqrt(-(V * l)));
	elseif ((V * l) <= 1e-241)
		tmp = c0 / sqrt((l * (V / A)));
	elseif ((V * l) <= 5e+274)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = A * (c0 / sqrt((V * (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], -4e-315], N[(N[Sqrt[(-A)], $MachinePrecision] * N[(c0 / N[Sqrt[(-N[(V * l), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-241], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+274], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(A * N[(c0 / N[Sqrt[N[(V * 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 -4 \cdot 10^{-315}:\\
\;\;\;\;\sqrt{-A} \cdot \frac{c0}{\sqrt{-V \cdot \ell}}\\

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

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

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


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

    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.9999999989e-315 < (*.f64 V l) < 9.9999999999999997e-242

    1. Initial program 54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{\ell \cdot V}{\ell \cdot A} \cdot \ell}}} \]
      11. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{1}{\frac{\ell \cdot A}{\ell \cdot V}}} \cdot \ell}} \]
      12. times-fracN/A

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{1}{\color{blue}{\frac{A}{V}}} \cdot \ell}} \]
      15. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A}} \cdot \ell}} \]
      16. /-lowering-/.f6473.9

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

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

    if 9.9999999999999997e-242 < (*.f64 V l) < 4.9999999999999998e274

    1. Initial program 88.7%

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

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

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

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

        \[\leadsto c0 \cdot \frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      5. *-lowering-*.f6499.4

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

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

    if 4.9999999999999998e274 < (*.f64 V l)

    1. Initial program 44.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 81.3% 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^{-114}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-241}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+274}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \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-114)
   (* c0 (sqrt (/ A (* V l))))
   (if (<= (* V l) 1e-241)
     (/ c0 (sqrt (* l (/ V A))))
     (if (<= (* V l) 5e+274)
       (* c0 (/ (sqrt A) (sqrt (* V l))))
       (* A (/ c0 (sqrt (* V (* 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-114) {
		tmp = c0 * sqrt((A / (V * l)));
	} else if ((V * l) <= 1e-241) {
		tmp = c0 / sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+274) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = A * (c0 / sqrt((V * (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-114)) then
        tmp = c0 * sqrt((a / (v * l)))
    else if ((v * l) <= 1d-241) then
        tmp = c0 / sqrt((l * (v / a)))
    else if ((v * l) <= 5d+274) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = a * (c0 / sqrt((v * (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-114) {
		tmp = c0 * Math.sqrt((A / (V * l)));
	} else if ((V * l) <= 1e-241) {
		tmp = c0 / Math.sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+274) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = A * (c0 / Math.sqrt((V * (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-114:
		tmp = c0 * math.sqrt((A / (V * l)))
	elif (V * l) <= 1e-241:
		tmp = c0 / math.sqrt((l * (V / A)))
	elif (V * l) <= 5e+274:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = A * (c0 / math.sqrt((V * (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-114)
		tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l))));
	elseif (Float64(V * l) <= 1e-241)
		tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A))));
	elseif (Float64(V * l) <= 5e+274)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(A * Float64(c0 / sqrt(Float64(V * 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-114)
		tmp = c0 * sqrt((A / (V * l)));
	elseif ((V * l) <= 1e-241)
		tmp = c0 / sqrt((l * (V / A)));
	elseif ((V * l) <= 5e+274)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = A * (c0 / sqrt((V * (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-114], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-241], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+274], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(A * N[(c0 / N[Sqrt[N[(V * 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^{-114}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\

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

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

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


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

    1. Initial program 81.8%

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

    if -1.0000000000000001e-114 < (*.f64 V l) < 9.9999999999999997e-242

    1. Initial program 58.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{\ell \cdot V}{\ell \cdot A} \cdot \ell}}} \]
      11. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{1}{\frac{\ell \cdot A}{\ell \cdot V}}} \cdot \ell}} \]
      12. times-fracN/A

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

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

        \[\leadsto \frac{c0}{\sqrt{\frac{1}{\color{blue}{\frac{A}{V}}} \cdot \ell}} \]
      15. clear-numN/A

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A}} \cdot \ell}} \]
      16. /-lowering-/.f6471.0

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

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

    if 9.9999999999999997e-242 < (*.f64 V l) < 4.9999999999999998e274

    1. Initial program 88.7%

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

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

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

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

        \[\leadsto c0 \cdot \frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      5. *-lowering-*.f6499.4

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

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

    if 4.9999999999999998e274 < (*.f64 V l)

    1. Initial program 44.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 90.7% accurate, 0.5× speedup?

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

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \left(\sqrt{\color{blue}{\mathsf{neg}\left(A\right)}} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(V \cdot \ell\right)}}\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \color{blue}{\sqrt{\frac{1}{\mathsf{neg}\left(V \cdot \ell\right)}}}\right) \]
      13. metadata-evalN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \sqrt{\frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\mathsf{neg}\left(V \cdot \ell\right)}}\right) \]
      14. frac-2negN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \sqrt{\color{blue}{\frac{-1}{V \cdot \ell}}}\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \sqrt{\color{blue}{\frac{-1}{V \cdot \ell}}}\right) \]
      16. *-commutativeN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \sqrt{\frac{-1}{\color{blue}{\ell \cdot V}}}\right) \]
      17. *-lowering-*.f6484.6

        \[\leadsto c0 \cdot \left(\sqrt{-A} \cdot \sqrt{\frac{-1}{\color{blue}{\ell \cdot V}}}\right) \]
    6. Applied egg-rr84.6%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{-A} \cdot \sqrt{\frac{-1}{\ell \cdot V}}\right)} \]
    7. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\ell \cdot V\right)}}}\right) \]
      2. sqrt-divN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \color{blue}{\frac{\sqrt{\mathsf{neg}\left(-1\right)}}{\sqrt{\mathsf{neg}\left(\ell \cdot V\right)}}}\right) \]
      3. metadata-evalN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{\sqrt{\color{blue}{1}}}{\sqrt{\mathsf{neg}\left(\ell \cdot V\right)}}\right) \]
      4. metadata-evalN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{neg}\left(\ell \cdot V\right)}}\right) \]
      5. metadata-evalN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\sqrt{\mathsf{neg}\left(\ell \cdot V\right)}}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \color{blue}{\frac{\mathsf{neg}\left(-1\right)}{\sqrt{\mathsf{neg}\left(\ell \cdot V\right)}}}\right) \]
      7. metadata-evalN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{neg}\left(\ell \cdot V\right)}}\right) \]
      8. /-rgt-identityN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(\ell \cdot V\right)}{1}}}}\right) \]
      9. metadata-evalN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\frac{\mathsf{neg}\left(\ell \cdot V\right)}{\color{blue}{\mathsf{neg}\left(-1\right)}}}}\right) \]
      10. frac-2negN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\ell \cdot V}{-1}}}}\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell \cdot V}{-1}}}}\right) \]
      12. frac-2negN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(\ell \cdot V\right)}{\mathsf{neg}\left(-1\right)}}}}\right) \]
      13. metadata-evalN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\frac{\mathsf{neg}\left(\ell \cdot V\right)}{\color{blue}{1}}}}\right) \]
      14. /-rgt-identityN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\color{blue}{\mathsf{neg}\left(\ell \cdot V\right)}}}\right) \]
      15. distribute-rgt-neg-inN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot \left(\mathsf{neg}\left(V\right)\right)}}}\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot \left(\mathsf{neg}\left(V\right)\right)}}}\right) \]
      17. neg-lowering-neg.f6485.2

        \[\leadsto c0 \cdot \left(\sqrt{-A} \cdot \frac{1}{\sqrt{\ell \cdot \color{blue}{\left(-V\right)}}}\right) \]
    8. Applied egg-rr85.2%

      \[\leadsto c0 \cdot \left(\sqrt{-A} \cdot \color{blue}{\frac{1}{\sqrt{\ell \cdot \left(-V\right)}}}\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(V\right)\right) \cdot \ell}}}\right) \]
      2. sqrt-prodN/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\color{blue}{\sqrt{\mathsf{neg}\left(V\right)} \cdot \sqrt{\ell}}}\right) \]
      3. pow1/2N/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\mathsf{neg}\left(V\right)} \cdot \color{blue}{{\ell}^{\frac{1}{2}}}}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\color{blue}{\sqrt{\mathsf{neg}\left(V\right)} \cdot {\ell}^{\frac{1}{2}}}}\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\color{blue}{\sqrt{\mathsf{neg}\left(V\right)}} \cdot {\ell}^{\frac{1}{2}}}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\color{blue}{\mathsf{neg}\left(V\right)}} \cdot {\ell}^{\frac{1}{2}}}\right) \]
      7. pow1/2N/A

        \[\leadsto c0 \cdot \left(\sqrt{\mathsf{neg}\left(A\right)} \cdot \frac{1}{\sqrt{\mathsf{neg}\left(V\right)} \cdot \color{blue}{\sqrt{\ell}}}\right) \]
      8. sqrt-lowering-sqrt.f6452.8

        \[\leadsto c0 \cdot \left(\sqrt{-A} \cdot \frac{1}{\sqrt{-V} \cdot \color{blue}{\sqrt{\ell}}}\right) \]
    10. Applied egg-rr52.8%

      \[\leadsto c0 \cdot \left(\sqrt{-A} \cdot \frac{1}{\color{blue}{\sqrt{-V} \cdot \sqrt{\ell}}}\right) \]

    if -1.999999999999994e-310 < A

    1. Initial program 75.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto c0 \cdot \frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      5. *-lowering-*.f6483.4

        \[\leadsto c0 \cdot \frac{\sqrt{A}}{\sqrt{\color{blue}{V \cdot \ell}}} \]
    4. Applied egg-rr83.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 76.0% accurate, 0.5× 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:\\ \;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{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 (/ A (* V l))))
   (if (<= t_0 0.0) (* A (/ c0 (sqrt (* V (* A l))))) (* c0 (sqrt t_0)))))
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 = A * (c0 / sqrt((V * (A * l))));
	} else {
		tmp = c0 * sqrt(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 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = a * (c0 / sqrt((v * (a * l))))
    else
        tmp = c0 * sqrt(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 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = A * (c0 / Math.sqrt((V * (A * l))));
	} else {
		tmp = c0 * Math.sqrt(t_0);
	}
	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 = A * (c0 / math.sqrt((V * (A * l))))
	else:
		tmp = c0 * math.sqrt(t_0)
	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(A * Float64(c0 / sqrt(Float64(V * Float64(A * l)))));
	else
		tmp = Float64(c0 * sqrt(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 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = A * (c0 / sqrt((V * (A * l))));
	else
		tmp = c0 * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(A * N[(c0 / N[Sqrt[N[(V * N[(A * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $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:\\
\;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 A (*.f64 V l)) < 0.0

    1. Initial program 33.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{\ell \cdot V}}} \]
      2. /-rgt-identityN/A

        \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{\frac{\ell}{1}} \cdot V}} \]
      3. associate-/r/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{\frac{\ell}{\frac{1}{V}}}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{\frac{\ell}{\frac{1}{V}}}}} \]
      5. /-lowering-/.f6433.0

        \[\leadsto c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\color{blue}{\frac{1}{V}}}}} \]
    4. Applied egg-rr33.0%

      \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{\frac{\ell}{\frac{1}{V}}}}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{\ell} \cdot \frac{1}{V}}} \]
      2. frac-timesN/A

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot 1}{\ell \cdot V}}} \]
      3. *-commutativeN/A

        \[\leadsto c0 \cdot \sqrt{\frac{A \cdot 1}{\color{blue}{V \cdot \ell}}} \]
      4. associate-*l/N/A

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V \cdot \ell} \cdot 1}} \]
      5. sqrt-prodN/A

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{1}\right)} \]
      6. *-inversesN/A

        \[\leadsto c0 \cdot \left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\color{blue}{\frac{A}{A}}}\right) \]
      7. sqrt-prodN/A

        \[\leadsto c0 \cdot \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot \frac{A}{A}}} \]
      8. times-fracN/A

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot A}{\left(V \cdot \ell\right) \cdot A}}} \]
      9. clear-numN/A

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{\left(V \cdot \ell\right) \cdot A}{A \cdot A}}}} \]
      10. sqrt-divN/A

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\left(V \cdot \ell\right) \cdot A}{A \cdot A}}}} \]
      11. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\left(V \cdot \ell\right) \cdot A}{A \cdot A}}} \]
      12. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{c0 \cdot 1}{\sqrt{\frac{\left(V \cdot \ell\right) \cdot A}{A \cdot A}}}} \]
      13. sqrt-divN/A

        \[\leadsto \frac{c0 \cdot 1}{\color{blue}{\frac{\sqrt{\left(V \cdot \ell\right) \cdot A}}{\sqrt{A \cdot A}}}} \]
      14. associate-*r/N/A

        \[\leadsto \color{blue}{c0 \cdot \frac{1}{\frac{\sqrt{\left(V \cdot \ell\right) \cdot A}}{\sqrt{A \cdot A}}}} \]
      15. clear-numN/A

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A \cdot A}}{\sqrt{\left(V \cdot \ell\right) \cdot A}}} \]
    6. Applied egg-rr54.1%

      \[\leadsto \color{blue}{A \cdot \frac{c0}{\sqrt{V \cdot \left(\ell \cdot A\right)}}} \]

    if 0.0 < (/.f64 A (*.f64 V l))

    1. Initial program 82.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification77.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \leq 0:\\ \;\;\;\;A \cdot \frac{c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 72.8% 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 74.1%

    \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  2. Add Preprocessing
  3. Add Preprocessing

Reproduce

?
herbie shell --seed 2024198 
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  :precision binary64
  (* c0 (sqrt (/ A (* V l)))))