
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-321)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 4e-309)
(sqrt (/ (* A (* c0_m (* c0_m (/ 1.0 V)))) l))
(* c0_m (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-321) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 4e-309) {
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
} else {
tmp = c0_m * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-321) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 4e-309) {
tmp = Math.sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
} else {
tmp = c0_m * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-321: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 4e-309: tmp = math.sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l)) else: tmp = c0_m * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-321) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 4e-309) tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m * Float64(1.0 / V)))) / l)); else tmp = Float64(c0_m * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-321)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 4e-309)
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
else
tmp = c0_m * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-321], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-309], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-321}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-309}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \left(c0\_m \cdot \frac{1}{V}\right)\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 48.6%
associate-/r*75.9%
sqrt-div38.5%
div-inv38.5%
Applied egg-rr38.5%
associate-*r/38.5%
*-rgt-identity38.5%
Simplified38.5%
if -inf.0 < (*.f64 V l) < -4.99994e-321Initial program 85.1%
frac-2neg85.1%
sqrt-div98.7%
distribute-rgt-neg-in98.7%
Applied egg-rr98.7%
if -4.99994e-321 < (*.f64 V l) < 3.9999999999999977e-309Initial program 40.8%
add-sqr-sqrt40.8%
pow240.8%
pow1/240.8%
sqrt-pow140.8%
metadata-eval40.8%
Applied egg-rr40.8%
Taylor expanded in c0 around 0 40.8%
associate-/l/58.3%
Simplified58.3%
add-sqr-sqrt32.0%
sqrt-unprod27.8%
swap-sqr23.0%
add-sqr-sqrt23.0%
associate-/l/20.5%
pow220.5%
Applied egg-rr20.5%
associate-/r*23.0%
associate-*l/23.3%
associate-*l/21.3%
associate-/l*23.6%
Simplified23.6%
div-inv23.6%
unpow223.6%
associate-*l*28.0%
Applied egg-rr28.0%
if 3.9999999999999977e-309 < (*.f64 V l) Initial program 86.9%
pow1/286.9%
div-inv86.9%
unpow-prod-down90.6%
pow1/290.6%
associate-/r*90.6%
Applied egg-rr90.6%
unpow1/290.6%
Simplified90.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+208) t_0 (* c0_m (/ 1.0 (sqrt (* V (/ l A))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 2e+208) {
tmp = t_0;
} else {
tmp = c0_m * (1.0 / sqrt((V * (l / A))));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
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_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 2d+208) then
tmp = t_0
else
tmp = c0_m * (1.0d0 / sqrt((v * (l / a))))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+208) {
tmp = t_0;
} else {
tmp = c0_m * (1.0 / Math.sqrt((V * (l / A))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 2e+208: tmp = t_0 else: tmp = c0_m * (1.0 / math.sqrt((V * (l / A)))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+208) tmp = t_0; else tmp = Float64(c0_m * Float64(1.0 / sqrt(Float64(V * Float64(l / A))))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 2e+208)
tmp = t_0;
else
tmp = c0_m * (1.0 / sqrt((V * (l / A))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+208], t$95$0, N[(c0$95$m * N[(1.0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+208}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 71.3%
associate-/r*70.8%
Simplified70.8%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e208Initial program 98.7%
if 2e208 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 69.1%
add-sqr-sqrt69.1%
pow269.1%
pow1/269.1%
sqrt-pow169.1%
metadata-eval69.1%
Applied egg-rr69.1%
pow-pow69.1%
metadata-eval69.1%
pow1/269.1%
clear-num69.1%
sqrt-div71.7%
metadata-eval71.7%
associate-/l*84.1%
Applied egg-rr84.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 2e+294)))
(* c0_m (sqrt (/ (/ A V) l)))
t_0))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+294)) {
tmp = c0_m * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
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_m * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 2d+294))) then
tmp = c0_m * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+294)) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 2e+294): tmp = c0_m * math.sqrt(((A / V) / l)) else: tmp = t_0 return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 2e+294)) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 2e+294)))
tmp = c0_m * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2e+294]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 2 \cdot 10^{+294}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 2.00000000000000013e294 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 70.3%
associate-/r*71.9%
Simplified71.9%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000013e294Initial program 97.6%
Final simplification78.0%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+208) t_0 (/ c0_m (sqrt (/ V (/ A l)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 2e+208) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V / (A / l)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
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_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 2d+208) then
tmp = t_0
else
tmp = c0_m / sqrt((v / (a / l)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+208) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V / (A / l)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 2e+208: tmp = t_0 else: tmp = c0_m / math.sqrt((V / (A / l))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+208) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V / Float64(A / l)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 2e+208)
tmp = t_0;
else
tmp = c0_m / sqrt((V / (A / l)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+208], t$95$0, N[(c0$95$m / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+208}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 71.3%
associate-/r*70.8%
Simplified70.8%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e208Initial program 98.7%
if 2e208 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 69.1%
add-sqr-sqrt69.1%
pow269.1%
pow1/269.1%
sqrt-pow169.1%
metadata-eval69.1%
Applied egg-rr69.1%
pow-pow69.1%
metadata-eval69.1%
pow1/269.1%
associate-/r*81.5%
sqrt-undiv50.3%
clear-num50.2%
un-div-inv50.3%
clear-num50.2%
sqrt-undiv81.4%
associate-/r*69.0%
frac-2neg69.0%
distribute-rgt-neg-out69.0%
sqrt-undiv40.1%
clear-num40.1%
sqrt-undiv71.7%
distribute-rgt-neg-out71.7%
frac-2neg71.7%
associate-/l*84.1%
Applied egg-rr84.1%
clear-num84.1%
div-inv84.1%
Applied egg-rr84.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+208) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 2e+208) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
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_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 2d+208) then
tmp = t_0
else
tmp = c0_m / sqrt((v * (l / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+208) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 2e+208: tmp = t_0 else: tmp = c0_m / math.sqrt((V * (l / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+208) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 2e+208)
tmp = t_0;
else
tmp = c0_m / sqrt((V * (l / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+208], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+208}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 71.3%
associate-/r*70.8%
Simplified70.8%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e208Initial program 98.7%
if 2e208 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 69.1%
add-sqr-sqrt69.1%
pow269.1%
pow1/269.1%
sqrt-pow169.1%
metadata-eval69.1%
Applied egg-rr69.1%
pow-pow69.1%
metadata-eval69.1%
pow1/269.1%
associate-/r*81.5%
sqrt-undiv50.3%
clear-num50.2%
un-div-inv50.3%
clear-num50.2%
sqrt-undiv81.4%
associate-/r*69.0%
frac-2neg69.0%
distribute-rgt-neg-out69.0%
sqrt-undiv40.1%
clear-num40.1%
sqrt-undiv71.7%
distribute-rgt-neg-out71.7%
frac-2neg71.7%
associate-/l*84.1%
Applied egg-rr84.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+199) t_0 (* c0_m (sqrt (/ (/ A l) V))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 2e+199) {
tmp = t_0;
} else {
tmp = c0_m * sqrt(((A / l) / V));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
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_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 2d+199) then
tmp = t_0
else
tmp = c0_m * sqrt(((a / l) / v))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+199) {
tmp = t_0;
} else {
tmp = c0_m * Math.sqrt(((A / l) / V));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 2e+199: tmp = t_0 else: tmp = c0_m * math.sqrt(((A / l) / V)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+199) tmp = t_0; else tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 2e+199)
tmp = t_0;
else
tmp = c0_m * sqrt(((A / l) / V));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+199], t$95$0, N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+199}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 71.3%
associate-/r*70.8%
Simplified70.8%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000019e199Initial program 98.6%
if 2.00000000000000019e199 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 70.7%
add-sqr-sqrt70.7%
pow270.7%
pow1/270.7%
sqrt-pow170.7%
metadata-eval70.7%
Applied egg-rr70.7%
Taylor expanded in c0 around 0 70.7%
associate-/l/82.4%
Simplified82.4%
Final simplification78.3%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= V -2e-310)
(* c0_m (pow (* (pow (/ A (- l)) 0.25) (pow (/ -1.0 V) 0.25)) 2.0))
(* (/ c0_m (sqrt V)) (/ (sqrt A) (sqrt l))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (V <= -2e-310) {
tmp = c0_m * pow((pow((A / -l), 0.25) * pow((-1.0 / V), 0.25)), 2.0);
} else {
tmp = (c0_m / sqrt(V)) * (sqrt(A) / sqrt(l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-2d-310)) then
tmp = c0_m * ((((a / -l) ** 0.25d0) * (((-1.0d0) / v) ** 0.25d0)) ** 2.0d0)
else
tmp = (c0_m / sqrt(v)) * (sqrt(a) / sqrt(l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (V <= -2e-310) {
tmp = c0_m * Math.pow((Math.pow((A / -l), 0.25) * Math.pow((-1.0 / V), 0.25)), 2.0);
} else {
tmp = (c0_m / Math.sqrt(V)) * (Math.sqrt(A) / Math.sqrt(l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if V <= -2e-310: tmp = c0_m * math.pow((math.pow((A / -l), 0.25) * math.pow((-1.0 / V), 0.25)), 2.0) else: tmp = (c0_m / math.sqrt(V)) * (math.sqrt(A) / math.sqrt(l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (V <= -2e-310) tmp = Float64(c0_m * (Float64((Float64(A / Float64(-l)) ^ 0.25) * (Float64(-1.0 / V) ^ 0.25)) ^ 2.0)); else tmp = Float64(Float64(c0_m / sqrt(V)) * Float64(sqrt(A) / sqrt(l))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if (V <= -2e-310)
tmp = c0_m * ((((A / -l) ^ 0.25) * ((-1.0 / V) ^ 0.25)) ^ 2.0);
else
tmp = (c0_m / sqrt(V)) * (sqrt(A) / sqrt(l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[V, -2e-310], N[(c0$95$m * N[Power[N[(N[Power[N[(A / (-l)), $MachinePrecision], 0.25], $MachinePrecision] * N[Power[N[(-1.0 / V), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0\_m \cdot {\left({\left(\frac{A}{-\ell}\right)}^{0.25} \cdot {\left(\frac{-1}{V}\right)}^{0.25}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V}} \cdot \frac{\sqrt{A}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if V < -1.999999999999994e-310Initial program 79.2%
add-sqr-sqrt78.9%
pow278.9%
pow1/278.9%
sqrt-pow178.9%
metadata-eval78.9%
Applied egg-rr78.9%
Taylor expanded in V around -inf 84.2%
distribute-lft-in84.2%
exp-sum84.5%
*-commutative84.5%
*-commutative84.5%
exp-to-pow85.3%
*-commutative85.3%
mul-1-neg85.3%
distribute-neg-frac285.3%
*-commutative85.3%
exp-to-pow89.1%
Simplified89.1%
if -1.999999999999994e-310 < V Initial program 74.4%
associate-/r*71.5%
clear-num70.6%
sqrt-div71.0%
metadata-eval71.0%
div-inv70.4%
clear-num70.4%
Applied egg-rr70.4%
Applied egg-rr45.4%
*-commutative45.4%
times-frac48.1%
Simplified48.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 1e-315)
(/ (* c0_m (sqrt (/ A V))) (sqrt l))
(if (<= t_0 5e+306)
(* c0_m (sqrt t_0))
(sqrt (/ (* A (* c0_m (* c0_m (/ 1.0 V)))) l)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = (c0_m * sqrt((A / V))) / sqrt(l);
} else if (t_0 <= 5e+306) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
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-315) then
tmp = (c0_m * sqrt((a / v))) / sqrt(l)
else if (t_0 <= 5d+306) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((a * (c0_m * (c0_m * (1.0d0 / v)))) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = (c0_m * Math.sqrt((A / V))) / Math.sqrt(l);
} else if (t_0 <= 5e+306) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-315: tmp = (c0_m * math.sqrt((A / V))) / math.sqrt(l) elif t_0 <= 5e+306: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-315) tmp = Float64(Float64(c0_m * sqrt(Float64(A / V))) / sqrt(l)); elseif (t_0 <= 5e+306) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m * Float64(1.0 / V)))) / l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-315)
tmp = (c0_m * sqrt((A / V))) / sqrt(l);
elseif (t_0 <= 5e+306)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-315], N[(N[(c0$95$m * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-315}:\\
\;\;\;\;\frac{c0\_m \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \left(c0\_m \cdot \frac{1}{V}\right)\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.999999985e-316Initial program 38.2%
*-commutative38.2%
associate-/r*55.3%
sqrt-div46.2%
associate-*l/46.2%
Applied egg-rr46.2%
if 9.999999985e-316 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
if 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 45.6%
add-sqr-sqrt45.6%
pow245.6%
pow1/245.6%
sqrt-pow145.6%
metadata-eval45.6%
Applied egg-rr45.6%
Taylor expanded in c0 around 0 45.6%
associate-/l/56.5%
Simplified56.5%
add-sqr-sqrt30.1%
sqrt-unprod27.2%
swap-sqr25.5%
add-sqr-sqrt25.6%
associate-/l/23.9%
pow223.9%
Applied egg-rr23.9%
associate-/r*25.6%
associate-*l/27.4%
associate-*l/27.7%
associate-/l*27.7%
Simplified27.7%
div-inv27.7%
unpow227.7%
associate-*l*29.0%
Applied egg-rr29.0%
Final simplification74.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 1e-315)
(/ c0_m (* (sqrt l) (sqrt (/ V A))))
(if (<= t_0 5e+306)
(* c0_m (sqrt t_0))
(sqrt (/ (* A (* c0_m (* c0_m (/ 1.0 V)))) l)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
} else if (t_0 <= 5e+306) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
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-315) then
tmp = c0_m / (sqrt(l) * sqrt((v / a)))
else if (t_0 <= 5d+306) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((a * (c0_m * (c0_m * (1.0d0 / v)))) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if (t_0 <= 5e+306) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-315: tmp = c0_m / (math.sqrt(l) * math.sqrt((V / A))) elif t_0 <= 5e+306: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-315) tmp = Float64(c0_m / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (t_0 <= 5e+306) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m * Float64(1.0 / V)))) / l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-315)
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
elseif (t_0 <= 5e+306)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-315], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-315}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \left(c0\_m \cdot \frac{1}{V}\right)\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.999999985e-316Initial program 38.2%
add-sqr-sqrt38.2%
pow238.2%
pow1/238.2%
sqrt-pow138.2%
metadata-eval38.2%
Applied egg-rr38.2%
pow-pow38.2%
metadata-eval38.2%
pow1/238.2%
associate-/r*55.3%
sqrt-undiv46.2%
clear-num46.2%
un-div-inv46.3%
clear-num46.2%
sqrt-undiv55.3%
associate-/r*38.2%
frac-2neg38.2%
distribute-rgt-neg-out38.2%
sqrt-undiv39.2%
clear-num39.2%
sqrt-undiv36.7%
distribute-rgt-neg-out36.7%
frac-2neg36.7%
associate-/l*48.8%
Applied egg-rr48.8%
Taylor expanded in V around 0 36.7%
*-commutative36.7%
associate-*r/48.7%
Simplified48.7%
*-commutative48.7%
sqrt-prod46.3%
Applied egg-rr46.3%
if 9.999999985e-316 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
if 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 45.6%
add-sqr-sqrt45.6%
pow245.6%
pow1/245.6%
sqrt-pow145.6%
metadata-eval45.6%
Applied egg-rr45.6%
Taylor expanded in c0 around 0 45.6%
associate-/l/56.5%
Simplified56.5%
add-sqr-sqrt30.1%
sqrt-unprod27.2%
swap-sqr25.5%
add-sqr-sqrt25.6%
associate-/l/23.9%
pow223.9%
Applied egg-rr23.9%
associate-/r*25.6%
associate-*l/27.4%
associate-*l/27.7%
associate-/l*27.7%
Simplified27.7%
div-inv27.7%
unpow227.7%
associate-*l*29.0%
Applied egg-rr29.0%
Final simplification74.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 1e-315)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= t_0 5e+306)
(* c0_m (sqrt t_0))
(sqrt (/ (* A (* c0_m (* c0_m (/ 1.0 V)))) l)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if (t_0 <= 5e+306) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
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-315) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if (t_0 <= 5d+306) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((a * (c0_m * (c0_m * (1.0d0 / v)))) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (t_0 <= 5e+306) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-315: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif t_0 <= 5e+306: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-315) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (t_0 <= 5e+306) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m * Float64(1.0 / V)))) / l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-315)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif (t_0 <= 5e+306)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-315], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-315}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \left(c0\_m \cdot \frac{1}{V}\right)\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.999999985e-316Initial program 38.2%
associate-/r*55.3%
sqrt-div46.2%
div-inv46.1%
Applied egg-rr46.1%
associate-*r/46.2%
*-rgt-identity46.2%
Simplified46.2%
if 9.999999985e-316 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
if 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 45.6%
add-sqr-sqrt45.6%
pow245.6%
pow1/245.6%
sqrt-pow145.6%
metadata-eval45.6%
Applied egg-rr45.6%
Taylor expanded in c0 around 0 45.6%
associate-/l/56.5%
Simplified56.5%
add-sqr-sqrt30.1%
sqrt-unprod27.2%
swap-sqr25.5%
add-sqr-sqrt25.6%
associate-/l/23.9%
pow223.9%
Applied egg-rr23.9%
associate-/r*25.6%
associate-*l/27.4%
associate-*l/27.7%
associate-/l*27.7%
Simplified27.7%
div-inv27.7%
unpow227.7%
associate-*l*29.0%
Applied egg-rr29.0%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 1e-315)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+306)
(* c0_m (sqrt t_0))
(sqrt (/ (* A (* c0_m (* c0_m (/ 1.0 V)))) l)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 5e+306) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
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-315) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 5d+306) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((a * (c0_m * (c0_m * (1.0d0 / v)))) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+306) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-315: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 5e+306: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-315) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+306) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m * Float64(1.0 / V)))) / l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-315)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 5e+306)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / V)))) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-315], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-315}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \left(c0\_m \cdot \frac{1}{V}\right)\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.999999985e-316Initial program 38.2%
associate-/r*55.3%
Simplified55.3%
if 9.999999985e-316 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
if 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 45.6%
add-sqr-sqrt45.6%
pow245.6%
pow1/245.6%
sqrt-pow145.6%
metadata-eval45.6%
Applied egg-rr45.6%
Taylor expanded in c0 around 0 45.6%
associate-/l/56.5%
Simplified56.5%
add-sqr-sqrt30.1%
sqrt-unprod27.2%
swap-sqr25.5%
add-sqr-sqrt25.6%
associate-/l/23.9%
pow223.9%
Applied egg-rr23.9%
associate-/r*25.6%
associate-*l/27.4%
associate-*l/27.7%
associate-/l*27.7%
Simplified27.7%
div-inv27.7%
unpow227.7%
associate-*l*29.0%
Applied egg-rr29.0%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (* c0_s (* c0_m (sqrt (/ A (* V l))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
return c0_s * (c0_m * sqrt((A / (V * l))));
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0_s * (c0_m * sqrt((a / (v * l))))
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
return c0_s * (c0_m * Math.sqrt((A / (V * l))));
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): return c0_s * (c0_m * math.sqrt((A / (V * l))))
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) return Float64(c0_s * Float64(c0_m * sqrt(Float64(A / Float64(V * l))))) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp = code(c0_s, c0_m, A, V, l)
tmp = c0_s * (c0_m * sqrt((A / (V * l))));
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)
\end{array}
Initial program 76.8%
herbie shell --seed 2024116
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))