
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (sqrt (- A))))
(*
c0_s
(if (<= (* V l) -5e+276)
(/ (/ 1.0 (/ (sqrt (- V)) t_0)) (/ (sqrt l) c0_m))
(if (<= (* V l) -2e-282)
(* c0_m (/ t_0 (sqrt (* V (- l)))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 2e+248)))
(sqrt (* (/ A (/ l c0_m)) (/ (/ 1.0 V) (/ 1.0 c0_m))))
(* c0_m (/ (sqrt A) (sqrt (* 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 = sqrt(-A);
double tmp;
if ((V * l) <= -5e+276) {
tmp = (1.0 / (sqrt(-V) / t_0)) / (sqrt(l) / c0_m);
} else if ((V * l) <= -2e-282) {
tmp = c0_m * (t_0 / sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+248)) {
tmp = sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
} else {
tmp = c0_m * (sqrt(A) / sqrt((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 = sqrt(-a)
if ((v * l) <= (-5d+276)) then
tmp = (1.0d0 / (sqrt(-v) / t_0)) / (sqrt(l) / c0_m)
else if ((v * l) <= (-2d-282)) then
tmp = c0_m * (t_0 / sqrt((v * -l)))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 2d+248))) then
tmp = sqrt(((a / (l / c0_m)) * ((1.0d0 / v) / (1.0d0 / c0_m))))
else
tmp = c0_m * (sqrt(a) / sqrt((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 = Math.sqrt(-A);
double tmp;
if ((V * l) <= -5e+276) {
tmp = (1.0 / (Math.sqrt(-V) / t_0)) / (Math.sqrt(l) / c0_m);
} else if ((V * l) <= -2e-282) {
tmp = c0_m * (t_0 / Math.sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+248)) {
tmp = Math.sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
} else {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((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 = math.sqrt(-A) tmp = 0 if (V * l) <= -5e+276: tmp = (1.0 / (math.sqrt(-V) / t_0)) / (math.sqrt(l) / c0_m) elif (V * l) <= -2e-282: tmp = c0_m * (t_0 / math.sqrt((V * -l))) elif ((V * l) <= 0.0) or not ((V * l) <= 2e+248): tmp = math.sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m)))) else: tmp = c0_m * (math.sqrt(A) / math.sqrt((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 = sqrt(Float64(-A)) tmp = 0.0 if (Float64(V * l) <= -5e+276) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(-V)) / t_0)) / Float64(sqrt(l) / c0_m)); elseif (Float64(V * l) <= -2e-282) tmp = Float64(c0_m * Float64(t_0 / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 2e+248)) tmp = sqrt(Float64(Float64(A / Float64(l / c0_m)) * Float64(Float64(1.0 / V) / Float64(1.0 / c0_m)))); else tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(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 = sqrt(-A);
tmp = 0.0;
if ((V * l) <= -5e+276)
tmp = (1.0 / (sqrt(-V) / t_0)) / (sqrt(l) / c0_m);
elseif ((V * l) <= -2e-282)
tmp = c0_m * (t_0 / sqrt((V * -l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 2e+248)))
tmp = sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
else
tmp = c0_m * (sqrt(A) / sqrt((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[Sqrt[(-A)], $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e+276], N[(N[(1.0 / N[(N[Sqrt[(-V)], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-282], N[(c0$95$m * N[(t$95$0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+248]], $MachinePrecision]], N[Sqrt[N[(N[(A / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / V), $MachinePrecision] / N[(1.0 / c0$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[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])\\
\\
\begin{array}{l}
t_0 := \sqrt{-A}\\
c0_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+276}:\\
\;\;\;\;\frac{\frac{1}{\frac{\sqrt{-V}}{t_0}}}{\frac{\sqrt{\ell}}{c0_m}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-282}:\\
\;\;\;\;c0_m \cdot \frac{t_0}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+248}\right):\\
\;\;\;\;\sqrt{\frac{A}{\frac{\ell}{c0_m}} \cdot \frac{\frac{1}{V}}{\frac{1}{c0_m}}}\\
\mathbf{else}:\\
\;\;\;\;c0_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000001e276Initial program 42.5%
associate-/r*66.2%
sqrt-div69.5%
associate-*r/69.6%
Applied egg-rr69.6%
*-commutative69.6%
associate-/l*69.3%
Simplified69.3%
clear-num69.4%
sqrt-div69.5%
metadata-eval69.5%
Applied egg-rr69.5%
frac-2neg69.5%
sqrt-div74.8%
Applied egg-rr74.8%
if -5.00000000000000001e276 < (*.f64 V l) < -2e-282Initial program 85.8%
frac-2neg85.8%
sqrt-div99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Simplified99.3%
if -2e-282 < (*.f64 V l) < 0.0 or 2.00000000000000009e248 < (*.f64 V l) Initial program 49.0%
clear-num49.0%
associate-/r/49.0%
associate-/r*48.9%
Applied egg-rr48.9%
sqrt-prod37.2%
*-commutative37.2%
*-commutative37.2%
sqrt-div32.1%
associate-*r/32.1%
sqrt-prod42.0%
div-inv42.0%
associate-/r/40.4%
add-sqr-sqrt24.9%
sqrt-unprod21.8%
associate-/r/21.8%
associate-/r/21.8%
swap-sqr21.3%
Applied egg-rr37.2%
associate-*l/35.7%
associate-/l*37.4%
Simplified37.4%
*-un-lft-identity37.4%
unpow237.4%
times-frac37.9%
Applied egg-rr37.9%
div-inv37.8%
*-commutative37.8%
times-frac42.8%
Applied egg-rr42.8%
if 0.0 < (*.f64 V l) < 2.00000000000000009e248Initial program 89.4%
sqrt-div99.5%
associate-*r/95.4%
Applied egg-rr95.4%
*-commutative95.4%
associate-/l*94.6%
associate-/r/99.5%
Simplified99.5%
Final simplification84.7%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 2e-305)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+193) t_0 (* c0_m (pow (* l (/ V 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 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-305) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 1e+193) {
tmp = t_0;
} else {
tmp = c0_m * pow((l * (V / 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 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 2d-305) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 1d+193) then
tmp = t_0
else
tmp = c0_m * ((l * (v / 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 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-305) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+193) {
tmp = t_0;
} else {
tmp = c0_m * Math.pow((l * (V / 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 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-305: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 1e+193: tmp = t_0 else: tmp = c0_m * math.pow((l * (V / 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(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-305) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+193) tmp = t_0; else tmp = Float64(c0_m * (Float64(l * Float64(V / 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 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-305)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 1e+193)
tmp = t_0;
else
tmp = c0_m * ((l * (V / 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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-305], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+193], t$95$0, N[(c0$95$m * N[Power[N[(l * N[(V / 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 := c0_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0_s \cdot \begin{array}{l}
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;c0_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+193}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;c0_m \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999999e-305Initial program 68.2%
associate-/r*71.5%
Simplified71.5%
if 1.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000007e193Initial program 98.6%
if 1.00000000000000007e193 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 74.5%
clear-num74.5%
associate-/r/74.5%
associate-/r*74.5%
Applied egg-rr74.5%
associate-*l/81.6%
associate-*r/81.6%
associate-*l/81.6%
*-un-lft-identity81.6%
Applied egg-rr81.6%
div-inv81.6%
associate-*l/81.5%
sqrt-prod54.1%
associate-*r*54.1%
*-commutative54.1%
sqrt-div54.1%
metadata-eval54.1%
div-inv54.2%
clear-num54.1%
associate-/r*54.0%
clear-num54.1%
sqrt-div21.9%
associate-/r*21.8%
sqrt-prod37.0%
clear-num37.1%
sqrt-undiv75.4%
*-commutative75.4%
Applied egg-rr75.4%
associate-/r/75.5%
pow1/275.5%
associate-*r/81.6%
pow-flip81.7%
metadata-eval81.7%
Applied egg-rr81.7%
Final simplification78.6%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (or (<= t_0 2e-305) (not (<= t_0 5e+215)))
(* c0_m (sqrt (/ (/ A V) l)))
t_0))))c0_m = fabs(c0);
c0_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 2e-305) || !(t_0 <= 5e+215)) {
tmp = c0_m * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0_m = abs(c0)
c0_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if ((t_0 <= 2d-305) .or. (.not. (t_0 <= 5d+215))) then
tmp = c0_m * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = c0_s * tmp
end function
c0_m = Math.abs(c0);
c0_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 2e-305) || !(t_0 <= 5e+215)) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0_m = math.fabs(c0) c0_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 2e-305) or not (t_0 <= 5e+215): tmp = c0_m * math.sqrt(((A / V) / l)) else: tmp = t_0 return c0_s * tmp
c0_m = abs(c0) c0_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 2e-305) || !(t_0 <= 5e+215)) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return Float64(c0_s * tmp) end
c0_m = abs(c0);
c0_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 2e-305) || ~((t_0 <= 5e+215)))
tmp = c0_m * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = c0_s * tmp;
end
c0_m = N[Abs[c0], $MachinePrecision]
c0_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 2e-305], N[Not[LessEqual[t$95$0, 5e+215]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
c0_m = \left|c0\right|
\\
c0_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0_s \cdot \begin{array}{l}
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-305} \lor \neg \left(t_0 \leq 5 \cdot 10^{+215}\right):\\
\;\;\;\;c0_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999999e-305 or 5.0000000000000001e215 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 68.5%
associate-/r*72.8%
Simplified72.8%
if 1.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000001e215Initial program 98.7%
Final simplification78.6%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 2e-305)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+219) t_0 (/ c0_m (sqrt (* l (/ V A)))))))))c0_m = fabs(c0);
c0_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-305) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 1e+219) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((l * (V / A)));
}
return c0_s * tmp;
}
c0_m = abs(c0)
c0_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 2d-305) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 1d+219) then
tmp = t_0
else
tmp = c0_m / sqrt((l * (v / a)))
end if
code = c0_s * tmp
end function
c0_m = Math.abs(c0);
c0_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-305) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+219) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((l * (V / A)));
}
return c0_s * tmp;
}
c0_m = math.fabs(c0) c0_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-305: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 1e+219: tmp = t_0 else: tmp = c0_m / math.sqrt((l * (V / A))) return c0_s * tmp
c0_m = abs(c0) c0_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-305) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+219) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(l * Float64(V / A)))); end return Float64(c0_s * tmp) end
c0_m = abs(c0);
c0_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-305)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 1e+219)
tmp = t_0;
else
tmp = c0_m / sqrt((l * (V / A)));
end
tmp_2 = c0_s * tmp;
end
c0_m = N[Abs[c0], $MachinePrecision]
c0_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-305], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+219], t$95$0, N[(c0$95$m / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0_m = \left|c0\right|
\\
c0_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0_s \cdot \begin{array}{l}
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-305}:\\
\;\;\;\;c0_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+219}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999999e-305Initial program 68.2%
associate-/r*71.5%
Simplified71.5%
if 1.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999965e218Initial program 98.7%
if 9.99999999999999965e218 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 70.3%
clear-num70.3%
associate-/r/70.3%
associate-/r*70.3%
Applied egg-rr70.3%
associate-*l/78.6%
associate-*r/78.6%
associate-*l/78.6%
*-un-lft-identity78.6%
Applied egg-rr78.6%
associate-/l/70.3%
sqrt-undiv34.9%
clear-num34.9%
un-div-inv34.9%
sqrt-undiv71.4%
*-commutative71.4%
Applied egg-rr71.4%
associate-*r/78.6%
Simplified78.6%
Final simplification78.6%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -5e+276)
(/ (* c0_m (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -2e-282)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 2e+248)))
(sqrt (* (/ A (/ l c0_m)) (/ (/ 1.0 V) (/ 1.0 c0_m))))
(* c0_m (/ (sqrt A) (sqrt (* 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+276) {
tmp = (c0_m * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -2e-282) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+248)) {
tmp = sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
} else {
tmp = c0_m * (sqrt(A) / sqrt((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+276)) then
tmp = (c0_m * sqrt((a / v))) / sqrt(l)
else if ((v * l) <= (-2d-282)) then
tmp = c0_m * (sqrt(-a) / sqrt((v * -l)))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 2d+248))) then
tmp = sqrt(((a / (l / c0_m)) * ((1.0d0 / v) / (1.0d0 / c0_m))))
else
tmp = c0_m * (sqrt(a) / sqrt((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+276) {
tmp = (c0_m * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -2e-282) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+248)) {
tmp = Math.sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
} else {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((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+276: tmp = (c0_m * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -2e-282: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif ((V * l) <= 0.0) or not ((V * l) <= 2e+248): tmp = math.sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m)))) else: tmp = c0_m * (math.sqrt(A) / math.sqrt((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+276) tmp = Float64(Float64(c0_m * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -2e-282) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 2e+248)) tmp = sqrt(Float64(Float64(A / Float64(l / c0_m)) * Float64(Float64(1.0 / V) / Float64(1.0 / c0_m)))); else tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(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+276)
tmp = (c0_m * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -2e-282)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 2e+248)))
tmp = sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
else
tmp = c0_m * (sqrt(A) / sqrt((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+276], N[(N[(c0$95$m * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-282], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+248]], $MachinePrecision]], N[Sqrt[N[(N[(A / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / V), $MachinePrecision] / N[(1.0 / c0$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[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 \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+276}:\\
\;\;\;\;\frac{c0_m \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-282}:\\
\;\;\;\;c0_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+248}\right):\\
\;\;\;\;\sqrt{\frac{A}{\frac{\ell}{c0_m}} \cdot \frac{\frac{1}{V}}{\frac{1}{c0_m}}}\\
\mathbf{else}:\\
\;\;\;\;c0_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000001e276Initial program 42.5%
*-commutative42.5%
associate-/r*66.2%
sqrt-div69.5%
associate-*l/69.6%
Applied egg-rr69.6%
if -5.00000000000000001e276 < (*.f64 V l) < -2e-282Initial program 85.8%
frac-2neg85.8%
sqrt-div99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Simplified99.3%
if -2e-282 < (*.f64 V l) < 0.0 or 2.00000000000000009e248 < (*.f64 V l) Initial program 49.0%
clear-num49.0%
associate-/r/49.0%
associate-/r*48.9%
Applied egg-rr48.9%
sqrt-prod37.2%
*-commutative37.2%
*-commutative37.2%
sqrt-div32.1%
associate-*r/32.1%
sqrt-prod42.0%
div-inv42.0%
associate-/r/40.4%
add-sqr-sqrt24.9%
sqrt-unprod21.8%
associate-/r/21.8%
associate-/r/21.8%
swap-sqr21.3%
Applied egg-rr37.2%
associate-*l/35.7%
associate-/l*37.4%
Simplified37.4%
*-un-lft-identity37.4%
unpow237.4%
times-frac37.9%
Applied egg-rr37.9%
div-inv37.8%
*-commutative37.8%
times-frac42.8%
Applied egg-rr42.8%
if 0.0 < (*.f64 V l) < 2.00000000000000009e248Initial program 89.4%
sqrt-div99.5%
associate-*r/95.4%
Applied egg-rr95.4%
*-commutative95.4%
associate-/l*94.6%
associate-/r/99.5%
Simplified99.5%
Final simplification84.3%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* c0_m (/ (sqrt (- (/ A l))) (sqrt (- V))))
(if (<= (* V l) -2e-282)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 2e+248)))
(sqrt (* (/ A (/ l c0_m)) (/ (/ 1.0 V) (/ 1.0 c0_m))))
(* c0_m (/ (sqrt A) (sqrt (* 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) <= -((double) INFINITY)) {
tmp = c0_m * (sqrt(-(A / l)) / sqrt(-V));
} else if ((V * l) <= -2e-282) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+248)) {
tmp = sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
} else {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
}
return c0_s * tmp;
}
c0_m = Math.abs(c0);
c0_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0_m * (Math.sqrt(-(A / l)) / Math.sqrt(-V));
} else if ((V * l) <= -2e-282) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+248)) {
tmp = Math.sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
} else {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((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) <= -math.inf: tmp = c0_m * (math.sqrt(-(A / l)) / math.sqrt(-V)) elif (V * l) <= -2e-282: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif ((V * l) <= 0.0) or not ((V * l) <= 2e+248): tmp = math.sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m)))) else: tmp = c0_m * (math.sqrt(A) / math.sqrt((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) <= Float64(-Inf)) tmp = Float64(c0_m * Float64(sqrt(Float64(-Float64(A / l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -2e-282) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 2e+248)) tmp = sqrt(Float64(Float64(A / Float64(l / c0_m)) * Float64(Float64(1.0 / V) / Float64(1.0 / c0_m)))); else tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(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) <= -Inf)
tmp = c0_m * (sqrt(-(A / l)) / sqrt(-V));
elseif ((V * l) <= -2e-282)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 2e+248)))
tmp = sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
else
tmp = c0_m * (sqrt(A) / sqrt((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], (-Infinity)], N[(c0$95$m * N[(N[Sqrt[(-N[(A / l), $MachinePrecision])], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-282], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+248]], $MachinePrecision]], N[Sqrt[N[(N[(A / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / V), $MachinePrecision] / N[(1.0 / c0$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[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 \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0_m \cdot \frac{\sqrt{-\frac{A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-282}:\\
\;\;\;\;c0_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+248}\right):\\
\;\;\;\;\sqrt{\frac{A}{\frac{\ell}{c0_m}} \cdot \frac{\frac{1}{V}}{\frac{1}{c0_m}}}\\
\mathbf{else}:\\
\;\;\;\;c0_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 36.0%
clear-num36.0%
associate-/r/36.0%
associate-/r*36.0%
Applied egg-rr36.0%
associate-*l/67.4%
associate-*r/67.5%
associate-*l/67.5%
*-un-lft-identity67.5%
Applied egg-rr67.5%
frac-2neg67.5%
sqrt-div79.1%
distribute-neg-frac79.1%
Applied egg-rr79.1%
if -inf.0 < (*.f64 V l) < -2e-282Initial program 84.5%
frac-2neg84.5%
sqrt-div99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Simplified99.3%
if -2e-282 < (*.f64 V l) < 0.0 or 2.00000000000000009e248 < (*.f64 V l) Initial program 49.0%
clear-num49.0%
associate-/r/49.0%
associate-/r*48.9%
Applied egg-rr48.9%
sqrt-prod37.2%
*-commutative37.2%
*-commutative37.2%
sqrt-div32.1%
associate-*r/32.1%
sqrt-prod42.0%
div-inv42.0%
associate-/r/40.4%
add-sqr-sqrt24.9%
sqrt-unprod21.8%
associate-/r/21.8%
associate-/r/21.8%
swap-sqr21.3%
Applied egg-rr37.2%
associate-*l/35.7%
associate-/l*37.4%
Simplified37.4%
*-un-lft-identity37.4%
unpow237.4%
times-frac37.9%
Applied egg-rr37.9%
div-inv37.8%
*-commutative37.8%
times-frac42.8%
Applied egg-rr42.8%
if 0.0 < (*.f64 V l) < 2.00000000000000009e248Initial program 89.4%
sqrt-div99.5%
associate-*r/95.4%
Applied egg-rr95.4%
*-commutative95.4%
associate-/l*94.6%
associate-/r/99.5%
Simplified99.5%
Final simplification85.4%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 1e+291)))
(sqrt (* (/ A (/ l c0_m)) (/ (/ 1.0 V) (/ 1.0 c0_m))))
(* 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 <= 1e+291)) {
tmp = sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
} 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 <= 1d+291))) then
tmp = sqrt(((a / (l / c0_m)) * ((1.0d0 / v) / (1.0d0 / c0_m))))
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 <= 1e+291)) {
tmp = Math.sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
} 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 <= 1e+291): tmp = math.sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m)))) 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 <= 1e+291)) tmp = sqrt(Float64(Float64(A / Float64(l / c0_m)) * Float64(Float64(1.0 / V) / Float64(1.0 / c0_m)))); 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 <= 1e+291)))
tmp = sqrt(((A / (l / c0_m)) * ((1.0 / V) / (1.0 / c0_m))));
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, 1e+291]], $MachinePrecision]], N[Sqrt[N[(N[(A / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / V), $MachinePrecision] / N[(1.0 / c0$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0_m = \left|c0\right|
\\
c0_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0_s \cdot \begin{array}{l}
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+291}\right):\\
\;\;\;\;\sqrt{\frac{A}{\frac{\ell}{c0_m}} \cdot \frac{\frac{1}{V}}{\frac{1}{c0_m}}}\\
\mathbf{else}:\\
\;\;\;\;c0_m \cdot \sqrt{t_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 9.9999999999999996e290 < (/.f64 A (*.f64 V l)) Initial program 42.6%
clear-num42.6%
associate-/r/42.6%
associate-/r*42.6%
Applied egg-rr42.6%
sqrt-prod30.1%
*-commutative30.1%
*-commutative30.1%
sqrt-div23.7%
associate-*r/23.7%
sqrt-prod47.4%
div-inv47.4%
associate-/r/46.5%
add-sqr-sqrt29.9%
sqrt-unprod25.3%
associate-/r/25.3%
associate-/r/25.4%
swap-sqr24.1%
Applied egg-rr33.9%
associate-*l/33.1%
associate-/l*34.0%
Simplified34.0%
*-un-lft-identity34.0%
unpow234.0%
times-frac36.2%
Applied egg-rr36.2%
div-inv36.1%
*-commutative36.1%
times-frac41.6%
Applied egg-rr41.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e290Initial program 99.3%
Final simplification74.9%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 1e+291)))
(sqrt (* (/ c0_m l) (* c0_m (/ A V))))
(* 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 <= 1e+291)) {
tmp = sqrt(((c0_m / l) * (c0_m * (A / V))));
} 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 <= 1d+291))) then
tmp = sqrt(((c0_m / l) * (c0_m * (a / v))))
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 <= 1e+291)) {
tmp = Math.sqrt(((c0_m / l) * (c0_m * (A / V))));
} 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 <= 1e+291): tmp = math.sqrt(((c0_m / l) * (c0_m * (A / V)))) 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 <= 1e+291)) tmp = sqrt(Float64(Float64(c0_m / l) * Float64(c0_m * Float64(A / V)))); 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 <= 1e+291)))
tmp = sqrt(((c0_m / l) * (c0_m * (A / V))));
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, 1e+291]], $MachinePrecision]], N[Sqrt[N[(N[(c0$95$m / l), $MachinePrecision] * N[(c0$95$m * N[(A / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0_m = \left|c0\right|
\\
c0_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0_s \cdot \begin{array}{l}
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+291}\right):\\
\;\;\;\;\sqrt{\frac{c0_m}{\ell} \cdot \left(c0_m \cdot \frac{A}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0_m \cdot \sqrt{t_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 9.9999999999999996e290 < (/.f64 A (*.f64 V l)) Initial program 42.6%
clear-num42.6%
associate-/r/42.6%
associate-/r*42.6%
Applied egg-rr42.6%
sqrt-prod30.1%
*-commutative30.1%
*-commutative30.1%
sqrt-div23.7%
associate-*r/23.7%
sqrt-prod47.4%
div-inv47.4%
associate-/r/46.5%
add-sqr-sqrt29.9%
sqrt-unprod25.3%
associate-/r/25.3%
associate-/r/25.4%
swap-sqr24.1%
Applied egg-rr33.9%
associate-*l/33.1%
associate-/l*34.0%
Simplified34.0%
*-un-lft-identity34.0%
unpow234.0%
times-frac36.2%
Applied egg-rr36.2%
*-un-lft-identity36.2%
*-commutative36.2%
times-frac36.3%
clear-num36.3%
div-inv36.3%
clear-num36.3%
/-rgt-identity36.3%
Applied egg-rr36.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e290Initial program 99.3%
Final simplification72.7%
c0_m = (fabs.f64 c0)
c0_s = (copysign.f64 1 c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 0.0)
(sqrt (* (/ A (/ 1.0 c0_m)) (/ (/ 1.0 V) (/ l c0_m))))
(if (<= t_0 1e+291)
(* c0_m (sqrt t_0))
(sqrt (* (/ c0_m l) (* c0_m (/ A V)))))))))c0_m = fabs(c0);
c0_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt(((A / (1.0 / c0_m)) * ((1.0 / V) / (l / c0_m))));
} else if (t_0 <= 1e+291) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((c0_m / l) * (c0_m * (A / V))));
}
return c0_s * tmp;
}
c0_m = abs(c0)
c0_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = sqrt(((a / (1.0d0 / c0_m)) * ((1.0d0 / v) / (l / c0_m))))
else if (t_0 <= 1d+291) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((c0_m / l) * (c0_m * (a / v))))
end if
code = c0_s * tmp
end function
c0_m = Math.abs(c0);
c0_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt(((A / (1.0 / c0_m)) * ((1.0 / V) / (l / c0_m))));
} else if (t_0 <= 1e+291) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((c0_m / l) * (c0_m * (A / V))));
}
return c0_s * tmp;
}
c0_m = math.fabs(c0) c0_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt(((A / (1.0 / c0_m)) * ((1.0 / V) / (l / c0_m)))) elif t_0 <= 1e+291: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((c0_m / l) * (c0_m * (A / V)))) return c0_s * tmp
c0_m = abs(c0) c0_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(Float64(A / Float64(1.0 / c0_m)) * Float64(Float64(1.0 / V) / Float64(l / c0_m)))); elseif (t_0 <= 1e+291) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(c0_m / l) * Float64(c0_m * Float64(A / V)))); end return Float64(c0_s * tmp) end
c0_m = abs(c0);
c0_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt(((A / (1.0 / c0_m)) * ((1.0 / V) / (l / c0_m))));
elseif (t_0 <= 1e+291)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((c0_m / l) * (c0_m * (A / V))));
end
tmp_2 = c0_s * tmp;
end
c0_m = N[Abs[c0], $MachinePrecision]
c0_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(A / N[(1.0 / c0$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / V), $MachinePrecision] / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+291], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(c0$95$m / l), $MachinePrecision] * N[(c0$95$m * N[(A / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0_m = \left|c0\right|
\\
c0_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0_s \cdot \begin{array}{l}
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\frac{1}{c0_m}} \cdot \frac{\frac{1}{V}}{\frac{\ell}{c0_m}}}\\
\mathbf{elif}\;t_0 \leq 10^{+291}:\\
\;\;\;\;c0_m \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{c0_m}{\ell} \cdot \left(c0_m \cdot \frac{A}{V}\right)}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 31.9%
clear-num31.9%
associate-/r/31.9%
associate-/r*31.9%
Applied egg-rr31.9%
sqrt-prod32.4%
*-commutative32.4%
*-commutative32.4%
sqrt-div24.8%
associate-*r/24.8%
sqrt-prod47.3%
div-inv47.3%
associate-/r/45.7%
add-sqr-sqrt32.3%
sqrt-unprod27.1%
associate-/r/27.1%
associate-/r/27.2%
swap-sqr24.9%
Applied egg-rr34.0%
associate-*l/34.1%
associate-/l*34.1%
Simplified34.1%
*-un-lft-identity34.1%
unpow234.1%
times-frac37.9%
Applied egg-rr37.9%
div-inv37.9%
times-frac43.0%
Applied egg-rr43.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e290Initial program 99.3%
if 9.9999999999999996e290 < (/.f64 A (*.f64 V l)) Initial program 55.5%
clear-num55.5%
associate-/r/55.5%
associate-/r*55.5%
Applied egg-rr55.5%
sqrt-prod27.4%
*-commutative27.4%
*-commutative27.4%
sqrt-div22.4%
associate-*r/22.4%
sqrt-prod47.6%
div-inv47.6%
associate-/r/47.5%
add-sqr-sqrt26.9%
sqrt-unprod23.2%
associate-/r/23.2%
associate-/r/23.2%
swap-sqr23.1%
Applied egg-rr33.8%
associate-*l/31.9%
associate-/l*33.9%
Simplified33.9%
*-un-lft-identity33.9%
unpow233.9%
times-frac34.0%
Applied egg-rr34.0%
*-un-lft-identity34.0%
*-commutative34.0%
times-frac34.1%
clear-num34.1%
div-inv34.1%
clear-num34.1%
/-rgt-identity34.1%
Applied egg-rr34.1%
Final simplification73.8%
c0_m = (fabs.f64 c0) c0_s = (copysign.f64 1 c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (* 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 75.4%
Final simplification75.4%
herbie shell --seed 2023316
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))