Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.9% → 91.5%
Time: 10.0s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 73.9% 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: 91.5% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\ \;\;\;\;c0\_m \cdot \frac{\frac{\sqrt{-A}}{\sqrt{\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+259}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{c0\_m} \cdot \sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) -5e-302)
    (* c0_m (/ (/ (sqrt (- A)) (sqrt l)) (sqrt (- V))))
    (if (<= (* V l) 0.0)
      (sqrt (* (/ A l) (* c0_m (/ c0_m V))))
      (if (<= (* V l) 2e+259)
        (* c0_m (/ (sqrt A) (sqrt (* V l))))
        (/ 1.0 (* (/ 1.0 c0_m) (sqrt (/ l (/ A V))))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -5e-302) {
		tmp = c0_m * ((sqrt(-A) / sqrt(l)) / sqrt(-V));
	} else if ((V * l) <= 0.0) {
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	} else if ((V * l) <= 2e+259) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-5d-302)) then
        tmp = c0_m * ((sqrt(-a) / sqrt(l)) / sqrt(-v))
    else if ((v * l) <= 0.0d0) then
        tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
    else if ((v * l) <= 2d+259) then
        tmp = c0_m * (sqrt(a) / sqrt((v * l)))
    else
        tmp = 1.0d0 / ((1.0d0 / c0_m) * sqrt((l / (a / v))))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -5e-302) {
		tmp = c0_m * ((Math.sqrt(-A) / Math.sqrt(l)) / Math.sqrt(-V));
	} else if ((V * l) <= 0.0) {
		tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
	} else if ((V * l) <= 2e+259) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = 1.0 / ((1.0 / c0_m) * Math.sqrt((l / (A / V))));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -5e-302:
		tmp = c0_m * ((math.sqrt(-A) / math.sqrt(l)) / math.sqrt(-V))
	elif (V * l) <= 0.0:
		tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V))))
	elif (V * l) <= 2e+259:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = 1.0 / ((1.0 / c0_m) * math.sqrt((l / (A / V))))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -5e-302)
		tmp = Float64(c0_m * Float64(Float64(sqrt(Float64(-A)) / sqrt(l)) / sqrt(Float64(-V))));
	elseif (Float64(V * l) <= 0.0)
		tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V))));
	elseif (Float64(V * l) <= 2e+259)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(1.0 / Float64(Float64(1.0 / c0_m) * sqrt(Float64(l / Float64(A / V)))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -5e-302)
		tmp = c0_m * ((sqrt(-A) / sqrt(l)) / sqrt(-V));
	elseif ((V * l) <= 0.0)
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	elseif ((V * l) <= 2e+259)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e-302], N[(c0$95$m * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+259], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / c0$95$m), $MachinePrecision] * N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\
\;\;\;\;c0\_m \cdot \frac{\frac{\sqrt{-A}}{\sqrt{\ell}}}{\sqrt{-V}}\\

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\

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

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


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

    1. Initial program 80.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \frac{\color{blue}{\frac{\sqrt{-A}}{\sqrt{-\left(-\ell\right)}}}}{\sqrt{-V}} \]
      3. remove-double-neg52.2%

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

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

    if -5.00000000000000033e-302 < (*.f64 V l) < 0.0

    1. Initial program 44.2%

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

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

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

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

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr34.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow234.8%

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 V l) < 2e259

    1. Initial program 86.5%

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

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

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

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

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

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

    if 2e259 < (*.f64 V l)

    1. Initial program 52.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{1}{\ell}}{\frac{V}{A}}}} \]
      5. *-un-lft-identity76.2%

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

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

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

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

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

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

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

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

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

Alternative 2: 81.5% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 10^{-251}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+307}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 1e-251)
      (* c0_m (sqrt (/ (/ 1.0 l) (/ V A))))
      (if (<= t_0 4e+307) t_0 (sqrt (* (/ A l) (* c0_m (/ c0_m V)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 1e-251) {
		tmp = c0_m * sqrt(((1.0 / l) / (V / A)));
	} else if (t_0 <= 4e+307) {
		tmp = t_0;
	} else {
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 1d-251) then
        tmp = c0_m * sqrt(((1.0d0 / l) / (v / a)))
    else if (t_0 <= 4d+307) then
        tmp = t_0
    else
        tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 1e-251) {
		tmp = c0_m * Math.sqrt(((1.0 / l) / (V / A)));
	} else if (t_0 <= 4e+307) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 1e-251:
		tmp = c0_m * math.sqrt(((1.0 / l) / (V / A)))
	elif t_0 <= 4e+307:
		tmp = t_0
	else:
		tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V))))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 1e-251)
		tmp = Float64(c0_m * sqrt(Float64(Float64(1.0 / l) / Float64(V / A))));
	elseif (t_0 <= 4e+307)
		tmp = t_0;
	else
		tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 1e-251)
		tmp = c0_m * sqrt(((1.0 / l) / (V / A)));
	elseif (t_0 <= 4e+307)
		tmp = t_0;
	else
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-251], N[(c0$95$m * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+307], t$95$0, N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-251}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\

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

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


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

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{1}{\ell}}{\frac{V}{A}}}} \]
      5. *-un-lft-identity79.8%

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

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

    if 1.00000000000000002e-251 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999994e307

    1. Initial program 98.6%

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

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

    1. Initial program 49.4%

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

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

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

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

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr49.0%

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

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

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

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

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

        \[\leadsto \sqrt{\frac{A \cdot {c0}^{2}}{\color{blue}{\ell \cdot V}}} \]
      3. times-frac59.0%

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

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

        \[\leadsto \sqrt{\frac{A}{\ell} \cdot \frac{\color{blue}{c0 \cdot c0}}{V}} \]
      2. *-un-lft-identity59.0%

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

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

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

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

Alternative 3: 79.9% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+266}\right):\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (or (<= t_0 2e-273) (not (<= t_0 2e+266)))
      (* c0_m (sqrt (/ (/ A V) l)))
      t_0))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= 2e-273) || !(t_0 <= 2e+266)) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else {
		tmp = t_0;
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0_m * sqrt((a / (v * l)))
    if ((t_0 <= 2d-273) .or. (.not. (t_0 <= 2d+266))) then
        tmp = c0_m * sqrt(((a / v) / l))
    else
        tmp = t_0
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= 2e-273) || !(t_0 <= 2e+266)) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else {
		tmp = t_0;
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if (t_0 <= 2e-273) or not (t_0 <= 2e+266):
		tmp = c0_m * math.sqrt(((A / V) / l))
	else:
		tmp = t_0
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if ((t_0 <= 2e-273) || !(t_0 <= 2e+266))
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	else
		tmp = t_0;
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if ((t_0 <= 2e-273) || ~((t_0 <= 2e+266)))
		tmp = c0_m * sqrt(((A / V) / l));
	else
		tmp = t_0;
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 2e-273], N[Not[LessEqual[t$95$0, 2e+266]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+266}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

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


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

    1. Initial program 69.9%

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

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

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

    if 2e-273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e266

    1. Initial program 99.7%

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

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

Alternative 4: 79.9% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 10^{-251}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+199}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 1e-251)
      (* c0_m (sqrt (/ (/ 1.0 l) (/ V A))))
      (if (<= t_0 5e+199) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 1e-251) {
		tmp = c0_m * sqrt(((1.0 / l) / (V / A)));
	} else if (t_0 <= 5e+199) {
		tmp = t_0;
	} else {
		tmp = c0_m / sqrt((V * (l / A)));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 1d-251) then
        tmp = c0_m * sqrt(((1.0d0 / l) / (v / a)))
    else if (t_0 <= 5d+199) then
        tmp = t_0
    else
        tmp = c0_m / sqrt((v * (l / a)))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 1e-251) {
		tmp = c0_m * Math.sqrt(((1.0 / l) / (V / A)));
	} else if (t_0 <= 5e+199) {
		tmp = t_0;
	} else {
		tmp = c0_m / Math.sqrt((V * (l / A)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 1e-251:
		tmp = c0_m * math.sqrt(((1.0 / l) / (V / A)))
	elif t_0 <= 5e+199:
		tmp = t_0
	else:
		tmp = c0_m / math.sqrt((V * (l / A)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 1e-251)
		tmp = Float64(c0_m * sqrt(Float64(Float64(1.0 / l) / Float64(V / A))));
	elseif (t_0 <= 5e+199)
		tmp = t_0;
	else
		tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 1e-251)
		tmp = c0_m * sqrt(((1.0 / l) / (V / A)));
	elseif (t_0 <= 5e+199)
		tmp = t_0;
	else
		tmp = c0_m / sqrt((V * (l / A)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-251], N[(c0$95$m * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+199], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-251}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+199}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{1}{\ell}}{\frac{V}{A}}}} \]
      5. *-un-lft-identity79.8%

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

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

    if 1.00000000000000002e-251 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e199

    1. Initial program 99.7%

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

    if 4.9999999999999998e199 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 59.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      9. sqrt-div23.0%

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

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

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

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

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

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

Alternative 5: 80.0% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+199}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 2e-273)
      (* c0_m (sqrt (/ (/ A V) l)))
      (if (<= t_0 5e+199) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 2e-273) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else if (t_0 <= 5e+199) {
		tmp = t_0;
	} else {
		tmp = c0_m / sqrt((V * (l / A)));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 2d-273) then
        tmp = c0_m * sqrt(((a / v) / l))
    else if (t_0 <= 5d+199) then
        tmp = t_0
    else
        tmp = c0_m / sqrt((v * (l / a)))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 2e-273) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 5e+199) {
		tmp = t_0;
	} else {
		tmp = c0_m / Math.sqrt((V * (l / A)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 2e-273:
		tmp = c0_m * math.sqrt(((A / V) / l))
	elif t_0 <= 5e+199:
		tmp = t_0
	else:
		tmp = c0_m / math.sqrt((V * (l / A)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 2e-273)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 5e+199)
		tmp = t_0;
	else
		tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 2e-273)
		tmp = c0_m * sqrt(((A / V) / l));
	elseif (t_0 <= 5e+199)
		tmp = t_0;
	else
		tmp = c0_m / sqrt((V * (l / A)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-273], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+199], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+199}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 73.5%

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

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

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

    if 2e-273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e199

    1. Initial program 99.7%

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

    if 4.9999999999999998e199 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 59.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      9. sqrt-div23.0%

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

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

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

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

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

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

Alternative 6: 79.3% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 10^{+182}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 2e-273)
      (* c0_m (sqrt (/ (/ A V) l)))
      (if (<= t_0 1e+182) t_0 (* c0_m (sqrt (/ (/ A l) V))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 2e-273) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else if (t_0 <= 1e+182) {
		tmp = t_0;
	} else {
		tmp = c0_m * sqrt(((A / l) / V));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 2d-273) then
        tmp = c0_m * sqrt(((a / v) / l))
    else if (t_0 <= 1d+182) then
        tmp = t_0
    else
        tmp = c0_m * sqrt(((a / l) / v))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 2e-273) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 1e+182) {
		tmp = t_0;
	} else {
		tmp = c0_m * Math.sqrt(((A / l) / V));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 2e-273:
		tmp = c0_m * math.sqrt(((A / V) / l))
	elif t_0 <= 1e+182:
		tmp = t_0
	else:
		tmp = c0_m * math.sqrt(((A / l) / V))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 2e-273)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 1e+182)
		tmp = t_0;
	else
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V)));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 2e-273)
		tmp = c0_m * sqrt(((A / V) / l));
	elseif (t_0 <= 1e+182)
		tmp = t_0;
	else
		tmp = c0_m * sqrt(((A / l) / V));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-273], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+182], t$95$0, N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 10^{+182}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 73.5%

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

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

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

    if 2e-273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e182

    1. Initial program 99.6%

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

    if 1.0000000000000001e182 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 63.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around 0 63.1%

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

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

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

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

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

Alternative 7: 90.9% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+259}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{c0\_m} \cdot \sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) (- INFINITY))
    (* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
    (if (<= (* V l) -5e-302)
      (* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
      (if (<= (* V l) 0.0)
        (sqrt (* (/ A l) (* c0_m (/ c0_m V))))
        (if (<= (* V l) 2e+259)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (/ 1.0 (* (/ 1.0 c0_m) (sqrt (/ l (/ A V)))))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	} else if ((V * l) <= -5e-302) {
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	} else if ((V * l) <= 2e+259) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
	}
	return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
	} else if ((V * l) <= -5e-302) {
		tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
	} else if ((V * l) <= 2e+259) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = 1.0 / ((1.0 / c0_m) * Math.sqrt((l / (A / V))));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V))
	elif (V * l) <= -5e-302:
		tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 0.0:
		tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V))))
	elif (V * l) <= 2e+259:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = 1.0 / ((1.0 / c0_m) * math.sqrt((l / (A / V))))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V))));
	elseif (Float64(V * l) <= -5e-302)
		tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V))));
	elseif (Float64(V * l) <= 2e+259)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(1.0 / Float64(Float64(1.0 / c0_m) * sqrt(Float64(l / Float64(A / V)))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	elseif ((V * l) <= -5e-302)
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 0.0)
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	elseif ((V * l) <= 2e+259)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-302], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+259], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / c0$95$m), $MachinePrecision] * N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\

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

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


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

    1. Initial program 45.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -5.00000000000000033e-302

    1. Initial program 89.7%

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

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

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

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

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

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

    if -5.00000000000000033e-302 < (*.f64 V l) < 0.0

    1. Initial program 44.2%

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

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

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

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

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr34.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow234.8%

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 V l) < 2e259

    1. Initial program 86.5%

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

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

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

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

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

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

    if 2e259 < (*.f64 V l)

    1. Initial program 52.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{1}{\ell}}{\frac{V}{A}}}} \]
      5. *-un-lft-identity76.2%

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

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

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

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

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

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

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

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

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

Alternative 8: 90.8% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0\_m \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+259}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{c0\_m} \cdot \sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) (- INFINITY))
    (/ (* c0_m (sqrt (/ A V))) (sqrt l))
    (if (<= (* V l) -5e-302)
      (* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
      (if (<= (* V l) 0.0)
        (sqrt (* (/ A l) (* c0_m (/ c0_m V))))
        (if (<= (* V l) 2e+259)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (/ 1.0 (* (/ 1.0 c0_m) (sqrt (/ l (/ A V)))))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (c0_m * sqrt((A / V))) / sqrt(l);
	} else if ((V * l) <= -5e-302) {
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	} else if ((V * l) <= 2e+259) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
	}
	return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (c0_m * Math.sqrt((A / V))) / Math.sqrt(l);
	} else if ((V * l) <= -5e-302) {
		tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
	} else if ((V * l) <= 2e+259) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = 1.0 / ((1.0 / c0_m) * Math.sqrt((l / (A / V))));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (c0_m * math.sqrt((A / V))) / math.sqrt(l)
	elif (V * l) <= -5e-302:
		tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 0.0:
		tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V))))
	elif (V * l) <= 2e+259:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = 1.0 / ((1.0 / c0_m) * math.sqrt((l / (A / V))))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(c0_m * sqrt(Float64(A / V))) / sqrt(l));
	elseif (Float64(V * l) <= -5e-302)
		tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V))));
	elseif (Float64(V * l) <= 2e+259)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(1.0 / Float64(Float64(1.0 / c0_m) * sqrt(Float64(l / Float64(A / V)))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (c0_m * sqrt((A / V))) / sqrt(l);
	elseif ((V * l) <= -5e-302)
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 0.0)
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	elseif ((V * l) <= 2e+259)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-302], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+259], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / c0$95$m), $MachinePrecision] * N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\

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

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


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

    1. Initial program 45.5%

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -5.00000000000000033e-302

    1. Initial program 89.7%

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

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

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

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

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

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

    if -5.00000000000000033e-302 < (*.f64 V l) < 0.0

    1. Initial program 44.2%

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

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

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

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

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr34.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow234.8%

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 V l) < 2e259

    1. Initial program 86.5%

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

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

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

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

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

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

    if 2e259 < (*.f64 V l)

    1. Initial program 52.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{1}{\ell}}{\frac{V}{A}}}} \]
      5. *-un-lft-identity76.2%

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

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

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

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

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

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

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

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

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

Alternative 9: 84.5% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+285}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-290}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+259}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{c0\_m} \cdot \sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) -2e+285)
    (* c0_m (sqrt (/ (/ A V) l)))
    (if (<= (* V l) -1e-290)
      (* c0_m (sqrt (/ A (* V l))))
      (if (<= (* V l) 0.0)
        (sqrt (* (/ A l) (* c0_m (/ c0_m V))))
        (if (<= (* V l) 2e+259)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (/ 1.0 (* (/ 1.0 c0_m) (sqrt (/ l (/ A V)))))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -2e+285) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else if ((V * l) <= -1e-290) {
		tmp = c0_m * sqrt((A / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	} else if ((V * l) <= 2e+259) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-2d+285)) then
        tmp = c0_m * sqrt(((a / v) / l))
    else if ((v * l) <= (-1d-290)) then
        tmp = c0_m * sqrt((a / (v * l)))
    else if ((v * l) <= 0.0d0) then
        tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
    else if ((v * l) <= 2d+259) then
        tmp = c0_m * (sqrt(a) / sqrt((v * l)))
    else
        tmp = 1.0d0 / ((1.0d0 / c0_m) * sqrt((l / (a / v))))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -2e+285) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else if ((V * l) <= -1e-290) {
		tmp = c0_m * Math.sqrt((A / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
	} else if ((V * l) <= 2e+259) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = 1.0 / ((1.0 / c0_m) * Math.sqrt((l / (A / V))));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -2e+285:
		tmp = c0_m * math.sqrt(((A / V) / l))
	elif (V * l) <= -1e-290:
		tmp = c0_m * math.sqrt((A / (V * l)))
	elif (V * l) <= 0.0:
		tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V))))
	elif (V * l) <= 2e+259:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = 1.0 / ((1.0 / c0_m) * math.sqrt((l / (A / V))))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -2e+285)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	elseif (Float64(V * l) <= -1e-290)
		tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l))));
	elseif (Float64(V * l) <= 0.0)
		tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V))));
	elseif (Float64(V * l) <= 2e+259)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(1.0 / Float64(Float64(1.0 / c0_m) * sqrt(Float64(l / Float64(A / V)))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -2e+285)
		tmp = c0_m * sqrt(((A / V) / l));
	elseif ((V * l) <= -1e-290)
		tmp = c0_m * sqrt((A / (V * l)));
	elseif ((V * l) <= 0.0)
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	elseif ((V * l) <= 2e+259)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -2e+285], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-290], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+259], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / c0$95$m), $MachinePrecision] * N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+285}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\

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

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


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

    1. Initial program 53.5%

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

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

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

    if -2e285 < (*.f64 V l) < -1.0000000000000001e-290

    1. Initial program 90.4%

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

    if -1.0000000000000001e-290 < (*.f64 V l) < 0.0

    1. Initial program 42.7%

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

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

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative33.8%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow233.4%

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 V l) < 2e259

    1. Initial program 86.5%

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

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

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

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

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

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

    if 2e259 < (*.f64 V l)

    1. Initial program 52.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{1}{\ell}}{\frac{V}{A}}}} \]
      5. *-un-lft-identity76.2%

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

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

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

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

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

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

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

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

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

Alternative 10: 85.3% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+259}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{c0\_m} \cdot \sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) -5e-302)
    (* c0_m (/ (sqrt (/ A V)) (sqrt l)))
    (if (<= (* V l) 0.0)
      (sqrt (* (/ A l) (* c0_m (/ c0_m V))))
      (if (<= (* V l) 2e+259)
        (* c0_m (/ (sqrt A) (sqrt (* V l))))
        (/ 1.0 (* (/ 1.0 c0_m) (sqrt (/ l (/ A V))))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -5e-302) {
		tmp = c0_m * (sqrt((A / V)) / sqrt(l));
	} else if ((V * l) <= 0.0) {
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	} else if ((V * l) <= 2e+259) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-5d-302)) then
        tmp = c0_m * (sqrt((a / v)) / sqrt(l))
    else if ((v * l) <= 0.0d0) then
        tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
    else if ((v * l) <= 2d+259) then
        tmp = c0_m * (sqrt(a) / sqrt((v * l)))
    else
        tmp = 1.0d0 / ((1.0d0 / c0_m) * sqrt((l / (a / v))))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -5e-302) {
		tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else if ((V * l) <= 0.0) {
		tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
	} else if ((V * l) <= 2e+259) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = 1.0 / ((1.0 / c0_m) * Math.sqrt((l / (A / V))));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -5e-302:
		tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l))
	elif (V * l) <= 0.0:
		tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V))))
	elif (V * l) <= 2e+259:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = 1.0 / ((1.0 / c0_m) * math.sqrt((l / (A / V))))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -5e-302)
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	elseif (Float64(V * l) <= 0.0)
		tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V))));
	elseif (Float64(V * l) <= 2e+259)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(1.0 / Float64(Float64(1.0 / c0_m) * sqrt(Float64(l / Float64(A / V)))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -5e-302)
		tmp = c0_m * (sqrt((A / V)) / sqrt(l));
	elseif ((V * l) <= 0.0)
		tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
	elseif ((V * l) <= 2e+259)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e-302], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+259], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / c0$95$m), $MachinePrecision] * N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\

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

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


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

    1. Initial program 80.8%

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

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

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

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

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

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

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

    if -5.00000000000000033e-302 < (*.f64 V l) < 0.0

    1. Initial program 44.2%

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

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

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

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

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr34.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow234.8%

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 V l) < 2e259

    1. Initial program 86.5%

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

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

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

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

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

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

    if 2e259 < (*.f64 V l)

    1. Initial program 52.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{1}{\ell}}{\frac{V}{A}}}} \]
      5. *-un-lft-identity76.2%

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

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

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

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

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

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

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

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

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

Alternative 11: 73.9% accurate, 1.0× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (* c0_s (* c0_m (sqrt (/ A (* V l))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	return c0_s * (c0_m * sqrt((A / (V * l))));
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    code = c0_s * (c0_m * sqrt((a / (v * l))))
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	return c0_s * (c0_m * Math.sqrt((A / (V * l))));
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	return c0_s * (c0_m * math.sqrt((A / (V * l))))
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	return Float64(c0_s * Float64(c0_m * sqrt(Float64(A / Float64(V * l)))))
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp = code(c0_s, c0_m, A, V, l)
	tmp = c0_s * (c0_m * sqrt((A / (V * l))));
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)
\end{array}
Derivation
  1. Initial program 77.0%

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

Reproduce

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