Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.8% → 92.4%
Time: 13.0s
Alternatives: 15
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 15 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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 92.4% 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{A}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-254}:\\ \;\;\;\;c0\_m \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0\_m \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\sqrt{\ell}}\right)\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+294}:\\ \;\;\;\;c0\_m \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{t\_0}{\ell} \cdot \frac{t\_0}{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))))
   (*
    c0_s
    (if (<= (* V l) -5e-254)
      (* c0_m (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l)))
      (if (<= (* V l) 0.0)
        (* c0_m (* (/ 1.0 (sqrt (/ V A))) (/ 1.0 (sqrt l))))
        (if (<= (* V l) 5e+294)
          (* c0_m (* (pow (* V l) -0.5) (sqrt A)))
          (sqrt (* (/ t_0 l) (/ t_0 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);
	double tmp;
	if ((V * l) <= -5e-254) {
		tmp = c0_m * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
	} else if ((V * l) <= 0.0) {
		tmp = c0_m * ((1.0 / sqrt((V / A))) * (1.0 / sqrt(l)));
	} else if ((V * l) <= 5e+294) {
		tmp = c0_m * (pow((V * l), -0.5) * sqrt(A));
	} else {
		tmp = sqrt(((t_0 / l) * (t_0 / 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)
    if ((v * l) <= (-5d-254)) then
        tmp = c0_m * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
    else if ((v * l) <= 0.0d0) then
        tmp = c0_m * ((1.0d0 / sqrt((v / a))) * (1.0d0 / sqrt(l)))
    else if ((v * l) <= 5d+294) then
        tmp = c0_m * (((v * l) ** (-0.5d0)) * sqrt(a))
    else
        tmp = sqrt(((t_0 / l) * (t_0 / 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);
	double tmp;
	if ((V * l) <= -5e-254) {
		tmp = c0_m * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
	} else if ((V * l) <= 0.0) {
		tmp = c0_m * ((1.0 / Math.sqrt((V / A))) * (1.0 / Math.sqrt(l)));
	} else if ((V * l) <= 5e+294) {
		tmp = c0_m * (Math.pow((V * l), -0.5) * Math.sqrt(A));
	} else {
		tmp = Math.sqrt(((t_0 / l) * (t_0 / 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)
	tmp = 0
	if (V * l) <= -5e-254:
		tmp = c0_m * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l))
	elif (V * l) <= 0.0:
		tmp = c0_m * ((1.0 / math.sqrt((V / A))) * (1.0 / math.sqrt(l)))
	elif (V * l) <= 5e+294:
		tmp = c0_m * (math.pow((V * l), -0.5) * math.sqrt(A))
	else:
		tmp = math.sqrt(((t_0 / l) * (t_0 / 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(A))
	tmp = 0.0
	if (Float64(V * l) <= -5e-254)
		tmp = Float64(c0_m * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l)));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(c0_m * Float64(Float64(1.0 / sqrt(Float64(V / A))) * Float64(1.0 / sqrt(l))));
	elseif (Float64(V * l) <= 5e+294)
		tmp = Float64(c0_m * Float64((Float64(V * l) ^ -0.5) * sqrt(A)));
	else
		tmp = sqrt(Float64(Float64(t_0 / l) * Float64(t_0 / 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);
	tmp = 0.0;
	if ((V * l) <= -5e-254)
		tmp = c0_m * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
	elseif ((V * l) <= 0.0)
		tmp = c0_m * ((1.0 / sqrt((V / A))) * (1.0 / sqrt(l)));
	elseif ((V * l) <= 5e+294)
		tmp = c0_m * (((V * l) ^ -0.5) * sqrt(A));
	else
		tmp = sqrt(((t_0 / l) * (t_0 / 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[A], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e-254], N[(c0$95$m * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(N[(1.0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+294], N[(c0$95$m * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(t$95$0 / l), $MachinePrecision] * N[(t$95$0 / 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{A}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-254}:\\
\;\;\;\;c0\_m \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{t\_0}{\ell} \cdot \frac{t\_0}{V}}\\


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

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 42.5%

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 V l) < 4.9999999999999999e294

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \left(\color{blue}{{\left(V \cdot \ell\right)}^{\left(-0.5\right)}} \cdot \sqrt{A}\right) \]
      8. metadata-eval98.5%

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

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

    if 4.9999999999999999e294 < (*.f64 V l)

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 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 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+192}\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 0.0) (not (<= t_0 5e+192)))
      (* 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 <= 0.0) || !(t_0 <= 5e+192)) {
		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 <= 0.0d0) .or. (.not. (t_0 <= 5d+192))) 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 <= 0.0) || !(t_0 <= 5e+192)) {
		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 <= 0.0) or not (t_0 <= 5e+192):
		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 <= 0.0) || !(t_0 <= 5e+192))
		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 <= 0.0) || ~((t_0 <= 5e+192)))
		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, 0.0], N[Not[LessEqual[t$95$0, 5e+192]], $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 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+192}\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)))) < 0.0 or 5.00000000000000033e192 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 65.8%

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000033e192

    1. Initial program 98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 0 \lor \neg \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 5 \cdot 10^{+192}\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 3: 80.2% 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 0:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+230}:\\ \;\;\;\;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 0.0)
      (* c0_m (sqrt (/ (/ A V) l)))
      (if (<= t_0 5e+230) 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 <= 0.0) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else if (t_0 <= 5e+230) {
		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 <= 0.0d0) then
        tmp = c0_m * sqrt(((a / v) / l))
    else if (t_0 <= 5d+230) 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 <= 0.0) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 5e+230) {
		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 <= 0.0:
		tmp = c0_m * math.sqrt(((A / V) / l))
	elif t_0 <= 5e+230:
		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 <= 0.0)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 5e+230)
		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 <= 0.0)
		tmp = c0_m * sqrt(((A / V) / l));
	elseif (t_0 <= 5e+230)
		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, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+230], 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 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+230}:\\
\;\;\;\;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)))) < 0.0

    1. Initial program 67.4%

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000003e230

    1. Initial program 98.7%

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

    if 5.0000000000000003e230 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+230}:\\
\;\;\;\;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)))) < 0.0

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000003e230

    1. Initial program 98.7%

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

    if 5.0000000000000003e230 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{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)))) < 0.0

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000003e230

    1. Initial program 98.7%

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

    if 5.0000000000000003e230 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 80.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 0:\\ \;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+240}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{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 0.0)
      (/ c0_m (sqrt (* V (/ l A))))
      (if (<= t_0 5e+240) t_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 t_0 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0_m / sqrt((V * (l / A)));
	} else if (t_0 <= 5e+240) {
		tmp = t_0;
	} else {
		tmp = 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) :: t_0
    real(8) :: tmp
    t_0 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 0.0d0) then
        tmp = c0_m / sqrt((v * (l / a)))
    else if (t_0 <= 5d+240) then
        tmp = t_0
    else
        tmp = 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 t_0 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0_m / Math.sqrt((V * (l / A)));
	} else if (t_0 <= 5e+240) {
		tmp = t_0;
	} else {
		tmp = 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):
	t_0 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0_m / math.sqrt((V * (l / A)))
	elif t_0 <= 5e+240:
		tmp = t_0
	else:
		tmp = 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)
	t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A))));
	elseif (t_0 <= 5e+240)
		tmp = t_0;
	else
		tmp = Float64(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)
	t_0 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0_m / sqrt((V * (l / A)));
	elseif (t_0 <= 5e+240)
		tmp = t_0;
	else
		tmp = 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_] := 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, 0.0], N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+240], t$95$0, N[(c0$95$m / N[Sqrt[N[(l / N[(A / 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 0:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{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)))) < 0.0

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000003e240

    1. Initial program 98.7%

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

    if 5.0000000000000003e240 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 42.5%

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 V l) < 4.9999999999999999e294

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \left(\color{blue}{{\left(V \cdot \ell\right)}^{\left(-0.5\right)}} \cdot \sqrt{A}\right) \]
      8. metadata-eval98.5%

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

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

    if 4.9999999999999999e294 < (*.f64 V l)

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{1 \cdot \left(-V\right)}{\frac{1}{\ell} \cdot \left(-A\right)}}}} \]
      5. *-un-lft-identity68.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 91.2% 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 -4 \cdot 10^{+238}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-235}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\frac{\frac{c0\_m}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+294}:\\ \;\;\;\;c0\_m \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \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) -4e+238)
    (* c0_m (/ (sqrt (/ A V)) (sqrt l)))
    (if (<= (* V l) -1e-235)
      (* c0_m (/ (sqrt (- A)) (sqrt (* l (- V)))))
      (if (<= (* V l) 0.0)
        (/ (/ c0_m (sqrt l)) (sqrt (/ V A)))
        (if (<= (* V l) 5e+294)
          (* c0_m (* (pow (* V l) -0.5) (sqrt A)))
          (/ c0_m (sqrt (/ V (/ A 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) {
	double tmp;
	if ((V * l) <= -4e+238) {
		tmp = c0_m * (sqrt((A / V)) / sqrt(l));
	} else if ((V * l) <= -1e-235) {
		tmp = c0_m * (sqrt(-A) / sqrt((l * -V)));
	} else if ((V * l) <= 0.0) {
		tmp = (c0_m / sqrt(l)) / sqrt((V / A));
	} else if ((V * l) <= 5e+294) {
		tmp = c0_m * (pow((V * l), -0.5) * sqrt(A));
	} else {
		tmp = c0_m / sqrt((V / (A / l)));
	}
	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) <= (-4d+238)) then
        tmp = c0_m * (sqrt((a / v)) / sqrt(l))
    else if ((v * l) <= (-1d-235)) then
        tmp = c0_m * (sqrt(-a) / sqrt((l * -v)))
    else if ((v * l) <= 0.0d0) then
        tmp = (c0_m / sqrt(l)) / sqrt((v / a))
    else if ((v * l) <= 5d+294) then
        tmp = c0_m * (((v * l) ** (-0.5d0)) * sqrt(a))
    else
        tmp = c0_m / sqrt((v / (a / l)))
    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) <= -4e+238) {
		tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else if ((V * l) <= -1e-235) {
		tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((l * -V)));
	} else if ((V * l) <= 0.0) {
		tmp = (c0_m / Math.sqrt(l)) / Math.sqrt((V / A));
	} else if ((V * l) <= 5e+294) {
		tmp = c0_m * (Math.pow((V * l), -0.5) * Math.sqrt(A));
	} else {
		tmp = c0_m / Math.sqrt((V / (A / l)));
	}
	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) <= -4e+238:
		tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l))
	elif (V * l) <= -1e-235:
		tmp = c0_m * (math.sqrt(-A) / math.sqrt((l * -V)))
	elif (V * l) <= 0.0:
		tmp = (c0_m / math.sqrt(l)) / math.sqrt((V / A))
	elif (V * l) <= 5e+294:
		tmp = c0_m * (math.pow((V * l), -0.5) * math.sqrt(A))
	else:
		tmp = c0_m / math.sqrt((V / (A / l)))
	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) <= -4e+238)
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	elseif (Float64(V * l) <= -1e-235)
		tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(Float64(c0_m / sqrt(l)) / sqrt(Float64(V / A)));
	elseif (Float64(V * l) <= 5e+294)
		tmp = Float64(c0_m * Float64((Float64(V * l) ^ -0.5) * sqrt(A)));
	else
		tmp = Float64(c0_m / sqrt(Float64(V / Float64(A / l))));
	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) <= -4e+238)
		tmp = c0_m * (sqrt((A / V)) / sqrt(l));
	elseif ((V * l) <= -1e-235)
		tmp = c0_m * (sqrt(-A) / sqrt((l * -V)));
	elseif ((V * l) <= 0.0)
		tmp = (c0_m / sqrt(l)) / sqrt((V / A));
	elseif ((V * l) <= 5e+294)
		tmp = c0_m * (((V * l) ^ -0.5) * sqrt(A));
	else
		tmp = c0_m / sqrt((V / (A / l)));
	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], -4e+238], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-235], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+294], N[(c0$95$m * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(V / N[(A / 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 \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+238}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

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

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

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

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


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

    1. Initial program 58.9%

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

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

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

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

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

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

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

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

    if -4.0000000000000002e238 < (*.f64 V l) < -9.9999999999999996e-236

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

    if -9.9999999999999996e-236 < (*.f64 V l) < 0.0

    1. Initial program 46.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
    9. Step-by-step derivation
      1. add-cbrt-cube31.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{c0}}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}} \]
    12. Simplified40.6%

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

    if 0.0 < (*.f64 V l) < 4.9999999999999999e294

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \left(\color{blue}{{\left(V \cdot \ell\right)}^{\left(-0.5\right)}} \cdot \sqrt{A}\right) \]
      8. metadata-eval98.5%

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

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

    if 4.9999999999999999e294 < (*.f64 V l)

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{1 \cdot \left(-V\right)}{\frac{1}{\ell} \cdot \left(-A\right)}}}} \]
      5. *-un-lft-identity68.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 91.4% 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 -4 \cdot 10^{+238}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-254}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0\_m \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\sqrt{\ell}}\right)\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+294}:\\ \;\;\;\;c0\_m \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \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) -4e+238)
    (* c0_m (/ (sqrt (/ A V)) (sqrt l)))
    (if (<= (* V l) -5e-254)
      (* c0_m (/ (sqrt (- A)) (sqrt (* l (- V)))))
      (if (<= (* V l) 0.0)
        (* c0_m (* (/ 1.0 (sqrt (/ V A))) (/ 1.0 (sqrt l))))
        (if (<= (* V l) 5e+294)
          (* c0_m (* (pow (* V l) -0.5) (sqrt A)))
          (/ c0_m (sqrt (/ V (/ A 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) {
	double tmp;
	if ((V * l) <= -4e+238) {
		tmp = c0_m * (sqrt((A / V)) / sqrt(l));
	} else if ((V * l) <= -5e-254) {
		tmp = c0_m * (sqrt(-A) / sqrt((l * -V)));
	} else if ((V * l) <= 0.0) {
		tmp = c0_m * ((1.0 / sqrt((V / A))) * (1.0 / sqrt(l)));
	} else if ((V * l) <= 5e+294) {
		tmp = c0_m * (pow((V * l), -0.5) * sqrt(A));
	} else {
		tmp = c0_m / sqrt((V / (A / l)));
	}
	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) <= (-4d+238)) then
        tmp = c0_m * (sqrt((a / v)) / sqrt(l))
    else if ((v * l) <= (-5d-254)) then
        tmp = c0_m * (sqrt(-a) / sqrt((l * -v)))
    else if ((v * l) <= 0.0d0) then
        tmp = c0_m * ((1.0d0 / sqrt((v / a))) * (1.0d0 / sqrt(l)))
    else if ((v * l) <= 5d+294) then
        tmp = c0_m * (((v * l) ** (-0.5d0)) * sqrt(a))
    else
        tmp = c0_m / sqrt((v / (a / l)))
    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) <= -4e+238) {
		tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else if ((V * l) <= -5e-254) {
		tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((l * -V)));
	} else if ((V * l) <= 0.0) {
		tmp = c0_m * ((1.0 / Math.sqrt((V / A))) * (1.0 / Math.sqrt(l)));
	} else if ((V * l) <= 5e+294) {
		tmp = c0_m * (Math.pow((V * l), -0.5) * Math.sqrt(A));
	} else {
		tmp = c0_m / Math.sqrt((V / (A / l)));
	}
	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) <= -4e+238:
		tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l))
	elif (V * l) <= -5e-254:
		tmp = c0_m * (math.sqrt(-A) / math.sqrt((l * -V)))
	elif (V * l) <= 0.0:
		tmp = c0_m * ((1.0 / math.sqrt((V / A))) * (1.0 / math.sqrt(l)))
	elif (V * l) <= 5e+294:
		tmp = c0_m * (math.pow((V * l), -0.5) * math.sqrt(A))
	else:
		tmp = c0_m / math.sqrt((V / (A / l)))
	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) <= -4e+238)
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	elseif (Float64(V * l) <= -5e-254)
		tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(c0_m * Float64(Float64(1.0 / sqrt(Float64(V / A))) * Float64(1.0 / sqrt(l))));
	elseif (Float64(V * l) <= 5e+294)
		tmp = Float64(c0_m * Float64((Float64(V * l) ^ -0.5) * sqrt(A)));
	else
		tmp = Float64(c0_m / sqrt(Float64(V / Float64(A / l))));
	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) <= -4e+238)
		tmp = c0_m * (sqrt((A / V)) / sqrt(l));
	elseif ((V * l) <= -5e-254)
		tmp = c0_m * (sqrt(-A) / sqrt((l * -V)));
	elseif ((V * l) <= 0.0)
		tmp = c0_m * ((1.0 / sqrt((V / A))) * (1.0 / sqrt(l)));
	elseif ((V * l) <= 5e+294)
		tmp = c0_m * (((V * l) ^ -0.5) * sqrt(A));
	else
		tmp = c0_m / sqrt((V / (A / l)));
	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], -4e+238], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-254], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(N[(1.0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+294], N[(c0$95$m * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(V / N[(A / 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 \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+238}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

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

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

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

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


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

    1. Initial program 58.9%

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

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

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

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

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

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

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

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

    if -4.0000000000000002e238 < (*.f64 V l) < -5.0000000000000003e-254

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 42.5%

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 V l) < 4.9999999999999999e294

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \left(\color{blue}{{\left(V \cdot \ell\right)}^{\left(-0.5\right)}} \cdot \sqrt{A}\right) \]
      8. metadata-eval98.5%

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

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

    if 4.9999999999999999e294 < (*.f64 V l)

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{1 \cdot \left(-V\right)}{\frac{1}{\ell} \cdot \left(-A\right)}}}} \]
      5. *-un-lft-identity68.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 84.6% 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}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;c0\_m \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\ \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 (<= l -5e-310)
    (* c0_m (* (pow (* V l) -0.5) (sqrt A)))
    (* c0_m (* (sqrt (/ A V)) (sqrt (/ 1.0 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) {
	double tmp;
	if (l <= -5e-310) {
		tmp = c0_m * (pow((V * l), -0.5) * sqrt(A));
	} else {
		tmp = c0_m * (sqrt((A / V)) * sqrt((1.0 / l)));
	}
	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 (l <= (-5d-310)) then
        tmp = c0_m * (((v * l) ** (-0.5d0)) * sqrt(a))
    else
        tmp = c0_m * (sqrt((a / v)) * sqrt((1.0d0 / l)))
    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 (l <= -5e-310) {
		tmp = c0_m * (Math.pow((V * l), -0.5) * Math.sqrt(A));
	} else {
		tmp = c0_m * (Math.sqrt((A / V)) * Math.sqrt((1.0 / l)));
	}
	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 l <= -5e-310:
		tmp = c0_m * (math.pow((V * l), -0.5) * math.sqrt(A))
	else:
		tmp = c0_m * (math.sqrt((A / V)) * math.sqrt((1.0 / l)))
	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 (l <= -5e-310)
		tmp = Float64(c0_m * Float64((Float64(V * l) ^ -0.5) * sqrt(A)));
	else
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) * sqrt(Float64(1.0 / l))));
	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 (l <= -5e-310)
		tmp = c0_m * (((V * l) ^ -0.5) * sqrt(A));
	else
		tmp = c0_m * (sqrt((A / V)) * sqrt((1.0 / l)));
	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[l, -5e-310], N[(c0$95$m * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / 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 \begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0\_m \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\

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


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

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \left(\color{blue}{{\left(V \cdot \ell\right)}^{\left(-0.5\right)}} \cdot \sqrt{A}\right) \]
      8. metadata-eval44.9%

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

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

    if -4.999999999999985e-310 < l

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 84.6% 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}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right)\\ \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 (<= l -5e-310)
    (* c0_m (/ (sqrt A) (sqrt (* V l))))
    (* c0_m (* (sqrt (/ A V)) (pow l -0.5))))))
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 (l <= -5e-310) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0_m * (sqrt((A / V)) * pow(l, -0.5));
	}
	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 (l <= (-5d-310)) then
        tmp = c0_m * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0_m * (sqrt((a / v)) * (l ** (-0.5d0)))
    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 (l <= -5e-310) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0_m * (Math.sqrt((A / V)) * Math.pow(l, -0.5));
	}
	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 l <= -5e-310:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0_m * (math.sqrt((A / V)) * math.pow(l, -0.5))
	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 (l <= -5e-310)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) * (l ^ -0.5)));
	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 (l <= -5e-310)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0_m * (sqrt((A / V)) * (l ^ -0.5));
	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[l, -5e-310], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $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}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

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


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

    1. Initial program 78.3%

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < l

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 84.6% 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}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;c0\_m \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right)\\ \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 (<= l -5e-310)
    (* c0_m (* (pow (* V l) -0.5) (sqrt A)))
    (* c0_m (* (sqrt (/ A V)) (pow l -0.5))))))
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 (l <= -5e-310) {
		tmp = c0_m * (pow((V * l), -0.5) * sqrt(A));
	} else {
		tmp = c0_m * (sqrt((A / V)) * pow(l, -0.5));
	}
	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 (l <= (-5d-310)) then
        tmp = c0_m * (((v * l) ** (-0.5d0)) * sqrt(a))
    else
        tmp = c0_m * (sqrt((a / v)) * (l ** (-0.5d0)))
    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 (l <= -5e-310) {
		tmp = c0_m * (Math.pow((V * l), -0.5) * Math.sqrt(A));
	} else {
		tmp = c0_m * (Math.sqrt((A / V)) * Math.pow(l, -0.5));
	}
	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 l <= -5e-310:
		tmp = c0_m * (math.pow((V * l), -0.5) * math.sqrt(A))
	else:
		tmp = c0_m * (math.sqrt((A / V)) * math.pow(l, -0.5))
	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 (l <= -5e-310)
		tmp = Float64(c0_m * Float64((Float64(V * l) ^ -0.5) * sqrt(A)));
	else
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) * (l ^ -0.5)));
	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 (l <= -5e-310)
		tmp = c0_m * (((V * l) ^ -0.5) * sqrt(A));
	else
		tmp = c0_m * (sqrt((A / V)) * (l ^ -0.5));
	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[l, -5e-310], N[(c0$95$m * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $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}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0\_m \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\

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


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

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \left(\color{blue}{{\left(V \cdot \ell\right)}^{\left(-0.5\right)}} \cdot \sqrt{A}\right) \]
      8. metadata-eval44.9%

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

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

    if -4.999999999999985e-310 < l

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 84.6% 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}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \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 (<= l -5e-310)
    (* c0_m (/ (sqrt A) (sqrt (* V l))))
    (* c0_m (/ (sqrt (/ A V)) (sqrt 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) {
	double tmp;
	if (l <= -5e-310) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0_m * (sqrt((A / V)) / sqrt(l));
	}
	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 (l <= (-5d-310)) then
        tmp = c0_m * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0_m * (sqrt((a / v)) / sqrt(l))
    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 (l <= -5e-310) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
	}
	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 l <= -5e-310:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l))
	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 (l <= -5e-310)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	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 (l <= -5e-310)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0_m * (sqrt((A / V)) / sqrt(l));
	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[l, -5e-310], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $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}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

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


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

    1. Initial program 78.3%

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < l

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

Alternative 14: 82.6% accurate, 0.8× 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 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 10^{+293}\right):\\ \;\;\;\;\sqrt{\frac{A}{V} \cdot \left(c0\_m \cdot \frac{c0\_m}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \sqrt{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 (/ A (* V l))))
   (*
    c0_s
    (if (or (<= t_0 0.0) (not (<= t_0 1e+293)))
      (sqrt (* (/ A V) (* c0_m (/ c0_m l))))
      (* c0_m (sqrt 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 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 1e+293)) {
		tmp = sqrt(((A / V) * (c0_m * (c0_m / l))));
	} else {
		tmp = c0_m * sqrt(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 = a / (v * l)
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+293))) then
        tmp = sqrt(((a / v) * (c0_m * (c0_m / l))))
    else
        tmp = c0_m * sqrt(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 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 1e+293)) {
		tmp = Math.sqrt(((A / V) * (c0_m * (c0_m / l))));
	} else {
		tmp = c0_m * Math.sqrt(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 = A / (V * l)
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 1e+293):
		tmp = math.sqrt(((A / V) * (c0_m * (c0_m / l))))
	else:
		tmp = c0_m * math.sqrt(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(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 1e+293))
		tmp = sqrt(Float64(Float64(A / V) * Float64(c0_m * Float64(c0_m / l))));
	else
		tmp = Float64(c0_m * sqrt(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 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 1e+293)))
		tmp = sqrt(((A / V) * (c0_m * (c0_m / l))));
	else
		tmp = c0_m * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+293]], $MachinePrecision]], N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $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 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 10^{+293}\right):\\
\;\;\;\;\sqrt{\frac{A}{V} \cdot \left(c0\_m \cdot \frac{c0\_m}{\ell}\right)}\\

\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\


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

    1. Initial program 36.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999992e292

    1. Initial program 98.7%

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

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

Alternative 15: 73.8% 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 76.7%

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

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

Reproduce

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