
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt A))))
(*
c0_s
(if (<= (* V l) (- INFINITY))
(/ (/ c0_m (sqrt l)) (sqrt (/ V A)))
(if (<= (* V l) -2e-305)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-304)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) 1e+307)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* (/ t_0 l) (/ t_0 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);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0_m / sqrt(l)) / sqrt((V / A));
} else if ((V * l) <= -2e-305) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-304) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((t_0 / l) * (t_0 / V)));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt(A);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0_m / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((V * l) <= -2e-305) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-304) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((t_0 / l) * (t_0 / 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) tmp = 0 if (V * l) <= -math.inf: tmp = (c0_m / math.sqrt(l)) / math.sqrt((V / A)) elif (V * l) <= -2e-305: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-304: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= 1e+307: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((t_0 / l) * (t_0 / V))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0_m / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= -2e-305) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-304) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(t_0 / l) * Float64(t_0 / 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);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0_m / sqrt(l)) / sqrt((V / A));
elseif ((V * l) <= -2e-305)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-304)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= 1e+307)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((t_0 / l) * (t_0 / V)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-305], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-304], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+307], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(t$95$0 / l), $MachinePrecision] * N[(t$95$0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{A}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-305}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-304}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{t\_0}{\ell} \cdot \frac{t\_0}{V}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 47.3%
add-sqr-sqrt47.3%
sqrt-unprod47.3%
*-commutative47.3%
*-commutative47.3%
swap-sqr47.3%
add-sqr-sqrt47.3%
pow247.3%
Applied egg-rr47.3%
associate-/r*56.8%
Simplified56.8%
sqrt-prod56.8%
sqrt-undiv29.8%
sqrt-pow129.8%
metadata-eval29.8%
pow129.8%
*-commutative29.8%
add-cbrt-cube29.8%
unpow229.8%
cbrt-prod29.8%
associate-*l*29.8%
unpow229.8%
cbrt-prod29.8%
pow229.8%
sqrt-undiv66.5%
associate-/r*47.3%
Applied egg-rr47.3%
associate-*r*47.3%
unpow247.3%
add-cube-cbrt47.3%
sqrt-div0.0%
clear-num0.0%
sqrt-div47.3%
*-commutative47.3%
associate-*r/66.3%
un-div-inv66.5%
sqrt-prod30.0%
associate-/r*29.8%
Applied egg-rr29.8%
if -inf.0 < (*.f64 V l) < -1.99999999999999999e-305Initial program 80.1%
frac-2neg80.1%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
distribute-rgt-neg-out99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Simplified99.5%
if -1.99999999999999999e-305 < (*.f64 V l) < 1.99999999999999994e-304Initial program 45.0%
clear-num45.0%
associate-/r/45.0%
associate-/r*45.0%
Applied egg-rr45.0%
associate-/l/45.0%
associate-*l/45.0%
*-un-lft-identity45.0%
associate-/r*56.6%
Applied egg-rr56.6%
frac-2neg56.6%
sqrt-div45.4%
distribute-neg-frac245.4%
Applied egg-rr45.4%
if 1.99999999999999994e-304 < (*.f64 V l) < 9.99999999999999986e306Initial program 88.0%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 23.4%
add-sqr-sqrt23.4%
sqrt-unprod23.4%
*-commutative23.4%
*-commutative23.4%
swap-sqr22.5%
add-sqr-sqrt22.5%
pow222.5%
Applied egg-rr22.5%
associate-/r*27.1%
Simplified27.1%
associate-*l/36.8%
*-commutative36.8%
associate-*r/27.1%
associate-/r*22.5%
associate-*r/22.4%
Applied egg-rr22.4%
add-sqr-sqrt22.4%
*-commutative22.4%
times-frac37.0%
sqrt-prod37.0%
sqrt-pow136.6%
metadata-eval36.6%
pow136.6%
sqrt-prod36.6%
sqrt-pow151.7%
metadata-eval51.7%
pow151.7%
Applied egg-rr51.7%
Final simplification86.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 4e-209)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+287) t_0 (/ 1.0 (/ (sqrt (* V (/ l A))) c0_m)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-209) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 2e+287) {
tmp = t_0;
} else {
tmp = 1.0 / (sqrt((V * (l / A))) / c0_m);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 4d-209) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 2d+287) then
tmp = t_0
else
tmp = 1.0d0 / (sqrt((v * (l / a))) / c0_m)
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-209) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+287) {
tmp = t_0;
} else {
tmp = 1.0 / (Math.sqrt((V * (l / A))) / c0_m);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 4e-209: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 2e+287: tmp = t_0 else: tmp = 1.0 / (math.sqrt((V * (l / A))) / c0_m) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-209) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+287) tmp = t_0; else tmp = Float64(1.0 / Float64(sqrt(Float64(V * Float64(l / A))) / c0_m)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-209)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 2e+287)
tmp = t_0;
else
tmp = 1.0 / (sqrt((V * (l / A))) / c0_m);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 4e-209], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+287], t$95$0, N[(1.0 / N[(N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-209}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+287}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{V \cdot \frac{\ell}{A}}}{c0\_m}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e-209Initial program 69.9%
clear-num69.9%
associate-/r/69.9%
associate-/r*69.9%
Applied egg-rr69.9%
associate-/l/69.9%
associate-*l/69.9%
*-un-lft-identity69.9%
associate-/r*67.0%
Applied egg-rr67.0%
if 4.0000000000000002e-209 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000002e287Initial program 98.1%
if 2.0000000000000002e287 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 43.4%
add-sqr-sqrt43.3%
sqrt-unprod35.1%
*-commutative35.1%
*-commutative35.1%
swap-sqr34.5%
add-sqr-sqrt34.5%
pow234.5%
Applied egg-rr34.5%
associate-/r*43.6%
Simplified43.6%
sqrt-prod43.5%
sqrt-undiv26.0%
sqrt-pow132.1%
metadata-eval32.1%
pow132.1%
*-commutative32.1%
add-cbrt-cube23.1%
unpow223.1%
cbrt-prod26.0%
associate-*l*26.1%
unpow226.1%
cbrt-prod31.7%
pow231.7%
sqrt-undiv52.1%
associate-/r*43.3%
Applied egg-rr43.3%
associate-*r*43.4%
unpow243.4%
add-cube-cbrt43.4%
sqrt-div25.5%
clear-num25.4%
sqrt-div44.2%
*-commutative44.2%
associate-*r/53.1%
un-div-inv53.2%
clear-num53.3%
*-commutative53.3%
associate-/r/50.4%
div-inv50.5%
clear-num50.5%
Applied egg-rr50.5%
Final simplification71.7%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 4e-209)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+287) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-209) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 2e+287) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 4d-209) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 2d+287) then
tmp = t_0
else
tmp = c0_m / sqrt((v * (l / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-209) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+287) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 4e-209: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 2e+287: tmp = t_0 else: tmp = c0_m / math.sqrt((V * (l / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-209) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+287) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-209)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 2e+287)
tmp = t_0;
else
tmp = c0_m / sqrt((V * (l / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 4e-209], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+287], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-209}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+287}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e-209Initial program 69.9%
clear-num69.9%
associate-/r/69.9%
associate-/r*69.9%
Applied egg-rr69.9%
associate-/l/69.9%
associate-*l/69.9%
*-un-lft-identity69.9%
associate-/r*67.0%
Applied egg-rr67.0%
if 4.0000000000000002e-209 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000002e287Initial program 98.1%
if 2.0000000000000002e287 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 43.4%
clear-num43.4%
associate-/r/43.4%
associate-/r*43.4%
Applied egg-rr43.4%
associate-*l/52.3%
sqrt-div32.1%
associate-*l/32.1%
*-un-lft-identity32.1%
clear-num32.1%
un-div-inv32.2%
sqrt-undiv53.3%
div-inv53.2%
clear-num53.2%
Applied egg-rr53.2%
*-commutative53.2%
associate-*l/44.3%
associate-/l*50.5%
Simplified50.5%
Final simplification71.7%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (/ (sqrt (/ A V)) (sqrt l)))))
(*
c0_s
(if (<= (* V l) -2e+152)
t_0
(if (<= (* V l) -5e-145)
(* c0_m (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 1e+307)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (/ (* (pow c0_m 2.0) (/ A l)) V)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -2e+152) {
tmp = t_0;
} else if ((V * l) <= -5e-145) {
tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((pow(c0_m, 2.0) * (A / l)) / V));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-2d+152)) then
tmp = t_0
else if ((v * l) <= (-5d-145)) then
tmp = c0_m * sqrt((a * ((1.0d0 / v) / l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 1d+307) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt((((c0_m ** 2.0d0) * (a / l)) / v))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+152) {
tmp = t_0;
} else if ((V * l) <= -5e-145) {
tmp = c0_m * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((Math.pow(c0_m, 2.0) * (A / l)) / V));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+152: tmp = t_0 elif (V * l) <= -5e-145: tmp = c0_m * math.sqrt((A * ((1.0 / V) / l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 1e+307: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((math.pow(c0_m, 2.0) * (A / l)) / V)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+152) tmp = t_0; elseif (Float64(V * l) <= -5e-145) tmp = Float64(c0_m * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64((c0_m ^ 2.0) * Float64(A / l)) / V)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+152)
tmp = t_0;
elseif ((V * l) <= -5e-145)
tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 1e+307)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((((c0_m ^ 2.0) * (A / l)) / V));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -2e+152], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-145], N[(c0$95$m * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+307], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[Power[c0$95$m, 2.0], $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision] / V), $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 -2 \cdot 10^{+152}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-145}:\\
\;\;\;\;c0\_m \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{{c0\_m}^{2} \cdot \frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000001e152 or -4.9999999999999998e-145 < (*.f64 V l) < 0.0Initial program 60.1%
associate-/r*66.3%
sqrt-div38.2%
div-inv38.1%
Applied egg-rr38.1%
associate-*r/38.2%
*-rgt-identity38.2%
Simplified38.2%
if -2.0000000000000001e152 < (*.f64 V l) < -4.9999999999999998e-145Initial program 86.9%
clear-num85.9%
associate-/r/86.9%
associate-/r*86.9%
Applied egg-rr86.9%
if 0.0 < (*.f64 V l) < 9.99999999999999986e306Initial program 88.1%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 23.4%
add-sqr-sqrt23.4%
sqrt-unprod23.4%
*-commutative23.4%
*-commutative23.4%
swap-sqr22.5%
add-sqr-sqrt22.5%
pow222.5%
Applied egg-rr22.5%
associate-/r*27.1%
Simplified27.1%
div-inv27.1%
*-commutative27.1%
associate-*l/27.1%
associate-*r/36.7%
un-div-inv36.7%
Applied egg-rr36.7%
Final simplification70.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(/ (/ c0_m (sqrt l)) (sqrt (/ V A)))
(if (<= (* V l) -1e-316)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* (sqrt (/ A V)) (* c0_m (pow l -0.5)))
(if (<= (* V l) 1e+307)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (/ (* (pow c0_m 2.0) (/ A l)) V))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0_m / sqrt(l)) / sqrt((V / A));
} else if ((V * l) <= -1e-316) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt((A / V)) * (c0_m * pow(l, -0.5));
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((pow(c0_m, 2.0) * (A / l)) / V));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0_m / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((V * l) <= -1e-316) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt((A / V)) * (c0_m * Math.pow(l, -0.5));
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((Math.pow(c0_m, 2.0) * (A / l)) / V));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = (c0_m / math.sqrt(l)) / math.sqrt((V / A)) elif (V * l) <= -1e-316: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.sqrt((A / V)) * (c0_m * math.pow(l, -0.5)) elif (V * l) <= 1e+307: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((math.pow(c0_m, 2.0) * (A / l)) / V)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0_m / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= -1e-316) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0_m * (l ^ -0.5))); elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64((c0_m ^ 2.0) * Float64(A / l)) / V)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0_m / sqrt(l)) / sqrt((V / A));
elseif ((V * l) <= -1e-316)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = sqrt((A / V)) * (c0_m * (l ^ -0.5));
elseif ((V * l) <= 1e+307)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((((c0_m ^ 2.0) * (A / l)) / V));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-316], 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[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0$95$m * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+307], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[Power[c0$95$m, 2.0], $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-316}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \left(c0\_m \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{{c0\_m}^{2} \cdot \frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 47.3%
add-sqr-sqrt47.3%
sqrt-unprod47.3%
*-commutative47.3%
*-commutative47.3%
swap-sqr47.3%
add-sqr-sqrt47.3%
pow247.3%
Applied egg-rr47.3%
associate-/r*56.8%
Simplified56.8%
sqrt-prod56.8%
sqrt-undiv29.8%
sqrt-pow129.8%
metadata-eval29.8%
pow129.8%
*-commutative29.8%
add-cbrt-cube29.8%
unpow229.8%
cbrt-prod29.8%
associate-*l*29.8%
unpow229.8%
cbrt-prod29.8%
pow229.8%
sqrt-undiv66.5%
associate-/r*47.3%
Applied egg-rr47.3%
associate-*r*47.3%
unpow247.3%
add-cube-cbrt47.3%
sqrt-div0.0%
clear-num0.0%
sqrt-div47.3%
*-commutative47.3%
associate-*r/66.3%
un-div-inv66.5%
sqrt-prod30.0%
associate-/r*29.8%
Applied egg-rr29.8%
if -inf.0 < (*.f64 V l) < -9.999999837e-317Initial program 79.5%
frac-2neg79.5%
sqrt-div99.1%
distribute-rgt-neg-in99.1%
Applied egg-rr99.1%
distribute-rgt-neg-out99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
Simplified99.1%
if -9.999999837e-317 < (*.f64 V l) < 0.0Initial program 42.8%
add-sqr-sqrt17.8%
sqrt-unprod18.0%
*-commutative18.0%
*-commutative18.0%
swap-sqr17.7%
add-sqr-sqrt17.7%
pow217.7%
Applied egg-rr17.7%
associate-/r*27.5%
Simplified27.5%
sqrt-prod27.3%
div-inv27.3%
sqrt-prod16.9%
sqrt-pow136.7%
metadata-eval36.7%
pow136.7%
associate-*l*36.9%
inv-pow36.9%
sqrt-pow136.9%
metadata-eval36.9%
Applied egg-rr36.9%
if 0.0 < (*.f64 V l) < 9.99999999999999986e306Initial program 88.1%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 23.4%
add-sqr-sqrt23.4%
sqrt-unprod23.4%
*-commutative23.4%
*-commutative23.4%
swap-sqr22.5%
add-sqr-sqrt22.5%
pow222.5%
Applied egg-rr22.5%
associate-/r*27.1%
Simplified27.1%
div-inv27.1%
*-commutative27.1%
associate-*l/27.1%
associate-*r/36.7%
un-div-inv36.7%
Applied egg-rr36.7%
Final simplification84.4%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(/ (/ c0_m (sqrt l)) (sqrt (/ V A)))
(if (<= (* V l) -2e-305)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-304)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) 1e+307)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (/ (* (pow c0_m 2.0) (/ A l)) V))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0_m / sqrt(l)) / sqrt((V / A));
} else if ((V * l) <= -2e-305) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-304) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((pow(c0_m, 2.0) * (A / l)) / V));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0_m / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((V * l) <= -2e-305) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-304) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((Math.pow(c0_m, 2.0) * (A / l)) / V));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = (c0_m / math.sqrt(l)) / math.sqrt((V / A)) elif (V * l) <= -2e-305: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-304: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= 1e+307: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((math.pow(c0_m, 2.0) * (A / l)) / V)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0_m / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= -2e-305) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-304) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64((c0_m ^ 2.0) * Float64(A / l)) / V)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0_m / sqrt(l)) / sqrt((V / A));
elseif ((V * l) <= -2e-305)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-304)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= 1e+307)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((((c0_m ^ 2.0) * (A / l)) / V));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-305], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-304], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+307], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[Power[c0$95$m, 2.0], $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-305}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-304}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{{c0\_m}^{2} \cdot \frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 47.3%
add-sqr-sqrt47.3%
sqrt-unprod47.3%
*-commutative47.3%
*-commutative47.3%
swap-sqr47.3%
add-sqr-sqrt47.3%
pow247.3%
Applied egg-rr47.3%
associate-/r*56.8%
Simplified56.8%
sqrt-prod56.8%
sqrt-undiv29.8%
sqrt-pow129.8%
metadata-eval29.8%
pow129.8%
*-commutative29.8%
add-cbrt-cube29.8%
unpow229.8%
cbrt-prod29.8%
associate-*l*29.8%
unpow229.8%
cbrt-prod29.8%
pow229.8%
sqrt-undiv66.5%
associate-/r*47.3%
Applied egg-rr47.3%
associate-*r*47.3%
unpow247.3%
add-cube-cbrt47.3%
sqrt-div0.0%
clear-num0.0%
sqrt-div47.3%
*-commutative47.3%
associate-*r/66.3%
un-div-inv66.5%
sqrt-prod30.0%
associate-/r*29.8%
Applied egg-rr29.8%
if -inf.0 < (*.f64 V l) < -1.99999999999999999e-305Initial program 80.1%
frac-2neg80.1%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
distribute-rgt-neg-out99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Simplified99.5%
if -1.99999999999999999e-305 < (*.f64 V l) < 1.99999999999999994e-304Initial program 45.0%
clear-num45.0%
associate-/r/45.0%
associate-/r*45.0%
Applied egg-rr45.0%
associate-/l/45.0%
associate-*l/45.0%
*-un-lft-identity45.0%
associate-/r*56.6%
Applied egg-rr56.6%
frac-2neg56.6%
sqrt-div45.4%
distribute-neg-frac245.4%
Applied egg-rr45.4%
if 1.99999999999999994e-304 < (*.f64 V l) < 9.99999999999999986e306Initial program 88.0%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 23.4%
add-sqr-sqrt23.4%
sqrt-unprod23.4%
*-commutative23.4%
*-commutative23.4%
swap-sqr22.5%
add-sqr-sqrt22.5%
pow222.5%
Applied egg-rr22.5%
associate-/r*27.1%
Simplified27.1%
div-inv27.1%
*-commutative27.1%
associate-*l/27.1%
associate-*r/36.7%
un-div-inv36.7%
Applied egg-rr36.7%
Final simplification84.9%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (/ (sqrt (/ A V)) (sqrt l)))))
(*
c0_s
(if (<= (* V l) -2e+152)
t_0
(if (<= (* V l) -5e-145)
(* c0_m (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 1e+307)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(* c0_m (sqrt (/ (/ A V) l))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -2e+152) {
tmp = t_0;
} else if ((V * l) <= -5e-145) {
tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0_m * sqrt(((A / V) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-2d+152)) then
tmp = t_0
else if ((v * l) <= (-5d-145)) then
tmp = c0_m * sqrt((a * ((1.0d0 / v) / l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 1d+307) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = c0_m * sqrt(((a / v) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+152) {
tmp = t_0;
} else if ((V * l) <= -5e-145) {
tmp = c0_m * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0_m * Math.sqrt(((A / V) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+152: tmp = t_0 elif (V * l) <= -5e-145: tmp = c0_m * math.sqrt((A * ((1.0 / V) / l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 1e+307: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0_m * math.sqrt(((A / V) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+152) tmp = t_0; elseif (Float64(V * l) <= -5e-145) tmp = Float64(c0_m * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+152)
tmp = t_0;
elseif ((V * l) <= -5e-145)
tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 1e+307)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = c0_m * sqrt(((A / V) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := 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], -2e+152], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-145], N[(c0$95$m * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+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[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+152}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-145}:\\
\;\;\;\;c0\_m \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000001e152 or -4.9999999999999998e-145 < (*.f64 V l) < 0.0Initial program 60.1%
associate-/r*66.3%
sqrt-div38.2%
div-inv38.1%
Applied egg-rr38.1%
associate-*r/38.2%
*-rgt-identity38.2%
Simplified38.2%
if -2.0000000000000001e152 < (*.f64 V l) < -4.9999999999999998e-145Initial program 86.9%
clear-num85.9%
associate-/r/86.9%
associate-/r*86.9%
Applied egg-rr86.9%
if 0.0 < (*.f64 V l) < 9.99999999999999986e306Initial program 88.1%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 23.4%
associate-/r*49.1%
Simplified49.1%
Final simplification71.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -5e-145)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 2e-304)
(/ c0_m (sqrt (* l (/ V A))))
(if (<= (* V l) 1e+307)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(* c0_m (sqrt (/ (/ A V) l))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-145) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 2e-304) {
tmp = c0_m / sqrt((l * (V / A)));
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0_m * sqrt(((A / V) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-145)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 2d-304) then
tmp = c0_m / sqrt((l * (v / a)))
else if ((v * l) <= 1d+307) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = c0_m * sqrt(((a / v) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-145) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 2e-304) {
tmp = c0_m / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 1e+307) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0_m * Math.sqrt(((A / V) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -5e-145: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 2e-304: tmp = c0_m / math.sqrt((l * (V / A))) elif (V * l) <= 1e+307: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0_m * math.sqrt(((A / V) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-145) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 2e-304) tmp = Float64(c0_m / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-145)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 2e-304)
tmp = c0_m / sqrt((l * (V / A)));
elseif ((V * l) <= 1e+307)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = c0_m * sqrt(((A / V) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e-145], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-304], N[(c0$95$m / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+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[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-145}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-304}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999998e-145Initial program 77.6%
if -4.9999999999999998e-145 < (*.f64 V l) < 1.99999999999999994e-304Initial program 57.4%
clear-num57.4%
associate-/r/57.3%
associate-/r*57.4%
Applied egg-rr57.4%
associate-*l/64.2%
sqrt-div36.0%
associate-*l/36.0%
*-un-lft-identity36.0%
clear-num36.0%
un-div-inv36.0%
sqrt-undiv64.7%
div-inv64.7%
clear-num64.7%
Applied egg-rr64.7%
if 1.99999999999999994e-304 < (*.f64 V l) < 9.99999999999999986e306Initial program 88.0%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 23.4%
associate-/r*49.1%
Simplified49.1%
Final simplification80.6%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (let* ((t_0 (* c0_m (sqrt (/ A (* V l)))))) (* c0_s (if (<= t_0 0.0) (* c0_m (sqrt (/ (/ A V) l))) 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) {
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) 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) {
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: 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) 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)
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[LessEqual[t$95$0, 0.0], 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:\\
\;\;\;\;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.0Initial program 67.7%
associate-/r*67.9%
Simplified67.9%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 80.7%
Final simplification72.9%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (let* ((t_0 (* c0_m (sqrt (/ A (* V l)))))) (* c0_s (if (<= t_0 4e-209) (* c0_m (sqrt (/ (/ A l) V))) 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 <= 4e-209) {
tmp = c0_m * sqrt(((A / l) / V));
} 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 <= 4d-209) then
tmp = c0_m * sqrt(((a / l) / v))
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 <= 4e-209) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} 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 <= 4e-209: tmp = c0_m * math.sqrt(((A / l) / V)) 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 <= 4e-209) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); 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 <= 4e-209)
tmp = c0_m * sqrt(((A / l) / V));
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[LessEqual[t$95$0, 4e-209], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $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 4 \cdot 10^{-209}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e-209Initial program 69.9%
clear-num69.9%
associate-/r/69.9%
associate-/r*69.9%
Applied egg-rr69.9%
associate-/l/69.9%
associate-*l/69.9%
*-un-lft-identity69.9%
associate-/r*67.0%
Applied egg-rr67.0%
if 4.0000000000000002e-209 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 78.2%
Final simplification70.8%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (* c0_s (* c0_m (sqrt (/ A (* V l))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
return c0_s * (c0_m * sqrt((A / (V * l))));
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0_s * (c0_m * sqrt((a / (v * l))))
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
return c0_s * (c0_m * Math.sqrt((A / (V * l))));
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): return c0_s * (c0_m * math.sqrt((A / (V * l))))
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) return Float64(c0_s * Float64(c0_m * sqrt(Float64(A / Float64(V * l))))) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp = code(c0_s, c0_m, A, V, l)
tmp = c0_s * (c0_m * sqrt((A / (V * l))));
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)
\end{array}
Initial program 72.8%
Final simplification72.8%
herbie shell --seed 2024081
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))