
(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 10 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) -2e+167)
(* (sqrt (/ A V)) (/ c0_m (sqrt l)))
(if (<= (* V l) -4e-306)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(sqrt (* (/ A V) (* c0_m (/ c0_m l))))
(if (<= (* V l) 1e+206)
(* 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) <= -2e+167) {
tmp = sqrt((A / V)) * (c0_m / sqrt(l));
} else if ((V * l) <= -4e-306) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((A / V) * (c0_m * (c0_m / l))));
} else if ((V * l) <= 1e+206) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-2d+167)) then
tmp = sqrt((a / v)) * (c0_m / sqrt(l))
else if ((v * l) <= (-4d-306)) then
tmp = c0_m * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = sqrt(((a / v) * (c0_m * (c0_m / l))))
else if ((v * l) <= 1d+206) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -2e+167) {
tmp = Math.sqrt((A / V)) * (c0_m / Math.sqrt(l));
} else if ((V * l) <= -4e-306) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((A / V) * (c0_m * (c0_m / l))));
} else if ((V * l) <= 1e+206) {
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) <= -2e+167: tmp = math.sqrt((A / V)) * (c0_m / math.sqrt(l)) elif (V * l) <= -4e-306: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.sqrt(((A / V) * (c0_m * (c0_m / l)))) elif (V * l) <= 1e+206: 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) <= -2e+167) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0_m / sqrt(l))); elseif (Float64(V * l) <= -4e-306) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(A / V) * Float64(c0_m * Float64(c0_m / l)))); elseif (Float64(V * l) <= 1e+206) 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) <= -2e+167)
tmp = sqrt((A / V)) * (c0_m / sqrt(l));
elseif ((V * l) <= -4e-306)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = sqrt(((A / V) * (c0_m * (c0_m / l))));
elseif ((V * l) <= 1e+206)
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], -2e+167], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-306], 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[(A / V), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+206], 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 -2 \cdot 10^{+167}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0\_m}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{V} \cdot \left(c0\_m \cdot \frac{c0\_m}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\
\;\;\;\;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) < -2.0000000000000001e167Initial program 54.8%
associate-/r*70.5%
Simplified70.5%
clear-num70.5%
associate-/r/70.5%
Applied egg-rr70.5%
sqrt-div28.8%
associate-*l/28.8%
*-un-lft-identity28.8%
associate-*r/28.8%
Applied egg-rr28.8%
*-commutative28.8%
associate-*r/28.9%
Simplified28.9%
if -2.0000000000000001e167 < (*.f64 V l) < -4.00000000000000011e-306Initial program 86.2%
frac-2neg86.2%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -4.00000000000000011e-306 < (*.f64 V l) < -0.0Initial program 38.8%
associate-/r*62.0%
Simplified62.0%
clear-num62.0%
associate-/r/62.0%
Applied egg-rr62.0%
div-inv62.0%
associate-*l/62.0%
*-un-lft-identity62.0%
add-sqr-sqrt34.1%
sqrt-unprod34.6%
*-commutative34.6%
*-commutative34.6%
swap-sqr34.4%
add-sqr-sqrt34.4%
frac-times28.1%
*-rgt-identity28.1%
pow228.1%
Applied egg-rr28.1%
associate-*l/28.0%
times-frac40.5%
Simplified40.5%
unpow240.5%
associate-/l*46.2%
Applied egg-rr46.2%
if -0.0 < (*.f64 V l) < 1e206Initial program 88.4%
sqrt-div98.9%
div-inv98.8%
Applied egg-rr98.8%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 1e206 < (*.f64 V l) Initial program 52.3%
associate-/r*76.0%
Simplified76.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 1e-174)
(* c0_m (pow (* l (/ V A)) -0.5))
(if (<= t_0 4e+302)
(* c0_m (sqrt (* A (/ (/ 1.0 V) l))))
(sqrt (* (/ A V) (* c0_m (/ 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 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-174) {
tmp = c0_m * pow((l * (V / A)), -0.5);
} else if (t_0 <= 4e+302) {
tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
} else {
tmp = sqrt(((A / V) * (c0_m * (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 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 1d-174) then
tmp = c0_m * ((l * (v / a)) ** (-0.5d0))
else if (t_0 <= 4d+302) then
tmp = c0_m * sqrt((a * ((1.0d0 / v) / l)))
else
tmp = sqrt(((a / v) * (c0_m * (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 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-174) {
tmp = c0_m * Math.pow((l * (V / A)), -0.5);
} else if (t_0 <= 4e+302) {
tmp = c0_m * Math.sqrt((A * ((1.0 / V) / l)));
} else {
tmp = Math.sqrt(((A / V) * (c0_m * (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 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 1e-174: tmp = c0_m * math.pow((l * (V / A)), -0.5) elif t_0 <= 4e+302: tmp = c0_m * math.sqrt((A * ((1.0 / V) / l))) else: tmp = math.sqrt(((A / V) * (c0_m * (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(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 1e-174) tmp = Float64(c0_m * (Float64(l * Float64(V / A)) ^ -0.5)); elseif (t_0 <= 4e+302) tmp = Float64(c0_m * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); else tmp = sqrt(Float64(Float64(A / V) * Float64(c0_m * Float64(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 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 1e-174)
tmp = c0_m * ((l * (V / A)) ^ -0.5);
elseif (t_0 <= 4e+302)
tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
else
tmp = sqrt(((A / V) * (c0_m * (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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-174], N[(c0$95$m * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+302], N[(c0$95$m * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / 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 10^{-174}:\\
\;\;\;\;c0\_m \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+302}:\\
\;\;\;\;c0\_m \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{V} \cdot \left(c0\_m \cdot \frac{c0\_m}{\ell}\right)}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1e-174Initial program 69.3%
associate-/r*75.0%
Simplified75.0%
clear-num74.7%
associate-/r/75.0%
Applied egg-rr75.0%
clear-num74.5%
sqrt-div74.8%
metadata-eval74.8%
*-un-lft-identity74.8%
times-frac71.1%
clear-num71.1%
/-rgt-identity71.1%
Applied egg-rr71.1%
pow1/271.1%
pow-flip71.2%
associate-*r/69.3%
metadata-eval69.3%
Applied egg-rr69.3%
*-commutative69.3%
associate-/l*74.6%
Simplified74.6%
if 1e-174 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000003e302Initial program 99.5%
clear-num99.5%
associate-/r/99.5%
associate-/r*99.6%
Applied egg-rr99.6%
if 4.0000000000000003e302 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 47.9%
associate-/r*53.7%
Simplified53.7%
clear-num53.7%
associate-/r/53.7%
Applied egg-rr53.7%
div-inv53.7%
associate-*l/53.7%
*-un-lft-identity53.7%
add-sqr-sqrt53.7%
sqrt-unprod53.7%
*-commutative53.7%
*-commutative53.7%
swap-sqr53.3%
add-sqr-sqrt53.3%
frac-times47.5%
*-rgt-identity47.5%
pow247.5%
Applied egg-rr47.5%
associate-*l/53.5%
times-frac65.3%
Simplified65.3%
unpow265.3%
associate-/l*74.1%
Applied egg-rr74.1%
Final simplification80.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 1e-211)
(* c0_m (pow (* l (/ V A)) -0.5))
(if (<= t_0 4e+302) t_0 (sqrt (* (/ A V) (* c0_m (/ 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 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-211) {
tmp = c0_m * pow((l * (V / A)), -0.5);
} else if (t_0 <= 4e+302) {
tmp = t_0;
} else {
tmp = sqrt(((A / V) * (c0_m * (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 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 1d-211) then
tmp = c0_m * ((l * (v / a)) ** (-0.5d0))
else if (t_0 <= 4d+302) then
tmp = t_0
else
tmp = sqrt(((a / v) * (c0_m * (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 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-211) {
tmp = c0_m * Math.pow((l * (V / A)), -0.5);
} else if (t_0 <= 4e+302) {
tmp = t_0;
} else {
tmp = Math.sqrt(((A / V) * (c0_m * (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 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 1e-211: tmp = c0_m * math.pow((l * (V / A)), -0.5) elif t_0 <= 4e+302: tmp = t_0 else: tmp = math.sqrt(((A / V) * (c0_m * (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(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 1e-211) tmp = Float64(c0_m * (Float64(l * Float64(V / A)) ^ -0.5)); elseif (t_0 <= 4e+302) tmp = t_0; else tmp = sqrt(Float64(Float64(A / V) * Float64(c0_m * Float64(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 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 1e-211)
tmp = c0_m * ((l * (V / A)) ^ -0.5);
elseif (t_0 <= 4e+302)
tmp = t_0;
else
tmp = sqrt(((A / V) * (c0_m * (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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-211], N[(c0$95$m * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+302], t$95$0, N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / 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 10^{-211}:\\
\;\;\;\;c0\_m \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+302}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{V} \cdot \left(c0\_m \cdot \frac{c0\_m}{\ell}\right)}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000009e-211Initial program 69.0%
associate-/r*74.7%
Simplified74.7%
clear-num74.4%
associate-/r/74.7%
Applied egg-rr74.7%
clear-num74.2%
sqrt-div74.5%
metadata-eval74.5%
*-un-lft-identity74.5%
times-frac70.8%
clear-num70.8%
/-rgt-identity70.8%
Applied egg-rr70.8%
pow1/270.8%
pow-flip70.9%
associate-*r/68.9%
metadata-eval68.9%
Applied egg-rr68.9%
*-commutative68.9%
associate-/l*74.3%
Simplified74.3%
if 1.00000000000000009e-211 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000003e302Initial program 99.5%
if 4.0000000000000003e302 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 47.9%
associate-/r*53.7%
Simplified53.7%
clear-num53.7%
associate-/r/53.7%
Applied egg-rr53.7%
div-inv53.7%
associate-*l/53.7%
*-un-lft-identity53.7%
add-sqr-sqrt53.7%
sqrt-unprod53.7%
*-commutative53.7%
*-commutative53.7%
swap-sqr53.3%
add-sqr-sqrt53.3%
frac-times47.5%
*-rgt-identity47.5%
pow247.5%
Applied egg-rr47.5%
associate-*l/53.5%
times-frac65.3%
Simplified65.3%
unpow265.3%
associate-/l*74.1%
Applied egg-rr74.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 2e-228) (not (<= t_0 4e+302)))
(* 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 <= 2e-228) || !(t_0 <= 4e+302)) {
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 <= 2d-228) .or. (.not. (t_0 <= 4d+302))) 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 <= 2e-228) || !(t_0 <= 4e+302)) {
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 <= 2e-228) or not (t_0 <= 4e+302): 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 <= 2e-228) || !(t_0 <= 4e+302)) 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 <= 2e-228) || ~((t_0 <= 4e+302)))
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, 2e-228], N[Not[LessEqual[t$95$0, 4e+302]], $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 2 \cdot 10^{-228} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+302}\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)))) < 2.00000000000000007e-228 or 4.0000000000000003e302 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 64.9%
associate-/r*70.8%
Simplified70.8%
if 2.00000000000000007e-228 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000003e302Initial program 99.5%
Final simplification77.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 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 1e-211)
(* c0_m (pow (* l (/ V A)) -0.5))
(if (<= t_0 2e+273) 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 <= 1e-211) {
tmp = c0_m * pow((l * (V / A)), -0.5);
} else if (t_0 <= 2e+273) {
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 <= 1d-211) then
tmp = c0_m * ((l * (v / a)) ** (-0.5d0))
else if (t_0 <= 2d+273) 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 <= 1e-211) {
tmp = c0_m * Math.pow((l * (V / A)), -0.5);
} else if (t_0 <= 2e+273) {
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 <= 1e-211: tmp = c0_m * math.pow((l * (V / A)), -0.5) elif t_0 <= 2e+273: 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 <= 1e-211) tmp = Float64(c0_m * (Float64(l * Float64(V / A)) ^ -0.5)); elseif (t_0 <= 2e+273) 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 <= 1e-211)
tmp = c0_m * ((l * (V / A)) ^ -0.5);
elseif (t_0 <= 2e+273)
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, 1e-211], N[(c0$95$m * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+273], 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 10^{-211}:\\
\;\;\;\;c0\_m \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;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)))) < 1.00000000000000009e-211Initial program 69.0%
associate-/r*74.7%
Simplified74.7%
clear-num74.4%
associate-/r/74.7%
Applied egg-rr74.7%
clear-num74.2%
sqrt-div74.5%
metadata-eval74.5%
*-un-lft-identity74.5%
times-frac70.8%
clear-num70.8%
/-rgt-identity70.8%
Applied egg-rr70.8%
pow1/270.8%
pow-flip70.9%
associate-*r/68.9%
metadata-eval68.9%
Applied egg-rr68.9%
*-commutative68.9%
associate-/l*74.3%
Simplified74.3%
if 1.00000000000000009e-211 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999989e273Initial program 99.5%
if 1.99999999999999989e273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 50.8%
associate-/r*53.7%
Simplified53.7%
clear-num53.7%
associate-/r/53.7%
Applied egg-rr53.7%
clear-num53.7%
sqrt-div58.1%
metadata-eval58.1%
*-un-lft-identity58.1%
times-frac61.1%
clear-num61.1%
/-rgt-identity61.1%
Applied egg-rr61.1%
un-div-inv61.1%
associate-*r/53.8%
Applied egg-rr53.8%
associate-/l*61.1%
Simplified61.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 2e-228)
(/ c0_m (sqrt (* l (/ V A))))
(if (<= t_0 2e+273) 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 <= 2e-228) {
tmp = c0_m / sqrt((l * (V / A)));
} else if (t_0 <= 2e+273) {
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 <= 2d-228) then
tmp = c0_m / sqrt((l * (v / a)))
else if (t_0 <= 2d+273) 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 <= 2e-228) {
tmp = c0_m / Math.sqrt((l * (V / A)));
} else if (t_0 <= 2e+273) {
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 <= 2e-228: tmp = c0_m / math.sqrt((l * (V / A))) elif t_0 <= 2e+273: 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 <= 2e-228) tmp = Float64(c0_m / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 2e+273) 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 <= 2e-228)
tmp = c0_m / sqrt((l * (V / A)));
elseif (t_0 <= 2e+273)
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, 2e-228], N[(c0$95$m / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+273], 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 2 \cdot 10^{-228}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;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)))) < 2.00000000000000007e-228Initial program 68.4%
associate-/r*74.3%
Simplified74.3%
clear-num73.9%
associate-/r/74.3%
Applied egg-rr74.3%
clear-num73.8%
sqrt-div74.1%
metadata-eval74.1%
*-un-lft-identity74.1%
times-frac70.3%
clear-num70.3%
/-rgt-identity70.3%
Applied egg-rr70.3%
un-div-inv70.3%
associate-*r/68.3%
Applied egg-rr68.3%
*-commutative68.3%
associate-/l*73.9%
Simplified73.9%
if 2.00000000000000007e-228 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999989e273Initial program 99.5%
if 1.99999999999999989e273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 50.8%
associate-/r*53.7%
Simplified53.7%
clear-num53.7%
associate-/r/53.7%
Applied egg-rr53.7%
clear-num53.7%
sqrt-div58.1%
metadata-eval58.1%
*-un-lft-identity58.1%
times-frac61.1%
clear-num61.1%
/-rgt-identity61.1%
Applied egg-rr61.1%
un-div-inv61.1%
associate-*r/53.8%
Applied egg-rr53.8%
associate-/l*61.1%
Simplified61.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 2e-228)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+273) 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 <= 2e-228) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 2e+273) {
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 <= 2d-228) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 2d+273) 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 <= 2e-228) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+273) {
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 <= 2e-228: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 2e+273: 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 <= 2e-228) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+273) 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 <= 2e-228)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 2e+273)
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, 2e-228], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+273], 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 2 \cdot 10^{-228}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;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)))) < 2.00000000000000007e-228Initial program 68.4%
associate-/r*74.3%
Simplified74.3%
if 2.00000000000000007e-228 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999989e273Initial program 99.5%
if 1.99999999999999989e273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 50.8%
associate-/r*53.7%
Simplified53.7%
clear-num53.7%
associate-/r/53.7%
Applied egg-rr53.7%
clear-num53.7%
sqrt-div58.1%
metadata-eval58.1%
*-un-lft-identity58.1%
times-frac61.1%
clear-num61.1%
/-rgt-identity61.1%
Applied egg-rr61.1%
un-div-inv61.1%
associate-*r/53.8%
Applied egg-rr53.8%
associate-/l*61.1%
Simplified61.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
(*
c0_s
(if (<= (* V l) -1e+163)
(* (sqrt (/ A V)) (/ c0_m (sqrt l)))
(if (<= (* V l) -4e-306)
(/ c0_m (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(sqrt (* (/ A V) (* c0_m (/ c0_m l))))
(if (<= (* V l) 1e+206)
(* 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) <= -1e+163) {
tmp = sqrt((A / V)) * (c0_m / sqrt(l));
} else if ((V * l) <= -4e-306) {
tmp = c0_m / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((A / V) * (c0_m * (c0_m / l))));
} else if ((V * l) <= 1e+206) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-1d+163)) then
tmp = sqrt((a / v)) * (c0_m / sqrt(l))
else if ((v * l) <= (-4d-306)) then
tmp = c0_m / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = sqrt(((a / v) * (c0_m * (c0_m / l))))
else if ((v * l) <= 1d+206) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -1e+163) {
tmp = Math.sqrt((A / V)) * (c0_m / Math.sqrt(l));
} else if ((V * l) <= -4e-306) {
tmp = c0_m / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((A / V) * (c0_m * (c0_m / l))));
} else if ((V * l) <= 1e+206) {
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) <= -1e+163: tmp = math.sqrt((A / V)) * (c0_m / math.sqrt(l)) elif (V * l) <= -4e-306: tmp = c0_m / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = math.sqrt(((A / V) * (c0_m * (c0_m / l)))) elif (V * l) <= 1e+206: 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) <= -1e+163) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0_m / sqrt(l))); elseif (Float64(V * l) <= -4e-306) tmp = Float64(c0_m / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(A / V) * Float64(c0_m * Float64(c0_m / l)))); elseif (Float64(V * l) <= 1e+206) 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) <= -1e+163)
tmp = sqrt((A / V)) * (c0_m / sqrt(l));
elseif ((V * l) <= -4e-306)
tmp = c0_m / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = sqrt(((A / V) * (c0_m * (c0_m / l))));
elseif ((V * l) <= 1e+206)
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], -1e+163], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-306], N[(c0$95$m / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+206], 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 -1 \cdot 10^{+163}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0\_m}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{V} \cdot \left(c0\_m \cdot \frac{c0\_m}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\
\;\;\;\;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) < -9.9999999999999994e162Initial program 53.4%
associate-/r*68.7%
Simplified68.7%
clear-num68.7%
associate-/r/68.7%
Applied egg-rr68.7%
sqrt-div28.2%
associate-*l/28.2%
*-un-lft-identity28.2%
associate-*r/28.2%
Applied egg-rr28.2%
*-commutative28.2%
associate-*r/28.2%
Simplified28.2%
if -9.9999999999999994e162 < (*.f64 V l) < -4.00000000000000011e-306Initial program 87.3%
associate-/r*74.5%
Simplified74.5%
clear-num73.7%
associate-/r/74.5%
Applied egg-rr74.5%
clear-num74.5%
sqrt-div75.6%
metadata-eval75.6%
*-un-lft-identity75.6%
times-frac73.2%
clear-num73.3%
/-rgt-identity73.3%
Applied egg-rr73.3%
un-div-inv73.3%
associate-*r/88.8%
Applied egg-rr88.8%
if -4.00000000000000011e-306 < (*.f64 V l) < -0.0Initial program 38.8%
associate-/r*62.0%
Simplified62.0%
clear-num62.0%
associate-/r/62.0%
Applied egg-rr62.0%
div-inv62.0%
associate-*l/62.0%
*-un-lft-identity62.0%
add-sqr-sqrt34.1%
sqrt-unprod34.6%
*-commutative34.6%
*-commutative34.6%
swap-sqr34.4%
add-sqr-sqrt34.4%
frac-times28.1%
*-rgt-identity28.1%
pow228.1%
Applied egg-rr28.1%
associate-*l/28.0%
times-frac40.5%
Simplified40.5%
unpow240.5%
associate-/l*46.2%
Applied egg-rr46.2%
if -0.0 < (*.f64 V l) < 1e206Initial program 88.4%
sqrt-div98.9%
div-inv98.8%
Applied egg-rr98.8%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 1e206 < (*.f64 V l) Initial program 52.3%
associate-/r*76.0%
Simplified76.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
(if (<= (* V l) -1e+163)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -4e-306)
(/ c0_m (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(sqrt (* (/ A V) (* c0_m (/ c0_m l))))
(if (<= (* V l) 1e+206)
(* 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) <= -1e+163) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -4e-306) {
tmp = c0_m / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((A / V) * (c0_m * (c0_m / l))));
} else if ((V * l) <= 1e+206) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-1d+163)) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-4d-306)) then
tmp = c0_m / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = sqrt(((a / v) * (c0_m * (c0_m / l))))
else if ((v * l) <= 1d+206) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -1e+163) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -4e-306) {
tmp = c0_m / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((A / V) * (c0_m * (c0_m / l))));
} else if ((V * l) <= 1e+206) {
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) <= -1e+163: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -4e-306: tmp = c0_m / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = math.sqrt(((A / V) * (c0_m * (c0_m / l)))) elif (V * l) <= 1e+206: 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) <= -1e+163) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -4e-306) tmp = Float64(c0_m / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(A / V) * Float64(c0_m * Float64(c0_m / l)))); elseif (Float64(V * l) <= 1e+206) 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) <= -1e+163)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -4e-306)
tmp = c0_m / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = sqrt(((A / V) * (c0_m * (c0_m / l))));
elseif ((V * l) <= 1e+206)
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], -1e+163], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-306], N[(c0$95$m / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+206], 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 -1 \cdot 10^{+163}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{V} \cdot \left(c0\_m \cdot \frac{c0\_m}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+206}:\\
\;\;\;\;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) < -9.9999999999999994e162Initial program 53.4%
associate-/r*68.7%
sqrt-div28.2%
div-inv28.2%
Applied egg-rr28.2%
associate-*r/28.2%
*-rgt-identity28.2%
Simplified28.2%
if -9.9999999999999994e162 < (*.f64 V l) < -4.00000000000000011e-306Initial program 87.3%
associate-/r*74.5%
Simplified74.5%
clear-num73.7%
associate-/r/74.5%
Applied egg-rr74.5%
clear-num74.5%
sqrt-div75.6%
metadata-eval75.6%
*-un-lft-identity75.6%
times-frac73.2%
clear-num73.3%
/-rgt-identity73.3%
Applied egg-rr73.3%
un-div-inv73.3%
associate-*r/88.8%
Applied egg-rr88.8%
if -4.00000000000000011e-306 < (*.f64 V l) < -0.0Initial program 38.8%
associate-/r*62.0%
Simplified62.0%
clear-num62.0%
associate-/r/62.0%
Applied egg-rr62.0%
div-inv62.0%
associate-*l/62.0%
*-un-lft-identity62.0%
add-sqr-sqrt34.1%
sqrt-unprod34.6%
*-commutative34.6%
*-commutative34.6%
swap-sqr34.4%
add-sqr-sqrt34.4%
frac-times28.1%
*-rgt-identity28.1%
pow228.1%
Applied egg-rr28.1%
associate-*l/28.0%
times-frac40.5%
Simplified40.5%
unpow240.5%
associate-/l*46.2%
Applied egg-rr46.2%
if -0.0 < (*.f64 V l) < 1e206Initial program 88.4%
sqrt-div98.9%
div-inv98.8%
Applied egg-rr98.8%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 1e206 < (*.f64 V l) Initial program 52.3%
associate-/r*76.0%
Simplified76.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 73.3%
herbie shell --seed 2024113
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))