
(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 16 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 1 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-318)
(/ c0_m (/ (sqrt l) (/ (sqrt (- A)) (sqrt (- V)))))
(if (<= (* V l) 0.0)
(sqrt (* (/ c0_m l) (/ (/ c0_m V) (/ 1.0 A))))
(if (<= (* V l) 5e+307)
(* c0_m (* (sqrt A) (pow (* V l) -0.5)))
(/ c0_m (sqrt (/ l (/ A 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 * l) <= -1e-318) {
tmp = c0_m / (sqrt(l) / (sqrt(-A) / sqrt(-V)));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = c0_m / sqrt((l / (A / 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 * l) <= (-1d-318)) then
tmp = c0_m / (sqrt(l) / (sqrt(-a) / sqrt(-v)))
else if ((v * l) <= 0.0d0) then
tmp = sqrt(((c0_m / l) * ((c0_m / v) / (1.0d0 / a))))
else if ((v * l) <= 5d+307) then
tmp = c0_m * (sqrt(a) * ((v * l) ** (-0.5d0)))
else
tmp = c0_m / sqrt((l / (a / 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 * l) <= -1e-318) {
tmp = c0_m / (Math.sqrt(l) / (Math.sqrt(-A) / Math.sqrt(-V)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = c0_m / Math.sqrt((l / (A / 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 * l) <= -1e-318: tmp = c0_m / (math.sqrt(l) / (math.sqrt(-A) / math.sqrt(-V))) elif (V * l) <= 0.0: tmp = math.sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A)))) elif (V * l) <= 5e+307: tmp = c0_m * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = c0_m / math.sqrt((l / (A / 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 (Float64(V * l) <= -1e-318) tmp = Float64(c0_m / Float64(sqrt(l) / Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(c0_m / l) * Float64(Float64(c0_m / V) / Float64(1.0 / A)))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0_m * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = Float64(c0_m / sqrt(Float64(l / Float64(A / 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 * l) <= -1e-318)
tmp = c0_m / (sqrt(l) / (sqrt(-A) / sqrt(-V)));
elseif ((V * l) <= 0.0)
tmp = sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
elseif ((V * l) <= 5e+307)
tmp = c0_m * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = c0_m / sqrt((l / (A / 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[N[(V * l), $MachinePrecision], -1e-318], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] / N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(c0$95$m / l), $MachinePrecision] * N[(N[(c0$95$m / V), $MachinePrecision] / N[(1.0 / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(l / N[(A / 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 \cdot \ell \leq -1 \cdot 10^{-318}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{\ell}}{\frac{\sqrt{-A}}{\sqrt{-V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{c0\_m}{\ell} \cdot \frac{\frac{c0\_m}{V}}{\frac{1}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0\_m \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999875e-319Initial program 79.2%
associate-/r*75.1%
sqrt-div43.5%
associate-*r/43.5%
Applied egg-rr43.5%
associate-/l*43.5%
Simplified43.5%
frac-2neg43.5%
sqrt-div50.6%
Applied egg-rr50.6%
if -9.9999875e-319 < (*.f64 V l) < 0.0Initial program 50.8%
associate-/r*68.1%
clear-num68.1%
sqrt-div71.1%
metadata-eval71.1%
div-inv71.1%
clear-num71.1%
Applied egg-rr71.1%
*-commutative71.1%
associate-*r/50.8%
*-commutative50.8%
sqrt-div23.9%
clear-num23.9%
sqrt-div50.8%
add-sqr-sqrt24.1%
pow1/224.1%
pow1/224.2%
pow-prod-down24.2%
Applied egg-rr25.9%
unpow1/225.9%
associate-/r*27.9%
Simplified27.9%
div-inv27.8%
unpow227.8%
associate-*l*31.4%
Applied egg-rr31.4%
div-inv31.4%
times-frac35.0%
un-div-inv35.0%
Applied egg-rr35.0%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
associate-/r*77.5%
clear-num77.3%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
associate-*r/77.8%
sqrt-prod39.3%
times-frac37.4%
metadata-eval37.4%
sqrt-div37.4%
clear-num37.4%
associate-/r/39.3%
expm1-log1p-u25.3%
expm1-udef13.5%
sqrt-undiv33.4%
associate-/l*35.2%
*-commutative35.2%
*-un-lft-identity35.2%
times-frac34.6%
/-rgt-identity34.6%
Applied egg-rr34.6%
expm1-def58.4%
expm1-log1p75.3%
Simplified75.3%
clear-num74.3%
un-div-inv75.9%
Applied egg-rr75.9%
associate-/l*82.6%
sqrt-div98.9%
associate-/l*97.1%
*-commutative97.1%
div-inv97.1%
*-commutative97.1%
associate-*l*98.9%
pow1/298.9%
pow-flip99.0%
metadata-eval99.0%
Applied egg-rr99.0%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*r/79.2%
sqrt-prod37.2%
times-frac37.1%
metadata-eval37.1%
sqrt-div37.2%
clear-num37.2%
associate-/r/37.1%
expm1-log1p-u28.5%
expm1-udef13.1%
sqrt-undiv35.2%
associate-/l*31.9%
*-commutative31.9%
*-un-lft-identity31.9%
times-frac35.2%
/-rgt-identity35.2%
Applied egg-rr35.2%
expm1-def66.4%
expm1-log1p79.2%
Simplified79.2%
associate-*r/31.9%
*-commutative31.9%
associate-/l*79.3%
Applied egg-rr79.3%
Final simplification70.4%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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+290)))
(* 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 <= 4e+290)) {
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 <= 4d+290))) 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 <= 4e+290)) {
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 <= 4e+290): 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 <= 4e+290)) 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 <= 4e+290)))
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, 4e+290]], $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 4 \cdot 10^{+290}\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 4.00000000000000025e290 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.2%
*-commutative65.2%
associate-/l/71.4%
Simplified71.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.00000000000000025e290Initial program 98.2%
Final simplification77.7%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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+227)
(/ (* c0_m (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -1e-52)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ c0_m (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 5e+307)
(* c0_m (* (sqrt A) (pow (* V l) -0.5)))
(/ c0_m (sqrt (/ l (/ A 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 * l) <= -1e+227) {
tmp = (c0_m * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -1e-52) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = c0_m / sqrt((l / (A / 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 * l) <= (-1d+227)) then
tmp = (c0_m * sqrt((a / v))) / sqrt(l)
else if ((v * l) <= (-1d-52)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0_m / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 5d+307) then
tmp = c0_m * (sqrt(a) * ((v * l) ** (-0.5d0)))
else
tmp = c0_m / sqrt((l / (a / 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 * l) <= -1e+227) {
tmp = (c0_m * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -1e-52) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = c0_m / Math.sqrt((l / (A / 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 * l) <= -1e+227: tmp = (c0_m * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -1e-52: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0_m / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 5e+307: tmp = c0_m * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = c0_m / math.sqrt((l / (A / 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 (Float64(V * l) <= -1e+227) tmp = Float64(Float64(c0_m * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -1e-52) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0_m * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = Float64(c0_m / sqrt(Float64(l / Float64(A / 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 * l) <= -1e+227)
tmp = (c0_m * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -1e-52)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 5e+307)
tmp = c0_m * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = c0_m / sqrt((l / (A / 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[N[(V * l), $MachinePrecision], -1e+227], N[(N[(c0$95$m * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-52], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(l / N[(A / 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 \cdot \ell \leq -1 \cdot 10^{+227}:\\
\;\;\;\;\frac{c0\_m \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-52}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0\_m \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.0000000000000001e227Initial program 57.7%
*-commutative57.7%
associate-/r*57.7%
sqrt-div44.4%
associate-*l/44.7%
Applied egg-rr44.7%
if -1.0000000000000001e227 < (*.f64 V l) < -1e-52Initial program 85.3%
if -1e-52 < (*.f64 V l) < 0.0Initial program 69.6%
associate-/r*76.3%
clear-num76.3%
sqrt-div77.5%
metadata-eval77.5%
div-inv77.5%
clear-num77.5%
Applied egg-rr77.5%
un-div-inv77.5%
sqrt-prod44.8%
associate-/r*44.8%
Applied egg-rr44.8%
associate-/r*44.8%
Simplified44.8%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
associate-/r*77.5%
clear-num77.3%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
associate-*r/77.8%
sqrt-prod39.3%
times-frac37.4%
metadata-eval37.4%
sqrt-div37.4%
clear-num37.4%
associate-/r/39.3%
expm1-log1p-u25.3%
expm1-udef13.5%
sqrt-undiv33.4%
associate-/l*35.2%
*-commutative35.2%
*-un-lft-identity35.2%
times-frac34.6%
/-rgt-identity34.6%
Applied egg-rr34.6%
expm1-def58.4%
expm1-log1p75.3%
Simplified75.3%
clear-num74.3%
un-div-inv75.9%
Applied egg-rr75.9%
associate-/l*82.6%
sqrt-div98.9%
associate-/l*97.1%
*-commutative97.1%
div-inv97.1%
*-commutative97.1%
associate-*l*98.9%
pow1/298.9%
pow-flip99.0%
metadata-eval99.0%
Applied egg-rr99.0%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*r/79.2%
sqrt-prod37.2%
times-frac37.1%
metadata-eval37.1%
sqrt-div37.2%
clear-num37.2%
associate-/r/37.1%
expm1-log1p-u28.5%
expm1-udef13.1%
sqrt-undiv35.2%
associate-/l*31.9%
*-commutative31.9%
*-un-lft-identity31.9%
times-frac35.2%
/-rgt-identity35.2%
Applied egg-rr35.2%
expm1-def66.4%
expm1-log1p79.2%
Simplified79.2%
associate-*r/31.9%
*-commutative31.9%
associate-/l*79.3%
Applied egg-rr79.3%
Final simplification76.3%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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)) (sqrt l)))))
(*
c0_s
(if (<= (* V l) -4e+241)
t_0
(if (<= (* V l) -1e-37)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 5e+307)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ c0_m (sqrt (/ l (/ A V)))))))))))c0_m = fabs(c0);
c0_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -4e+241) {
tmp = t_0;
} else if ((V * l) <= -1e-37) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0_m / sqrt((l / (A / V)));
}
return c0_s * tmp;
}
c0_m = abs(c0)
c0_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-4d+241)) then
tmp = t_0
else if ((v * l) <= (-1d-37)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 5d+307) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = c0_m / sqrt((l / (a / v)))
end if
code = c0_s * tmp
end function
c0_m = Math.abs(c0);
c0_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -4e+241) {
tmp = t_0;
} else if ((V * l) <= -1e-37) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0_m / Math.sqrt((l / (A / V)));
}
return c0_s * tmp;
}
c0_m = math.fabs(c0) c0_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -4e+241: tmp = t_0 elif (V * l) <= -1e-37: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 5e+307: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0_m / math.sqrt((l / (A / V))) return c0_s * tmp
c0_m = abs(c0) c0_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -4e+241) tmp = t_0; elseif (Float64(V * l) <= -1e-37) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0_m / sqrt(Float64(l / Float64(A / V)))); end return Float64(c0_s * tmp) end
c0_m = abs(c0);
c0_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -4e+241)
tmp = t_0;
elseif ((V * l) <= -1e-37)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 5e+307)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = c0_m / sqrt((l / (A / V)));
end
tmp_2 = c0_s * tmp;
end
c0_m = N[Abs[c0], $MachinePrecision]
c0_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -4e+241], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-37], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], 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[(l / N[(A / 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])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+241}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-37}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000002e241 or -1.00000000000000007e-37 < (*.f64 V l) < 0.0Initial program 66.7%
associate-/r*72.1%
sqrt-div43.1%
associate-*r/43.2%
Applied egg-rr43.2%
*-commutative43.2%
associate-/l*43.1%
associate-/r/43.1%
Simplified43.1%
if -4.0000000000000002e241 < (*.f64 V l) < -1.00000000000000007e-37Initial program 85.6%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
sqrt-div98.9%
associate-*r/97.1%
Applied egg-rr97.1%
*-commutative97.1%
associate-/l*94.3%
associate-/r/98.9%
Simplified98.9%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*r/79.2%
sqrt-prod37.2%
times-frac37.1%
metadata-eval37.1%
sqrt-div37.2%
clear-num37.2%
associate-/r/37.1%
expm1-log1p-u28.5%
expm1-udef13.1%
sqrt-undiv35.2%
associate-/l*31.9%
*-commutative31.9%
*-un-lft-identity31.9%
times-frac35.2%
/-rgt-identity35.2%
Applied egg-rr35.2%
expm1-def66.4%
expm1-log1p79.2%
Simplified79.2%
associate-*r/31.9%
*-commutative31.9%
associate-/l*79.3%
Applied egg-rr79.3%
Final simplification75.9%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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) -4e+241)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-52)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ c0_m (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 5e+307)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ c0_m (sqrt (/ l (/ A 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 * l) <= -4e+241) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-52) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0_m / sqrt((l / (A / 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 * l) <= (-4d+241)) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-1d-52)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0_m / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 5d+307) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = c0_m / sqrt((l / (a / 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 * l) <= -4e+241) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-52) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0_m / Math.sqrt((l / (A / 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 * l) <= -4e+241: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-52: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0_m / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 5e+307: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0_m / math.sqrt((l / (A / 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 (Float64(V * l) <= -4e+241) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-52) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0_m / sqrt(Float64(l / Float64(A / 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 * l) <= -4e+241)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-52)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 5e+307)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = c0_m / sqrt((l / (A / 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[N[(V * l), $MachinePrecision], -4e+241], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-52], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], 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[(l / N[(A / 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 \cdot \ell \leq -4 \cdot 10^{+241}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-52}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000002e241Initial program 49.4%
associate-/r*49.4%
sqrt-div40.1%
associate-*r/40.3%
Applied egg-rr40.3%
*-commutative40.3%
associate-/l*40.1%
associate-/r/40.1%
Simplified40.1%
if -4.0000000000000002e241 < (*.f64 V l) < -1e-52Initial program 86.2%
if -1e-52 < (*.f64 V l) < 0.0Initial program 69.6%
associate-/r*76.3%
clear-num76.3%
sqrt-div77.5%
metadata-eval77.5%
div-inv77.5%
clear-num77.5%
Applied egg-rr77.5%
un-div-inv77.5%
sqrt-prod44.8%
associate-/r*44.8%
Applied egg-rr44.8%
associate-/r*44.8%
Simplified44.8%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
sqrt-div98.9%
associate-*r/97.1%
Applied egg-rr97.1%
*-commutative97.1%
associate-/l*94.3%
associate-/r/98.9%
Simplified98.9%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*r/79.2%
sqrt-prod37.2%
times-frac37.1%
metadata-eval37.1%
sqrt-div37.2%
clear-num37.2%
associate-/r/37.1%
expm1-log1p-u28.5%
expm1-udef13.1%
sqrt-undiv35.2%
associate-/l*31.9%
*-commutative31.9%
*-un-lft-identity31.9%
times-frac35.2%
/-rgt-identity35.2%
Applied egg-rr35.2%
expm1-def66.4%
expm1-log1p79.2%
Simplified79.2%
associate-*r/31.9%
*-commutative31.9%
associate-/l*79.3%
Applied egg-rr79.3%
Final simplification76.6%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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+227)
(/ c0_m (/ (sqrt l) (sqrt (/ A V))))
(if (<= (* V l) -1e-52)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ c0_m (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 5e+307)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ c0_m (sqrt (/ l (/ A 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 * l) <= -1e+227) {
tmp = c0_m / (sqrt(l) / sqrt((A / V)));
} else if ((V * l) <= -1e-52) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0_m / sqrt((l / (A / 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 * l) <= (-1d+227)) then
tmp = c0_m / (sqrt(l) / sqrt((a / v)))
else if ((v * l) <= (-1d-52)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0_m / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 5d+307) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = c0_m / sqrt((l / (a / 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 * l) <= -1e+227) {
tmp = c0_m / (Math.sqrt(l) / Math.sqrt((A / V)));
} else if ((V * l) <= -1e-52) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0_m / Math.sqrt((l / (A / 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 * l) <= -1e+227: tmp = c0_m / (math.sqrt(l) / math.sqrt((A / V))) elif (V * l) <= -1e-52: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0_m / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 5e+307: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0_m / math.sqrt((l / (A / 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 (Float64(V * l) <= -1e+227) tmp = Float64(c0_m / Float64(sqrt(l) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -1e-52) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0_m / sqrt(Float64(l / Float64(A / 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 * l) <= -1e+227)
tmp = c0_m / (sqrt(l) / sqrt((A / V)));
elseif ((V * l) <= -1e-52)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 5e+307)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = c0_m / sqrt((l / (A / 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[N[(V * l), $MachinePrecision], -1e+227], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-52], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], 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[(l / N[(A / 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 \cdot \ell \leq -1 \cdot 10^{+227}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-52}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.0000000000000001e227Initial program 57.7%
associate-/r*57.7%
sqrt-div44.4%
associate-*r/44.7%
Applied egg-rr44.7%
associate-/l*44.5%
Simplified44.5%
if -1.0000000000000001e227 < (*.f64 V l) < -1e-52Initial program 85.3%
if -1e-52 < (*.f64 V l) < 0.0Initial program 69.6%
associate-/r*76.3%
clear-num76.3%
sqrt-div77.5%
metadata-eval77.5%
div-inv77.5%
clear-num77.5%
Applied egg-rr77.5%
un-div-inv77.5%
sqrt-prod44.8%
associate-/r*44.8%
Applied egg-rr44.8%
associate-/r*44.8%
Simplified44.8%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
sqrt-div98.9%
associate-*r/97.1%
Applied egg-rr97.1%
*-commutative97.1%
associate-/l*94.3%
associate-/r/98.9%
Simplified98.9%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*r/79.2%
sqrt-prod37.2%
times-frac37.1%
metadata-eval37.1%
sqrt-div37.2%
clear-num37.2%
associate-/r/37.1%
expm1-log1p-u28.5%
expm1-udef13.1%
sqrt-undiv35.2%
associate-/l*31.9%
*-commutative31.9%
*-un-lft-identity31.9%
times-frac35.2%
/-rgt-identity35.2%
Applied egg-rr35.2%
expm1-def66.4%
expm1-log1p79.2%
Simplified79.2%
associate-*r/31.9%
*-commutative31.9%
associate-/l*79.3%
Applied egg-rr79.3%
Final simplification76.2%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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+227)
(/ c0_m (/ (sqrt l) (sqrt (/ A V))))
(if (<= (* V l) -1e-52)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ c0_m (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 5e+307)
(/ c0_m (/ (sqrt (* V l)) (sqrt A)))
(/ c0_m (sqrt (/ l (/ A 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 * l) <= -1e+227) {
tmp = c0_m / (sqrt(l) / sqrt((A / V)));
} else if ((V * l) <= -1e-52) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0_m / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0_m / sqrt((l / (A / 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 * l) <= (-1d+227)) then
tmp = c0_m / (sqrt(l) / sqrt((a / v)))
else if ((v * l) <= (-1d-52)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0_m / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 5d+307) then
tmp = c0_m / (sqrt((v * l)) / sqrt(a))
else
tmp = c0_m / sqrt((l / (a / 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 * l) <= -1e+227) {
tmp = c0_m / (Math.sqrt(l) / Math.sqrt((A / V)));
} else if ((V * l) <= -1e-52) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0_m / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0_m / Math.sqrt((l / (A / 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 * l) <= -1e+227: tmp = c0_m / (math.sqrt(l) / math.sqrt((A / V))) elif (V * l) <= -1e-52: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0_m / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 5e+307: tmp = c0_m / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0_m / math.sqrt((l / (A / 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 (Float64(V * l) <= -1e+227) tmp = Float64(c0_m / Float64(sqrt(l) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -1e-52) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0_m / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0_m / sqrt(Float64(l / Float64(A / 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 * l) <= -1e+227)
tmp = c0_m / (sqrt(l) / sqrt((A / V)));
elseif ((V * l) <= -1e-52)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 5e+307)
tmp = c0_m / (sqrt((V * l)) / sqrt(A));
else
tmp = c0_m / sqrt((l / (A / 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[N[(V * l), $MachinePrecision], -1e+227], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-52], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0$95$m / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(l / N[(A / 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 \cdot \ell \leq -1 \cdot 10^{+227}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-52}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.0000000000000001e227Initial program 57.7%
associate-/r*57.7%
sqrt-div44.4%
associate-*r/44.7%
Applied egg-rr44.7%
associate-/l*44.5%
Simplified44.5%
if -1.0000000000000001e227 < (*.f64 V l) < -1e-52Initial program 85.3%
if -1e-52 < (*.f64 V l) < 0.0Initial program 69.6%
associate-/r*76.3%
clear-num76.3%
sqrt-div77.5%
metadata-eval77.5%
div-inv77.5%
clear-num77.5%
Applied egg-rr77.5%
un-div-inv77.5%
sqrt-prod44.8%
associate-/r*44.8%
Applied egg-rr44.8%
associate-/r*44.8%
Simplified44.8%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
associate-/r*77.5%
clear-num77.3%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
associate-*r/77.8%
sqrt-prod39.3%
times-frac37.4%
metadata-eval37.4%
sqrt-div37.4%
clear-num37.4%
sqrt-div44.3%
frac-times45.1%
sqrt-prod97.1%
Applied egg-rr97.1%
associate-/l*98.9%
*-commutative98.9%
Simplified98.9%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*r/79.2%
sqrt-prod37.2%
times-frac37.1%
metadata-eval37.1%
sqrt-div37.2%
clear-num37.2%
associate-/r/37.1%
expm1-log1p-u28.5%
expm1-udef13.1%
sqrt-undiv35.2%
associate-/l*31.9%
*-commutative31.9%
*-un-lft-identity31.9%
times-frac35.2%
/-rgt-identity35.2%
Applied egg-rr35.2%
expm1-def66.4%
expm1-log1p79.2%
Simplified79.2%
associate-*r/31.9%
*-commutative31.9%
associate-/l*79.3%
Applied egg-rr79.3%
Final simplification76.2%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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+227)
(/ (* c0_m (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -1e-52)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ c0_m (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 5e+307)
(/ c0_m (/ (sqrt (* V l)) (sqrt A)))
(/ c0_m (sqrt (/ l (/ A 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 * l) <= -1e+227) {
tmp = (c0_m * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -1e-52) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0_m / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0_m / sqrt((l / (A / 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 * l) <= (-1d+227)) then
tmp = (c0_m * sqrt((a / v))) / sqrt(l)
else if ((v * l) <= (-1d-52)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0_m / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 5d+307) then
tmp = c0_m / (sqrt((v * l)) / sqrt(a))
else
tmp = c0_m / sqrt((l / (a / 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 * l) <= -1e+227) {
tmp = (c0_m * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -1e-52) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 5e+307) {
tmp = c0_m / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0_m / Math.sqrt((l / (A / 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 * l) <= -1e+227: tmp = (c0_m * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -1e-52: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0_m / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 5e+307: tmp = c0_m / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0_m / math.sqrt((l / (A / 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 (Float64(V * l) <= -1e+227) tmp = Float64(Float64(c0_m * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -1e-52) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0_m / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0_m / sqrt(Float64(l / Float64(A / 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 * l) <= -1e+227)
tmp = (c0_m * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -1e-52)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 5e+307)
tmp = c0_m / (sqrt((V * l)) / sqrt(A));
else
tmp = c0_m / sqrt((l / (A / 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[N[(V * l), $MachinePrecision], -1e+227], N[(N[(c0$95$m * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-52], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0$95$m / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(l / N[(A / 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 \cdot \ell \leq -1 \cdot 10^{+227}:\\
\;\;\;\;\frac{c0\_m \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-52}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.0000000000000001e227Initial program 57.7%
*-commutative57.7%
associate-/r*57.7%
sqrt-div44.4%
associate-*l/44.7%
Applied egg-rr44.7%
if -1.0000000000000001e227 < (*.f64 V l) < -1e-52Initial program 85.3%
if -1e-52 < (*.f64 V l) < 0.0Initial program 69.6%
associate-/r*76.3%
clear-num76.3%
sqrt-div77.5%
metadata-eval77.5%
div-inv77.5%
clear-num77.5%
Applied egg-rr77.5%
un-div-inv77.5%
sqrt-prod44.8%
associate-/r*44.8%
Applied egg-rr44.8%
associate-/r*44.8%
Simplified44.8%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
associate-/r*77.5%
clear-num77.3%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
associate-*r/77.8%
sqrt-prod39.3%
times-frac37.4%
metadata-eval37.4%
sqrt-div37.4%
clear-num37.4%
sqrt-div44.3%
frac-times45.1%
sqrt-prod97.1%
Applied egg-rr97.1%
associate-/l*98.9%
*-commutative98.9%
Simplified98.9%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*r/79.2%
sqrt-prod37.2%
times-frac37.1%
metadata-eval37.1%
sqrt-div37.2%
clear-num37.2%
associate-/r/37.1%
expm1-log1p-u28.5%
expm1-udef13.1%
sqrt-undiv35.2%
associate-/l*31.9%
*-commutative31.9%
*-un-lft-identity31.9%
times-frac35.2%
/-rgt-identity35.2%
Applied egg-rr35.2%
expm1-def66.4%
expm1-log1p79.2%
Simplified79.2%
associate-*r/31.9%
*-commutative31.9%
associate-/l*79.3%
Applied egg-rr79.3%
Final simplification76.2%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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) -5e-311)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(sqrt (* (/ c0_m l) (/ (/ c0_m V) (/ 1.0 A))))
(if (<= (* V l) 5e+307)
(* c0_m (* (sqrt A) (pow (* V l) -0.5)))
(/ c0_m (sqrt (/ l (/ A 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 * l) <= -5e-311) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = c0_m / sqrt((l / (A / 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 * l) <= (-5d-311)) then
tmp = c0_m * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = sqrt(((c0_m / l) * ((c0_m / v) / (1.0d0 / a))))
else if ((v * l) <= 5d+307) then
tmp = c0_m * (sqrt(a) * ((v * l) ** (-0.5d0)))
else
tmp = c0_m / sqrt((l / (a / 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 * l) <= -5e-311) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = c0_m / Math.sqrt((l / (A / 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 * l) <= -5e-311: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A)))) elif (V * l) <= 5e+307: tmp = c0_m * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = c0_m / math.sqrt((l / (A / 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 (Float64(V * l) <= -5e-311) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(c0_m / l) * Float64(Float64(c0_m / V) / Float64(1.0 / A)))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0_m * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = Float64(c0_m / sqrt(Float64(l / Float64(A / 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 * l) <= -5e-311)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
elseif ((V * l) <= 5e+307)
tmp = c0_m * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = c0_m / sqrt((l / (A / 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[N[(V * l), $MachinePrecision], -5e-311], 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[(c0$95$m / l), $MachinePrecision] * N[(N[(c0$95$m / V), $MachinePrecision] / N[(1.0 / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(l / N[(A / 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 \cdot \ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{c0\_m}{\ell} \cdot \frac{\frac{c0\_m}{V}}{\frac{1}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0\_m \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000023e-311Initial program 79.9%
frac-2neg79.9%
sqrt-div93.1%
distribute-rgt-neg-in93.1%
Applied egg-rr93.1%
distribute-rgt-neg-out93.1%
*-commutative93.1%
distribute-rgt-neg-in93.1%
Simplified93.1%
if -5.00000000000023e-311 < (*.f64 V l) < 0.0Initial program 49.2%
associate-/r*65.8%
clear-num65.8%
sqrt-div68.7%
metadata-eval68.7%
div-inv68.7%
clear-num68.7%
Applied egg-rr68.7%
*-commutative68.7%
associate-*r/49.2%
*-commutative49.2%
sqrt-div23.1%
clear-num23.1%
sqrt-div49.2%
add-sqr-sqrt23.3%
pow1/223.3%
pow1/223.4%
pow-prod-down23.4%
Applied egg-rr25.0%
unpow1/225.0%
associate-/r*26.9%
Simplified26.9%
div-inv26.9%
unpow226.9%
associate-*l*30.3%
Applied egg-rr30.3%
div-inv30.3%
times-frac33.8%
un-div-inv33.8%
Applied egg-rr33.8%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
associate-/r*77.5%
clear-num77.3%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
associate-*r/77.8%
sqrt-prod39.3%
times-frac37.4%
metadata-eval37.4%
sqrt-div37.4%
clear-num37.4%
associate-/r/39.3%
expm1-log1p-u25.3%
expm1-udef13.5%
sqrt-undiv33.4%
associate-/l*35.2%
*-commutative35.2%
*-un-lft-identity35.2%
times-frac34.6%
/-rgt-identity34.6%
Applied egg-rr34.6%
expm1-def58.4%
expm1-log1p75.3%
Simplified75.3%
clear-num74.3%
un-div-inv75.9%
Applied egg-rr75.9%
associate-/l*82.6%
sqrt-div98.9%
associate-/l*97.1%
*-commutative97.1%
div-inv97.1%
*-commutative97.1%
associate-*l*98.9%
pow1/298.9%
pow-flip99.0%
metadata-eval99.0%
Applied egg-rr99.0%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*r/79.2%
sqrt-prod37.2%
times-frac37.1%
metadata-eval37.1%
sqrt-div37.2%
clear-num37.2%
associate-/r/37.1%
expm1-log1p-u28.5%
expm1-udef13.1%
sqrt-undiv35.2%
associate-/l*31.9%
*-commutative31.9%
*-un-lft-identity31.9%
times-frac35.2%
/-rgt-identity35.2%
Applied egg-rr35.2%
expm1-def66.4%
expm1-log1p79.2%
Simplified79.2%
associate-*r/31.9%
*-commutative31.9%
associate-/l*79.3%
Applied egg-rr79.3%
Final simplification87.6%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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-260)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(sqrt (* (/ c0_m l) (/ (/ c0_m V) (/ 1.0 A))))
(if (<= (* V l) 5e+307)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ c0_m (sqrt (/ l (/ A 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 * l) <= -1e-260) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0_m / sqrt((l / (A / 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 * l) <= (-1d-260)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = sqrt(((c0_m / l) * ((c0_m / v) / (1.0d0 / a))))
else if ((v * l) <= 5d+307) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = c0_m / sqrt((l / (a / 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 * l) <= -1e-260) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
} else if ((V * l) <= 5e+307) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0_m / Math.sqrt((l / (A / 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 * l) <= -1e-260: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = math.sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A)))) elif (V * l) <= 5e+307: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0_m / math.sqrt((l / (A / 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 (Float64(V * l) <= -1e-260) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(c0_m / l) * Float64(Float64(c0_m / V) / Float64(1.0 / A)))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0_m / sqrt(Float64(l / Float64(A / 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 * l) <= -1e-260)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
elseif ((V * l) <= 5e+307)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = c0_m / sqrt((l / (A / 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[N[(V * l), $MachinePrecision], -1e-260], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(c0$95$m / l), $MachinePrecision] * N[(N[(c0$95$m / V), $MachinePrecision] / N[(1.0 / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], 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[(l / N[(A / 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 \cdot \ell \leq -1 \cdot 10^{-260}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{c0\_m}{\ell} \cdot \frac{\frac{c0\_m}{V}}{\frac{1}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999961e-261Initial program 81.5%
if -9.99999999999999961e-261 < (*.f64 V l) < 0.0Initial program 49.8%
associate-/r*63.5%
clear-num63.4%
sqrt-div65.9%
metadata-eval65.9%
div-inv65.9%
clear-num65.9%
Applied egg-rr65.9%
*-commutative65.9%
associate-*r/49.8%
*-commutative49.8%
sqrt-div19.0%
clear-num19.0%
sqrt-div49.8%
add-sqr-sqrt19.2%
pow1/219.2%
pow1/219.3%
pow-prod-down19.4%
Applied egg-rr20.7%
unpow1/220.7%
associate-/r*22.3%
Simplified22.3%
div-inv22.2%
unpow222.2%
associate-*l*25.0%
Applied egg-rr25.0%
div-inv25.0%
times-frac27.9%
un-div-inv27.9%
Applied egg-rr27.9%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
sqrt-div98.9%
associate-*r/97.1%
Applied egg-rr97.1%
*-commutative97.1%
associate-/l*94.3%
associate-/r/98.9%
Simplified98.9%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*r/79.2%
sqrt-prod37.2%
times-frac37.1%
metadata-eval37.1%
sqrt-div37.2%
clear-num37.2%
associate-/r/37.1%
expm1-log1p-u28.5%
expm1-udef13.1%
sqrt-undiv35.2%
associate-/l*31.9%
*-commutative31.9%
*-un-lft-identity31.9%
times-frac35.2%
/-rgt-identity35.2%
Applied egg-rr35.2%
expm1-def66.4%
expm1-log1p79.2%
Simplified79.2%
associate-*r/31.9%
*-commutative31.9%
associate-/l*79.3%
Applied egg-rr79.3%
Final simplification80.9%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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 (<= (* c0_m (sqrt (/ A (* V l)))) 1e+54)
(* c0_m (sqrt (/ (/ A V) l)))
(/ 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 tmp;
if ((c0_m * sqrt((A / (V * l)))) <= 1e+54) {
tmp = c0_m * sqrt(((A / V) / l));
} 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) :: tmp
if ((c0_m * sqrt((a / (v * l)))) <= 1d+54) then
tmp = c0_m * sqrt(((a / v) / l))
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 tmp;
if ((c0_m * Math.sqrt((A / (V * l)))) <= 1e+54) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} 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): tmp = 0 if (c0_m * math.sqrt((A / (V * l)))) <= 1e+54: tmp = c0_m * math.sqrt(((A / V) / l)) 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) tmp = 0.0 if (Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) <= 1e+54) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); 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)
tmp = 0.0;
if ((c0_m * sqrt((A / (V * l)))) <= 1e+54)
tmp = c0_m * sqrt(((A / V) / l));
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_] := N[(c0$95$s * If[LessEqual[N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e+54], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 10^{+54}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e54Initial program 72.7%
*-commutative72.7%
associate-/l/76.5%
Simplified76.5%
if 1.0000000000000001e54 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 73.4%
associate-/r*73.4%
clear-num73.4%
sqrt-div76.6%
metadata-eval76.6%
div-inv76.6%
clear-num76.6%
Applied egg-rr76.6%
associate-*r/76.6%
sqrt-prod37.1%
times-frac37.1%
metadata-eval37.1%
sqrt-div37.1%
clear-num37.1%
associate-/r/37.0%
expm1-log1p-u35.1%
expm1-udef35.1%
sqrt-undiv72.4%
associate-/l*71.4%
*-commutative71.4%
*-un-lft-identity71.4%
times-frac73.3%
/-rgt-identity73.3%
Applied egg-rr73.3%
expm1-def73.3%
expm1-log1p77.6%
Simplified77.6%
Final simplification76.8%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 4e+298)))
(sqrt (* (/ c0_m l) (/ (/ c0_m V) (/ 1.0 A))))
(* c0_m (sqrt t_0))))))c0_m = fabs(c0);
c0_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+298)) {
tmp = sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
} else {
tmp = c0_m * sqrt(t_0);
}
return c0_s * tmp;
}
c0_m = abs(c0)
c0_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+298))) then
tmp = sqrt(((c0_m / l) * ((c0_m / v) / (1.0d0 / a))))
else
tmp = c0_m * sqrt(t_0)
end if
code = c0_s * tmp
end function
c0_m = Math.abs(c0);
c0_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+298)) {
tmp = Math.sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
} else {
tmp = c0_m * Math.sqrt(t_0);
}
return c0_s * tmp;
}
c0_m = math.fabs(c0) c0_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+298): tmp = math.sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A)))) else: tmp = c0_m * math.sqrt(t_0) return c0_s * tmp
c0_m = abs(c0) c0_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+298)) tmp = sqrt(Float64(Float64(c0_m / l) * Float64(Float64(c0_m / V) / Float64(1.0 / A)))); else tmp = Float64(c0_m * sqrt(t_0)); end return Float64(c0_s * tmp) end
c0_m = abs(c0);
c0_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+298)))
tmp = sqrt(((c0_m / l) * ((c0_m / V) / (1.0 / A))));
else
tmp = c0_m * sqrt(t_0);
end
tmp_2 = c0_s * tmp;
end
c0_m = N[Abs[c0], $MachinePrecision]
c0_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+298]], $MachinePrecision]], N[Sqrt[N[(N[(c0$95$m / l), $MachinePrecision] * N[(N[(c0$95$m / V), $MachinePrecision] / N[(1.0 / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0_m = \left|c0\right|
\\
c0_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+298}\right):\\
\;\;\;\;\sqrt{\frac{c0\_m}{\ell} \cdot \frac{\frac{c0\_m}{V}}{\frac{1}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 3.9999999999999998e298 < (/.f64 A (*.f64 V l)) Initial program 41.4%
associate-/r*55.2%
clear-num55.2%
sqrt-div57.1%
metadata-eval57.1%
div-inv57.0%
clear-num57.0%
Applied egg-rr57.0%
*-commutative57.0%
associate-*r/42.5%
*-commutative42.5%
sqrt-div35.8%
clear-num35.8%
sqrt-div41.4%
add-sqr-sqrt32.0%
pow1/232.0%
pow1/232.1%
pow-prod-down32.1%
Applied egg-rr33.1%
unpow1/233.1%
associate-/r*35.4%
Simplified35.4%
div-inv35.4%
unpow235.4%
associate-*l*39.6%
Applied egg-rr39.6%
div-inv39.5%
times-frac44.6%
un-div-inv44.6%
Applied egg-rr44.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 3.9999999999999998e298Initial program 99.0%
Final simplification74.4%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 4e+298)))
(sqrt (* (/ c0_m V) (* c0_m (/ A l))))
(* c0_m (sqrt t_0))))))c0_m = fabs(c0);
c0_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+298)) {
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
} else {
tmp = c0_m * sqrt(t_0);
}
return c0_s * tmp;
}
c0_m = abs(c0)
c0_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+298))) then
tmp = sqrt(((c0_m / v) * (c0_m * (a / l))))
else
tmp = c0_m * sqrt(t_0)
end if
code = c0_s * tmp
end function
c0_m = Math.abs(c0);
c0_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+298)) {
tmp = Math.sqrt(((c0_m / V) * (c0_m * (A / l))));
} else {
tmp = c0_m * Math.sqrt(t_0);
}
return c0_s * tmp;
}
c0_m = math.fabs(c0) c0_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+298): tmp = math.sqrt(((c0_m / V) * (c0_m * (A / l)))) else: tmp = c0_m * math.sqrt(t_0) return c0_s * tmp
c0_m = abs(c0) c0_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+298)) tmp = sqrt(Float64(Float64(c0_m / V) * Float64(c0_m * Float64(A / l)))); else tmp = Float64(c0_m * sqrt(t_0)); end return Float64(c0_s * tmp) end
c0_m = abs(c0);
c0_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+298)))
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
else
tmp = c0_m * sqrt(t_0);
end
tmp_2 = c0_s * tmp;
end
c0_m = N[Abs[c0], $MachinePrecision]
c0_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+298]], $MachinePrecision]], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0_m = \left|c0\right|
\\
c0_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+298}\right):\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \left(c0\_m \cdot \frac{A}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 3.9999999999999998e298 < (/.f64 A (*.f64 V l)) Initial program 41.4%
associate-/r*55.2%
clear-num55.2%
sqrt-div57.1%
metadata-eval57.1%
div-inv57.0%
clear-num57.0%
Applied egg-rr57.0%
*-commutative57.0%
associate-*r/42.5%
*-commutative42.5%
sqrt-div35.8%
clear-num35.8%
sqrt-div41.4%
add-sqr-sqrt32.0%
pow1/232.0%
pow1/232.1%
pow-prod-down32.1%
Applied egg-rr33.1%
unpow1/233.1%
associate-/r*35.4%
Simplified35.4%
div-inv35.4%
unpow235.4%
associate-*l*39.6%
Applied egg-rr39.6%
div-inv39.6%
*-commutative39.6%
clear-num39.6%
associate-*l*40.3%
un-div-inv40.3%
Applied egg-rr40.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 3.9999999999999998e298Initial program 99.0%
Final simplification72.4%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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 (<= l 1.8e+125)
(/ c0_m (sqrt (* l (/ V A))))
(/ c0_m (sqrt (/ V (/ A l)))))))c0_m = fabs(c0);
c0_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (l <= 1.8e+125) {
tmp = c0_m / sqrt((l * (V / A)));
} else {
tmp = c0_m / sqrt((V / (A / l)));
}
return c0_s * tmp;
}
c0_m = abs(c0)
c0_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= 1.8d+125) then
tmp = c0_m / sqrt((l * (v / a)))
else
tmp = c0_m / sqrt((v / (a / l)))
end if
code = c0_s * tmp
end function
c0_m = Math.abs(c0);
c0_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (l <= 1.8e+125) {
tmp = c0_m / Math.sqrt((l * (V / A)));
} else {
tmp = c0_m / Math.sqrt((V / (A / l)));
}
return c0_s * tmp;
}
c0_m = math.fabs(c0) c0_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if l <= 1.8e+125: tmp = c0_m / math.sqrt((l * (V / A))) else: tmp = c0_m / math.sqrt((V / (A / l))) return c0_s * tmp
c0_m = abs(c0) c0_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (l <= 1.8e+125) tmp = Float64(c0_m / sqrt(Float64(l * Float64(V / A)))); else tmp = Float64(c0_m / sqrt(Float64(V / Float64(A / l)))); end return Float64(c0_s * tmp) end
c0_m = abs(c0);
c0_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if (l <= 1.8e+125)
tmp = c0_m / sqrt((l * (V / A)));
else
tmp = c0_m / sqrt((V / (A / l)));
end
tmp_2 = c0_s * tmp;
end
c0_m = N[Abs[c0], $MachinePrecision]
c0_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[l, 1.8e+125], N[(c0$95$m / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c0_m = \left|c0\right|
\\
c0_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 1.8 \cdot 10^{+125}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if l < 1.8000000000000002e125Initial program 75.1%
associate-/r*79.2%
clear-num79.1%
sqrt-div80.1%
metadata-eval80.1%
div-inv79.8%
clear-num79.8%
Applied egg-rr79.8%
associate-*r/79.8%
sqrt-prod35.2%
times-frac34.9%
metadata-eval34.9%
sqrt-div34.5%
clear-num34.5%
associate-/r/34.8%
expm1-log1p-u20.8%
expm1-udef12.8%
sqrt-undiv35.9%
associate-/l*34.1%
*-commutative34.1%
*-un-lft-identity34.1%
times-frac35.0%
/-rgt-identity35.0%
Applied egg-rr35.0%
expm1-def54.8%
expm1-log1p75.2%
Simplified75.2%
Taylor expanded in V around 0 75.6%
associate-*l/79.8%
Simplified79.8%
if 1.8000000000000002e125 < l Initial program 58.3%
associate-/r*52.2%
clear-num51.6%
sqrt-div51.6%
metadata-eval51.6%
div-inv51.5%
clear-num51.5%
Applied egg-rr51.5%
associate-*r/51.5%
sqrt-prod79.3%
times-frac76.2%
metadata-eval76.2%
sqrt-div76.5%
clear-num76.4%
associate-/r/79.2%
expm1-log1p-u66.4%
expm1-udef28.3%
sqrt-undiv16.7%
associate-/l*25.1%
*-commutative25.1%
*-un-lft-identity25.1%
times-frac25.0%
/-rgt-identity25.0%
Applied egg-rr25.0%
expm1-def47.6%
expm1-log1p63.2%
Simplified63.2%
clear-num63.2%
un-div-inv63.1%
Applied egg-rr63.1%
Final simplification77.7%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 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 (<= l 3.5e+130)
(/ c0_m (sqrt (/ l (/ A V))))
(/ c0_m (sqrt (/ V (/ A l)))))))c0_m = fabs(c0);
c0_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (l <= 3.5e+130) {
tmp = c0_m / sqrt((l / (A / V)));
} else {
tmp = c0_m / sqrt((V / (A / l)));
}
return c0_s * tmp;
}
c0_m = abs(c0)
c0_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= 3.5d+130) then
tmp = c0_m / sqrt((l / (a / v)))
else
tmp = c0_m / sqrt((v / (a / l)))
end if
code = c0_s * tmp
end function
c0_m = Math.abs(c0);
c0_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (l <= 3.5e+130) {
tmp = c0_m / Math.sqrt((l / (A / V)));
} else {
tmp = c0_m / Math.sqrt((V / (A / l)));
}
return c0_s * tmp;
}
c0_m = math.fabs(c0) c0_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if l <= 3.5e+130: tmp = c0_m / math.sqrt((l / (A / V))) else: tmp = c0_m / math.sqrt((V / (A / l))) return c0_s * tmp
c0_m = abs(c0) c0_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (l <= 3.5e+130) tmp = Float64(c0_m / sqrt(Float64(l / Float64(A / V)))); else tmp = Float64(c0_m / sqrt(Float64(V / Float64(A / l)))); end return Float64(c0_s * tmp) end
c0_m = abs(c0);
c0_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if (l <= 3.5e+130)
tmp = c0_m / sqrt((l / (A / V)));
else
tmp = c0_m / sqrt((V / (A / l)));
end
tmp_2 = c0_s * tmp;
end
c0_m = N[Abs[c0], $MachinePrecision]
c0_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[l, 3.5e+130], N[(c0$95$m / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c0_m = \left|c0\right|
\\
c0_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 3.5 \cdot 10^{+130}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if l < 3.5000000000000001e130Initial program 75.1%
associate-/r*79.2%
clear-num79.1%
sqrt-div80.1%
metadata-eval80.1%
div-inv79.8%
clear-num79.8%
Applied egg-rr79.8%
associate-*r/79.8%
sqrt-prod35.2%
times-frac34.9%
metadata-eval34.9%
sqrt-div34.5%
clear-num34.5%
associate-/r/34.8%
expm1-log1p-u20.8%
expm1-udef12.8%
sqrt-undiv35.9%
associate-/l*34.1%
*-commutative34.1%
*-un-lft-identity34.1%
times-frac35.0%
/-rgt-identity35.0%
Applied egg-rr35.0%
expm1-def54.8%
expm1-log1p75.2%
Simplified75.2%
associate-*r/75.6%
*-commutative75.6%
associate-/l*80.1%
Applied egg-rr80.1%
if 3.5000000000000001e130 < l Initial program 58.3%
associate-/r*52.2%
clear-num51.6%
sqrt-div51.6%
metadata-eval51.6%
div-inv51.5%
clear-num51.5%
Applied egg-rr51.5%
associate-*r/51.5%
sqrt-prod79.3%
times-frac76.2%
metadata-eval76.2%
sqrt-div76.5%
clear-num76.4%
associate-/r/79.2%
expm1-log1p-u66.4%
expm1-udef28.3%
sqrt-undiv16.7%
associate-/l*25.1%
*-commutative25.1%
*-un-lft-identity25.1%
times-frac25.0%
/-rgt-identity25.0%
Applied egg-rr25.0%
expm1-def47.6%
expm1-log1p63.2%
Simplified63.2%
clear-num63.2%
un-div-inv63.1%
Applied egg-rr63.1%
Final simplification77.9%
c0_m = (fabs.f64 c0) c0_s = (copysign.f64 1 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 72.9%
Final simplification72.9%
herbie shell --seed 2024040
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))