
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
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 (<= A -1e-310)
(/ (* (/ (sqrt (- A)) (sqrt (- V))) c0_m) (sqrt l))
(if (<= A 5.2e+290)
(*
c0_m
(* (/ (sqrt A) (sqrt (* V (cbrt l)))) (sqrt (pow (cbrt l) -2.0))))
(sqrt (/ (* (* A c0_m) (/ c0_m 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 (A <= -1e-310) {
tmp = ((sqrt(-A) / sqrt(-V)) * c0_m) / sqrt(l);
} else if (A <= 5.2e+290) {
tmp = c0_m * ((sqrt(A) / sqrt((V * cbrt(l)))) * sqrt(pow(cbrt(l), -2.0)));
} else {
tmp = sqrt((((A * c0_m) * (c0_m / 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 (A <= -1e-310) {
tmp = ((Math.sqrt(-A) / Math.sqrt(-V)) * c0_m) / Math.sqrt(l);
} else if (A <= 5.2e+290) {
tmp = c0_m * ((Math.sqrt(A) / Math.sqrt((V * Math.cbrt(l)))) * Math.sqrt(Math.pow(Math.cbrt(l), -2.0)));
} else {
tmp = Math.sqrt((((A * c0_m) * (c0_m / 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 (A <= -1e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * c0_m) / sqrt(l)); elseif (A <= 5.2e+290) tmp = Float64(c0_m * Float64(Float64(sqrt(A) / sqrt(Float64(V * cbrt(l)))) * sqrt((cbrt(l) ^ -2.0)))); else tmp = sqrt(Float64(Float64(Float64(A * c0_m) * Float64(c0_m / V)) / l)); end return Float64(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[A, -1e-310], N[(N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0$95$m), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 5.2e+290], N[(c0$95$m * N[(N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[(A * c0$95$m), $MachinePrecision] * N[(c0$95$m / V), $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])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0\_m}{\sqrt{\ell}}\\
\mathbf{elif}\;A \leq 5.2 \cdot 10^{+290}:\\
\;\;\;\;c0\_m \cdot \left(\frac{\sqrt{A}}{\sqrt{V \cdot \sqrt[3]{\ell}}} \cdot \sqrt{{\left(\sqrt[3]{\ell}\right)}^{-2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(A \cdot c0\_m\right) \cdot \frac{c0\_m}{V}}{\ell}}\\
\end{array}
\end{array}
if A < -9.999999999999969e-311Initial program 78.3%
*-commutative78.3%
associate-/r*77.5%
sqrt-div44.4%
associate-*l/44.5%
Applied egg-rr44.5%
frac-2neg44.5%
sqrt-div54.5%
Applied egg-rr54.5%
if -9.999999999999969e-311 < A < 5.19999999999999997e290Initial program 72.1%
associate-/r*69.9%
div-inv69.8%
add-cube-cbrt69.5%
times-frac74.1%
pow274.1%
Applied egg-rr74.1%
associate-*l/73.1%
associate-/l/72.4%
associate-*r/72.4%
*-rgt-identity72.4%
*-commutative72.4%
Simplified72.4%
div-inv72.5%
sqrt-prod77.3%
associate-/r*74.8%
pow-flip74.9%
metadata-eval74.9%
Applied egg-rr74.9%
associate-/l/77.3%
sqrt-div93.6%
Applied egg-rr93.6%
if 5.19999999999999997e290 < A Initial program 51.7%
associate-/r*51.6%
div-inv51.6%
add-cube-cbrt51.6%
times-frac67.0%
pow267.0%
Applied egg-rr67.0%
associate-*l/51.3%
associate-/l/51.3%
associate-*r/51.6%
*-rgt-identity51.6%
*-commutative51.6%
Simplified51.6%
Applied egg-rr17.5%
associate-*l/18.1%
associate-/l*18.1%
Simplified18.1%
unpow218.1%
associate-/l*18.2%
Applied egg-rr18.2%
associate-*r*17.9%
associate-/r*18.3%
associate-*r/34.4%
Applied egg-rr34.4%
Final simplification74.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(sqrt (/ (/ A (/ l c0_m)) (/ V c0_m)))
(if (<= t_0 2e+274)
t_0
(/ 1.0 (sqrt (* (/ V c0_m) (/ (/ l c0_m) A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
} else if (t_0 <= 2e+274) {
tmp = t_0;
} else {
tmp = 1.0 / sqrt(((V / c0_m) * ((l / c0_m) / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = sqrt(((a / (l / c0_m)) / (v / c0_m)))
else if (t_0 <= 2d+274) then
tmp = t_0
else
tmp = 1.0d0 / sqrt(((v / c0_m) * ((l / c0_m) / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt(((A / (l / c0_m)) / (V / c0_m)));
} else if (t_0 <= 2e+274) {
tmp = t_0;
} else {
tmp = 1.0 / Math.sqrt(((V / c0_m) * ((l / c0_m) / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt(((A / (l / c0_m)) / (V / c0_m))) elif t_0 <= 2e+274: tmp = t_0 else: tmp = 1.0 / math.sqrt(((V / c0_m) * ((l / c0_m) / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(Float64(A / Float64(l / c0_m)) / Float64(V / c0_m))); elseif (t_0 <= 2e+274) tmp = t_0; else tmp = Float64(1.0 / sqrt(Float64(Float64(V / c0_m) * Float64(Float64(l / c0_m) / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
elseif (t_0 <= 2e+274)
tmp = t_0;
else
tmp = 1.0 / sqrt(((V / c0_m) * ((l / c0_m) / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(A / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 2e+274], t$95$0, N[(1.0 / N[Sqrt[N[(N[(V / c0$95$m), $MachinePrecision] * N[(N[(l / c0$95$m), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{\frac{A}{\frac{\ell}{c0\_m}}}{\frac{V}{c0\_m}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+274}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{V}{c0\_m} \cdot \frac{\frac{\ell}{c0\_m}}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.3%
associate-/r*71.5%
div-inv71.6%
add-cube-cbrt71.2%
times-frac71.6%
pow271.6%
Applied egg-rr71.6%
associate-*l/72.9%
associate-/l/72.4%
associate-*r/72.4%
*-rgt-identity72.4%
*-commutative72.4%
Simplified72.4%
Applied egg-rr17.2%
associate-*l/18.4%
associate-/l*18.5%
Simplified18.5%
unpow218.5%
*-commutative18.5%
times-frac23.3%
Applied egg-rr23.3%
*-commutative23.3%
clear-num23.3%
frac-times22.7%
*-un-lft-identity22.7%
Applied egg-rr22.7%
associate-*r/22.7%
*-commutative22.7%
associate-/r*23.2%
clear-num23.2%
associate-/l/23.8%
clear-num23.8%
Applied egg-rr23.8%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999984e274Initial program 99.1%
if 1.99999999999999984e274 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 44.2%
associate-/r*44.5%
div-inv44.5%
add-cube-cbrt44.4%
times-frac48.1%
pow248.1%
Applied egg-rr48.1%
associate-*l/44.5%
associate-/l/44.5%
associate-*r/44.4%
*-rgt-identity44.4%
*-commutative44.4%
Simplified44.4%
Applied egg-rr35.8%
associate-*l/36.3%
associate-/l*36.3%
Simplified36.3%
unpow236.3%
associate-/l*44.1%
Applied egg-rr44.1%
associate-*r*48.0%
clear-num48.0%
un-div-inv48.0%
Applied egg-rr48.0%
clear-num48.0%
sqrt-div48.0%
metadata-eval48.0%
associate-/l*60.4%
*-commutative60.4%
times-frac68.3%
Applied egg-rr68.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 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 4e+278)))
(sqrt (/ (/ A (/ l c0_m)) (/ V c0_m)))
t_0))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+278)) {
tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+278))) then
tmp = sqrt(((a / (l / c0_m)) / (v / c0_m)))
else
tmp = t_0
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+278)) {
tmp = Math.sqrt(((A / (l / c0_m)) / (V / c0_m)));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+278): tmp = math.sqrt(((A / (l / c0_m)) / (V / c0_m))) else: tmp = t_0 return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+278)) tmp = sqrt(Float64(Float64(A / Float64(l / c0_m)) / Float64(V / c0_m))); else tmp = t_0; end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+278)))
tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
else
tmp = t_0;
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+278]], $MachinePrecision]], N[Sqrt[N[(N[(A / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+278}\right):\\
\;\;\;\;\sqrt{\frac{\frac{A}{\frac{\ell}{c0\_m}}}{\frac{V}{c0\_m}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 3.99999999999999985e278 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.0%
associate-/r*68.0%
div-inv68.0%
add-cube-cbrt67.7%
times-frac68.5%
pow268.5%
Applied egg-rr68.5%
associate-*l/69.2%
associate-/l/68.7%
associate-*r/68.7%
*-rgt-identity68.7%
*-commutative68.7%
Simplified68.7%
Applied egg-rr19.6%
associate-*l/20.7%
associate-/l*20.8%
Simplified20.8%
unpow220.8%
*-commutative20.8%
times-frac28.1%
Applied egg-rr28.1%
*-commutative28.1%
clear-num28.1%
frac-times27.6%
*-un-lft-identity27.6%
Applied egg-rr27.6%
associate-*r/27.5%
*-commutative27.5%
associate-/r*28.5%
clear-num28.5%
associate-/l/29.0%
clear-num29.0%
Applied egg-rr29.0%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e278Initial program 99.1%
Final simplification46.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 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 5e+303)))
(sqrt (* A (* (/ c0_m V) (/ c0_m l))))
t_0))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+303)) {
tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+303))) then
tmp = sqrt((a * ((c0_m / v) * (c0_m / l))))
else
tmp = t_0
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+303)) {
tmp = Math.sqrt((A * ((c0_m / V) * (c0_m / l))));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+303): tmp = math.sqrt((A * ((c0_m / V) * (c0_m / l)))) else: tmp = t_0 return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+303)) tmp = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / l)))); else tmp = t_0; end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+303)))
tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
else
tmp = t_0;
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+303]], $MachinePrecision]], N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+303}\right):\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 4.9999999999999997e303 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.8%
associate-/r*68.3%
div-inv68.3%
add-cube-cbrt68.0%
times-frac68.3%
pow268.3%
Applied egg-rr68.3%
associate-*l/69.5%
associate-/l/69.0%
associate-*r/69.0%
*-rgt-identity69.0%
*-commutative69.0%
Simplified69.0%
Applied egg-rr19.6%
associate-*l/20.8%
associate-/l*20.8%
Simplified20.8%
unpow220.8%
*-commutative20.8%
times-frac28.2%
Applied egg-rr28.2%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999997e303Initial program 99.1%
Final simplification46.5%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(sqrt (/ (* (* A c0_m) (/ c0_m V)) l))
(if (<= t_0 4e+278) t_0 (sqrt (/ (* A c0_m) (* l (/ V c0_m)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt((((A * c0_m) * (c0_m / V)) / l));
} else if (t_0 <= 4e+278) {
tmp = t_0;
} else {
tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = sqrt((((a * c0_m) * (c0_m / v)) / l))
else if (t_0 <= 4d+278) then
tmp = t_0
else
tmp = sqrt(((a * c0_m) / (l * (v / c0_m))))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt((((A * c0_m) * (c0_m / V)) / l));
} else if (t_0 <= 4e+278) {
tmp = t_0;
} else {
tmp = Math.sqrt(((A * c0_m) / (l * (V / c0_m))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt((((A * c0_m) * (c0_m / V)) / l)) elif t_0 <= 4e+278: tmp = t_0 else: tmp = math.sqrt(((A * c0_m) / (l * (V / c0_m)))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(Float64(Float64(A * c0_m) * Float64(c0_m / V)) / l)); elseif (t_0 <= 4e+278) tmp = t_0; else tmp = sqrt(Float64(Float64(A * c0_m) / Float64(l * Float64(V / c0_m)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt((((A * c0_m) * (c0_m / V)) / l));
elseif (t_0 <= 4e+278)
tmp = t_0;
else
tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(N[(A * c0$95$m), $MachinePrecision] * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+278], t$95$0, N[Sqrt[N[(N[(A * c0$95$m), $MachinePrecision] / N[(l * N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{\left(A \cdot c0\_m\right) \cdot \frac{c0\_m}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+278}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot c0\_m}{\ell \cdot \frac{V}{c0\_m}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.3%
associate-/r*71.5%
div-inv71.6%
add-cube-cbrt71.2%
times-frac71.6%
pow271.6%
Applied egg-rr71.6%
associate-*l/72.9%
associate-/l/72.4%
associate-*r/72.4%
*-rgt-identity72.4%
*-commutative72.4%
Simplified72.4%
Applied egg-rr17.2%
associate-*l/18.4%
associate-/l*18.5%
Simplified18.5%
unpow218.5%
associate-/l*21.0%
Applied egg-rr21.0%
associate-*r*20.9%
associate-/r*22.6%
associate-*r/23.8%
Applied egg-rr23.8%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e278Initial program 99.1%
if 3.99999999999999985e278 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 41.7%
associate-/r*42.1%
div-inv42.1%
add-cube-cbrt42.1%
times-frac45.9%
pow245.9%
Applied egg-rr45.9%
associate-*l/42.1%
associate-/l/42.1%
associate-*r/42.1%
*-rgt-identity42.1%
*-commutative42.1%
Simplified42.1%
Applied egg-rr37.0%
associate-*l/37.5%
associate-/l*37.5%
Simplified37.5%
unpow237.5%
associate-/l*45.7%
Applied egg-rr45.7%
associate-*r*49.8%
clear-num49.8%
un-div-inv49.8%
Applied egg-rr49.8%
associate-/l*59.0%
Applied egg-rr59.0%
*-commutative59.0%
associate-*l/49.8%
associate-*r/63.2%
Simplified63.2%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(sqrt (* A (* (/ c0_m V) (/ c0_m l))))
(if (<= t_0 4e+278) t_0 (sqrt (/ (* A c0_m) (* l (/ V c0_m)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
} else if (t_0 <= 4e+278) {
tmp = t_0;
} else {
tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = sqrt((a * ((c0_m / v) * (c0_m / l))))
else if (t_0 <= 4d+278) then
tmp = t_0
else
tmp = sqrt(((a * c0_m) / (l * (v / c0_m))))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt((A * ((c0_m / V) * (c0_m / l))));
} else if (t_0 <= 4e+278) {
tmp = t_0;
} else {
tmp = Math.sqrt(((A * c0_m) / (l * (V / c0_m))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt((A * ((c0_m / V) * (c0_m / l)))) elif t_0 <= 4e+278: tmp = t_0 else: tmp = math.sqrt(((A * c0_m) / (l * (V / c0_m)))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / l)))); elseif (t_0 <= 4e+278) tmp = t_0; else tmp = sqrt(Float64(Float64(A * c0_m) / Float64(l * Float64(V / c0_m)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
elseif (t_0 <= 4e+278)
tmp = t_0;
else
tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+278], t$95$0, N[Sqrt[N[(N[(A * c0$95$m), $MachinePrecision] / N[(l * N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+278}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot c0\_m}{\ell \cdot \frac{V}{c0\_m}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.3%
associate-/r*71.5%
div-inv71.6%
add-cube-cbrt71.2%
times-frac71.6%
pow271.6%
Applied egg-rr71.6%
associate-*l/72.9%
associate-/l/72.4%
associate-*r/72.4%
*-rgt-identity72.4%
*-commutative72.4%
Simplified72.4%
Applied egg-rr17.2%
associate-*l/18.4%
associate-/l*18.5%
Simplified18.5%
unpow218.5%
*-commutative18.5%
times-frac23.3%
Applied egg-rr23.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e278Initial program 99.1%
if 3.99999999999999985e278 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 41.7%
associate-/r*42.1%
div-inv42.1%
add-cube-cbrt42.1%
times-frac45.9%
pow245.9%
Applied egg-rr45.9%
associate-*l/42.1%
associate-/l/42.1%
associate-*r/42.1%
*-rgt-identity42.1%
*-commutative42.1%
Simplified42.1%
Applied egg-rr37.0%
associate-*l/37.5%
associate-/l*37.5%
Simplified37.5%
unpow237.5%
associate-/l*45.7%
Applied egg-rr45.7%
associate-*r*49.8%
clear-num49.8%
un-div-inv49.8%
Applied egg-rr49.8%
associate-/l*59.0%
Applied egg-rr59.0%
*-commutative59.0%
associate-*l/49.8%
associate-*r/63.2%
Simplified63.2%
Final simplification46.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(sqrt (* A (* (/ c0_m V) (/ c0_m l))))
(if (<= t_0 2e+284) t_0 (sqrt (* A (/ c0_m (* l (/ V c0_m))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
} else if (t_0 <= 2e+284) {
tmp = t_0;
} else {
tmp = sqrt((A * (c0_m / (l * (V / c0_m)))));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = sqrt((a * ((c0_m / v) * (c0_m / l))))
else if (t_0 <= 2d+284) then
tmp = t_0
else
tmp = sqrt((a * (c0_m / (l * (v / c0_m)))))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt((A * ((c0_m / V) * (c0_m / l))));
} else if (t_0 <= 2e+284) {
tmp = t_0;
} else {
tmp = Math.sqrt((A * (c0_m / (l * (V / c0_m)))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt((A * ((c0_m / V) * (c0_m / l)))) elif t_0 <= 2e+284: tmp = t_0 else: tmp = math.sqrt((A * (c0_m / (l * (V / c0_m))))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / l)))); elseif (t_0 <= 2e+284) tmp = t_0; else tmp = sqrt(Float64(A * Float64(c0_m / Float64(l * Float64(V / c0_m))))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
elseif (t_0 <= 2e+284)
tmp = t_0;
else
tmp = sqrt((A * (c0_m / (l * (V / c0_m)))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 2e+284], t$95$0, N[Sqrt[N[(A * N[(c0$95$m / N[(l * N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \frac{c0\_m}{\ell \cdot \frac{V}{c0\_m}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.3%
associate-/r*71.5%
div-inv71.6%
add-cube-cbrt71.2%
times-frac71.6%
pow271.6%
Applied egg-rr71.6%
associate-*l/72.9%
associate-/l/72.4%
associate-*r/72.4%
*-rgt-identity72.4%
*-commutative72.4%
Simplified72.4%
Applied egg-rr17.2%
associate-*l/18.4%
associate-/l*18.5%
Simplified18.5%
unpow218.5%
*-commutative18.5%
times-frac23.3%
Applied egg-rr23.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000016e284Initial program 99.1%
if 2.00000000000000016e284 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 41.7%
associate-/r*42.1%
div-inv42.1%
add-cube-cbrt42.1%
times-frac45.9%
pow245.9%
Applied egg-rr45.9%
associate-*l/42.1%
associate-/l/42.1%
associate-*r/42.1%
*-rgt-identity42.1%
*-commutative42.1%
Simplified42.1%
Applied egg-rr37.0%
associate-*l/37.5%
associate-/l*37.5%
Simplified37.5%
unpow237.5%
*-commutative37.5%
times-frac63.3%
Applied egg-rr63.3%
*-commutative63.3%
clear-num63.3%
frac-times63.1%
*-un-lft-identity63.1%
Applied egg-rr63.1%
Final simplification46.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 2.5e+212)))
(* c0_m (sqrt (/ (/ A V) l)))
t_0))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2.5e+212)) {
tmp = c0_m * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 2.5d+212))) then
tmp = c0_m * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2.5e+212)) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 2.5e+212): tmp = c0_m * math.sqrt(((A / V) / l)) else: tmp = t_0 return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 2.5e+212)) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 2.5e+212)))
tmp = c0_m * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2.5e+212]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 2.5 \cdot 10^{+212}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 2.49999999999999996e212 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.7%
associate-/r*68.7%
Simplified68.7%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.49999999999999996e212Initial program 99.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 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(sqrt (* A (* c0_m (/ c0_m (* V l)))))
(if (<= t_0 1e+185) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt((A * (c0_m * (c0_m / (V * l)))));
} else if (t_0 <= 1e+185) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = sqrt((a * (c0_m * (c0_m / (v * l)))))
else if (t_0 <= 1d+185) then
tmp = t_0
else
tmp = c0_m / sqrt((v * (l / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt((A * (c0_m * (c0_m / (V * l)))));
} else if (t_0 <= 1e+185) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt((A * (c0_m * (c0_m / (V * l))))) elif t_0 <= 1e+185: tmp = t_0 else: tmp = c0_m / math.sqrt((V * (l / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(A * Float64(c0_m * Float64(c0_m / Float64(V * l))))); elseif (t_0 <= 1e+185) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt((A * (c0_m * (c0_m / (V * l)))));
elseif (t_0 <= 1e+185)
tmp = t_0;
else
tmp = c0_m / sqrt((V * (l / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(A * N[(c0$95$m * N[(c0$95$m / N[(V * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+185], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V \cdot \ell}\right)}\\
\mathbf{elif}\;t\_0 \leq 10^{+185}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.3%
associate-/r*71.5%
div-inv71.6%
add-cube-cbrt71.2%
times-frac71.6%
pow271.6%
Applied egg-rr71.6%
associate-*l/72.9%
associate-/l/72.4%
associate-*r/72.4%
*-rgt-identity72.4%
*-commutative72.4%
Simplified72.4%
Applied egg-rr17.2%
associate-*l/18.4%
associate-/l*18.5%
Simplified18.5%
unpow218.5%
associate-/l*21.0%
Applied egg-rr21.0%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e184Initial program 99.1%
if 9.9999999999999998e184 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 56.6%
*-un-lft-identity56.6%
times-frac59.7%
Applied egg-rr59.7%
associate-*l/59.7%
*-un-lft-identity59.7%
Applied egg-rr59.7%
div-inv59.7%
clear-num59.7%
frac-times59.7%
*-commutative59.7%
add-sqr-sqrt59.6%
frac-times59.7%
sqrt-unprod60.5%
add-sqr-sqrt60.6%
un-div-inv60.6%
Applied egg-rr60.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+185) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 1e+185) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 1d+185) then
tmp = t_0
else
tmp = c0_m / sqrt((v * (l / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+185) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 1e+185: tmp = t_0 else: tmp = c0_m / math.sqrt((V * (l / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+185) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 1e+185)
tmp = t_0;
else
tmp = c0_m / sqrt((V * (l / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+185], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+185}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.3%
associate-/r*71.5%
Simplified71.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e184Initial program 99.1%
if 9.9999999999999998e184 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 56.6%
*-un-lft-identity56.6%
times-frac59.7%
Applied egg-rr59.7%
associate-*l/59.7%
*-un-lft-identity59.7%
Applied egg-rr59.7%
div-inv59.7%
clear-num59.7%
frac-times59.7%
*-commutative59.7%
add-sqr-sqrt59.6%
frac-times59.7%
sqrt-unprod60.5%
add-sqr-sqrt60.6%
un-div-inv60.6%
Applied egg-rr60.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= V -9e-297)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(* c0_m (/ (sqrt A) (* (sqrt l) (sqrt V)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (V <= -9e-297) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else {
tmp = c0_m * (sqrt(A) / (sqrt(l) * sqrt(V)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-9d-297)) then
tmp = c0_m * (sqrt((a / -l)) / sqrt(-v))
else
tmp = c0_m * (sqrt(a) / (sqrt(l) * sqrt(v)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (V <= -9e-297) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else {
tmp = c0_m * (Math.sqrt(A) / (Math.sqrt(l) * Math.sqrt(V)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if V <= -9e-297: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) else: tmp = c0_m * (math.sqrt(A) / (math.sqrt(l) * math.sqrt(V))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (V <= -9e-297) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); else tmp = Float64(c0_m * Float64(sqrt(A) / Float64(sqrt(l) * sqrt(V)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if (V <= -9e-297)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
else
tmp = c0_m * (sqrt(A) / (sqrt(l) * sqrt(V)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[V, -9e-297], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \leq -9 \cdot 10^{-297}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}\\
\end{array}
\end{array}
if V < -8.99999999999999951e-297Initial program 76.2%
*-un-lft-identity76.2%
times-frac77.1%
Applied egg-rr77.1%
associate-*l/77.1%
*-un-lft-identity77.1%
Applied egg-rr77.1%
frac-2neg77.1%
sqrt-div91.5%
Applied egg-rr91.5%
distribute-frac-neg291.5%
Simplified91.5%
if -8.99999999999999951e-297 < V Initial program 72.5%
associate-/r*73.4%
div-inv73.4%
add-cube-cbrt73.0%
times-frac74.8%
pow274.8%
Applied egg-rr74.8%
associate-*l/76.0%
associate-/l/75.4%
associate-*r/75.4%
*-rgt-identity75.4%
*-commutative75.4%
Simplified75.4%
associate-/r*73.0%
associate-/l/73.0%
unpow273.0%
add-cube-cbrt73.4%
un-div-inv73.4%
sqrt-unprod45.5%
*-commutative45.5%
sqrt-div56.0%
sqrt-div55.9%
metadata-eval55.9%
frac-times56.0%
*-un-lft-identity56.0%
Applied egg-rr56.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) (- INFINITY))
(sqrt (* A (/ (* c0_m (/ c0_m V)) l)))
(if (<= (* V l) -5e-300)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ 1.0 (sqrt (* (/ V c0_m) (/ (/ l c0_m) A))))
(if (<= (* V l) 5e+209)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (/ (/ A (/ l c0_m)) (/ V c0_m)))))))))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 * ((c0_m * (c0_m / V)) / l)));
} else if ((V * l) <= -5e-300) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = 1.0 / sqrt(((V / c0_m) * ((l / c0_m) / A)));
} else if ((V * l) <= 5e+209) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
}
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 * ((c0_m * (c0_m / V)) / l)));
} else if ((V * l) <= -5e-300) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = 1.0 / Math.sqrt(((V / c0_m) * ((l / c0_m) / A)));
} else if ((V * l) <= 5e+209) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A / (l / c0_m)) / (V / c0_m)));
}
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 * ((c0_m * (c0_m / V)) / l))) elif (V * l) <= -5e-300: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = 1.0 / math.sqrt(((V / c0_m) * ((l / c0_m) / A))) elif (V * l) <= 5e+209: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A / (l / c0_m)) / (V / c0_m))) 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 = sqrt(Float64(A * Float64(Float64(c0_m * Float64(c0_m / V)) / l))); elseif (Float64(V * l) <= -5e-300) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(1.0 / sqrt(Float64(Float64(V / c0_m) * Float64(Float64(l / c0_m) / A)))); elseif (Float64(V * l) <= 5e+209) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A / Float64(l / c0_m)) / Float64(V / c0_m))); 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 * ((c0_m * (c0_m / V)) / l)));
elseif ((V * l) <= -5e-300)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = 1.0 / sqrt(((V / c0_m) * ((l / c0_m) / A)));
elseif ((V * l) <= 5e+209)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
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[Sqrt[N[(A * N[(N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-300], 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[(1.0 / N[Sqrt[N[(N[(V / c0$95$m), $MachinePrecision] * N[(N[(l / c0$95$m), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+209], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $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:\\
\;\;\;\;\sqrt{A \cdot \frac{c0\_m \cdot \frac{c0\_m}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-300}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{1}{\sqrt{\frac{V}{c0\_m} \cdot \frac{\frac{\ell}{c0\_m}}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+209}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{A}{\frac{\ell}{c0\_m}}}{\frac{V}{c0\_m}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 36.5%
associate-/r*55.7%
div-inv55.7%
add-cube-cbrt55.6%
times-frac49.3%
pow249.3%
Applied egg-rr49.3%
associate-*l/49.3%
associate-/l/49.4%
associate-*r/49.3%
*-rgt-identity49.3%
*-commutative49.3%
Simplified49.3%
Applied egg-rr35.0%
associate-*l/34.8%
associate-/l*35.0%
Simplified35.0%
unpow235.0%
associate-/l*36.5%
Applied egg-rr36.5%
*-commutative36.5%
associate-/r*42.3%
associate-*l/48.8%
Applied egg-rr48.8%
if -inf.0 < (*.f64 V l) < -4.99999999999999996e-300Initial program 92.5%
frac-2neg92.5%
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 -4.99999999999999996e-300 < (*.f64 V l) < 0.0Initial program 32.2%
associate-/r*52.2%
div-inv52.2%
add-cube-cbrt52.1%
times-frac49.0%
pow249.0%
Applied egg-rr49.0%
associate-*l/48.9%
associate-/l/48.9%
associate-*r/49.0%
*-rgt-identity49.0%
*-commutative49.0%
Simplified49.0%
Applied egg-rr6.2%
associate-*l/4.2%
associate-/l*6.3%
Simplified6.3%
unpow26.3%
associate-/l*9.5%
Applied egg-rr9.5%
associate-*r*9.1%
clear-num9.1%
un-div-inv9.1%
Applied egg-rr9.1%
clear-num9.1%
sqrt-div9.1%
metadata-eval9.1%
associate-/l*22.6%
*-commutative22.6%
times-frac30.1%
Applied egg-rr30.1%
if 0.0 < (*.f64 V l) < 4.99999999999999964e209Initial program 83.2%
sqrt-div98.9%
div-inv98.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 4.99999999999999964e209 < (*.f64 V l) Initial program 56.3%
associate-/r*69.3%
div-inv69.3%
add-cube-cbrt69.2%
times-frac65.4%
pow265.4%
Applied egg-rr65.4%
associate-*l/65.4%
associate-/l/62.3%
associate-*r/62.3%
*-rgt-identity62.3%
*-commutative62.3%
Simplified62.3%
Applied egg-rr34.0%
associate-*l/34.1%
associate-/l*34.2%
Simplified34.2%
unpow234.2%
*-commutative34.2%
times-frac53.3%
Applied egg-rr53.3%
*-commutative53.3%
clear-num53.2%
frac-times53.3%
*-un-lft-identity53.3%
Applied egg-rr53.3%
associate-*r/53.2%
*-commutative53.2%
associate-/r*59.4%
clear-num59.4%
associate-/l/59.5%
clear-num59.5%
Applied egg-rr59.5%
Final simplification83.3%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= V -4e-310)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= V 1e-288)
(* c0_m (sqrt (/ A (* V l))))
(if (<= V 9e-214)
(/ c0_m (* (sqrt V) (sqrt (/ l A))))
(/ c0_m (* (sqrt l) (sqrt (/ 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 tmp;
if (V <= -4e-310) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if (V <= 1e-288) {
tmp = c0_m * sqrt((A / (V * l)));
} else if (V <= 9e-214) {
tmp = c0_m / (sqrt(V) * sqrt((l / A)));
} else {
tmp = c0_m / (sqrt(l) * sqrt((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) :: tmp
if (v <= (-4d-310)) then
tmp = c0_m * (sqrt((a / -l)) / sqrt(-v))
else if (v <= 1d-288) then
tmp = c0_m * sqrt((a / (v * l)))
else if (v <= 9d-214) then
tmp = c0_m / (sqrt(v) * sqrt((l / a)))
else
tmp = c0_m / (sqrt(l) * sqrt((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 tmp;
if (V <= -4e-310) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if (V <= 1e-288) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if (V <= 9e-214) {
tmp = c0_m / (Math.sqrt(V) * Math.sqrt((l / A)));
} else {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((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): tmp = 0 if V <= -4e-310: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif V <= 1e-288: tmp = c0_m * math.sqrt((A / (V * l))) elif V <= 9e-214: tmp = c0_m / (math.sqrt(V) * math.sqrt((l / A))) else: tmp = c0_m / (math.sqrt(l) * math.sqrt((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) tmp = 0.0 if (V <= -4e-310) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (V <= 1e-288) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (V <= 9e-214) tmp = Float64(c0_m / Float64(sqrt(V) * sqrt(Float64(l / A)))); else tmp = Float64(c0_m / Float64(sqrt(l) * sqrt(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)
tmp = 0.0;
if (V <= -4e-310)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif (V <= 1e-288)
tmp = c0_m * sqrt((A / (V * l)));
elseif (V <= 9e-214)
tmp = c0_m / (sqrt(V) * sqrt((l / A)));
else
tmp = c0_m / (sqrt(l) * sqrt((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_] := N[(c0$95$s * If[LessEqual[V, -4e-310], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[V, 1e-288], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[V, 9e-214], N[(c0$95$m / N[(N[Sqrt[V], $MachinePrecision] * N[Sqrt[N[(l / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[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])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \leq 10^{-288}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \leq 9 \cdot 10^{-214}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V} \cdot \sqrt{\frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\end{array}
\end{array}
if V < -3.999999999999988e-310Initial program 76.0%
*-un-lft-identity76.0%
times-frac76.9%
Applied egg-rr76.9%
associate-*l/76.9%
*-un-lft-identity76.9%
Applied egg-rr76.9%
frac-2neg76.9%
sqrt-div91.7%
Applied egg-rr91.7%
distribute-frac-neg291.7%
Simplified91.7%
if -3.999999999999988e-310 < V < 1.00000000000000006e-288Initial program 100.0%
if 1.00000000000000006e-288 < V < 9.0000000000000002e-214Initial program 52.9%
*-un-lft-identity52.9%
times-frac61.8%
Applied egg-rr61.8%
associate-*l/61.7%
*-un-lft-identity61.7%
Applied egg-rr61.7%
div-inv61.8%
clear-num61.8%
frac-times61.7%
*-commutative61.7%
add-sqr-sqrt61.7%
frac-times61.7%
sqrt-unprod61.2%
add-sqr-sqrt61.7%
un-div-inv61.8%
Applied egg-rr61.8%
associate-*r/52.9%
*-commutative52.9%
associate-/l*61.9%
Simplified61.9%
associate-*r/52.9%
*-commutative52.9%
associate-*r/61.8%
sqrt-prod89.9%
Applied egg-rr89.9%
*-commutative89.9%
Simplified89.9%
if 9.0000000000000002e-214 < V Initial program 74.1%
*-un-lft-identity74.1%
times-frac74.7%
Applied egg-rr74.7%
associate-*l/74.7%
*-un-lft-identity74.7%
Applied egg-rr74.7%
div-inv74.7%
clear-num74.4%
frac-times74.4%
*-commutative74.4%
add-sqr-sqrt74.3%
frac-times74.4%
sqrt-unprod74.4%
add-sqr-sqrt74.6%
un-div-inv74.6%
Applied egg-rr74.6%
associate-*r/74.7%
*-commutative74.7%
associate-/l*75.5%
Simplified75.5%
*-commutative75.5%
sqrt-prod45.2%
Applied egg-rr45.2%
Final simplification71.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 (* 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 74.4%
herbie shell --seed 2024107
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))