
(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 14 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
(let* ((t_0 (sqrt (- A))))
(if (<= (* V l) (- INFINITY))
(* (pow l -0.5) (/ c0 (/ (sqrt (- V)) t_0)))
(if (<= (* V l) -5e-233)
(* c0 (/ t_0 (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(* 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 = sqrt(-A);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = pow(l, -0.5) * (c0 / (sqrt(-V) / t_0));
} else if ((V * l) <= -5e-233) {
tmp = c0 * (t_0 / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt(-A);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = Math.pow(l, -0.5) * (c0 / (Math.sqrt(-V) / t_0));
} else if ((V * l) <= -5e-233) {
tmp = c0 * (t_0 / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} 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 = math.sqrt(-A) tmp = 0 if (V * l) <= -math.inf: tmp = math.pow(l, -0.5) * (c0 / (math.sqrt(-V) / t_0)) elif (V * l) <= -5e-233: tmp = c0 * (t_0 / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) 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 = sqrt(Float64(-A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64((l ^ -0.5) * Float64(c0 / Float64(sqrt(Float64(-V)) / t_0))); elseif (Float64(V * l) <= -5e-233) tmp = Float64(c0 * Float64(t_0 / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); 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 = sqrt(-A);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (l ^ -0.5) * (c0 / (sqrt(-V) / t_0));
elseif ((V * l) <= -5e-233)
tmp = c0 * (t_0 / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
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[Sqrt[(-A)], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[(N[Sqrt[(-V)], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-233], N[(c0 * N[(t$95$0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $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 := \sqrt{-A}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\frac{\sqrt{-V}}{t\_0}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-233}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 26.5%
add-sqr-sqrt26.5%
sqrt-unprod26.5%
*-commutative26.5%
*-commutative26.5%
swap-sqr25.4%
add-sqr-sqrt25.4%
pow225.4%
Applied egg-rr25.4%
associate-/r*25.5%
Simplified25.5%
*-commutative25.5%
sqrt-prod29.5%
sqrt-pow151.8%
metadata-eval51.8%
pow151.8%
sqrt-undiv34.3%
clear-num34.2%
un-div-inv34.3%
*-un-lft-identity34.3%
div-inv34.2%
metadata-eval34.2%
sqrt-div34.2%
clear-num34.2%
times-frac34.3%
pow1/234.3%
pow-flip34.3%
metadata-eval34.3%
Applied egg-rr34.3%
frac-2neg34.3%
sqrt-div49.7%
Applied egg-rr49.7%
if -inf.0 < (*.f64 V l) < -5.00000000000000012e-233Initial program 86.1%
frac-2neg86.1%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -5.00000000000000012e-233 < (*.f64 V l) < -0.0Initial program 42.7%
add-sqr-sqrt21.1%
sqrt-unprod19.0%
*-commutative19.0%
*-commutative19.0%
swap-sqr16.4%
add-sqr-sqrt16.4%
pow216.4%
Applied egg-rr16.4%
associate-/r*19.6%
Simplified19.6%
*-commutative19.6%
sqrt-prod19.6%
sqrt-pow178.8%
metadata-eval78.8%
pow178.8%
sqrt-undiv52.8%
clear-num52.7%
un-div-inv52.6%
*-un-lft-identity52.6%
div-inv52.5%
metadata-eval52.5%
sqrt-div52.7%
clear-num53.4%
times-frac49.8%
pow1/249.8%
pow-flip49.8%
metadata-eval49.8%
Applied egg-rr49.8%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
div-inv95.7%
Applied egg-rr95.7%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.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 l))))))
(if (or (<= t_0 0.0) (not (<= t_0 1e+308)))
(* 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 <= 1e+308)) {
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 <= 1d+308))) 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 <= 1e+308)) {
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 <= 1e+308): 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 <= 1e+308)) 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 <= 1e+308)))
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, 1e+308]], $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 10^{+308}\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 1e308 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.9%
associate-/r*73.1%
Simplified73.1%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1e308Initial program 98.8%
Final simplification80.7%
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 1e+277) 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(((A / V) / l));
} else if (t_0 <= 1e+277) {
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(((a / v) / l))
else if (t_0 <= 1d+277) 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(((A / V) / l));
} else if (t_0 <= 1e+277) {
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(((A / V) / l)) elif t_0 <= 1e+277: 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(Float64(A / V) / l))); elseif (t_0 <= 1e+277) 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(((A / V) / l));
elseif (t_0 <= 1e+277)
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[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+277], 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:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+277}:\\
\;\;\;\;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 69.2%
associate-/r*75.1%
Simplified75.1%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1e277Initial program 98.7%
if 1e277 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 56.7%
associate-/r*68.4%
clear-num68.4%
sqrt-div73.6%
metadata-eval73.6%
div-inv73.6%
clear-num73.6%
Applied egg-rr73.6%
un-div-inv73.8%
Applied egg-rr73.8%
associate-*r/59.5%
*-commutative59.5%
associate-/l*73.8%
Simplified73.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 (sqrt (- A))))
(if (<= (* V l) (- INFINITY))
(/ (/ c0 (sqrt l)) (/ (sqrt (- V)) t_0))
(if (<= (* V l) -5e-233)
(* c0 (/ t_0 (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(* 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 = sqrt(-A);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0 / sqrt(l)) / (sqrt(-V) / t_0);
} else if ((V * l) <= -5e-233) {
tmp = c0 * (t_0 / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt(-A);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 / Math.sqrt(l)) / (Math.sqrt(-V) / t_0);
} else if ((V * l) <= -5e-233) {
tmp = c0 * (t_0 / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} 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 = math.sqrt(-A) tmp = 0 if (V * l) <= -math.inf: tmp = (c0 / math.sqrt(l)) / (math.sqrt(-V) / t_0) elif (V * l) <= -5e-233: tmp = c0 * (t_0 / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) 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 = sqrt(Float64(-A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0 / sqrt(l)) / Float64(sqrt(Float64(-V)) / t_0)); elseif (Float64(V * l) <= -5e-233) tmp = Float64(c0 * Float64(t_0 / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); 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 = sqrt(-A);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0 / sqrt(l)) / (sqrt(-V) / t_0);
elseif ((V * l) <= -5e-233)
tmp = c0 * (t_0 / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
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[Sqrt[(-A)], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[(-V)], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-233], N[(c0 * N[(t$95$0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $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 := \sqrt{-A}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\frac{\sqrt{-V}}{t\_0}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-233}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 26.5%
add-sqr-sqrt26.5%
sqrt-unprod26.5%
*-commutative26.5%
*-commutative26.5%
swap-sqr25.4%
add-sqr-sqrt25.4%
pow225.4%
Applied egg-rr25.4%
associate-/r*25.5%
Simplified25.5%
*-commutative25.5%
sqrt-prod29.5%
sqrt-pow151.8%
metadata-eval51.8%
pow151.8%
sqrt-undiv34.3%
clear-num34.2%
un-div-inv34.3%
add-cbrt-cube17.8%
unpow217.8%
cbrt-prod17.9%
div-inv17.9%
metadata-eval17.9%
sqrt-div18.0%
clear-num18.0%
times-frac17.9%
unpow217.9%
cbrt-prod33.8%
pow233.8%
Applied egg-rr33.8%
associate-*r/33.9%
associate-*l/34.0%
unpow234.0%
rem-3cbrt-lft34.2%
Simplified34.2%
frac-2neg34.3%
sqrt-div49.7%
Applied egg-rr49.7%
if -inf.0 < (*.f64 V l) < -5.00000000000000012e-233Initial program 86.1%
frac-2neg86.1%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -5.00000000000000012e-233 < (*.f64 V l) < -0.0Initial program 42.7%
add-sqr-sqrt21.1%
sqrt-unprod19.0%
*-commutative19.0%
*-commutative19.0%
swap-sqr16.4%
add-sqr-sqrt16.4%
pow216.4%
Applied egg-rr16.4%
associate-/r*19.6%
Simplified19.6%
*-commutative19.6%
sqrt-prod19.6%
sqrt-pow178.8%
metadata-eval78.8%
pow178.8%
sqrt-undiv52.8%
clear-num52.7%
un-div-inv52.6%
*-un-lft-identity52.6%
div-inv52.5%
metadata-eval52.5%
sqrt-div52.7%
clear-num53.4%
times-frac49.8%
pow1/249.8%
pow-flip49.8%
metadata-eval49.8%
Applied egg-rr49.8%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
div-inv95.7%
Applied egg-rr95.7%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.8%
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-233)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(* c0 (/ (sqrt A) (sqrt (* 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-233) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((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-233) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} 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): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt(-(A / l)) / math.sqrt(-V)) elif (V * l) <= -5e-233: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) 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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(-Float64(A / l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -5e-233) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); 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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt(-(A / l)) / sqrt(-V));
elseif ((V * l) <= -5e-233)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
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_] := 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-233], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $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}
\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^{-233}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 26.5%
associate-/r*51.8%
clear-num47.8%
sqrt-div47.7%
metadata-eval47.7%
div-inv47.7%
clear-num47.7%
Applied egg-rr47.7%
Taylor expanded in c0 around 0 26.5%
*-commutative26.5%
associate-/l/51.8%
Simplified51.8%
frac-2neg51.8%
sqrt-div29.0%
distribute-neg-frac229.0%
Applied egg-rr29.0%
distribute-frac-neg229.0%
distribute-neg-frac29.0%
Simplified29.0%
if -inf.0 < (*.f64 V l) < -5.00000000000000012e-233Initial program 86.1%
frac-2neg86.1%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -5.00000000000000012e-233 < (*.f64 V l) < -0.0Initial program 42.7%
add-sqr-sqrt21.1%
sqrt-unprod19.0%
*-commutative19.0%
*-commutative19.0%
swap-sqr16.4%
add-sqr-sqrt16.4%
pow216.4%
Applied egg-rr16.4%
associate-/r*19.6%
Simplified19.6%
*-commutative19.6%
sqrt-prod19.6%
sqrt-pow178.8%
metadata-eval78.8%
pow178.8%
sqrt-undiv52.8%
clear-num52.7%
un-div-inv52.6%
*-un-lft-identity52.6%
div-inv52.5%
metadata-eval52.5%
sqrt-div52.7%
clear-num53.4%
times-frac49.8%
pow1/249.8%
pow-flip49.8%
metadata-eval49.8%
Applied egg-rr49.8%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
div-inv95.7%
Applied egg-rr95.7%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.8%
Final simplification85.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+244)
(/ (* c0 (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -5e-233)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+244) {
tmp = (c0 * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -5e-233) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} 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) :: tmp
if ((v * l) <= (-2d+244)) then
tmp = (c0 * sqrt((a / v))) / sqrt(l)
else if ((v * l) <= (-5d-233)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = (l ** (-0.5d0)) * (c0 / sqrt((v / a)))
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 tmp;
if ((V * l) <= -2e+244) {
tmp = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -5e-233) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} 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): tmp = 0 if (V * l) <= -2e+244: tmp = (c0 * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -5e-233: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) 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) tmp = 0.0 if (Float64(V * l) <= -2e+244) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -5e-233) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); 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)
tmp = 0.0;
if ((V * l) <= -2e+244)
tmp = (c0 * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -5e-233)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+244], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-233], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+244}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-233}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000015e244Initial program 49.3%
*-commutative49.3%
associate-/r*64.5%
sqrt-div37.1%
associate-*l/37.3%
Applied egg-rr37.3%
if -2.00000000000000015e244 < (*.f64 V l) < -5.00000000000000012e-233Initial program 86.5%
frac-2neg86.5%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -5.00000000000000012e-233 < (*.f64 V l) < -0.0Initial program 42.7%
add-sqr-sqrt21.1%
sqrt-unprod19.0%
*-commutative19.0%
*-commutative19.0%
swap-sqr16.4%
add-sqr-sqrt16.4%
pow216.4%
Applied egg-rr16.4%
associate-/r*19.6%
Simplified19.6%
*-commutative19.6%
sqrt-prod19.6%
sqrt-pow178.8%
metadata-eval78.8%
pow178.8%
sqrt-undiv52.8%
clear-num52.7%
un-div-inv52.6%
*-un-lft-identity52.6%
div-inv52.5%
metadata-eval52.5%
sqrt-div52.7%
clear-num53.4%
times-frac49.8%
pow1/249.8%
pow-flip49.8%
metadata-eval49.8%
Applied egg-rr49.8%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
div-inv95.7%
Applied egg-rr95.7%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.8%
Final simplification82.9%
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) -1e+215)
(/ (* c0 (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -5e-124)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(/ (* c0 (pow (/ V A) -0.5)) (sqrt l))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+215) {
tmp = (c0 * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -5e-124) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = (c0 * pow((V / A), -0.5)) / sqrt(l);
} 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) :: tmp
if ((v * l) <= (-1d+215)) then
tmp = (c0 * sqrt((a / v))) / sqrt(l)
else if ((v * l) <= (-5d-124)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = (c0 * ((v / a) ** (-0.5d0))) / sqrt(l)
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 tmp;
if ((V * l) <= -1e+215) {
tmp = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -5e-124) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = (c0 * Math.pow((V / A), -0.5)) / Math.sqrt(l);
} 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): tmp = 0 if (V * l) <= -1e+215: tmp = (c0 * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -5e-124: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = (c0 * math.pow((V / A), -0.5)) / math.sqrt(l) 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) tmp = 0.0 if (Float64(V * l) <= -1e+215) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -5e-124) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(Float64(c0 * (Float64(V / A) ^ -0.5)) / sqrt(l)); 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)
tmp = 0.0;
if ((V * l) <= -1e+215)
tmp = (c0 * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -5e-124)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = (c0 * ((V / A) ^ -0.5)) / sqrt(l);
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+215], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-124], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(c0 * N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $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}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+215}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-124}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0 \cdot {\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999907e214Initial program 50.1%
*-commutative50.1%
associate-/r*62.3%
sqrt-div35.6%
associate-*l/35.7%
Applied egg-rr35.7%
if -9.99999999999999907e214 < (*.f64 V l) < -5.0000000000000003e-124Initial program 90.1%
associate-/r*72.2%
clear-num72.2%
sqrt-div72.2%
metadata-eval72.2%
div-inv71.1%
clear-num72.5%
Applied egg-rr72.5%
un-div-inv72.5%
Applied egg-rr72.5%
associate-*r/90.1%
*-commutative90.1%
associate-/l*76.8%
Simplified76.8%
Taylor expanded in V around 0 90.1%
if -5.0000000000000003e-124 < (*.f64 V l) < -0.0Initial program 55.6%
associate-/r*81.3%
clear-num81.3%
sqrt-div82.6%
metadata-eval82.6%
div-inv82.5%
clear-num82.6%
Applied egg-rr82.6%
un-div-inv82.7%
Applied egg-rr82.7%
associate-*r/55.6%
*-commutative55.6%
associate-/l*79.4%
Simplified79.4%
associate-*r/55.6%
associate-*l/82.7%
*-commutative82.7%
sqrt-prod45.4%
associate-/r*45.3%
div-inv45.3%
pow1/245.3%
pow-flip45.3%
metadata-eval45.3%
Applied egg-rr45.3%
associate-*l/42.7%
Simplified42.7%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
div-inv95.7%
Applied egg-rr95.7%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.8%
Final simplification74.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) -1e+215)
(/ (* c0 (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -5e-124)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+215) {
tmp = (c0 * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -5e-124) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} 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) :: tmp
if ((v * l) <= (-1d+215)) then
tmp = (c0 * sqrt((a / v))) / sqrt(l)
else if ((v * l) <= (-5d-124)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = (l ** (-0.5d0)) * (c0 / sqrt((v / a)))
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 tmp;
if ((V * l) <= -1e+215) {
tmp = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -5e-124) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} 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): tmp = 0 if (V * l) <= -1e+215: tmp = (c0 * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -5e-124: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) 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) tmp = 0.0 if (Float64(V * l) <= -1e+215) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -5e-124) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); 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)
tmp = 0.0;
if ((V * l) <= -1e+215)
tmp = (c0 * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -5e-124)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+215], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-124], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+215}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-124}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999907e214Initial program 50.1%
*-commutative50.1%
associate-/r*62.3%
sqrt-div35.6%
associate-*l/35.7%
Applied egg-rr35.7%
if -9.99999999999999907e214 < (*.f64 V l) < -5.0000000000000003e-124Initial program 90.1%
associate-/r*72.2%
clear-num72.2%
sqrt-div72.2%
metadata-eval72.2%
div-inv71.1%
clear-num72.5%
Applied egg-rr72.5%
un-div-inv72.5%
Applied egg-rr72.5%
associate-*r/90.1%
*-commutative90.1%
associate-/l*76.8%
Simplified76.8%
Taylor expanded in V around 0 90.1%
if -5.0000000000000003e-124 < (*.f64 V l) < -0.0Initial program 55.6%
add-sqr-sqrt27.5%
sqrt-unprod21.6%
*-commutative21.6%
*-commutative21.6%
swap-sqr18.0%
add-sqr-sqrt18.0%
pow218.0%
Applied egg-rr18.0%
associate-/r*20.3%
Simplified20.3%
*-commutative20.3%
sqrt-prod23.6%
sqrt-pow181.3%
metadata-eval81.3%
pow181.3%
sqrt-undiv44.8%
clear-num44.8%
un-div-inv44.8%
*-un-lft-identity44.8%
div-inv44.7%
metadata-eval44.7%
sqrt-div44.8%
clear-num45.4%
times-frac42.7%
pow1/242.7%
pow-flip42.7%
metadata-eval42.7%
Applied egg-rr42.7%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
div-inv95.7%
Applied egg-rr95.7%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.8%
Final simplification74.2%
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 (sqrt (/ A V))))
(if (<= (* V l) -1e+215)
(/ (* c0 t_0) (sqrt l))
(if (<= (* V l) -5e-124)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(* c0 (/ t_0 (sqrt l)))
(* 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 = sqrt((A / V));
double tmp;
if ((V * l) <= -1e+215) {
tmp = (c0 * t_0) / sqrt(l);
} else if ((V * l) <= -5e-124) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 / sqrt(l));
} 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 = sqrt((a / v))
if ((v * l) <= (-1d+215)) then
tmp = (c0 * t_0) / sqrt(l)
else if ((v * l) <= (-5d-124)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (t_0 / sqrt(l))
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 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+215) {
tmp = (c0 * t_0) / Math.sqrt(l);
} else if ((V * l) <= -5e-124) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 / Math.sqrt(l));
} 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 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+215: tmp = (c0 * t_0) / math.sqrt(l) elif (V * l) <= -5e-124: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = c0 * (t_0 / math.sqrt(l)) 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 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -1e+215) tmp = Float64(Float64(c0 * t_0) / sqrt(l)); elseif (Float64(V * l) <= -5e-124) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); 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 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+215)
tmp = (c0 * t_0) / sqrt(l);
elseif ((V * l) <= -5e-124)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = c0 * (t_0 / sqrt(l));
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[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+215], N[(N[(c0 * t$95$0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-124], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(t$95$0 / 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+215}:\\
\;\;\;\;\frac{c0 \cdot t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-124}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999907e214Initial program 50.1%
*-commutative50.1%
associate-/r*62.3%
sqrt-div35.6%
associate-*l/35.7%
Applied egg-rr35.7%
if -9.99999999999999907e214 < (*.f64 V l) < -5.0000000000000003e-124Initial program 90.1%
associate-/r*72.2%
clear-num72.2%
sqrt-div72.2%
metadata-eval72.2%
div-inv71.1%
clear-num72.5%
Applied egg-rr72.5%
un-div-inv72.5%
Applied egg-rr72.5%
associate-*r/90.1%
*-commutative90.1%
associate-/l*76.8%
Simplified76.8%
Taylor expanded in V around 0 90.1%
if -5.0000000000000003e-124 < (*.f64 V l) < -0.0Initial program 55.6%
associate-/r*81.3%
sqrt-div44.8%
div-inv44.8%
Applied egg-rr44.8%
associate-*r/44.8%
*-rgt-identity44.8%
Simplified44.8%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
div-inv95.7%
Applied egg-rr95.7%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.8%
Final simplification74.6%
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) -1e+215)
t_0
(if (<= (* V l) -5e-124)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0) t_0 (* 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) <= -1e+215) {
tmp = t_0;
} else if ((V * l) <= -5e-124) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} 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) <= (-1d+215)) then
tmp = t_0
else if ((v * l) <= (-5d-124)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = t_0
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) <= -1e+215) {
tmp = t_0;
} else if ((V * l) <= -5e-124) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} 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) <= -1e+215: tmp = t_0 elif (V * l) <= -5e-124: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = t_0 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) <= -1e+215) tmp = t_0; elseif (Float64(V * l) <= -5e-124) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = t_0; 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) <= -1e+215)
tmp = t_0;
elseif ((V * l) <= -5e-124)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = t_0;
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], -1e+215], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-124], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, 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 -1 \cdot 10^{+215}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-124}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999907e214 or -5.0000000000000003e-124 < (*.f64 V l) < -0.0Initial program 53.4%
associate-/r*73.8%
sqrt-div41.2%
div-inv41.1%
Applied egg-rr41.1%
associate-*r/41.2%
*-rgt-identity41.2%
Simplified41.2%
if -9.99999999999999907e214 < (*.f64 V l) < -5.0000000000000003e-124Initial program 90.1%
associate-/r*72.2%
clear-num72.2%
sqrt-div72.2%
metadata-eval72.2%
div-inv71.1%
clear-num72.5%
Applied egg-rr72.5%
un-div-inv72.5%
Applied egg-rr72.5%
associate-*r/90.1%
*-commutative90.1%
associate-/l*76.8%
Simplified76.8%
Taylor expanded in V around 0 90.1%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
div-inv95.7%
Applied egg-rr95.7%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.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 (/ A (* V l))))
(if (<= t_0 1e-318)
(sqrt (* (/ A l) (* c0 (/ c0 V))))
(if (<= t_0 5e+259)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (/ V (/ A l))))))))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 <= 1e-318) {
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
} else if (t_0 <= 5e+259) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / sqrt((V / (A / 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 = a / (v * l)
if (t_0 <= 1d-318) then
tmp = sqrt(((a / l) * (c0 * (c0 / v))))
else if (t_0 <= 5d+259) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / sqrt((v / (a / 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 = A / (V * l);
double tmp;
if (t_0 <= 1e-318) {
tmp = Math.sqrt(((A / l) * (c0 * (c0 / V))));
} else if (t_0 <= 5e+259) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
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 <= 1e-318: tmp = math.sqrt(((A / l) * (c0 * (c0 / V)))) elif t_0 <= 5e+259: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((V / (A / l))) 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 <= 1e-318) tmp = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))); elseif (t_0 <= 5e+259) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-318)
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
elseif (t_0 <= 5e+259)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / sqrt((V / (A / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-318], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+259], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $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 10^{-318}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+259}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999875e-319Initial program 36.0%
associate-/r*51.6%
clear-num49.3%
sqrt-div49.3%
metadata-eval49.3%
div-inv49.3%
clear-num49.3%
Applied egg-rr49.3%
un-div-inv49.4%
Applied egg-rr49.4%
associate-*r/35.0%
*-commutative35.0%
associate-/l*49.4%
Simplified49.4%
associate-*r/35.0%
associate-*l/49.4%
*-commutative49.4%
clear-num49.3%
add-sqr-sqrt40.8%
sqrt-unprod39.0%
clear-num39.1%
clear-num39.1%
frac-times36.3%
add-sqr-sqrt36.3%
*-commutative36.3%
associate-*l/34.2%
associate-*r/36.3%
add-sqr-sqrt36.3%
frac-times39.1%
pow239.1%
Applied egg-rr35.1%
associate-*l/40.6%
*-commutative40.6%
times-frac42.8%
Simplified42.8%
unpow242.8%
*-un-lft-identity42.8%
times-frac53.1%
Applied egg-rr53.1%
if 9.9999875e-319 < (/.f64 A (*.f64 V l)) < 5.00000000000000033e259Initial program 99.6%
associate-/r*89.2%
clear-num89.3%
sqrt-div89.2%
metadata-eval89.2%
div-inv88.3%
clear-num88.8%
Applied egg-rr88.8%
un-div-inv88.9%
Applied egg-rr88.9%
associate-*r/99.6%
*-commutative99.6%
associate-/l*87.8%
Simplified87.8%
Taylor expanded in V around 0 99.6%
if 5.00000000000000033e259 < (/.f64 A (*.f64 V l)) Initial program 43.7%
associate-/r*66.0%
clear-num66.0%
sqrt-div69.0%
metadata-eval69.0%
div-inv69.0%
clear-num69.0%
Applied egg-rr69.0%
un-div-inv69.1%
Applied egg-rr69.1%
associate-*r/45.3%
*-commutative45.3%
associate-*l/69.1%
remove-double-div69.0%
associate-/l/69.0%
associate-*r/69.0%
*-rgt-identity69.0%
associate-/r/66.0%
*-lft-identity66.0%
associate-*r/66.0%
associate-*l/65.9%
associate-/l*67.6%
associate-/r*70.7%
remove-double-div70.8%
Simplified70.8%
Final simplification84.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 (/ A (* V l))))
(if (<= t_0 1e-318)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+259)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (/ V (/ A l))))))))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 <= 1e-318) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+259) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / sqrt((V / (A / 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 = a / (v * l)
if (t_0 <= 1d-318) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+259) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / sqrt((v / (a / 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 = A / (V * l);
double tmp;
if (t_0 <= 1e-318) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+259) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
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 <= 1e-318: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+259: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((V / (A / l))) 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 <= 1e-318) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+259) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-318)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+259)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / sqrt((V / (A / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-318], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+259], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $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 10^{-318}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+259}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999875e-319Initial program 36.0%
associate-/r*51.6%
clear-num49.3%
sqrt-div49.3%
metadata-eval49.3%
div-inv49.3%
clear-num49.3%
Applied egg-rr49.3%
Taylor expanded in c0 around 0 36.0%
*-commutative36.0%
associate-/l/51.8%
Simplified51.8%
if 9.9999875e-319 < (/.f64 A (*.f64 V l)) < 5.00000000000000033e259Initial program 99.6%
associate-/r*89.2%
clear-num89.3%
sqrt-div89.2%
metadata-eval89.2%
div-inv88.3%
clear-num88.8%
Applied egg-rr88.8%
un-div-inv88.9%
Applied egg-rr88.9%
associate-*r/99.6%
*-commutative99.6%
associate-/l*87.8%
Simplified87.8%
Taylor expanded in V around 0 99.6%
if 5.00000000000000033e259 < (/.f64 A (*.f64 V l)) Initial program 43.7%
associate-/r*66.0%
clear-num66.0%
sqrt-div69.0%
metadata-eval69.0%
div-inv69.0%
clear-num69.0%
Applied egg-rr69.0%
un-div-inv69.1%
Applied egg-rr69.1%
associate-*r/45.3%
*-commutative45.3%
associate-*l/69.1%
remove-double-div69.0%
associate-/l/69.0%
associate-*r/69.0%
*-rgt-identity69.0%
associate-/r/66.0%
*-lft-identity66.0%
associate-*r/66.0%
associate-*l/65.9%
associate-/l*67.6%
associate-/r*70.7%
remove-double-div70.8%
Simplified70.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 (/ A (* V l))))
(if (<= t_0 1e-318)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+259) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ V (/ A l))))))))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 <= 1e-318) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+259) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V / (A / 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 = a / (v * l)
if (t_0 <= 1d-318) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+259) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v / (a / 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 = A / (V * l);
double tmp;
if (t_0 <= 1e-318) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+259) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
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 <= 1e-318: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+259: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V / (A / l))) 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 <= 1e-318) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+259) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-318)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+259)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V / (A / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-318], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+259], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $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 10^{-318}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+259}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999875e-319Initial program 36.0%
associate-/r*51.6%
clear-num49.3%
sqrt-div49.3%
metadata-eval49.3%
div-inv49.3%
clear-num49.3%
Applied egg-rr49.3%
Taylor expanded in c0 around 0 36.0%
*-commutative36.0%
associate-/l/51.8%
Simplified51.8%
if 9.9999875e-319 < (/.f64 A (*.f64 V l)) < 5.00000000000000033e259Initial program 99.6%
if 5.00000000000000033e259 < (/.f64 A (*.f64 V l)) Initial program 43.7%
associate-/r*66.0%
clear-num66.0%
sqrt-div69.0%
metadata-eval69.0%
div-inv69.0%
clear-num69.0%
Applied egg-rr69.0%
un-div-inv69.1%
Applied egg-rr69.1%
associate-*r/45.3%
*-commutative45.3%
associate-*l/69.1%
remove-double-div69.0%
associate-/l/69.0%
associate-*r/69.0%
*-rgt-identity69.0%
associate-/r/66.0%
*-lft-identity66.0%
associate-*r/66.0%
associate-*l/65.9%
associate-/l*67.6%
associate-/r*70.7%
remove-double-div70.8%
Simplified70.8%
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.7%
herbie shell --seed 2024123
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))