
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* (pow l -0.5) (* c0_m (sqrt (/ A V))))
(if (<= (* V l) -5e-284)
(* c0_m (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* V l) 1e-299)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= (* V l) 2e+302)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* (/ A l) (* c0_m (/ c0_m 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 = pow(l, -0.5) * (c0_m * sqrt((A / V)));
} else if ((V * l) <= -5e-284) {
tmp = c0_m * (sqrt(-A) / sqrt((l * -V)));
} else if ((V * l) <= 1e-299) {
tmp = c0_m * sqrt(((A / l) / V));
} else if ((V * l) <= 2e+302) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A / l) * (c0_m * (c0_m / 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 = Math.pow(l, -0.5) * (c0_m * Math.sqrt((A / V)));
} else if ((V * l) <= -5e-284) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((V * l) <= 1e-299) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if ((V * l) <= 2e+302) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / 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 = math.pow(l, -0.5) * (c0_m * math.sqrt((A / V))) elif (V * l) <= -5e-284: tmp = c0_m * (math.sqrt(-A) / math.sqrt((l * -V))) elif (V * l) <= 1e-299: tmp = c0_m * math.sqrt(((A / l) / V)) elif (V * l) <= 2e+302: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / 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((l ^ -0.5) * Float64(c0_m * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -5e-284) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(V * l) <= 1e-299) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(V * l) <= 2e+302) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / 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 = (l ^ -0.5) * (c0_m * sqrt((A / V)));
elseif ((V * l) <= -5e-284)
tmp = c0_m * (sqrt(-A) / sqrt((l * -V)));
elseif ((V * l) <= 1e-299)
tmp = c0_m * sqrt(((A / l) / V));
elseif ((V * l) <= 2e+302)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A / l) * (c0_m * (c0_m / 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[Power[l, -0.5], $MachinePrecision] * N[(c0$95$m * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-284], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-299], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+302], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / 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 -\infty:\\
\;\;\;\;{\ell}^{-0.5} \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-284}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-299}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+302}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 31.1%
*-commutative31.1%
associate-/r*45.0%
sqrt-div71.2%
associate-*l/71.3%
Applied egg-rr71.3%
clear-num70.9%
associate-/r/71.4%
pow1/271.4%
pow-flip71.3%
metadata-eval71.3%
*-commutative71.3%
Applied egg-rr71.3%
if -inf.0 < (*.f64 V l) < -4.99999999999999973e-284Initial program 84.7%
frac-2neg84.7%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -4.99999999999999973e-284 < (*.f64 V l) < 9.99999999999999992e-300Initial program 49.8%
Taylor expanded in c0 around 0 49.8%
*-commutative49.8%
associate-/r*79.6%
Simplified79.6%
if 9.99999999999999992e-300 < (*.f64 V l) < 2.0000000000000002e302Initial program 81.2%
sqrt-div99.4%
associate-*r/98.0%
Applied egg-rr98.0%
associate-/l*99.4%
Simplified99.4%
if 2.0000000000000002e302 < (*.f64 V l) Initial program 38.6%
add-sqr-sqrt38.6%
sqrt-unprod38.6%
*-commutative38.6%
*-commutative38.6%
swap-sqr37.4%
add-sqr-sqrt37.4%
pow237.4%
Applied egg-rr37.4%
associate-*l/37.1%
*-commutative37.1%
times-frac42.3%
Simplified42.3%
unpow242.3%
associate-/l*47.1%
Applied egg-rr47.1%
Final simplification90.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 (or (<= t_0 0.0) (not (<= t_0 4e+278)))
(* 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 <= 0.0) || !(t_0 <= 4e+278)) {
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 <= 0.0d0) .or. (.not. (t_0 <= 4d+278))) 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 <= 0.0) || !(t_0 <= 4e+278)) {
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 <= 0.0) or not (t_0 <= 4e+278): 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 <= 0.0) || !(t_0 <= 4e+278)) 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 <= 0.0) || ~((t_0 <= 4e+278)))
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[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+278]], $MachinePrecision]], 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 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+278}\right):\\
\;\;\;\;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)))) < 0.0 or 3.99999999999999985e278 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 61.8%
Taylor expanded in c0 around 0 61.8%
*-commutative61.8%
associate-/r*67.8%
Simplified67.8%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e278Initial program 98.5%
Final simplification76.0%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 4e+278) t_0 (/ 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 t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 4e+278) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 4d+278) then
tmp = t_0
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 t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 4e+278) {
tmp = t_0;
} 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): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 4e+278: tmp = t_0 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) 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 / l) / V))); elseif (t_0 <= 4e+278) tmp = t_0; 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)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 4e+278)
tmp = t_0;
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_] := 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 / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+278], t$95$0, 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])\\
\\
\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}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+278}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 65.7%
Taylor expanded in c0 around 0 65.7%
*-commutative65.7%
associate-/r*71.3%
Simplified71.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e278Initial program 98.5%
if 3.99999999999999985e278 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 45.8%
*-un-lft-identity45.8%
times-frac53.7%
Applied egg-rr53.7%
frac-times45.8%
*-un-lft-identity45.8%
sqrt-undiv43.5%
clear-num43.5%
un-div-inv43.5%
sqrt-undiv48.6%
Applied egg-rr48.6%
associate-*r/55.2%
Simplified55.2%
associate-*r/48.6%
*-un-lft-identity48.6%
times-frac55.2%
associate-/r/55.2%
clear-num55.2%
Applied egg-rr55.2%
Final simplification76.2%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 4e+278) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 4e+278) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 4d+278) then
tmp = t_0
else
tmp = c0_m / sqrt((v * (l / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 4e+278) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 4e+278: tmp = t_0 else: tmp = c0_m / math.sqrt((V * (l / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 4e+278) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 4e+278)
tmp = t_0;
else
tmp = c0_m / sqrt((V * (l / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+278], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+278}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 65.7%
Taylor expanded in c0 around 0 65.7%
*-commutative65.7%
associate-/r*71.3%
Simplified71.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e278Initial program 98.5%
if 3.99999999999999985e278 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 45.8%
*-un-lft-identity45.8%
times-frac53.7%
Applied egg-rr53.7%
frac-times45.8%
*-un-lft-identity45.8%
sqrt-undiv43.5%
clear-num43.5%
un-div-inv43.5%
sqrt-undiv48.6%
Applied egg-rr48.6%
associate-*r/55.2%
Simplified55.2%
Final simplification76.2%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -2e+182)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-58)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) -5e-284)
(/ c0_m (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 1e-299)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= (* V l) 2e+302)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* (/ A l) (* c0_m (/ c0_m 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) <= -2e+182) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-58) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= -5e-284) {
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 1e-299) {
tmp = c0_m * sqrt(((A / l) / V));
} else if ((V * l) <= 2e+302) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A / l) * (c0_m * (c0_m / 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) <= (-2d+182)) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-2d-58)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= (-5d-284)) then
tmp = c0_m / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 1d-299) then
tmp = c0_m * sqrt(((a / l) / v))
else if ((v * l) <= 2d+302) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt(((a / l) * (c0_m * (c0_m / 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) <= -2e+182) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-58) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= -5e-284) {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 1e-299) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if ((V * l) <= 2e+302) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / 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) <= -2e+182: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-58: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= -5e-284: tmp = c0_m / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 1e-299: tmp = c0_m * math.sqrt(((A / l) / V)) elif (V * l) <= 2e+302: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / 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) <= -2e+182) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-58) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= -5e-284) tmp = Float64(c0_m / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 1e-299) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(V * l) <= 2e+302) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / 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) <= -2e+182)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-58)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= -5e-284)
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 1e-299)
tmp = c0_m * sqrt(((A / l) / V));
elseif ((V * l) <= 2e+302)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A / l) * (c0_m * (c0_m / 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], -2e+182], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-58], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-284], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-299], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+302], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / 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 -2 \cdot 10^{+182}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-58}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-284}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-299}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+302}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000001e182Initial program 57.6%
associate-/r*63.7%
sqrt-div59.3%
associate-*r/59.3%
Applied egg-rr59.3%
associate-/l*59.3%
Simplified59.3%
if -2.0000000000000001e182 < (*.f64 V l) < -2.0000000000000001e-58Initial program 94.3%
if -2.0000000000000001e-58 < (*.f64 V l) < -4.99999999999999973e-284Initial program 76.9%
*-un-lft-identity76.9%
times-frac74.2%
Applied egg-rr74.2%
frac-times76.9%
*-un-lft-identity76.9%
sqrt-undiv0.0%
clear-num0.0%
un-div-inv0.0%
sqrt-undiv77.2%
Applied egg-rr77.2%
associate-*r/74.3%
Simplified74.3%
associate-*r/77.2%
*-un-lft-identity77.2%
times-frac74.3%
associate-/r/74.3%
clear-num74.3%
Applied egg-rr74.3%
associate-/r/71.7%
sqrt-prod43.6%
Applied egg-rr43.6%
if -4.99999999999999973e-284 < (*.f64 V l) < 9.99999999999999992e-300Initial program 49.8%
Taylor expanded in c0 around 0 49.8%
*-commutative49.8%
associate-/r*79.6%
Simplified79.6%
if 9.99999999999999992e-300 < (*.f64 V l) < 2.0000000000000002e302Initial program 81.2%
sqrt-div99.4%
associate-*r/98.0%
Applied egg-rr98.0%
associate-/l*99.4%
Simplified99.4%
if 2.0000000000000002e302 < (*.f64 V l) Initial program 38.6%
add-sqr-sqrt38.6%
sqrt-unprod38.6%
*-commutative38.6%
*-commutative38.6%
swap-sqr37.4%
add-sqr-sqrt37.4%
pow237.4%
Applied egg-rr37.4%
associate-*l/37.1%
*-commutative37.1%
times-frac42.3%
Simplified42.3%
unpow242.3%
associate-/l*47.1%
Applied egg-rr47.1%
Final simplification78.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
(*
c0_s
(if (<= (* V l) -2e+182)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-133)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 1e-318)
(/ c0_m (sqrt (/ V (/ A l))))
(if (<= (* V l) 2e+302)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* (/ A l) (* c0_m (/ c0_m 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) <= -2e+182) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-133) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 1e-318) {
tmp = c0_m / sqrt((V / (A / l)));
} else if ((V * l) <= 2e+302) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A / l) * (c0_m * (c0_m / 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) <= (-2d+182)) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-2d-133)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 1d-318) then
tmp = c0_m / sqrt((v / (a / l)))
else if ((v * l) <= 2d+302) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt(((a / l) * (c0_m * (c0_m / 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) <= -2e+182) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-133) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 1e-318) {
tmp = c0_m / Math.sqrt((V / (A / l)));
} else if ((V * l) <= 2e+302) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / 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) <= -2e+182: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-133: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 1e-318: tmp = c0_m / math.sqrt((V / (A / l))) elif (V * l) <= 2e+302: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / 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) <= -2e+182) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-133) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 1e-318) tmp = Float64(c0_m / sqrt(Float64(V / Float64(A / l)))); elseif (Float64(V * l) <= 2e+302) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / 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) <= -2e+182)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-133)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 1e-318)
tmp = c0_m / sqrt((V / (A / l)));
elseif ((V * l) <= 2e+302)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A / l) * (c0_m * (c0_m / 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], -2e+182], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-133], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-318], N[(c0$95$m / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+302], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / 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 -2 \cdot 10^{+182}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-133}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-318}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+302}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000001e182Initial program 57.6%
associate-/r*63.7%
sqrt-div59.3%
associate-*r/59.3%
Applied egg-rr59.3%
associate-/l*59.3%
Simplified59.3%
if -2.0000000000000001e182 < (*.f64 V l) < -2.0000000000000001e-133Initial program 92.5%
if -2.0000000000000001e-133 < (*.f64 V l) < 9.9999875e-319Initial program 53.1%
*-un-lft-identity53.1%
times-frac74.3%
Applied egg-rr74.3%
frac-times53.1%
*-un-lft-identity53.1%
sqrt-undiv9.7%
clear-num9.7%
un-div-inv9.7%
sqrt-undiv53.1%
Applied egg-rr53.1%
associate-*r/74.3%
Simplified74.3%
associate-*r/53.1%
*-un-lft-identity53.1%
times-frac74.3%
associate-/r/74.3%
clear-num74.4%
Applied egg-rr74.4%
if 9.9999875e-319 < (*.f64 V l) < 2.0000000000000002e302Initial program 81.6%
sqrt-div99.4%
associate-*r/97.1%
Applied egg-rr97.1%
associate-/l*99.4%
Simplified99.4%
if 2.0000000000000002e302 < (*.f64 V l) Initial program 38.6%
add-sqr-sqrt38.6%
sqrt-unprod38.6%
*-commutative38.6%
*-commutative38.6%
swap-sqr37.4%
add-sqr-sqrt37.4%
pow237.4%
Applied egg-rr37.4%
associate-*l/37.1%
*-commutative37.1%
times-frac42.3%
Simplified42.3%
unpow242.3%
associate-/l*47.1%
Applied egg-rr47.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) -2e-133)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 1e-318)
(/ c0_m (sqrt (/ V (/ A l))))
(if (<= (* V l) 2e+302)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* (/ A l) (* c0_m (/ c0_m 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) <= -2e-133) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 1e-318) {
tmp = c0_m / sqrt((V / (A / l)));
} else if ((V * l) <= 2e+302) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A / l) * (c0_m * (c0_m / 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) <= (-2d-133)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 1d-318) then
tmp = c0_m / sqrt((v / (a / l)))
else if ((v * l) <= 2d+302) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt(((a / l) * (c0_m * (c0_m / 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) <= -2e-133) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 1e-318) {
tmp = c0_m / Math.sqrt((V / (A / l)));
} else if ((V * l) <= 2e+302) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / 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) <= -2e-133: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 1e-318: tmp = c0_m / math.sqrt((V / (A / l))) elif (V * l) <= 2e+302: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / 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) <= -2e-133) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 1e-318) tmp = Float64(c0_m / sqrt(Float64(V / Float64(A / l)))); elseif (Float64(V * l) <= 2e+302) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / 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) <= -2e-133)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 1e-318)
tmp = c0_m / sqrt((V / (A / l)));
elseif ((V * l) <= 2e+302)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A / l) * (c0_m * (c0_m / 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], -2e-133], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-318], N[(c0$95$m / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+302], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / 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 -2 \cdot 10^{-133}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-318}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+302}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000001e-133Initial program 79.8%
if -2.0000000000000001e-133 < (*.f64 V l) < 9.9999875e-319Initial program 53.1%
*-un-lft-identity53.1%
times-frac74.3%
Applied egg-rr74.3%
frac-times53.1%
*-un-lft-identity53.1%
sqrt-undiv9.7%
clear-num9.7%
un-div-inv9.7%
sqrt-undiv53.1%
Applied egg-rr53.1%
associate-*r/74.3%
Simplified74.3%
associate-*r/53.1%
*-un-lft-identity53.1%
times-frac74.3%
associate-/r/74.3%
clear-num74.4%
Applied egg-rr74.4%
if 9.9999875e-319 < (*.f64 V l) < 2.0000000000000002e302Initial program 81.6%
sqrt-div99.4%
associate-*r/97.1%
Applied egg-rr97.1%
associate-/l*99.4%
Simplified99.4%
if 2.0000000000000002e302 < (*.f64 V l) Initial program 38.6%
add-sqr-sqrt38.6%
sqrt-unprod38.6%
*-commutative38.6%
*-commutative38.6%
swap-sqr37.4%
add-sqr-sqrt37.4%
pow237.4%
Applied egg-rr37.4%
associate-*l/37.1%
*-commutative37.1%
times-frac42.3%
Simplified42.3%
unpow242.3%
associate-/l*47.1%
Applied egg-rr47.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 2e-312)
(sqrt (* (/ A l) (* c0_m (/ c0_m V))))
(if (<= t_0 5e+296)
(* c0_m (pow (/ (* V l) A) -0.5))
(* c0_m (pow (* V (/ l A)) -0.5)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-312) {
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if (t_0 <= 5e+296) {
tmp = c0_m * pow(((V * l) / A), -0.5);
} else {
tmp = c0_m * pow((V * (l / A)), -0.5);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 2d-312) then
tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
else if (t_0 <= 5d+296) then
tmp = c0_m * (((v * l) / a) ** (-0.5d0))
else
tmp = c0_m * ((v * (l / a)) ** (-0.5d0))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-312) {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if (t_0 <= 5e+296) {
tmp = c0_m * Math.pow(((V * l) / A), -0.5);
} else {
tmp = c0_m * Math.pow((V * (l / A)), -0.5);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e-312: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V)))) elif t_0 <= 5e+296: tmp = c0_m * math.pow(((V * l) / A), -0.5) else: tmp = c0_m * math.pow((V * (l / A)), -0.5) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e-312) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V)))); elseif (t_0 <= 5e+296) tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5)); else tmp = Float64(c0_m * (Float64(V * Float64(l / A)) ^ -0.5)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e-312)
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
elseif (t_0 <= 5e+296)
tmp = c0_m * (((V * l) / A) ^ -0.5);
else
tmp = c0_m * ((V * (l / A)) ^ -0.5);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-312], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+296], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-312}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000000000019e-312Initial program 41.9%
add-sqr-sqrt40.5%
sqrt-unprod40.6%
*-commutative40.6%
*-commutative40.6%
swap-sqr39.4%
add-sqr-sqrt39.4%
pow239.4%
Applied egg-rr39.4%
associate-*l/39.8%
*-commutative39.8%
times-frac43.7%
Simplified43.7%
unpow243.7%
associate-/l*52.3%
Applied egg-rr52.3%
if 2.0000000000019e-312 < (/.f64 A (*.f64 V l)) < 5.0000000000000001e296Initial program 99.2%
Taylor expanded in c0 around 0 99.2%
*-commutative99.2%
associate-/r*88.3%
Simplified88.3%
clear-num88.2%
associate-/r/88.3%
Applied egg-rr88.3%
clear-num88.3%
sqrt-div88.3%
metadata-eval88.3%
div-inv88.1%
associate-*l/88.2%
*-un-lft-identity88.2%
clear-num88.8%
pow1/288.8%
pow-flip88.9%
clear-num88.2%
*-un-lft-identity88.2%
associate-*l/88.2%
div-inv88.3%
*-un-lft-identity88.3%
times-frac88.0%
clear-num88.1%
/-rgt-identity88.1%
metadata-eval88.1%
Applied egg-rr88.1%
associate-*r/99.2%
associate-*l/88.9%
*-commutative88.9%
Simplified88.9%
*-commutative88.9%
associate-*l/99.2%
Applied egg-rr99.2%
if 5.0000000000000001e296 < (/.f64 A (*.f64 V l)) Initial program 36.4%
Taylor expanded in c0 around 0 36.4%
*-commutative36.4%
associate-/r*54.0%
Simplified54.0%
clear-num53.9%
associate-/r/53.9%
Applied egg-rr53.9%
clear-num53.9%
sqrt-div55.7%
metadata-eval55.7%
div-inv55.8%
associate-*l/55.8%
*-un-lft-identity55.8%
clear-num55.8%
pow1/255.8%
pow-flip55.8%
clear-num55.9%
*-un-lft-identity55.9%
associate-*l/55.8%
div-inv55.8%
*-un-lft-identity55.8%
times-frac54.6%
clear-num54.7%
/-rgt-identity54.7%
metadata-eval54.7%
Applied egg-rr54.7%
associate-*r/39.1%
associate-*l/55.8%
*-commutative55.8%
Simplified55.8%
Final simplification78.4%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 2e-297)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+296)
(* c0_m (pow (/ (* V l) A) -0.5))
(* c0_m (pow (* V (/ l A)) -0.5)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-297) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 5e+296) {
tmp = c0_m * pow(((V * l) / A), -0.5);
} else {
tmp = c0_m * pow((V * (l / A)), -0.5);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 2d-297) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 5d+296) then
tmp = c0_m * (((v * l) / a) ** (-0.5d0))
else
tmp = c0_m * ((v * (l / a)) ** (-0.5d0))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-297) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+296) {
tmp = c0_m * Math.pow(((V * l) / A), -0.5);
} else {
tmp = c0_m * Math.pow((V * (l / A)), -0.5);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e-297: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 5e+296: tmp = c0_m * math.pow(((V * l) / A), -0.5) else: tmp = c0_m * math.pow((V * (l / A)), -0.5) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e-297) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+296) tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5)); else tmp = Float64(c0_m * (Float64(V * Float64(l / A)) ^ -0.5)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e-297)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 5e+296)
tmp = c0_m * (((V * l) / A) ^ -0.5);
else
tmp = c0_m * ((V * (l / A)) ^ -0.5);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-297], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+296], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-297}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.00000000000000008e-297Initial program 44.7%
Taylor expanded in c0 around 0 44.7%
*-commutative44.7%
associate-/r*55.3%
Simplified55.3%
if 2.00000000000000008e-297 < (/.f64 A (*.f64 V l)) < 5.0000000000000001e296Initial program 99.2%
Taylor expanded in c0 around 0 99.2%
*-commutative99.2%
associate-/r*89.5%
Simplified89.5%
clear-num89.3%
associate-/r/89.5%
Applied egg-rr89.5%
clear-num89.4%
sqrt-div89.5%
metadata-eval89.5%
div-inv89.3%
associate-*l/89.3%
*-un-lft-identity89.3%
clear-num90.0%
pow1/290.0%
pow-flip90.1%
clear-num89.4%
*-un-lft-identity89.4%
associate-*l/89.3%
div-inv89.5%
*-un-lft-identity89.5%
times-frac87.7%
clear-num87.8%
/-rgt-identity87.8%
metadata-eval87.8%
Applied egg-rr87.8%
associate-*r/99.2%
associate-*l/90.1%
*-commutative90.1%
Simplified90.1%
*-commutative90.1%
associate-*l/99.2%
Applied egg-rr99.2%
if 5.0000000000000001e296 < (/.f64 A (*.f64 V l)) Initial program 36.4%
Taylor expanded in c0 around 0 36.4%
*-commutative36.4%
associate-/r*54.0%
Simplified54.0%
clear-num53.9%
associate-/r/53.9%
Applied egg-rr53.9%
clear-num53.9%
sqrt-div55.7%
metadata-eval55.7%
div-inv55.8%
associate-*l/55.8%
*-un-lft-identity55.8%
clear-num55.8%
pow1/255.8%
pow-flip55.8%
clear-num55.9%
*-un-lft-identity55.9%
associate-*l/55.8%
div-inv55.8%
*-un-lft-identity55.8%
times-frac54.6%
clear-num54.7%
/-rgt-identity54.7%
metadata-eval54.7%
Applied egg-rr54.7%
associate-*r/39.1%
associate-*l/55.8%
*-commutative55.8%
Simplified55.8%
Final simplification78.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 (/ A (* V l))))
(*
c0_s
(if (<= t_0 5e-297)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+296)
(/ c0_m (sqrt (/ (* V l) A)))
(* c0_m (pow (* V (/ l A)) -0.5)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-297) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 5e+296) {
tmp = c0_m / sqrt(((V * l) / A));
} else {
tmp = c0_m * pow((V * (l / A)), -0.5);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-297) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 5d+296) then
tmp = c0_m / sqrt(((v * l) / a))
else
tmp = c0_m * ((v * (l / a)) ** (-0.5d0))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-297) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+296) {
tmp = c0_m / Math.sqrt(((V * l) / A));
} else {
tmp = c0_m * Math.pow((V * (l / A)), -0.5);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-297: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 5e+296: tmp = c0_m / math.sqrt(((V * l) / A)) else: tmp = c0_m * math.pow((V * (l / A)), -0.5) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-297) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+296) tmp = Float64(c0_m / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0_m * (Float64(V * Float64(l / A)) ^ -0.5)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-297)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 5e+296)
tmp = c0_m / sqrt(((V * l) / A));
else
tmp = c0_m * ((V * (l / A)) ^ -0.5);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 5e-297], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+296], N[(c0$95$m / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-297}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5e-297Initial program 45.6%
Taylor expanded in c0 around 0 45.6%
*-commutative45.6%
associate-/r*56.0%
Simplified56.0%
if 5e-297 < (/.f64 A (*.f64 V l)) < 5.0000000000000001e296Initial program 99.2%
*-un-lft-identity99.2%
times-frac89.5%
Applied egg-rr89.5%
frac-times99.2%
*-un-lft-identity99.2%
sqrt-undiv47.8%
clear-num47.8%
un-div-inv47.8%
sqrt-undiv99.2%
Applied egg-rr99.2%
if 5.0000000000000001e296 < (/.f64 A (*.f64 V l)) Initial program 36.4%
Taylor expanded in c0 around 0 36.4%
*-commutative36.4%
associate-/r*54.0%
Simplified54.0%
clear-num53.9%
associate-/r/53.9%
Applied egg-rr53.9%
clear-num53.9%
sqrt-div55.7%
metadata-eval55.7%
div-inv55.8%
associate-*l/55.8%
*-un-lft-identity55.8%
clear-num55.8%
pow1/255.8%
pow-flip55.8%
clear-num55.9%
*-un-lft-identity55.9%
associate-*l/55.8%
div-inv55.8%
*-un-lft-identity55.8%
times-frac54.6%
clear-num54.7%
/-rgt-identity54.7%
metadata-eval54.7%
Applied egg-rr54.7%
associate-*r/39.1%
associate-*l/55.8%
*-commutative55.8%
Simplified55.8%
Final simplification78.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 (/ A (* V l))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 5e+262)))
(* c0_m (sqrt (/ (/ A V) l)))
(* c0_m (sqrt t_0))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+262)) {
tmp = c0_m * sqrt(((A / V) / l));
} else {
tmp = c0_m * sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+262))) then
tmp = c0_m * sqrt(((a / v) / l))
else
tmp = c0_m * sqrt(t_0)
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+262)) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else {
tmp = c0_m * Math.sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+262): tmp = c0_m * math.sqrt(((A / V) / l)) else: tmp = c0_m * math.sqrt(t_0) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+262)) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0_m * sqrt(t_0)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+262)))
tmp = c0_m * sqrt(((A / V) / l));
else
tmp = c0_m * sqrt(t_0);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+262]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+262}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5.00000000000000008e262 < (/.f64 A (*.f64 V l)) Initial program 41.0%
associate-/r*56.6%
Simplified56.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000008e262Initial program 98.8%
Final simplification78.9%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 5e-297)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+296)
(/ c0_m (sqrt (/ (* V l) 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 t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-297) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 5e+296) {
tmp = c0_m / sqrt(((V * l) / 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) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-297) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 5d+296) then
tmp = c0_m / sqrt(((v * l) / 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 t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-297) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+296) {
tmp = c0_m / Math.sqrt(((V * l) / 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): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-297: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 5e+296: tmp = c0_m / math.sqrt(((V * l) / 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) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-297) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+296) tmp = Float64(c0_m / sqrt(Float64(Float64(V * l) / 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)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-297)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 5e+296)
tmp = c0_m / sqrt(((V * l) / 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_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 5e-297], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+296], N[(c0$95$m / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $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])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-297}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5e-297Initial program 45.6%
Taylor expanded in c0 around 0 45.6%
*-commutative45.6%
associate-/r*56.0%
Simplified56.0%
if 5e-297 < (/.f64 A (*.f64 V l)) < 5.0000000000000001e296Initial program 99.2%
*-un-lft-identity99.2%
times-frac89.5%
Applied egg-rr89.5%
frac-times99.2%
*-un-lft-identity99.2%
sqrt-undiv47.8%
clear-num47.8%
un-div-inv47.8%
sqrt-undiv99.2%
Applied egg-rr99.2%
if 5.0000000000000001e296 < (/.f64 A (*.f64 V l)) Initial program 36.4%
*-un-lft-identity36.4%
times-frac53.9%
Applied egg-rr53.9%
frac-times36.4%
*-un-lft-identity36.4%
sqrt-undiv35.8%
clear-num35.8%
un-div-inv35.8%
sqrt-undiv39.1%
Applied egg-rr39.1%
associate-*r/55.8%
Simplified55.8%
associate-*r/39.1%
*-un-lft-identity39.1%
times-frac55.8%
associate-/r/55.8%
clear-num55.8%
Applied egg-rr55.8%
Final simplification78.6%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (* c0_s (* 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 71.5%
herbie shell --seed 2024146
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))