
(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:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ 1.0 (/ (sqrt (- V)) (sqrt (/ (- A) l)))))
(if (<= (* V l) -5e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-317)
(* c0 (* (pow (/ (- l) A) -0.5) (pow (/ -1.0 V) 0.5)))
(* c0 (* (sqrt A) (pow (* V l) -0.5)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (1.0 / (sqrt(-V) / sqrt((-A / l))));
} else if ((V * l) <= -5e-306) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-317) {
tmp = c0 * (pow((-l / A), -0.5) * pow((-1.0 / V), 0.5));
} else {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (1.0 / (Math.sqrt(-V) / Math.sqrt((-A / l))));
} else if ((V * l) <= -5e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-317) {
tmp = c0 * (Math.pow((-l / A), -0.5) * Math.pow((-1.0 / V), 0.5));
} else {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (1.0 / (math.sqrt(-V) / math.sqrt((-A / l)))) elif (V * l) <= -5e-306: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-317: tmp = c0 * (math.pow((-l / A), -0.5) * math.pow((-1.0 / V), 0.5)) else: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(Float64(-A) / l))))); elseif (Float64(V * l) <= -5e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-317) tmp = Float64(c0 * Float64((Float64(Float64(-l) / A) ^ -0.5) * (Float64(-1.0 / V) ^ 0.5))); else tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (1.0 / (sqrt(-V) / sqrt((-A / l))));
elseif ((V * l) <= -5e-306)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-317)
tmp = c0 * (((-l / A) ^ -0.5) * ((-1.0 / V) ^ 0.5));
else
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(1.0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-317], N[(c0 * N[(N[Power[N[((-l) / A), $MachinePrecision], -0.5], $MachinePrecision] * N[Power[N[(-1.0 / V), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{1}{\frac{\sqrt{-V}}{\sqrt{\frac{-A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-317}:\\
\;\;\;\;c0 \cdot \left({\left(\frac{-\ell}{A}\right)}^{-0.5} \cdot {\left(\frac{-1}{V}\right)}^{0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 16.6%
clear-num16.6%
sqrt-div16.6%
metadata-eval16.6%
associate-/l*50.2%
Applied egg-rr50.2%
associate-/l*16.6%
Simplified16.6%
associate-/l*50.2%
frac-2neg50.2%
sqrt-div51.9%
Applied egg-rr51.9%
distribute-neg-frac51.9%
Simplified51.9%
if -inf.0 < (*.f64 V l) < -4.99999999999999998e-306Initial program 84.8%
frac-2neg84.8%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -4.99999999999999998e-306 < (*.f64 V l) < 1.00000023e-317Initial program 38.2%
pow1/238.2%
clear-num38.2%
inv-pow38.2%
pow-pow38.2%
associate-/l*54.5%
metadata-eval54.5%
Applied egg-rr54.5%
associate-/l*38.2%
Simplified38.2%
Taylor expanded in V around -inf 34.1%
distribute-lft-in34.1%
exp-sum34.3%
*-commutative34.3%
associate-*r/34.3%
associate-/l*34.3%
metadata-eval34.3%
associate-/r*34.3%
neg-mul-134.3%
exp-to-pow34.3%
neg-mul-134.3%
associate-/r*34.3%
metadata-eval34.3%
associate-/l*34.3%
neg-mul-134.3%
*-commutative34.3%
*-commutative34.3%
associate-*l*34.3%
Simplified36.0%
if 1.00000023e-317 < (*.f64 V l) Initial program 80.5%
div-inv80.5%
sqrt-prod91.6%
pow1/291.6%
inv-pow91.6%
pow-pow92.2%
metadata-eval92.2%
Applied egg-rr92.2%
Final simplification85.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))) (t_1 (/ c0 (sqrt (/ (* V l) A)))))
(if (<= t_0 -4e-319)
t_1
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+289) t_1 (sqrt (/ (* c0 A) (* l (/ V c0)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double t_1 = c0 / sqrt(((V * l) / A));
double tmp;
if (t_0 <= -4e-319) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+289) {
tmp = t_1;
} else {
tmp = sqrt(((c0 * A) / (l * (V / c0))));
}
return tmp;
}
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) :: t_1
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
t_1 = c0 / sqrt(((v * l) / a))
if (t_0 <= (-4d-319)) then
tmp = t_1
else if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+289) then
tmp = t_1
else
tmp = sqrt(((c0 * a) / (l * (v / c0))))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double t_1 = c0 / Math.sqrt(((V * l) / A));
double tmp;
if (t_0 <= -4e-319) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+289) {
tmp = t_1;
} else {
tmp = Math.sqrt(((c0 * A) / (l * (V / c0))));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) t_1 = c0 / math.sqrt(((V * l) / A)) tmp = 0 if t_0 <= -4e-319: tmp = t_1 elif t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+289: tmp = t_1 else: tmp = math.sqrt(((c0 * A) / (l * (V / c0)))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) t_1 = Float64(c0 / sqrt(Float64(Float64(V * l) / A))) tmp = 0.0 if (t_0 <= -4e-319) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+289) tmp = t_1; else tmp = sqrt(Float64(Float64(c0 * A) / Float64(l * Float64(V / c0)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
t_1 = c0 / sqrt(((V * l) / A));
tmp = 0.0;
if (t_0 <= -4e-319)
tmp = t_1;
elseif (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+289)
tmp = t_1;
else
tmp = sqrt(((c0 * A) / (l * (V / c0))));
end
tmp_2 = tmp;
end
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[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-319], t$95$1, 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+289], t$95$1, N[Sqrt[N[(N[(c0 * A), $MachinePrecision] / N[(l * N[(V / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
t_1 := \frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{if}\;t_0 \leq -4 \cdot 10^{-319}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{c0 \cdot A}{\ell \cdot \frac{V}{c0}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -4.0000049e-319 or -0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000031e289Initial program 90.8%
pow1/290.8%
clear-num90.7%
inv-pow90.7%
pow-pow91.6%
associate-/l*78.4%
metadata-eval78.4%
Applied egg-rr78.4%
associate-/l*91.6%
Simplified91.6%
sqr-pow91.2%
sqr-pow91.6%
metadata-eval91.6%
sqrt-pow291.5%
inv-pow91.5%
un-div-inv91.7%
div-inv91.6%
associate-*l*77.3%
div-inv77.3%
Applied egg-rr77.3%
Taylor expanded in V around 0 91.7%
if -4.0000049e-319 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -0.0Initial program 38.5%
add-sqr-sqrt38.5%
pow238.5%
pow1/238.5%
sqrt-pow138.5%
metadata-eval38.5%
Applied egg-rr38.5%
Taylor expanded in c0 around 0 38.5%
associate-/r*53.7%
Simplified53.7%
if 5.00000000000000031e289 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 41.1%
add-sqr-sqrt41.1%
pow241.1%
pow1/241.1%
sqrt-pow141.1%
metadata-eval41.1%
Applied egg-rr41.1%
pow-pow41.1%
metadata-eval41.1%
pow1/241.1%
clear-num41.1%
associate-*r/51.0%
sqrt-div51.0%
metadata-eval51.0%
div-inv51.0%
add-sqr-sqrt51.0%
sqrt-unprod51.0%
frac-times50.5%
add-sqr-sqrt50.5%
Applied egg-rr50.5%
times-frac64.4%
associate-/r/77.6%
associate-*l*67.7%
*-commutative67.7%
associate-*l/64.3%
associate-/l*67.7%
associate-*r/72.7%
associate-/r/72.6%
*-commutative72.6%
Simplified72.6%
Final simplification80.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ 1.0 (/ (sqrt (- V)) (sqrt (/ (- A) l)))))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -5e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-317) t_0 (* c0 (* (sqrt A) (pow (* V l) -0.5))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (1.0 / (sqrt(-V) / sqrt((-A / l))));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -5e-306) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-317) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (1.0 / (Math.sqrt(-V) / Math.sqrt((-A / l))));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -5e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-317) {
tmp = t_0;
} else {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (1.0 / (math.sqrt(-V) / math.sqrt((-A / l)))) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -5e-306: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-317: tmp = t_0 else: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(1.0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(Float64(-A) / l))))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -5e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-317) tmp = t_0; else tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (1.0 / (sqrt(-V) / sqrt((-A / l))));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -5e-306)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-317)
tmp = t_0;
else
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
end
tmp_2 = tmp;
end
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[(1.0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-317], t$95$0, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{1}{\frac{\sqrt{-V}}{\sqrt{\frac{-A}{\ell}}}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-317}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -4.99999999999999998e-306 < (*.f64 V l) < 1.00000023e-317Initial program 27.8%
clear-num27.8%
sqrt-div27.8%
metadata-eval27.8%
associate-/l*52.4%
Applied egg-rr52.4%
associate-/l*27.8%
Simplified27.8%
associate-/l*52.4%
frac-2neg52.4%
sqrt-div43.6%
Applied egg-rr43.6%
distribute-neg-frac43.6%
Simplified43.6%
if -inf.0 < (*.f64 V l) < -4.99999999999999998e-306Initial program 84.8%
frac-2neg84.8%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if 1.00000023e-317 < (*.f64 V l) Initial program 80.5%
div-inv80.5%
sqrt-prod91.6%
pow1/291.6%
inv-pow91.6%
pow-pow92.2%
metadata-eval92.2%
Applied egg-rr92.2%
Final simplification85.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (pow (* V (/ -1.0 (/ (- A) l))) -0.5))
(* c0 (* (sqrt A) (pow (* V l) -0.5)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-306) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * pow((V * (-1.0 / (-A / l))), -0.5);
} else {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * Math.pow((V * (-1.0 / (-A / l))), -0.5);
} else {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-306: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * math.pow((V * (-1.0 / (-A / l))), -0.5) else: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * (Float64(V * Float64(-1.0 / Float64(Float64(-A) / l))) ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-306)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * ((V * (-1.0 / (-A / l))) ^ -0.5);
else
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-306], 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[(c0 * N[Power[N[(V * N[(-1.0 / N[((-A) / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{-1}{\frac{-A}{\ell}}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 16.6%
associate-/r*50.4%
sqrt-div52.2%
Applied egg-rr52.2%
if -inf.0 < (*.f64 V l) < -4.99999999999999998e-306Initial program 84.8%
frac-2neg84.8%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -4.99999999999999998e-306 < (*.f64 V l) < -0.0Initial program 39.6%
pow1/239.6%
clear-num39.6%
inv-pow39.6%
pow-pow39.6%
associate-/l*56.6%
metadata-eval56.6%
Applied egg-rr56.6%
associate-/l*39.6%
Simplified39.6%
associate-/l*56.6%
frac-2neg56.6%
div-inv56.7%
Applied egg-rr56.7%
if -0.0 < (*.f64 V l) Initial program 79.8%
div-inv79.8%
sqrt-prod90.8%
pow1/290.8%
inv-pow90.8%
pow-pow91.9%
metadata-eval91.9%
Applied egg-rr91.9%
Final simplification88.0%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (* (sqrt A) (pow (* V l) -0.5)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
}
return tmp;
}
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) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 68.3%
associate-/r*71.5%
sqrt-div40.0%
Applied egg-rr40.0%
if -4.999999999999985e-310 < A Initial program 76.6%
div-inv76.6%
sqrt-prod86.4%
pow1/286.4%
inv-pow86.4%
pow-pow87.4%
metadata-eval87.4%
Applied egg-rr87.4%
Final simplification62.8%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (* c0 (sqrt (/ A (* V l)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * sqrt((A / (V * l)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
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) :: tmp
if (l <= (-5d-310)) then
tmp = c0 * sqrt((a / (v * l)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * math.sqrt((A / (V * l))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 * sqrt((A / (V * l)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -5e-310], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 73.3%
if -4.999999999999985e-310 < l Initial program 71.2%
associate-/r*74.4%
sqrt-div87.0%
Applied egg-rr87.0%
Final simplification79.7%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* (sqrt A) (/ c0 (sqrt (* V l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
}
return tmp;
}
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) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = sqrt(a) * (c0 / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = sqrt(A) * (c0 / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 68.3%
associate-/r*71.5%
sqrt-div40.0%
Applied egg-rr40.0%
if -4.999999999999985e-310 < A Initial program 76.6%
sqrt-div87.3%
associate-*r/83.6%
Applied egg-rr83.6%
associate-*l/83.6%
Simplified83.6%
Final simplification61.0%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
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) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 68.3%
associate-/r*71.5%
sqrt-div40.0%
Applied egg-rr40.0%
if -4.999999999999985e-310 < A Initial program 76.6%
sqrt-div87.3%
associate-*r/83.6%
Applied egg-rr83.6%
*-commutative83.6%
associate-*l/87.3%
Simplified87.3%
Final simplification62.7%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+297) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = 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;
}
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 = 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
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = 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;
}
[V, l] = sort([V, l]) 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
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(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
V, l = num2cell(sort([V, l])){:}
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
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(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}
[V, l] = \mathsf{sort}([V, 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}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.0%
add-sqr-sqrt32.0%
pow232.0%
pow1/232.0%
sqrt-pow132.0%
metadata-eval32.0%
Applied egg-rr32.0%
Taylor expanded in c0 around 0 32.0%
associate-/r*48.8%
Simplified48.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e297Initial program 98.9%
if 4.9999999999999998e297 < (/.f64 A (*.f64 V l)) Initial program 32.5%
pow1/232.5%
clear-num32.5%
inv-pow32.5%
pow-pow35.3%
associate-/l*41.7%
metadata-eval41.7%
Applied egg-rr41.7%
associate-/l*35.3%
Simplified35.3%
sqr-pow35.3%
sqr-pow35.3%
metadata-eval35.3%
sqrt-pow235.3%
inv-pow35.3%
un-div-inv35.3%
div-inv35.3%
associate-*l*41.7%
div-inv41.7%
Applied egg-rr41.7%
Final simplification77.7%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* V l)))) (if (<= t_0 0.0) (* c0 (sqrt (/ (/ A V) l))) (* c0 (sqrt t_0)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
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 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) 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)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
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));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, 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{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.0%
add-sqr-sqrt32.0%
pow232.0%
pow1/232.0%
sqrt-pow132.0%
metadata-eval32.0%
Applied egg-rr32.0%
Taylor expanded in c0 around 0 32.0%
associate-/r*48.8%
Simplified48.8%
if 0.0 < (/.f64 A (*.f64 V l)) Initial program 83.9%
Final simplification76.1%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= (/ A (* V l)) 0.0) (* c0 (sqrt (/ (/ A V) l))) (/ c0 (sqrt (/ (* V l) A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 / sqrt(((V * l) / A));
}
return tmp;
}
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) :: tmp
if ((a / (v * l)) <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 / sqrt(((v * l) / a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 / Math.sqrt(((V * l) / A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (A / (V * l)) <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 / math.sqrt(((V * l) / A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(A / Float64(V * l)) <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((A / (V * l)) <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 / sqrt(((V * l) / A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{A}{V \cdot \ell} \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.0%
add-sqr-sqrt32.0%
pow232.0%
pow1/232.0%
sqrt-pow132.0%
metadata-eval32.0%
Applied egg-rr32.0%
Taylor expanded in c0 around 0 32.0%
associate-/r*48.8%
Simplified48.8%
if 0.0 < (/.f64 A (*.f64 V l)) Initial program 83.9%
pow1/283.9%
clear-num83.8%
inv-pow83.8%
pow-pow84.5%
associate-/l*75.0%
metadata-eval75.0%
Applied egg-rr75.0%
associate-/l*84.5%
Simplified84.5%
sqr-pow84.2%
sqr-pow84.5%
metadata-eval84.5%
sqrt-pow284.4%
inv-pow84.4%
un-div-inv84.5%
div-inv84.5%
associate-*l*74.2%
div-inv74.2%
Applied egg-rr74.2%
Taylor expanded in V around 0 84.5%
Final simplification76.6%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
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
code = c0 * sqrt((a / (v * l)))
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 72.3%
Final simplification72.3%
herbie shell --seed 2023261
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))