
(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))
(* (* (sqrt (/ A V)) (pow l -0.5)) c0_m)
(if (<= (* V l) -1e-274)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(sqrt (/ (* (/ c0_m V) (* A c0_m)) l))
(if (<= (* V l) 4e+237)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(* 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) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (sqrt((A / V)) * pow(l, -0.5)) * c0_m;
} else if ((V * l) <= -1e-274) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
} else if ((V * l) <= 4e+237) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0_m * sqrt(((A / 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 = (Math.sqrt((A / V)) * Math.pow(l, -0.5)) * c0_m;
} else if ((V * l) <= -1e-274) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt((((c0_m / V) * (A * c0_m)) / l));
} else if ((V * l) <= 4e+237) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0_m * Math.sqrt(((A / 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 = (math.sqrt((A / V)) * math.pow(l, -0.5)) * c0_m elif (V * l) <= -1e-274: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.sqrt((((c0_m / V) * (A * c0_m)) / l)) elif (V * l) <= 4e+237: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0_m * math.sqrt(((A / 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(Float64(sqrt(Float64(A / V)) * (l ^ -0.5)) * c0_m); elseif (Float64(V * l) <= -1e-274) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(A * c0_m)) / l)); elseif (Float64(V * l) <= 4e+237) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0_m * sqrt(Float64(Float64(A / 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 = (sqrt((A / V)) * (l ^ -0.5)) * c0_m;
elseif ((V * l) <= -1e-274)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
elseif ((V * l) <= 4e+237)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = c0_m * sqrt(((A / 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[(N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision] * c0$95$m), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-274], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(A * c0$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+237], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / 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 \cdot \ell \leq -\infty:\\
\;\;\;\;\left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right) \cdot c0\_m\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-274}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+237}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 38.4%
clear-num38.4%
associate-/r/38.4%
associate-/r*38.4%
Applied egg-rr38.4%
Taylor expanded in c0 around 0 38.4%
associate-/l/63.3%
Simplified63.3%
associate-/l/38.4%
associate-/r*63.3%
frac-2neg63.3%
distribute-frac-neg63.3%
sqrt-undiv30.4%
div-inv30.2%
add-sqr-sqrt30.2%
sqrt-unprod21.9%
sqr-neg21.9%
sqrt-unprod0.0%
add-sqr-sqrt8.7%
clear-num13.0%
clear-num8.7%
pow1/28.7%
pow-flip8.7%
add-sqr-sqrt8.7%
sqrt-unprod37.2%
sqr-neg37.2%
sqrt-unprod61.0%
add-sqr-sqrt61.1%
metadata-eval61.1%
Applied egg-rr61.1%
if -inf.0 < (*.f64 V l) < -9.99999999999999966e-275Initial program 84.3%
frac-2neg84.3%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -9.99999999999999966e-275 < (*.f64 V l) < -0.0Initial program 50.0%
add-sqr-sqrt41.1%
sqrt-unprod41.3%
*-commutative41.3%
*-commutative41.3%
swap-sqr40.9%
add-sqr-sqrt40.9%
pow240.9%
Applied egg-rr40.9%
associate-/r*45.1%
Simplified45.1%
Taylor expanded in A around 0 44.8%
*-commutative44.8%
times-frac49.0%
associate-/r/45.1%
associate-/r/45.2%
associate-/r*45.2%
Simplified45.2%
unpow245.2%
div-inv45.2%
times-frac56.8%
Applied egg-rr56.8%
div-inv56.9%
inv-pow56.9%
pow-flip57.0%
metadata-eval57.0%
pow157.0%
Applied egg-rr57.0%
if -0.0 < (*.f64 V l) < 3.99999999999999976e237Initial program 86.1%
sqrt-div99.5%
div-inv99.4%
Applied egg-rr99.4%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 3.99999999999999976e237 < (*.f64 V l) Initial program 47.0%
associate-/r*70.8%
Simplified70.8%
Final simplification89.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-322)
(* c0_m (/ 1.0 (/ (sqrt l) (sqrt (/ A V)))))
(if (<= t_0 4e+300)
(* c0_m (pow (/ (* V l) A) -0.5))
(sqrt (/ (* (/ c0_m V) (* A c0_m)) 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-322) {
tmp = c0_m * (1.0 / (sqrt(l) / sqrt((A / V))));
} else if (t_0 <= 4e+300) {
tmp = c0_m * pow(((V * l) / A), -0.5);
} else {
tmp = sqrt((((c0_m / V) * (A * c0_m)) / 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-322) then
tmp = c0_m * (1.0d0 / (sqrt(l) / sqrt((a / v))))
else if (t_0 <= 4d+300) then
tmp = c0_m * (((v * l) / a) ** (-0.5d0))
else
tmp = sqrt((((c0_m / v) * (a * c0_m)) / 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-322) {
tmp = c0_m * (1.0 / (Math.sqrt(l) / Math.sqrt((A / V))));
} else if (t_0 <= 4e+300) {
tmp = c0_m * Math.pow(((V * l) / A), -0.5);
} else {
tmp = Math.sqrt((((c0_m / V) * (A * c0_m)) / 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-322: tmp = c0_m * (1.0 / (math.sqrt(l) / math.sqrt((A / V)))) elif t_0 <= 4e+300: tmp = c0_m * math.pow(((V * l) / A), -0.5) else: tmp = math.sqrt((((c0_m / V) * (A * c0_m)) / 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-322) tmp = Float64(c0_m * Float64(1.0 / Float64(sqrt(l) / sqrt(Float64(A / V))))); elseif (t_0 <= 4e+300) tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5)); else tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(A * c0_m)) / 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-322)
tmp = c0_m * (1.0 / (sqrt(l) / sqrt((A / V))));
elseif (t_0 <= 4e+300)
tmp = c0_m * (((V * l) / A) ^ -0.5);
else
tmp = sqrt((((c0_m / V) * (A * c0_m)) / 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-322], N[(c0$95$m * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(A * c0$95$m), $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^{-322}:\\
\;\;\;\;c0\_m \cdot \frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.88131e-323Initial program 35.5%
associate-/r*55.0%
sqrt-div47.5%
clear-num47.6%
Applied egg-rr47.6%
if 9.88131e-323 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300Initial program 99.6%
frac-2neg99.6%
sqrt-div46.3%
distribute-rgt-neg-in46.3%
Applied egg-rr46.3%
distribute-rgt-neg-out46.3%
*-commutative46.3%
distribute-rgt-neg-in46.3%
Simplified46.3%
clear-num46.2%
sqrt-undiv99.4%
distribute-rgt-neg-out99.4%
frac-2neg99.4%
sqrt-div53.1%
add-sqr-sqrt22.8%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod22.8%
add-sqr-sqrt53.1%
sqrt-div99.4%
associate-*r/84.5%
Applied egg-rr99.7%
if 4.0000000000000002e300 < (/.f64 A (*.f64 V l)) Initial program 46.8%
add-sqr-sqrt28.0%
sqrt-unprod28.1%
*-commutative28.1%
*-commutative28.1%
swap-sqr27.7%
add-sqr-sqrt27.7%
pow227.7%
Applied egg-rr27.7%
associate-/r*29.7%
Simplified29.7%
Taylor expanded in A around 0 32.6%
*-commutative32.6%
times-frac32.6%
associate-/r/29.7%
associate-/r/29.8%
associate-/r*31.4%
Simplified31.4%
unpow231.4%
div-inv31.4%
times-frac43.0%
Applied egg-rr43.0%
div-inv43.0%
inv-pow43.0%
pow-flip43.0%
metadata-eval43.0%
pow143.0%
Applied egg-rr43.0%
Final simplification75.9%
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-322)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= t_0 4e+300)
(* c0_m (pow (/ (* V l) A) -0.5))
(sqrt (/ (* (/ c0_m V) (* A c0_m)) 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-322) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if (t_0 <= 4e+300) {
tmp = c0_m * pow(((V * l) / A), -0.5);
} else {
tmp = sqrt((((c0_m / V) * (A * c0_m)) / 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-322) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if (t_0 <= 4d+300) then
tmp = c0_m * (((v * l) / a) ** (-0.5d0))
else
tmp = sqrt((((c0_m / v) * (a * c0_m)) / 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-322) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (t_0 <= 4e+300) {
tmp = c0_m * Math.pow(((V * l) / A), -0.5);
} else {
tmp = Math.sqrt((((c0_m / V) * (A * c0_m)) / 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-322: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif t_0 <= 4e+300: tmp = c0_m * math.pow(((V * l) / A), -0.5) else: tmp = math.sqrt((((c0_m / V) * (A * c0_m)) / 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-322) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (t_0 <= 4e+300) tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5)); else tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(A * c0_m)) / 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-322)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif (t_0 <= 4e+300)
tmp = c0_m * (((V * l) / A) ^ -0.5);
else
tmp = sqrt((((c0_m / V) * (A * c0_m)) / 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-322], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(A * c0$95$m), $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^{-322}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.88131e-323Initial program 35.5%
associate-/r*55.0%
sqrt-div47.5%
div-inv47.4%
Applied egg-rr47.4%
associate-*r/47.5%
*-rgt-identity47.5%
Simplified47.5%
if 9.88131e-323 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300Initial program 99.6%
frac-2neg99.6%
sqrt-div46.3%
distribute-rgt-neg-in46.3%
Applied egg-rr46.3%
distribute-rgt-neg-out46.3%
*-commutative46.3%
distribute-rgt-neg-in46.3%
Simplified46.3%
clear-num46.2%
sqrt-undiv99.4%
distribute-rgt-neg-out99.4%
frac-2neg99.4%
sqrt-div53.1%
add-sqr-sqrt22.8%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod22.8%
add-sqr-sqrt53.1%
sqrt-div99.4%
associate-*r/84.5%
Applied egg-rr99.7%
if 4.0000000000000002e300 < (/.f64 A (*.f64 V l)) Initial program 46.8%
add-sqr-sqrt28.0%
sqrt-unprod28.1%
*-commutative28.1%
*-commutative28.1%
swap-sqr27.7%
add-sqr-sqrt27.7%
pow227.7%
Applied egg-rr27.7%
associate-/r*29.7%
Simplified29.7%
Taylor expanded in A around 0 32.6%
*-commutative32.6%
times-frac32.6%
associate-/r/29.7%
associate-/r/29.8%
associate-/r*31.4%
Simplified31.4%
unpow231.4%
div-inv31.4%
times-frac43.0%
Applied egg-rr43.0%
div-inv43.0%
inv-pow43.0%
pow-flip43.0%
metadata-eval43.0%
pow143.0%
Applied egg-rr43.0%
Final simplification75.9%
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 (or (<= t_0 1e-322) (not (<= t_0 4e+300)))
(sqrt (* (/ c0_m V) (/ (* A c0_m) l)))
(* c0_m (pow (/ (* V l) A) -0.5))))))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-322) || !(t_0 <= 4e+300)) {
tmp = sqrt(((c0_m / V) * ((A * c0_m) / l)));
} else {
tmp = c0_m * pow(((V * l) / A), -0.5);
}
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-322) .or. (.not. (t_0 <= 4d+300))) then
tmp = sqrt(((c0_m / v) * ((a * c0_m) / l)))
else
tmp = c0_m * (((v * l) / a) ** (-0.5d0))
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-322) || !(t_0 <= 4e+300)) {
tmp = Math.sqrt(((c0_m / V) * ((A * c0_m) / l)));
} else {
tmp = c0_m * Math.pow(((V * l) / A), -0.5);
}
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-322) or not (t_0 <= 4e+300): tmp = math.sqrt(((c0_m / V) * ((A * c0_m) / l))) else: tmp = c0_m * math.pow(((V * l) / A), -0.5) 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-322) || !(t_0 <= 4e+300)) tmp = sqrt(Float64(Float64(c0_m / V) * Float64(Float64(A * c0_m) / l))); else tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5)); 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-322) || ~((t_0 <= 4e+300)))
tmp = sqrt(((c0_m / V) * ((A * c0_m) / l)));
else
tmp = c0_m * (((V * l) / A) ^ -0.5);
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[Or[LessEqual[t$95$0, 1e-322], N[Not[LessEqual[t$95$0, 4e+300]], $MachinePrecision]], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(N[(A * c0$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $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^{-322} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+300}\right):\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \frac{A \cdot c0\_m}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.88131e-323 or 4.0000000000000002e300 < (/.f64 A (*.f64 V l)) Initial program 40.8%
add-sqr-sqrt31.8%
sqrt-unprod31.8%
*-commutative31.8%
*-commutative31.8%
swap-sqr31.3%
add-sqr-sqrt31.3%
pow231.3%
Applied egg-rr31.3%
associate-/r*33.6%
Simplified33.6%
Taylor expanded in A around 0 34.4%
*-commutative34.4%
times-frac36.5%
associate-/r/32.9%
associate-/r/32.9%
associate-/r*35.9%
Simplified35.9%
unpow235.9%
div-inv35.9%
times-frac45.0%
Applied egg-rr45.0%
associate-/l*44.1%
div-inv44.1%
inv-pow44.1%
pow-flip44.2%
metadata-eval44.2%
pow144.2%
Applied egg-rr44.2%
if 9.88131e-323 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300Initial program 99.6%
frac-2neg99.6%
sqrt-div46.3%
distribute-rgt-neg-in46.3%
Applied egg-rr46.3%
distribute-rgt-neg-out46.3%
*-commutative46.3%
distribute-rgt-neg-in46.3%
Simplified46.3%
clear-num46.2%
sqrt-undiv99.4%
distribute-rgt-neg-out99.4%
frac-2neg99.4%
sqrt-div53.1%
add-sqr-sqrt22.8%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod22.8%
add-sqr-sqrt53.1%
sqrt-div99.4%
associate-*r/84.5%
Applied egg-rr99.7%
Final simplification75.4%
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 (or (<= t_0 0.0) (not (<= t_0 4e+300)))
(sqrt (/ (* (/ c0_m V) (* A c0_m)) l))
(* c0_m (sqrt 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 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+300)) {
tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
} else {
tmp = c0_m * sqrt(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 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+300))) then
tmp = sqrt((((c0_m / v) * (a * c0_m)) / l))
else
tmp = c0_m * sqrt(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 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+300)) {
tmp = Math.sqrt((((c0_m / V) * (A * c0_m)) / l));
} else {
tmp = c0_m * Math.sqrt(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 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+300): tmp = math.sqrt((((c0_m / V) * (A * c0_m)) / l)) else: tmp = c0_m * math.sqrt(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(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+300)) tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(A * c0_m)) / l)); else tmp = Float64(c0_m * sqrt(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 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+300)))
tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
else
tmp = c0_m * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+300]], $MachinePrecision]], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(A * c0$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $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 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+300}\right):\\
\;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.0000000000000002e300 < (/.f64 A (*.f64 V l)) Initial program 40.9%
add-sqr-sqrt32.1%
sqrt-unprod32.1%
*-commutative32.1%
*-commutative32.1%
swap-sqr31.6%
add-sqr-sqrt31.6%
pow231.6%
Applied egg-rr31.6%
associate-/r*33.9%
Simplified33.9%
Taylor expanded in A around 0 34.7%
*-commutative34.7%
times-frac36.8%
associate-/r/33.2%
associate-/r/33.2%
associate-/r*36.2%
Simplified36.2%
unpow236.2%
div-inv36.2%
times-frac45.4%
Applied egg-rr45.4%
div-inv45.4%
inv-pow45.4%
pow-flip45.4%
metadata-eval45.4%
pow145.4%
Applied egg-rr45.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300Initial program 99.1%
Final simplification75.8%
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 0.0)
(sqrt (/ (* (/ c0_m V) (/ c0_m (/ 1.0 A))) l))
(if (<= t_0 4e+300)
(* c0_m (sqrt t_0))
(sqrt (/ (* (/ c0_m V) (* A c0_m)) 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 <= 0.0) {
tmp = sqrt((((c0_m / V) * (c0_m / (1.0 / A))) / l));
} else if (t_0 <= 4e+300) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt((((c0_m / V) * (A * c0_m)) / 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 <= 0.0d0) then
tmp = sqrt((((c0_m / v) * (c0_m / (1.0d0 / a))) / l))
else if (t_0 <= 4d+300) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt((((c0_m / v) * (a * c0_m)) / 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 <= 0.0) {
tmp = Math.sqrt((((c0_m / V) * (c0_m / (1.0 / A))) / l));
} else if (t_0 <= 4e+300) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt((((c0_m / V) * (A * c0_m)) / 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 <= 0.0: tmp = math.sqrt((((c0_m / V) * (c0_m / (1.0 / A))) / l)) elif t_0 <= 4e+300: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt((((c0_m / V) * (A * c0_m)) / 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 <= 0.0) tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(c0_m / Float64(1.0 / A))) / l)); elseif (t_0 <= 4e+300) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(A * c0_m)) / 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 <= 0.0)
tmp = sqrt((((c0_m / V) * (c0_m / (1.0 / A))) / l));
elseif (t_0 <= 4e+300)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt((((c0_m / V) * (A * c0_m)) / 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, 0.0], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / N[(1.0 / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(A * c0$95$m), $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 0:\\
\;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \frac{c0\_m}{\frac{1}{A}}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 35.7%
add-sqr-sqrt35.7%
sqrt-unprod35.7%
*-commutative35.7%
*-commutative35.7%
swap-sqr35.0%
add-sqr-sqrt35.0%
pow235.0%
Applied egg-rr35.0%
associate-/r*37.5%
Simplified37.5%
Taylor expanded in A around 0 36.6%
*-commutative36.6%
times-frac40.6%
associate-/r/36.2%
associate-/r/36.2%
associate-/r*40.4%
Simplified40.4%
unpow240.4%
div-inv40.4%
times-frac47.5%
Applied egg-rr47.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300Initial program 99.1%
if 4.0000000000000002e300 < (/.f64 A (*.f64 V l)) Initial program 46.8%
add-sqr-sqrt28.0%
sqrt-unprod28.1%
*-commutative28.1%
*-commutative28.1%
swap-sqr27.7%
add-sqr-sqrt27.7%
pow227.7%
Applied egg-rr27.7%
associate-/r*29.7%
Simplified29.7%
Taylor expanded in A around 0 32.6%
*-commutative32.6%
times-frac32.6%
associate-/r/29.7%
associate-/r/29.8%
associate-/r*31.4%
Simplified31.4%
unpow231.4%
div-inv31.4%
times-frac43.0%
Applied egg-rr43.0%
div-inv43.0%
inv-pow43.0%
pow-flip43.0%
metadata-eval43.0%
pow143.0%
Applied egg-rr43.0%
Final simplification75.8%
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 2e-254)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 4e+300)
(* c0_m (sqrt t_0))
(* c0_m (pow (* V (/ l A)) -0.5)))))))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 <= 2e-254) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 4e+300) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = c0_m * pow((V * (l / A)), -0.5);
}
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 <= 2d-254) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 4d+300) then
tmp = c0_m * sqrt(t_0)
else
tmp = c0_m * ((v * (l / a)) ** (-0.5d0))
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 <= 2e-254) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 4e+300) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = c0_m * Math.pow((V * (l / A)), -0.5);
}
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 <= 2e-254: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 4e+300: tmp = c0_m * math.sqrt(t_0) else: tmp = c0_m * math.pow((V * (l / A)), -0.5) 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 <= 2e-254) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 4e+300) tmp = Float64(c0_m * sqrt(t_0)); else tmp = Float64(c0_m * (Float64(V * Float64(l / A)) ^ -0.5)); 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 <= 2e-254)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 4e+300)
tmp = c0_m * sqrt(t_0);
else
tmp = c0_m * ((V * (l / A)) ^ -0.5);
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, 2e-254], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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 2 \cdot 10^{-254}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.9999999999999998e-254Initial program 45.5%
clear-num45.1%
associate-/r/45.5%
associate-/r*45.9%
Applied egg-rr45.9%
Taylor expanded in c0 around 0 45.5%
associate-/l/60.6%
Simplified60.6%
if 1.9999999999999998e-254 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300Initial program 99.6%
if 4.0000000000000002e300 < (/.f64 A (*.f64 V l)) Initial program 46.8%
frac-2neg46.8%
sqrt-div31.1%
distribute-rgt-neg-in31.1%
Applied egg-rr31.1%
distribute-rgt-neg-out31.1%
*-commutative31.1%
distribute-rgt-neg-in31.1%
Simplified31.1%
clear-num31.1%
sqrt-undiv51.5%
distribute-rgt-neg-out51.5%
frac-2neg51.5%
sqrt-div46.6%
add-sqr-sqrt27.0%
sqrt-unprod23.5%
sqr-neg23.5%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
*-commutative0.1%
add-sqr-sqrt0.0%
sqrt-unprod23.5%
sqr-neg23.5%
sqrt-unprod27.0%
add-sqr-sqrt46.6%
sqrt-div51.5%
associate-*r/59.9%
Applied egg-rr51.5%
associate-/l*59.9%
Simplified59.9%
Final simplification80.7%
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-322)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 4e+300)
(* c0_m (pow (/ (* V l) A) -0.5))
(* c0_m (pow (* V (/ l A)) -0.5)))))))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-322) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 4e+300) {
tmp = c0_m * pow(((V * l) / A), -0.5);
} else {
tmp = c0_m * pow((V * (l / A)), -0.5);
}
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-322) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 4d+300) then
tmp = c0_m * (((v * l) / a) ** (-0.5d0))
else
tmp = c0_m * ((v * (l / a)) ** (-0.5d0))
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-322) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 4e+300) {
tmp = c0_m * Math.pow(((V * l) / A), -0.5);
} else {
tmp = c0_m * Math.pow((V * (l / A)), -0.5);
}
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-322: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 4e+300: tmp = c0_m * math.pow(((V * l) / A), -0.5) else: tmp = c0_m * math.pow((V * (l / A)), -0.5) 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-322) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 4e+300) tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5)); else tmp = Float64(c0_m * (Float64(V * Float64(l / A)) ^ -0.5)); 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-322)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 4e+300)
tmp = c0_m * (((V * l) / A) ^ -0.5);
else
tmp = c0_m * ((V * (l / A)) ^ -0.5);
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-322], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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^{-322}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.88131e-323Initial program 35.5%
associate-/r*55.0%
Simplified55.0%
if 9.88131e-323 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300Initial program 99.6%
frac-2neg99.6%
sqrt-div46.3%
distribute-rgt-neg-in46.3%
Applied egg-rr46.3%
distribute-rgt-neg-out46.3%
*-commutative46.3%
distribute-rgt-neg-in46.3%
Simplified46.3%
clear-num46.2%
sqrt-undiv99.4%
distribute-rgt-neg-out99.4%
frac-2neg99.4%
sqrt-div53.1%
add-sqr-sqrt22.8%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod22.8%
add-sqr-sqrt53.1%
sqrt-div99.4%
associate-*r/84.5%
Applied egg-rr99.7%
if 4.0000000000000002e300 < (/.f64 A (*.f64 V l)) Initial program 46.8%
frac-2neg46.8%
sqrt-div31.1%
distribute-rgt-neg-in31.1%
Applied egg-rr31.1%
distribute-rgt-neg-out31.1%
*-commutative31.1%
distribute-rgt-neg-in31.1%
Simplified31.1%
clear-num31.1%
sqrt-undiv51.5%
distribute-rgt-neg-out51.5%
frac-2neg51.5%
sqrt-div46.6%
add-sqr-sqrt27.0%
sqrt-unprod23.5%
sqr-neg23.5%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
*-commutative0.1%
add-sqr-sqrt0.0%
sqrt-unprod23.5%
sqr-neg23.5%
sqrt-unprod27.0%
add-sqr-sqrt46.6%
sqrt-div51.5%
associate-*r/59.9%
Applied egg-rr51.5%
associate-/l*59.9%
Simplified59.9%
Final simplification81.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 (or (<= t_0 4e-308) (not (<= t_0 4e+300)))
(* c0_m (sqrt (/ (/ A V) l)))
(* c0_m (sqrt 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 = A / (V * l);
double tmp;
if ((t_0 <= 4e-308) || !(t_0 <= 4e+300)) {
tmp = c0_m * sqrt(((A / V) / l));
} else {
tmp = c0_m * sqrt(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 = a / (v * l)
if ((t_0 <= 4d-308) .or. (.not. (t_0 <= 4d+300))) then
tmp = c0_m * sqrt(((a / v) / l))
else
tmp = c0_m * sqrt(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 = A / (V * l);
double tmp;
if ((t_0 <= 4e-308) || !(t_0 <= 4e+300)) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else {
tmp = c0_m * Math.sqrt(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 = A / (V * l) tmp = 0 if (t_0 <= 4e-308) or not (t_0 <= 4e+300): tmp = c0_m * math.sqrt(((A / V) / l)) else: tmp = c0_m * math.sqrt(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(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 4e-308) || !(t_0 <= 4e+300)) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0_m * sqrt(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 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 4e-308) || ~((t_0 <= 4e+300)))
tmp = c0_m * sqrt(((A / V) / l));
else
tmp = c0_m * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 4e-308], N[Not[LessEqual[t$95$0, 4e+300]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $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 4 \cdot 10^{-308} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+300}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.00000000000000013e-308 or 4.0000000000000002e300 < (/.f64 A (*.f64 V l)) Initial program 41.3%
associate-/r*55.9%
Simplified55.9%
if 4.00000000000000013e-308 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300Initial program 99.6%
Final simplification80.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
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 2e-254)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 4e+300)
(* c0_m (sqrt t_0))
(* 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) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-254) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 4e+300) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = c0_m * sqrt(((A / 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 <= 2d-254) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 4d+300) then
tmp = c0_m * sqrt(t_0)
else
tmp = c0_m * sqrt(((a / 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 <= 2e-254) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 4e+300) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = c0_m * Math.sqrt(((A / 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 <= 2e-254: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 4e+300: tmp = c0_m * math.sqrt(t_0) else: tmp = c0_m * math.sqrt(((A / 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 <= 2e-254) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 4e+300) tmp = Float64(c0_m * sqrt(t_0)); else tmp = Float64(c0_m * sqrt(Float64(Float64(A / 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 <= 2e-254)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 4e+300)
tmp = c0_m * sqrt(t_0);
else
tmp = c0_m * sqrt(((A / 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, 2e-254], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / 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])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-254}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.9999999999999998e-254Initial program 45.5%
clear-num45.1%
associate-/r/45.5%
associate-/r*45.9%
Applied egg-rr45.9%
Taylor expanded in c0 around 0 45.5%
associate-/l/60.6%
Simplified60.6%
if 1.9999999999999998e-254 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300Initial program 99.6%
if 4.0000000000000002e300 < (/.f64 A (*.f64 V l)) Initial program 46.8%
associate-/r*56.1%
Simplified56.1%
Final simplification80.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 2e-254)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+288)
(* c0_m (sqrt t_0))
(/ c0_m (sqrt (* l (/ V 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 = A / (V * l);
double tmp;
if (t_0 <= 2e-254) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 5e+288) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = c0_m / sqrt((l * (V / 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 = a / (v * l)
if (t_0 <= 2d-254) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 5d+288) then
tmp = c0_m * sqrt(t_0)
else
tmp = c0_m / sqrt((l * (v / 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 = A / (V * l);
double tmp;
if (t_0 <= 2e-254) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+288) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = c0_m / Math.sqrt((l * (V / 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 = A / (V * l) tmp = 0 if t_0 <= 2e-254: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 5e+288: tmp = c0_m * math.sqrt(t_0) else: tmp = c0_m / math.sqrt((l * (V / 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e-254) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+288) tmp = Float64(c0_m * sqrt(t_0)); else tmp = Float64(c0_m / sqrt(Float64(l * Float64(V / 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e-254)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 5e+288)
tmp = c0_m * sqrt(t_0);
else
tmp = c0_m / sqrt((l * (V / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-254], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+288], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(l * N[(V / 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 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-254}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.9999999999999998e-254Initial program 45.5%
clear-num45.1%
associate-/r/45.5%
associate-/r*45.9%
Applied egg-rr45.9%
Taylor expanded in c0 around 0 45.5%
associate-/l/60.6%
Simplified60.6%
if 1.9999999999999998e-254 < (/.f64 A (*.f64 V l)) < 5.0000000000000003e288Initial program 99.6%
if 5.0000000000000003e288 < (/.f64 A (*.f64 V l)) Initial program 49.7%
clear-num49.7%
associate-/r/49.6%
associate-/r*49.6%
Applied egg-rr49.6%
*-commutative49.6%
associate-/r*49.6%
div-inv49.7%
sqrt-undiv47.6%
clear-num47.6%
un-div-inv47.7%
sqrt-undiv54.1%
clear-num49.7%
associate-/r*58.4%
clear-num62.5%
div-inv62.6%
clear-num62.6%
Applied egg-rr62.6%
Final simplification80.8%
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 73.9%
Final simplification73.9%
herbie shell --seed 2024059
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))