Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.5% → 96.7%
Time: 10.3s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

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

\[\begin{array}{l} \\ c0 \cdot {\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (* c0 (pow (/ (cbrt A) (* (cbrt V) (cbrt l))) 1.5)))
double code(double c0, double A, double V, double l) {
	return c0 * pow((cbrt(A) / (cbrt(V) * cbrt(l))), 1.5);
}
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.pow((Math.cbrt(A) / (Math.cbrt(V) * Math.cbrt(l))), 1.5);
}
function code(c0, A, V, l)
	return Float64(c0 * (Float64(cbrt(A) / Float64(cbrt(V) * cbrt(l))) ^ 1.5))
end
code[c0_, A_, V_, l_] := N[(c0 * N[Power[N[(N[Power[A, 1/3], $MachinePrecision] / N[(N[Power[V, 1/3], $MachinePrecision] * N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
c0 \cdot {\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5}
\end{array}
Derivation
  1. Initial program 68.5%

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

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

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

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

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

      \[\leadsto c0 \cdot {\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{\color{blue}{\left(0.3333333333333333 \cdot 1.5\right)}} \]
    3. pow-pow66.4%

      \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{0.3333333333333333}\right)}^{1.5}} \]
    4. un-div-inv66.4%

      \[\leadsto c0 \cdot {\left({\color{blue}{\left(\frac{\frac{A}{V}}{\ell}\right)}}^{0.3333333333333333}\right)}^{1.5} \]
    5. associate-/r*64.5%

      \[\leadsto c0 \cdot {\left({\color{blue}{\left(\frac{A}{V \cdot \ell}\right)}}^{0.3333333333333333}\right)}^{1.5} \]
    6. pow1/368.0%

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

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

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

    \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt[3]{\frac{\frac{A}{V}}{\ell}}\right)}^{1.5}} \]
  8. Step-by-step derivation
    1. cbrt-div83.7%

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

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

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

      \[\leadsto c0 \cdot {\color{blue}{\left(\frac{\sqrt[3]{A} \cdot 1}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}}^{1.5} \]
  9. Applied egg-rr97.5%

    \[\leadsto c0 \cdot {\color{blue}{\left(\frac{\sqrt[3]{A} \cdot 1}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}}^{1.5} \]
  10. Step-by-step derivation
    1. *-rgt-identity97.5%

      \[\leadsto c0 \cdot {\left(\frac{\color{blue}{\sqrt[3]{A}}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5} \]
  11. Simplified97.5%

    \[\leadsto c0 \cdot {\color{blue}{\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}}^{1.5} \]
  12. Final simplification97.5%

    \[\leadsto c0 \cdot {\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5} \]

Alternative 2: 89.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-290}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq \infty\right):\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) (- INFINITY))
   (/ c0 (* (sqrt (/ V A)) (sqrt l)))
   (if (<= (* V l) -1e-290)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (or (<= (* V l) 5e-316) (not (<= (* V l) INFINITY)))
       (* c0 (pow (/ (cbrt (/ A V)) (cbrt l)) 1.5))
       (/ c0 (/ (sqrt (* V l)) (sqrt A)))))))
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = c0 / (sqrt((V / A)) * sqrt(l));
	} else if ((V * l) <= -1e-290) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if (((V * l) <= 5e-316) || !((V * l) <= ((double) INFINITY))) {
		tmp = c0 * pow((cbrt((A / V)) / cbrt(l)), 1.5);
	} else {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	}
	return tmp;
}
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
	} else if ((V * l) <= -1e-290) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if (((V * l) <= 5e-316) || !((V * l) <= Double.POSITIVE_INFINITY)) {
		tmp = c0 * Math.pow((Math.cbrt((A / V)) / Math.cbrt(l)), 1.5);
	} else {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	}
	return tmp;
}
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l)));
	elseif (Float64(V * l) <= -1e-290)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif ((Float64(V * l) <= 5e-316) || !(Float64(V * l) <= Inf))
		tmp = Float64(c0 * (Float64(cbrt(Float64(A / V)) / cbrt(l)) ^ 1.5));
	else
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	end
	return tmp
end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-290], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 5e-316], N[Not[LessEqual[N[(V * l), $MachinePrecision], Infinity]], $MachinePrecision]], N[(c0 * N[Power[N[(N[Power[N[(A / V), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq \infty\right):\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\

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


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

    1. Initial program 23.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 83.7%

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

        \[\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. *-commutative99.4%

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

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

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

    if -1.0000000000000001e-290 < (*.f64 V l) < 5.000000017e-316 or +inf.0 < (*.f64 V l)

    1. Initial program 24.4%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\sqrt[3]{\color{blue}{\frac{\frac{A}{V}}{\ell}}}\right)}^{1.5} \]
      2. un-div-inv54.8%

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

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

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

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

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{\sqrt[3]{\frac{A}{V}} \cdot 1}{\sqrt[3]{\ell}}\right)}}^{1.5} \]
      2. *-rgt-identity83.8%

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

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

    if 5.000000017e-316 < (*.f64 V l) < +inf.0

    1. Initial program 76.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-290}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq \infty\right):\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \]

Alternative 3: 89.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-290}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316}:\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\ \mathbf{elif}\;V \cdot \ell \leq \infty:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) (- INFINITY))
   (/ c0 (* (sqrt (/ V A)) (sqrt l)))
   (if (<= (* V l) -1e-290)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (<= (* V l) 5e-316)
       (* c0 (pow (/ (cbrt (/ A V)) (cbrt l)) 1.5))
       (if (<= (* V l) INFINITY)
         (/ c0 (/ (sqrt (* V l)) (sqrt A)))
         (* c0 (pow (/ (cbrt (/ A l)) (cbrt V)) 1.5)))))))
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = c0 / (sqrt((V / A)) * sqrt(l));
	} else if ((V * l) <= -1e-290) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 5e-316) {
		tmp = c0 * pow((cbrt((A / V)) / cbrt(l)), 1.5);
	} else if ((V * l) <= ((double) INFINITY)) {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	} else {
		tmp = c0 * pow((cbrt((A / l)) / cbrt(V)), 1.5);
	}
	return tmp;
}
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
	} else if ((V * l) <= -1e-290) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 5e-316) {
		tmp = c0 * Math.pow((Math.cbrt((A / V)) / Math.cbrt(l)), 1.5);
	} else if ((V * l) <= Double.POSITIVE_INFINITY) {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	} else {
		tmp = c0 * Math.pow((Math.cbrt((A / l)) / Math.cbrt(V)), 1.5);
	}
	return tmp;
}
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l)));
	elseif (Float64(V * l) <= -1e-290)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 5e-316)
		tmp = Float64(c0 * (Float64(cbrt(Float64(A / V)) / cbrt(l)) ^ 1.5));
	elseif (Float64(V * l) <= Inf)
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	else
		tmp = Float64(c0 * (Float64(cbrt(Float64(A / l)) / cbrt(V)) ^ 1.5));
	end
	return tmp
end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-290], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-316], N[(c0 * N[Power[N[(N[Power[N[(A / V), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(N[Power[N[(A / l), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[V, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\

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

\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}\\


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

    1. Initial program 23.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 83.7%

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

        \[\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. *-commutative99.4%

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

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

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

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

    1. Initial program 24.4%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\sqrt[3]{\color{blue}{\frac{\frac{A}{V}}{\ell}}}\right)}^{1.5} \]
      2. un-div-inv54.8%

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

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

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

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

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{\sqrt[3]{\frac{A}{V}} \cdot 1}{\sqrt[3]{\ell}}\right)}}^{1.5} \]
      2. *-rgt-identity83.8%

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

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

    if 5.000000017e-316 < (*.f64 V l) < +inf.0

    1. Initial program 76.8%

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

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

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

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

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

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

    if +inf.0 < (*.f64 V l)

    1. Initial program 68.5%

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{0.5}} \]
      2. add-cube-cbrt68.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-290}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316}:\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\ \mathbf{elif}\;V \cdot \ell \leq \infty:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}\\ \end{array} \]

Alternative 4: 83.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\sqrt{\frac{A}{V}} \cdot \left(c0 \cdot {\ell}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) (- INFINITY))
   (/ c0 (* (sqrt (/ V A)) (sqrt l)))
   (if (<= (* V l) -1e-295)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (<= (* V l) 0.0)
       (* (sqrt (/ A V)) (* c0 (pow l -0.5)))
       (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = c0 / (sqrt((V / A)) * sqrt(l));
	} else if ((V * l) <= -1e-295) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = sqrt((A / V)) * (c0 * pow(l, -0.5));
	} else {
		tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
	}
	return tmp;
}
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
	} else if ((V * l) <= -1e-295) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = Math.sqrt((A / V)) * (c0 * Math.pow(l, -0.5));
	} else {
		tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
	}
	return tmp;
}
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l))
	elif (V * l) <= -1e-295:
		tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 0.0:
		tmp = math.sqrt((A / V)) * (c0 * math.pow(l, -0.5))
	else:
		tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l)))
	return tmp
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l)));
	elseif (Float64(V * l) <= -1e-295)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 * (l ^ -0.5)));
	else
		tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l))));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = c0 / (sqrt((V / A)) * sqrt(l));
	elseif ((V * l) <= -1e-295)
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 0.0)
		tmp = sqrt((A / V)) * (c0 * (l ^ -0.5));
	else
		tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-295], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\

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

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

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


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

    1. Initial program 23.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -1.00000000000000006e-295

    1. Initial program 83.9%

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

        \[\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. *-commutative99.4%

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

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

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

    if -1.00000000000000006e-295 < (*.f64 V l) < 0.0

    1. Initial program 20.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. sqrt-div15.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 V l)

    1. Initial program 76.7%

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*76.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\sqrt{\frac{A}{V}} \cdot \left(c0 \cdot {\ell}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\ \end{array} \]

Alternative 5: 74.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+307}\right):\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (or (<= t_0 0.0) (not (<= t_0 5e+307)))
     (* c0 (/ (sqrt (/ A V)) (sqrt l)))
     (* c0 (sqrt t_0)))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	} else {
		tmp = c0 * sqrt(t_0);
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+307))) then
        tmp = c0 * (sqrt((a / v)) / sqrt(l))
    else
        tmp = c0 * sqrt(t_0)
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else {
		tmp = c0 * Math.sqrt(t_0);
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 5e+307):
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	else:
		tmp = c0 * math.sqrt(t_0)
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 5e+307))
		tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	else
		tmp = Float64(c0 * sqrt(t_0));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 5e+307)))
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	else
		tmp = c0 * sqrt(t_0);
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+307]], $MachinePrecision]], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+307}\right):\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\


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

    1. Initial program 27.5%

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

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

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

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

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

    1. Initial program 98.8%

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

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

Alternative 6: 74.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+307}\right):\\ \;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (or (<= t_0 0.0) (not (<= t_0 5e+307)))
     (* (sqrt (/ A V)) (/ c0 (sqrt l)))
     (* c0 (sqrt t_0)))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
		tmp = sqrt((A / V)) * (c0 / sqrt(l));
	} else {
		tmp = c0 * sqrt(t_0);
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+307))) then
        tmp = sqrt((a / v)) * (c0 / sqrt(l))
    else
        tmp = c0 * sqrt(t_0)
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
		tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
	} else {
		tmp = c0 * Math.sqrt(t_0);
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 5e+307):
		tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l))
	else:
		tmp = c0 * math.sqrt(t_0)
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 5e+307))
		tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l)));
	else
		tmp = Float64(c0 * sqrt(t_0));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 5e+307)))
		tmp = sqrt((A / V)) * (c0 / sqrt(l));
	else
		tmp = c0 * sqrt(t_0);
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+307]], $MachinePrecision]], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+307}\right):\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\


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

    1. Initial program 27.5%

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{\color{blue}{\left(0.3333333333333333 \cdot 1.5\right)}} \]
      3. pow-pow44.1%

        \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{0.3333333333333333}\right)}^{1.5}} \]
      4. un-div-inv44.1%

        \[\leadsto c0 \cdot {\left({\color{blue}{\left(\frac{\frac{A}{V}}{\ell}\right)}}^{0.3333333333333333}\right)}^{1.5} \]
      5. associate-/r*27.5%

        \[\leadsto c0 \cdot {\left({\color{blue}{\left(\frac{A}{V \cdot \ell}\right)}}^{0.3333333333333333}\right)}^{1.5} \]
      6. pow1/327.5%

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

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

        \[\leadsto c0 \cdot {\left(\sqrt[3]{\color{blue}{\frac{\frac{A}{V}}{\ell}}}\right)}^{1.5} \]
    7. Simplified45.6%

      \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt[3]{\frac{\frac{A}{V}}{\ell}}\right)}^{1.5}} \]
    8. Step-by-step derivation
      1. cbrt-div77.4%

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

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

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

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

      \[\leadsto c0 \cdot {\color{blue}{\left(\frac{\sqrt[3]{A} \cdot 1}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}}^{1.5} \]
    10. Step-by-step derivation
      1. *-rgt-identity96.5%

        \[\leadsto c0 \cdot {\left(\frac{\color{blue}{\sqrt[3]{A}}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5} \]
    11. Simplified96.5%

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

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

        \[\leadsto c0 \cdot \color{blue}{\sqrt{{\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5} \cdot {\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5}}} \]
      3. pow-prod-up45.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{{\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{\left(1.5 + 1.5\right)}}} \]
      4. cbrt-unprod27.5%

        \[\leadsto c0 \cdot \sqrt{{\left(\frac{\sqrt[3]{A}}{\color{blue}{\sqrt[3]{V \cdot \ell}}}\right)}^{\left(1.5 + 1.5\right)}} \]
      5. cbrt-undiv27.5%

        \[\leadsto c0 \cdot \sqrt{{\color{blue}{\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}}^{\left(1.5 + 1.5\right)}} \]
      6. *-un-lft-identity27.5%

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

        \[\leadsto c0 \cdot \sqrt{{\left(\sqrt[3]{\frac{1 \cdot A}{\color{blue}{\ell \cdot V}}}\right)}^{\left(1.5 + 1.5\right)}} \]
      8. frac-times45.6%

        \[\leadsto c0 \cdot \sqrt{{\left(\sqrt[3]{\color{blue}{\frac{1}{\ell} \cdot \frac{A}{V}}}\right)}^{\left(1.5 + 1.5\right)}} \]
      9. associate-/r/44.9%

        \[\leadsto c0 \cdot \sqrt{{\left(\sqrt[3]{\color{blue}{\frac{1}{\frac{\ell}{\frac{A}{V}}}}}\right)}^{\left(1.5 + 1.5\right)}} \]
      10. metadata-eval44.9%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.8%

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

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

Alternative 7: 74.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+307}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (* (sqrt (/ A V)) (/ c0 (sqrt l)))
     (if (<= t_0 5e+307)
       (* c0 (sqrt t_0))
       (/ c0 (* (sqrt (/ V A)) (sqrt l)))))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt((A / V)) * (c0 / sqrt(l));
	} else if (t_0 <= 5e+307) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 / (sqrt((V / A)) * sqrt(l));
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = sqrt((a / v)) * (c0 / sqrt(l))
    else if (t_0 <= 5d+307) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 / (sqrt((v / a)) * sqrt(l))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
	} else if (t_0 <= 5e+307) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l))
	elif t_0 <= 5e+307:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l))
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l)));
	elseif (t_0 <= 5e+307)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l)));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt((A / V)) * (c0 / sqrt(l));
	elseif (t_0 <= 5e+307)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 / (sqrt((V / A)) * sqrt(l));
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+307], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 31.0%

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{\color{blue}{\left(0.3333333333333333 \cdot 1.5\right)}} \]
      3. pow-pow46.3%

        \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{0.3333333333333333}\right)}^{1.5}} \]
      4. un-div-inv46.3%

        \[\leadsto c0 \cdot {\left({\color{blue}{\left(\frac{\frac{A}{V}}{\ell}\right)}}^{0.3333333333333333}\right)}^{1.5} \]
      5. associate-/r*31.0%

        \[\leadsto c0 \cdot {\left({\color{blue}{\left(\frac{A}{V \cdot \ell}\right)}}^{0.3333333333333333}\right)}^{1.5} \]
      6. pow1/331.0%

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

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

        \[\leadsto c0 \cdot {\left(\sqrt[3]{\color{blue}{\frac{\frac{A}{V}}{\ell}}}\right)}^{1.5} \]
    7. Simplified47.6%

      \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt[3]{\frac{\frac{A}{V}}{\ell}}\right)}^{1.5}} \]
    8. Step-by-step derivation
      1. cbrt-div81.0%

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

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

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

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

      \[\leadsto c0 \cdot {\color{blue}{\left(\frac{\sqrt[3]{A} \cdot 1}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}}^{1.5} \]
    10. Step-by-step derivation
      1. *-rgt-identity94.9%

        \[\leadsto c0 \cdot {\left(\frac{\color{blue}{\sqrt[3]{A}}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5} \]
    11. Simplified94.9%

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

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

        \[\leadsto c0 \cdot \color{blue}{\sqrt{{\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5} \cdot {\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5}}} \]
      3. pow-prod-up47.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{{\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{\left(1.5 + 1.5\right)}}} \]
      4. cbrt-unprod31.0%

        \[\leadsto c0 \cdot \sqrt{{\left(\frac{\sqrt[3]{A}}{\color{blue}{\sqrt[3]{V \cdot \ell}}}\right)}^{\left(1.5 + 1.5\right)}} \]
      5. cbrt-undiv31.0%

        \[\leadsto c0 \cdot \sqrt{{\color{blue}{\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}}^{\left(1.5 + 1.5\right)}} \]
      6. *-un-lft-identity31.0%

        \[\leadsto c0 \cdot \sqrt{{\left(\sqrt[3]{\frac{\color{blue}{1 \cdot A}}{V \cdot \ell}}\right)}^{\left(1.5 + 1.5\right)}} \]
      7. *-commutative31.0%

        \[\leadsto c0 \cdot \sqrt{{\left(\sqrt[3]{\frac{1 \cdot A}{\color{blue}{\ell \cdot V}}}\right)}^{\left(1.5 + 1.5\right)}} \]
      8. frac-times47.6%

        \[\leadsto c0 \cdot \sqrt{{\left(\sqrt[3]{\color{blue}{\frac{1}{\ell} \cdot \frac{A}{V}}}\right)}^{\left(1.5 + 1.5\right)}} \]
      9. associate-/r/46.3%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.8%

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

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

    1. Initial program 22.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. sqrt-div22.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 62.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (if (<= l -2e-310)
   (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))
   (/ c0 (* (sqrt (/ V A)) (sqrt l)))))
double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -2e-310) {
		tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
	} else {
		tmp = c0 / (sqrt((V / A)) * sqrt(l));
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if (l <= (-2d-310)) then
        tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
    else
        tmp = c0 / (sqrt((v / a)) * sqrt(l))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -2e-310) {
		tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
	} else {
		tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
	}
	return tmp;
}
def code(c0, A, V, l):
	tmp = 0
	if l <= -2e-310:
		tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l)))
	else:
		tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l))
	return tmp
function code(c0, A, V, l)
	tmp = 0.0
	if (l <= -2e-310)
		tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l))));
	else
		tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l)));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if (l <= -2e-310)
		tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
	else
		tmp = c0 / (sqrt((V / A)) * sqrt(l));
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := If[LessEqual[l, -2e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < l

    1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 62.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (if (<= l -2e-310)
   (/ c0 (/ (sqrt (* V l)) (sqrt A)))
   (/ c0 (* (sqrt (/ V A)) (sqrt l)))))
double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -2e-310) {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	} else {
		tmp = c0 / (sqrt((V / A)) * sqrt(l));
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if (l <= (-2d-310)) then
        tmp = c0 / (sqrt((v * l)) / sqrt(a))
    else
        tmp = c0 / (sqrt((v / a)) * sqrt(l))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -2e-310) {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	} else {
		tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
	}
	return tmp;
}
def code(c0, A, V, l):
	tmp = 0
	if l <= -2e-310:
		tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A))
	else:
		tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l))
	return tmp
function code(c0, A, V, l)
	tmp = 0.0
	if (l <= -2e-310)
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	else
		tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l)));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if (l <= -2e-310)
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	else
		tmp = c0 / (sqrt((V / A)) * sqrt(l));
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := If[LessEqual[l, -2e-310], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

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

    if -1.999999999999994e-310 < l

    1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 80.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (* c0 (sqrt (/ (/ A V) l)))
     (if (<= t_0 5e+297) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if (t_0 <= 5e+297) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 * pow((V * (l / A)), -0.5);
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = c0 * sqrt(((a / v) / l))
    else if (t_0 <= 5d+297) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 * ((v * (l / a)) ** (-0.5d0))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 5e+297) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 * Math.pow((V * (l / A)), -0.5);
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif t_0 <= 5e+297:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 * math.pow((V * (l / A)), -0.5)
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 5e+297)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * sqrt(((A / V) / l));
	elseif (t_0 <= 5e+297)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 * ((V * (l / A)) ^ -0.5);
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+297], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 31.0%

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*31.0%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
      2. *-lft-identity31.0%

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \]
    6. Taylor expanded in c0 around 0 31.0%

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e297

    1. Initial program 98.8%

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

    if 4.9999999999999998e297 < (/.f64 A (*.f64 V l))

    1. Initial program 24.5%

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*27.2%

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

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity46.0%

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

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

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

Alternative 11: 80.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{c0}{V} \cdot \left(A \cdot \frac{c0}{\ell}\right)}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (sqrt (* (/ c0 V) (* A (/ c0 l))))
     (if (<= t_0 5e+297) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt(((c0 / V) * (A * (c0 / l))));
	} else if (t_0 <= 5e+297) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 * pow((V * (l / A)), -0.5);
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = sqrt(((c0 / v) * (a * (c0 / l))))
    else if (t_0 <= 5d+297) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 * ((v * (l / a)) ** (-0.5d0))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt(((c0 / V) * (A * (c0 / l))));
	} else if (t_0 <= 5e+297) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 * Math.pow((V * (l / A)), -0.5);
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt(((c0 / V) * (A * (c0 / l))))
	elif t_0 <= 5e+297:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 * math.pow((V * (l / A)), -0.5)
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(Float64(c0 / V) * Float64(A * Float64(c0 / l))));
	elseif (t_0 <= 5e+297)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt(((c0 / V) * (A * (c0 / l))));
	elseif (t_0 <= 5e+297)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 * ((V * (l / A)) ^ -0.5);
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(c0 / V), $MachinePrecision] * N[(A * N[(c0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+297], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \left(A \cdot \frac{c0}{\ell}\right)}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 31.0%

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{\color{blue}{\left(0.3333333333333333 \cdot 1.5\right)}} \]
      3. pow-pow46.3%

        \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V} \cdot \frac{1}{\ell}\right)}^{0.3333333333333333}\right)}^{1.5}} \]
      4. un-div-inv46.3%

        \[\leadsto c0 \cdot {\left({\color{blue}{\left(\frac{\frac{A}{V}}{\ell}\right)}}^{0.3333333333333333}\right)}^{1.5} \]
      5. associate-/r*31.0%

        \[\leadsto c0 \cdot {\left({\color{blue}{\left(\frac{A}{V \cdot \ell}\right)}}^{0.3333333333333333}\right)}^{1.5} \]
      6. pow1/331.0%

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

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

        \[\leadsto c0 \cdot {\left(\sqrt[3]{\color{blue}{\frac{\frac{A}{V}}{\ell}}}\right)}^{1.5} \]
    7. Simplified47.6%

      \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt[3]{\frac{\frac{A}{V}}{\ell}}\right)}^{1.5}} \]
    8. Step-by-step derivation
      1. cbrt-div81.0%

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

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

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

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

      \[\leadsto c0 \cdot {\color{blue}{\left(\frac{\sqrt[3]{A} \cdot 1}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}}^{1.5} \]
    10. Step-by-step derivation
      1. *-rgt-identity94.9%

        \[\leadsto c0 \cdot {\left(\frac{\color{blue}{\sqrt[3]{A}}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5} \]
    11. Simplified94.9%

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

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

        \[\leadsto c0 \cdot \color{blue}{\sqrt{{\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5} \cdot {\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{1.5}}} \]
      3. pow-prod-up47.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{{\left(\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \sqrt[3]{\ell}}\right)}^{\left(1.5 + 1.5\right)}}} \]
      4. cbrt-unprod31.0%

        \[\leadsto c0 \cdot \sqrt{{\left(\frac{\sqrt[3]{A}}{\color{blue}{\sqrt[3]{V \cdot \ell}}}\right)}^{\left(1.5 + 1.5\right)}} \]
      5. cbrt-undiv31.0%

        \[\leadsto c0 \cdot \sqrt{{\color{blue}{\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}}^{\left(1.5 + 1.5\right)}} \]
      6. *-un-lft-identity31.0%

        \[\leadsto c0 \cdot \sqrt{{\left(\sqrt[3]{\frac{\color{blue}{1 \cdot A}}{V \cdot \ell}}\right)}^{\left(1.5 + 1.5\right)}} \]
      7. *-commutative31.0%

        \[\leadsto c0 \cdot \sqrt{{\left(\sqrt[3]{\frac{1 \cdot A}{\color{blue}{\ell \cdot V}}}\right)}^{\left(1.5 + 1.5\right)}} \]
      8. frac-times47.6%

        \[\leadsto c0 \cdot \sqrt{{\left(\sqrt[3]{\color{blue}{\frac{1}{\ell} \cdot \frac{A}{V}}}\right)}^{\left(1.5 + 1.5\right)}} \]
      9. associate-/r/46.3%

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e297

    1. Initial program 98.8%

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

    if 4.9999999999999998e297 < (/.f64 A (*.f64 V l))

    1. Initial program 24.5%

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*27.2%

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

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity46.0%

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

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

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

Alternative 12: 79.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+307}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (or (<= t_0 0.0) (not (<= t_0 5e+307)))
     (* c0 (sqrt (/ (/ A V) l)))
     (* c0 (sqrt t_0)))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
		tmp = c0 * sqrt(((A / V) / l));
	} else {
		tmp = c0 * sqrt(t_0);
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+307))) then
        tmp = c0 * sqrt(((a / v) / l))
    else
        tmp = c0 * sqrt(t_0)
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+307)) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else {
		tmp = c0 * Math.sqrt(t_0);
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 5e+307):
		tmp = c0 * math.sqrt(((A / V) / l))
	else:
		tmp = c0 * math.sqrt(t_0)
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 5e+307))
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	else
		tmp = Float64(c0 * sqrt(t_0));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 5e+307)))
		tmp = c0 * sqrt(((A / V) / l));
	else
		tmp = c0 * sqrt(t_0);
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+307]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+307}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\


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

    1. Initial program 27.5%

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*28.7%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
      2. *-lft-identity28.7%

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \]
    6. Taylor expanded in c0 around 0 27.5%

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

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

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

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

    1. Initial program 98.8%

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

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

Alternative 13: 80.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (* c0 (sqrt (/ (/ A V) l)))
     (if (<= t_0 5e+297) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if (t_0 <= 5e+297) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 / sqrt((V * (l / A)));
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = c0 * sqrt(((a / v) / l))
    else if (t_0 <= 5d+297) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 / sqrt((v * (l / a)))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 5e+297) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 / Math.sqrt((V * (l / A)));
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif t_0 <= 5e+297:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 / math.sqrt((V * (l / A)))
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 5e+297)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * sqrt(((A / V) / l));
	elseif (t_0 <= 5e+297)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 / sqrt((V * (l / A)));
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+297], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 31.0%

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*31.0%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
      2. *-lft-identity31.0%

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \]
    6. Taylor expanded in c0 around 0 31.0%

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e297

    1. Initial program 98.8%

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

    if 4.9999999999999998e297 < (/.f64 A (*.f64 V l))

    1. Initial program 24.5%

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*27.2%

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

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity46.0%

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

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt46.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 73.5% 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}
Derivation
  1. Initial program 68.5%

    \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  2. Final simplification68.5%

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

Reproduce

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