
(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 13 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: c0, A, 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 (- l))) (sqrt (- V))))
(if (<= (* V l) -5e-302)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 5e-292) (not (<= (* V l) 2e+295)))
(* c0 (pow (* V (/ l A)) -0.5))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -5e-302) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 5e-292) || !((V * l) <= 2e+295)) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
assert c0 < A && A < V && 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 / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -5e-302) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 5e-292) || !((V * l) <= 2e+295)) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -5e-302: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif ((V * l) <= 5e-292) or not ((V * l) <= 2e+295): tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -5e-302) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 5e-292) || !(Float64(V * l) <= 2e+295)) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -5e-302)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif (((V * l) <= 5e-292) || ~(((V * l) <= 2e+295)))
tmp = c0 * ((V * (l / A)) ^ -0.5);
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, 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 / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-302], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 5e-292], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+295]], $MachinePrecision]], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-292} \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+295}\right):\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 42.2%
associate-/r*92.4%
div-inv92.4%
Applied egg-rr92.4%
un-div-inv92.4%
clear-num92.3%
associate-/l/92.4%
sqrt-div92.4%
metadata-eval92.4%
pow1/292.4%
pow-flip92.4%
associate-*r/42.2%
*-commutative42.2%
associate-/l*92.4%
metadata-eval92.4%
Applied egg-rr92.4%
metadata-eval92.4%
pow-flip92.4%
metadata-eval92.4%
pow1/292.4%
clear-num92.4%
div-inv92.5%
sqrt-div92.4%
clear-num92.4%
frac-2neg92.4%
sqrt-div53.7%
distribute-neg-frac253.7%
Applied egg-rr53.7%
distribute-frac-neg253.7%
distribute-neg-frac53.7%
Simplified53.7%
if -inf.0 < (*.f64 V l) < -5.00000000000000033e-302Initial program 84.0%
frac-2neg84.0%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -5.00000000000000033e-302 < (*.f64 V l) < 4.99999999999999981e-292 or 2e295 < (*.f64 V l) Initial program 34.3%
associate-/r*70.2%
div-inv70.1%
Applied egg-rr70.1%
un-div-inv70.2%
clear-num70.2%
associate-/l/70.1%
sqrt-div71.0%
metadata-eval71.0%
pow1/271.0%
pow-flip71.1%
associate-*r/34.3%
*-commutative34.3%
associate-/l*71.1%
metadata-eval71.1%
Applied egg-rr71.1%
if 4.99999999999999981e-292 < (*.f64 V l) < 2e295Initial program 89.2%
pow1/289.2%
div-inv89.2%
unpow-prod-down99.4%
pow1/299.4%
associate-/r*99.4%
Applied egg-rr99.4%
unpow1/299.4%
Simplified99.4%
Final simplification92.1%
NOTE: c0, A, 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))))))
(if (<= t_0 0.0)
(/ c0 (sqrt (/ l (/ A V))))
(if (<= t_0 5e+238) t_0 (* c0 (pow (* V (/ l A)) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((l / (A / V)));
} else if (t_0 <= 5e+238) {
tmp = t_0;
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, 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 * l)))
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((l / (a / v)))
else if (t_0 <= 5d+238) then
tmp = t_0
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((l / (A / V)));
} else if (t_0 <= 5e+238) {
tmp = t_0;
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((l / (A / V))) elif t_0 <= 5e+238: tmp = t_0 else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); elseif (t_0 <= 5e+238) tmp = t_0; else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((l / (A / V)));
elseif (t_0 <= 5e+238)
tmp = t_0;
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, 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]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+238], t$95$0, N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+238}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 68.5%
associate-/r*74.2%
div-inv74.2%
Applied egg-rr74.2%
un-div-inv74.2%
clear-num73.9%
associate-/l/74.0%
sqrt-div74.3%
metadata-eval74.3%
pow1/274.3%
pow-flip74.4%
associate-*r/68.2%
*-commutative68.2%
associate-/l*76.1%
metadata-eval76.1%
Applied egg-rr76.1%
metadata-eval76.1%
pow-flip76.0%
pow1/276.0%
div-inv76.1%
Applied egg-rr76.1%
*-commutative76.1%
associate-/r/74.3%
Simplified74.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999995e238Initial program 98.9%
if 4.99999999999999995e238 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 44.1%
associate-/r*63.9%
div-inv63.8%
Applied egg-rr63.8%
un-div-inv63.9%
clear-num63.7%
associate-/l/63.8%
sqrt-div63.7%
metadata-eval63.7%
pow1/263.7%
pow-flip63.9%
associate-*r/46.8%
*-commutative46.8%
associate-/l*64.0%
metadata-eval64.0%
Applied egg-rr64.0%
NOTE: c0, A, 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))))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+305)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+305)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, 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 * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+305))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+305)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+305): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+305)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+305)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, 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]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+305]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+305}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 3.9999999999999998e305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 64.7%
associate-/r*72.4%
Simplified72.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.9999999999999998e305Initial program 98.8%
Final simplification80.5%
NOTE: c0, A, 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))))))
(if (<= t_0 0.0)
(/ c0 (sqrt (/ l (/ A V))))
(if (<= t_0 5e+238) t_0 (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((l / (A / V)));
} else if (t_0 <= 5e+238) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, 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 * l)))
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((l / (a / v)))
else if (t_0 <= 5d+238) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((l / (A / V)));
} else if (t_0 <= 5e+238) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((l / (A / V))) elif t_0 <= 5e+238: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); elseif (t_0 <= 5e+238) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((l / (A / V)));
elseif (t_0 <= 5e+238)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, 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]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+238], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+238}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 68.5%
associate-/r*74.2%
div-inv74.2%
Applied egg-rr74.2%
un-div-inv74.2%
clear-num73.9%
associate-/l/74.0%
sqrt-div74.3%
metadata-eval74.3%
pow1/274.3%
pow-flip74.4%
associate-*r/68.2%
*-commutative68.2%
associate-/l*76.1%
metadata-eval76.1%
Applied egg-rr76.1%
metadata-eval76.1%
pow-flip76.0%
pow1/276.0%
div-inv76.1%
Applied egg-rr76.1%
*-commutative76.1%
associate-/r/74.3%
Simplified74.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999995e238Initial program 98.9%
if 4.99999999999999995e238 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 44.1%
associate-/r*63.9%
div-inv63.8%
Applied egg-rr63.8%
un-div-inv63.9%
clear-num63.7%
associate-/l/63.8%
sqrt-div63.7%
metadata-eval63.7%
un-div-inv63.7%
associate-*r/46.7%
*-commutative46.7%
associate-/l*63.9%
Applied egg-rr63.9%
NOTE: c0, A, 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))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+238) t_0 (* c0 (sqrt (/ (/ A l) V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+238) {
tmp = t_0;
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, 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 * l)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+238) then
tmp = t_0
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+238) {
tmp = t_0;
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+238: tmp = t_0 else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(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+238) tmp = t_0; else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+238)
tmp = t_0;
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, 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]}, 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+238], t$95$0, N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\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^{+238}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 68.5%
associate-/r*74.2%
Simplified74.2%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999995e238Initial program 98.9%
if 4.99999999999999995e238 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 44.1%
associate-/r*63.9%
div-inv63.8%
Applied egg-rr63.8%
associate-*l/60.1%
un-div-inv60.1%
Applied egg-rr60.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e-302)
(* c0 (* (/ (sqrt (- A)) (sqrt (- V))) (sqrt (/ 1.0 l))))
(if (or (<= (* V l) 5e-292) (not (<= (* V l) 2e+295)))
(* c0 (pow (* V (/ l A)) -0.5))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-302) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) * sqrt((1.0 / l)));
} else if (((V * l) <= 5e-292) || !((V * l) <= 2e+295)) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: c0, A, 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 ((v * l) <= (-5d-302)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) * sqrt((1.0d0 / l)))
else if (((v * l) <= 5d-292) .or. (.not. ((v * l) <= 2d+295))) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-302) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) * Math.sqrt((1.0 / l)));
} else if (((V * l) <= 5e-292) || !((V * l) <= 2e+295)) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-302: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) * math.sqrt((1.0 / l))) elif ((V * l) <= 5e-292) or not ((V * l) <= 2e+295): tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-302) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * sqrt(Float64(1.0 / l)))); elseif ((Float64(V * l) <= 5e-292) || !(Float64(V * l) <= 2e+295)) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-302)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) * sqrt((1.0 / l)));
elseif (((V * l) <= 5e-292) || ~(((V * l) <= 2e+295)))
tmp = c0 * ((V * (l / A)) ^ -0.5);
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-302], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 5e-292], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+295]], $MachinePrecision]], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\
\;\;\;\;c0 \cdot \left(\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-292} \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+295}\right):\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000033e-302Initial program 79.3%
pow1/279.3%
associate-/r*76.6%
div-inv76.6%
unpow-prod-down47.4%
pow1/247.4%
Applied egg-rr47.4%
unpow1/247.4%
Simplified47.4%
frac-2neg47.4%
sqrt-div53.5%
Applied egg-rr53.5%
if -5.00000000000000033e-302 < (*.f64 V l) < 4.99999999999999981e-292 or 2e295 < (*.f64 V l) Initial program 34.3%
associate-/r*70.2%
div-inv70.1%
Applied egg-rr70.1%
un-div-inv70.2%
clear-num70.2%
associate-/l/70.1%
sqrt-div71.0%
metadata-eval71.0%
pow1/271.0%
pow-flip71.1%
associate-*r/34.3%
*-commutative34.3%
associate-/l*71.1%
metadata-eval71.1%
Applied egg-rr71.1%
if 4.99999999999999981e-292 < (*.f64 V l) < 2e295Initial program 89.2%
pow1/289.2%
div-inv89.2%
unpow-prod-down99.4%
pow1/299.4%
associate-/r*99.4%
Applied egg-rr99.4%
unpow1/299.4%
Simplified99.4%
Final simplification73.8%
NOTE: c0, A, 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)) (sqrt l)))))
(if (<= (* V l) -2e+173)
t_0
(if (<= (* V l) -1e-36)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) -4e-279)
t_0
(if (or (<= (* V l) 0.0) (not (<= (* V l) 2e+295)))
(* c0 (pow (* V (/ l A)) -0.5))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))))assert(c0 < A && A < V && 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) <= -2e+173) {
tmp = t_0;
} else if ((V * l) <= -1e-36) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= -4e-279) {
tmp = t_0;
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+295)) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, 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) <= (-2d+173)) then
tmp = t_0
else if ((v * l) <= (-1d-36)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= (-4d-279)) then
tmp = t_0
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 2d+295))) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && 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) <= -2e+173) {
tmp = t_0;
} else if ((V * l) <= -1e-36) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= -4e-279) {
tmp = t_0;
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+295)) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+173: tmp = t_0 elif (V * l) <= -1e-36: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= -4e-279: tmp = t_0 elif ((V * l) <= 0.0) or not ((V * l) <= 2e+295): tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, 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) <= -2e+173) tmp = t_0; elseif (Float64(V * l) <= -1e-36) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= -4e-279) tmp = t_0; elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 2e+295)) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+173)
tmp = t_0;
elseif ((V * l) <= -1e-36)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= -4e-279)
tmp = t_0;
elseif (((V * l) <= 0.0) || ~(((V * l) <= 2e+295)))
tmp = c0 * ((V * (l / A)) ^ -0.5);
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, 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], -2e+173], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-36], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-279], t$95$0, If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+295]], $MachinePrecision]], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+173}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-36}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-279}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+295}\right):\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e173 or -9.9999999999999994e-37 < (*.f64 V l) < -4.00000000000000022e-279Initial program 71.2%
associate-/r*78.4%
sqrt-div52.8%
div-inv52.7%
Applied egg-rr52.7%
associate-*r/52.8%
*-rgt-identity52.8%
Simplified52.8%
if -2e173 < (*.f64 V l) < -9.9999999999999994e-37Initial program 93.2%
if -4.00000000000000022e-279 < (*.f64 V l) < -0.0 or 2e295 < (*.f64 V l) Initial program 33.7%
associate-/r*68.8%
div-inv68.7%
Applied egg-rr68.7%
un-div-inv68.8%
clear-num68.7%
associate-/l/68.7%
sqrt-div69.5%
metadata-eval69.5%
pow1/269.5%
pow-flip69.6%
associate-*r/33.7%
*-commutative33.7%
associate-/l*69.6%
metadata-eval69.6%
Applied egg-rr69.6%
if -0.0 < (*.f64 V l) < 2e295Initial program 89.3%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
Final simplification80.4%
NOTE: c0, A, 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-302)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 5e-292) (not (<= (* V l) 2e+295)))
(* c0 (pow (* V (/ l A)) -0.5))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(c0 < A && A < V && 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-302) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 5e-292) || !((V * l) <= 2e+295)) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
assert c0 < A && A < V && 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-302) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 5e-292) || !((V * l) <= 2e+295)) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, 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-302: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif ((V * l) <= 5e-292) or not ((V * l) <= 2e+295): tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, 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-302) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 5e-292) || !(Float64(V * l) <= 2e+295)) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, 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-302)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif (((V * l) <= 5e-292) || ~(((V * l) <= 2e+295)))
tmp = c0 * ((V * (l / A)) ^ -0.5);
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, 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-302], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 5e-292], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+295]], $MachinePrecision]], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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}
[c0, A, V, l] = \mathsf{sort}([c0, A, 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^{-302}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-292} \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+295}\right):\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 42.2%
associate-/r*92.4%
sqrt-div53.6%
div-inv53.5%
Applied egg-rr53.5%
associate-*r/53.6%
*-rgt-identity53.6%
Simplified53.6%
if -inf.0 < (*.f64 V l) < -5.00000000000000033e-302Initial program 84.0%
frac-2neg84.0%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -5.00000000000000033e-302 < (*.f64 V l) < 4.99999999999999981e-292 or 2e295 < (*.f64 V l) Initial program 34.3%
associate-/r*70.2%
div-inv70.1%
Applied egg-rr70.1%
un-div-inv70.2%
clear-num70.2%
associate-/l/70.1%
sqrt-div71.0%
metadata-eval71.0%
pow1/271.0%
pow-flip71.1%
associate-*r/34.3%
*-commutative34.3%
associate-/l*71.1%
metadata-eval71.1%
Applied egg-rr71.1%
if 4.99999999999999981e-292 < (*.f64 V l) < 2e295Initial program 89.2%
pow1/289.2%
div-inv89.2%
unpow-prod-down99.4%
pow1/299.4%
associate-/r*99.4%
Applied egg-rr99.4%
unpow1/299.4%
Simplified99.4%
Final simplification92.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+173)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-24)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 2e+295)
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))
(* c0 (pow (* V (/ l A)) -0.5)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+173) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-24) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 2e+295) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, 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 ((v * l) <= (-2d+173)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-2d-24)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 2d+295) then
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+173) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-24) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 2e+295) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+173: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-24: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 2e+295: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+173) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-24) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 2e+295) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+173)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-24)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 2e+295)
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+173], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-24], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+295], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+173}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-24}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+295}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e173Initial program 62.2%
associate-/r*81.1%
sqrt-div60.7%
div-inv60.6%
Applied egg-rr60.6%
associate-*r/60.7%
*-rgt-identity60.7%
Simplified60.7%
if -2e173 < (*.f64 V l) < -1.99999999999999985e-24Initial program 92.8%
if -1.99999999999999985e-24 < (*.f64 V l) < -0.0Initial program 62.9%
associate-/r*76.5%
div-inv76.4%
Applied egg-rr76.4%
un-div-inv76.5%
clear-num74.9%
associate-/l/75.0%
sqrt-div75.9%
metadata-eval75.9%
un-div-inv75.9%
sqrt-prod48.9%
associate-/r*47.4%
Applied egg-rr47.4%
associate-/l/48.9%
Simplified48.9%
if -0.0 < (*.f64 V l) < 2e295Initial program 89.3%
pow1/289.3%
div-inv89.3%
unpow-prod-down99.4%
pow1/299.4%
associate-/r*99.4%
Applied egg-rr99.4%
unpow1/299.4%
Simplified99.4%
if 2e295 < (*.f64 V l) Initial program 33.7%
associate-/r*62.5%
div-inv62.5%
Applied egg-rr62.5%
un-div-inv62.5%
clear-num62.5%
associate-/l/62.5%
sqrt-div62.4%
metadata-eval62.4%
pow1/262.4%
pow-flip62.6%
associate-*r/33.7%
*-commutative33.7%
associate-/l*62.6%
metadata-eval62.6%
Applied egg-rr62.6%
Final simplification78.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* V (/ l A))))
(if (<= (* V l) -1e+215)
(/ c0 (sqrt t_0))
(if (<= (* V l) -5e-98)
(* c0 (sqrt (/ A (* V l))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 2e+295)))
(* c0 (pow t_0 -0.5))
(* c0 (/ (sqrt A) (sqrt (* V l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = V * (l / A);
double tmp;
if ((V * l) <= -1e+215) {
tmp = c0 / sqrt(t_0);
} else if ((V * l) <= -5e-98) {
tmp = c0 * sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+295)) {
tmp = c0 * pow(t_0, -0.5);
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, 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 = v * (l / a)
if ((v * l) <= (-1d+215)) then
tmp = c0 / sqrt(t_0)
else if ((v * l) <= (-5d-98)) then
tmp = c0 * sqrt((a / (v * l)))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 2d+295))) then
tmp = c0 * (t_0 ** (-0.5d0))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = V * (l / A);
double tmp;
if ((V * l) <= -1e+215) {
tmp = c0 / Math.sqrt(t_0);
} else if ((V * l) <= -5e-98) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+295)) {
tmp = c0 * Math.pow(t_0, -0.5);
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = V * (l / A) tmp = 0 if (V * l) <= -1e+215: tmp = c0 / math.sqrt(t_0) elif (V * l) <= -5e-98: tmp = c0 * math.sqrt((A / (V * l))) elif ((V * l) <= 0.0) or not ((V * l) <= 2e+295): tmp = c0 * math.pow(t_0, -0.5) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(V * Float64(l / A)) tmp = 0.0 if (Float64(V * l) <= -1e+215) tmp = Float64(c0 / sqrt(t_0)); elseif (Float64(V * l) <= -5e-98) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 2e+295)) tmp = Float64(c0 * (t_0 ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = V * (l / A);
tmp = 0.0;
if ((V * l) <= -1e+215)
tmp = c0 / sqrt(t_0);
elseif ((V * l) <= -5e-98)
tmp = c0 * sqrt((A / (V * l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 2e+295)))
tmp = c0 * (t_0 ^ -0.5);
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+215], N[(c0 / N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-98], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+295]], $MachinePrecision]], N[(c0 * N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := V \cdot \frac{\ell}{A}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+215}:\\
\;\;\;\;\frac{c0}{\sqrt{t\_0}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-98}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+295}\right):\\
\;\;\;\;c0 \cdot {t\_0}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999907e214Initial program 61.6%
associate-/r*82.6%
div-inv82.6%
Applied egg-rr82.6%
un-div-inv82.6%
clear-num80.7%
associate-/l/80.8%
sqrt-div80.8%
metadata-eval80.8%
un-div-inv80.9%
associate-*r/61.8%
*-commutative61.8%
associate-/l*84.4%
Applied egg-rr84.4%
if -9.99999999999999907e214 < (*.f64 V l) < -5.00000000000000018e-98Initial program 88.3%
if -5.00000000000000018e-98 < (*.f64 V l) < -0.0 or 2e295 < (*.f64 V l) Initial program 50.2%
associate-/r*72.9%
div-inv72.8%
Applied egg-rr72.8%
un-div-inv72.9%
clear-num72.8%
associate-/l/72.9%
sqrt-div73.3%
metadata-eval73.3%
pow1/273.3%
pow-flip73.5%
associate-*r/51.0%
*-commutative51.0%
associate-/l*74.4%
metadata-eval74.4%
Applied egg-rr74.4%
if -0.0 < (*.f64 V l) < 2e295Initial program 89.3%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
Final simplification88.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+173)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-24)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 2e+295)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* V (/ l A)) -0.5)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+173) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-24) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 2e+295) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, 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 ((v * l) <= (-2d+173)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-2d-24)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 2d+295) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+173) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-24) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 2e+295) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+173: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-24: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 2e+295: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+173) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-24) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 2e+295) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+173)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-24)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 2e+295)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+173], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-24], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+295], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+173}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-24}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+295}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e173Initial program 62.2%
associate-/r*81.1%
sqrt-div60.7%
div-inv60.6%
Applied egg-rr60.6%
associate-*r/60.7%
*-rgt-identity60.7%
Simplified60.7%
if -2e173 < (*.f64 V l) < -1.99999999999999985e-24Initial program 92.8%
if -1.99999999999999985e-24 < (*.f64 V l) < -0.0Initial program 62.9%
associate-/r*76.5%
div-inv76.4%
Applied egg-rr76.4%
un-div-inv76.5%
clear-num74.9%
associate-/l/75.0%
sqrt-div75.9%
metadata-eval75.9%
un-div-inv75.9%
sqrt-prod48.9%
associate-/r*47.4%
Applied egg-rr47.4%
associate-/l/48.9%
Simplified48.9%
if -0.0 < (*.f64 V l) < 2e295Initial program 89.3%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 2e295 < (*.f64 V l) Initial program 33.7%
associate-/r*62.5%
div-inv62.5%
Applied egg-rr62.5%
un-div-inv62.5%
clear-num62.5%
associate-/l/62.5%
sqrt-div62.4%
metadata-eval62.4%
pow1/262.4%
pow-flip62.6%
associate-*r/33.7%
*-commutative33.7%
associate-/l*62.6%
metadata-eval62.6%
Applied egg-rr62.6%
Final simplification78.0%
NOTE: c0, A, 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 1e+284) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && 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 <= 1e+284) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, 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 <= 1d+284) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && 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 <= 1e+284) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, 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 <= 1e+284: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, 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 <= 1e+284) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, 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 <= 1e+284)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, 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, 1e+284], 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, 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 10^{+284}:\\
\;\;\;\;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 36.0%
associate-/r*59.1%
Simplified59.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000008e284Initial program 99.0%
if 1.00000000000000008e284 < (/.f64 A (*.f64 V l)) Initial program 35.6%
associate-/r*59.4%
div-inv59.3%
Applied egg-rr59.3%
un-div-inv59.4%
clear-num59.4%
associate-/l/59.3%
sqrt-div60.9%
metadata-eval60.9%
un-div-inv60.9%
associate-*r/37.8%
*-commutative37.8%
associate-/l*61.9%
Applied egg-rr61.9%
NOTE: c0, A, 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(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, 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 c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 75.1%
herbie shell --seed 2024089
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))