Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\]
↓
\[\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\end{array}
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+304}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-281}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+304}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l))))) ↓
;; Ensure these are sorted, for example in Racket, do
(match-define (list V l) (sort (V l) <))
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -5e+304)
t_0
(if (<= (* V l) -4e-314)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-281)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 4e+304) (/ c0 (/ (sqrt (* V l)) (sqrt A))) t_0)))))) double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
↓
// Ensure these are sorted
assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -5e+304) {
tmp = t_0;
} else if ((V * l) <= -4e-314) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-281) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 4e+304) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = 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
code = c0 * sqrt((a / (v * l)))
end function
↓
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-5d+304)) then
tmp = t_0
else if ((v * l) <= (-4d-314)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 2d-281) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 4d+304) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
↓
// Ensure these are sorted
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -5e+304) {
tmp = t_0;
} else if ((V * l) <= -4e-314) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-281) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 4e+304) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = t_0;
}
return tmp;
}
def code(c0, A, V, l):
return c0 * math.sqrt((A / (V * l)))
↓
[V, l] = sort([V, l])
def code(c0, A, V, l):
t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l))
tmp = 0
if (V * l) <= -5e+304:
tmp = t_0
elif (V * l) <= -4e-314:
tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l)))
elif (V * l) <= 2e-281:
tmp = c0 / math.sqrt((l * (V / A)))
elif (V * l) <= 4e+304:
tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A))
else:
tmp = t_0
return tmp
function code(c0, A, V, l)
return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
↓
V, l = sort([V, l])
function code(c0, A, V, l)
t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l)))
tmp = 0.0
if (Float64(V * l) <= -5e+304)
tmp = t_0;
elseif (Float64(V * l) <= -4e-314)
tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
elseif (Float64(V * l) <= 2e-281)
tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A))));
elseif (Float64(V * l) <= 4e+304)
tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
else
tmp = t_0;
end
return tmp
end
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
↓
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -5e+304)
tmp = t_0;
elseif ((V * l) <= -4e-314)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-281)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 4e+304)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = t_0;
end
tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
↓
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+304], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -4e-314], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-281], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+304], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
↓
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\end{array}
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+304}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-281}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+304}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
Alternatives Alternative 1 Accuracy 79.9% Cost 34640
\[\begin{array}{l}
t_0 := \sqrt{\frac{c0}{V} \cdot \left(A \cdot \frac{c0}{\ell}\right)}\\
t_1 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-318}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-186}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{\ell}}{V}\right)}^{-0.5}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Accuracy 81.1% Cost 27724
\[\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-317}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \left(A \cdot \frac{c0}{\ell}\right)}\\
\end{array}
\]
Alternative 3 Accuracy 78.2% Cost 20808
\[\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-186}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{\ell}}{V}\right)}^{-0.5}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{V} \cdot \frac{c0}{\ell}\right)}\\
\end{array}
\]
Alternative 4 Accuracy 86.0% Cost 14288
\[\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+137}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-196}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-281}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+304}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Accuracy 85.7% Cost 14288
\[\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+137}:\\
\;\;\;\;\frac{c0 \cdot t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-196}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-281}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+304}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\end{array}
\]
Alternative 6 Accuracy 80.0% Cost 7890
\[\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+137} \lor \neg \left(V \cdot \ell \leq -2 \cdot 10^{-170} \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{-251}\right) \land V \cdot \ell \leq 2 \cdot 10^{+154}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\end{array}
\]
Alternative 7 Accuracy 80.7% Cost 7688
\[\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\]
Alternative 8 Accuracy 80.7% Cost 7624
\[\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\]
Alternative 9 Accuracy 74.1% Cost 6848
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\]