
(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
(let* ((t_0 (/ (/ c0_m (sqrt l)) (sqrt (/ V A)))))
(*
c0_s
(if (<= (* V l) -2e+265)
t_0
(if (<= (* V l) -4e-268)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 4e+271)
(* c0_m (* (sqrt A) (sqrt (/ (/ 1.0 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 t_0 = (c0_m / sqrt(l)) / sqrt((V / A));
double tmp;
if ((V * l) <= -2e+265) {
tmp = t_0;
} else if ((V * l) <= -4e-268) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+271) {
tmp = c0_m * (sqrt(A) * sqrt(((1.0 / 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) :: t_0
real(8) :: tmp
t_0 = (c0_m / sqrt(l)) / sqrt((v / a))
if ((v * l) <= (-2d+265)) then
tmp = t_0
else if ((v * l) <= (-4d-268)) then
tmp = c0_m * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 4d+271) then
tmp = c0_m * (sqrt(a) * sqrt(((1.0d0 / 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 t_0 = (c0_m / Math.sqrt(l)) / Math.sqrt((V / A));
double tmp;
if ((V * l) <= -2e+265) {
tmp = t_0;
} else if ((V * l) <= -4e-268) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+271) {
tmp = c0_m * (Math.sqrt(A) * Math.sqrt(((1.0 / 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): t_0 = (c0_m / math.sqrt(l)) / math.sqrt((V / A)) tmp = 0 if (V * l) <= -2e+265: tmp = t_0 elif (V * l) <= -4e-268: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 4e+271: tmp = c0_m * (math.sqrt(A) * math.sqrt(((1.0 / 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) t_0 = Float64(Float64(c0_m / sqrt(l)) / sqrt(Float64(V / A))) tmp = 0.0 if (Float64(V * l) <= -2e+265) tmp = t_0; elseif (Float64(V * l) <= -4e-268) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 4e+271) tmp = Float64(c0_m * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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)
t_0 = (c0_m / sqrt(l)) / sqrt((V / A));
tmp = 0.0;
if ((V * l) <= -2e+265)
tmp = t_0;
elseif ((V * l) <= -4e-268)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 4e+271)
tmp = c0_m * (sqrt(A) * sqrt(((1.0 / 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_] := Block[{t$95$0 = N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -2e+265], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -4e-268], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 4e+271], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / 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])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{c0\_m}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+265}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-268}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+271}:\\
\;\;\;\;c0\_m \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000013e265 or -3.99999999999999983e-268 < (*.f64 V l) < 0.0Initial program 40.0%
add-sqr-sqrt40.0%
pow240.0%
pow1/240.0%
sqrt-pow140.0%
metadata-eval40.0%
Applied egg-rr40.0%
pow-pow40.0%
metadata-eval40.0%
pow1/240.0%
sqrt-div6.5%
clear-num6.5%
sqrt-div40.0%
associate-*r/54.2%
un-div-inv54.2%
clear-num54.2%
associate-*r/40.0%
*-commutative40.0%
associate-/l*54.2%
Applied egg-rr54.2%
clear-num54.2%
add-cbrt-cube44.3%
unpow244.3%
cbrt-prod46.4%
sqrt-prod39.1%
times-frac39.1%
unpow239.1%
cbrt-prod47.8%
pow247.8%
Applied egg-rr47.8%
associate-*r/47.9%
associate-*l/47.9%
unpow247.9%
rem-3cbrt-lft48.7%
Simplified48.7%
if -2.00000000000000013e265 < (*.f64 V l) < -3.99999999999999983e-268Initial program 85.6%
frac-2neg85.6%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if 0.0 < (*.f64 V l) < 3.99999999999999981e271Initial program 84.5%
pow1/284.5%
div-inv84.5%
unpow-prod-down99.5%
pow1/299.5%
associate-/r*99.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
if 3.99999999999999981e271 < (*.f64 V l) Initial program 54.8%
add-sqr-sqrt54.7%
pow254.7%
pow1/254.7%
sqrt-pow154.7%
metadata-eval54.7%
Applied egg-rr54.7%
pow-pow54.8%
metadata-eval54.8%
pow1/254.8%
pow154.8%
*-commutative54.8%
metadata-eval54.8%
metadata-eval54.8%
pow-sqr43.1%
pow-prod-down43.3%
swap-sqr42.6%
add-sqr-sqrt42.6%
pow242.6%
metadata-eval42.6%
Applied egg-rr42.6%
unpow1/242.6%
associate-*l/42.3%
*-commutative42.3%
times-frac54.2%
Simplified54.2%
unpow254.2%
*-un-lft-identity54.2%
times-frac60.0%
Applied egg-rr60.0%
Final simplification86.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 2e-275)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+245) t_0 (* 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 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-275) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 2e+245) {
tmp = t_0;
} 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 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 2d-275) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 2d+245) then
tmp = t_0
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 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-275) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+245) {
tmp = t_0;
} 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 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-275: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 2e+245: tmp = t_0 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(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-275) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+245) tmp = t_0; 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 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-275)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 2e+245)
tmp = t_0;
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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-275], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+245], t$95$0, 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-275}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+245}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999987e-275Initial program 69.8%
associate-/r*70.7%
Simplified70.7%
if 1.99999999999999987e-275 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000009e245Initial program 99.2%
if 2.00000000000000009e245 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 38.7%
associate-/r*41.9%
clear-num41.9%
sqrt-div41.8%
metadata-eval41.8%
div-inv41.8%
clear-num41.8%
Applied egg-rr41.8%
*-commutative41.8%
associate-*l/38.7%
associate-/l*41.8%
Simplified41.8%
inv-pow41.8%
sqrt-pow241.9%
associate-*r/38.8%
*-commutative38.8%
associate-/l*41.9%
metadata-eval41.9%
Applied egg-rr41.9%
associate-*r/38.8%
*-commutative38.8%
associate-/l*41.9%
Simplified41.9%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (or (<= t_0 2e-275) (not (<= t_0 1e+238)))
(* 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-275) || !(t_0 <= 1e+238)) {
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-275) .or. (.not. (t_0 <= 1d+238))) 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-275) || !(t_0 <= 1e+238)) {
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-275) or not (t_0 <= 1e+238): 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-275) || !(t_0 <= 1e+238)) 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-275) || ~((t_0 <= 1e+238)))
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-275], N[Not[LessEqual[t$95$0, 1e+238]], $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^{-275} \lor \neg \left(t\_0 \leq 10^{+238}\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.99999999999999987e-275 or 1e238 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.2%
associate-/r*66.4%
Simplified66.4%
if 1.99999999999999987e-275 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1e238Initial program 99.2%
Final simplification74.5%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 2e-275)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+247) 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 <= 2e-275) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 2e+247) {
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 <= 2d-275) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 2d+247) 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 <= 2e-275) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+247) {
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 <= 2e-275: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 2e+247: 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 <= 2e-275) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+247) 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 <= 2e-275)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 2e+247)
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, 2e-275], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+247], 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 2 \cdot 10^{-275}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+247}:\\
\;\;\;\;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)))) < 1.99999999999999987e-275Initial program 69.8%
associate-/r*70.7%
Simplified70.7%
if 1.99999999999999987e-275 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.9999999999999999e247Initial program 99.2%
if 1.9999999999999999e247 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 38.7%
add-sqr-sqrt38.7%
pow238.7%
pow1/238.7%
sqrt-pow138.7%
metadata-eval38.7%
Applied egg-rr38.7%
pow-pow38.7%
metadata-eval38.7%
pow1/238.7%
sqrt-div36.4%
clear-num36.3%
sqrt-div38.7%
associate-*r/41.8%
un-div-inv41.8%
associate-*r/38.7%
*-commutative38.7%
associate-/l*41.9%
Applied egg-rr41.9%
*-commutative41.9%
associate-/r/41.8%
Simplified41.8%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 2e-275)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+245) 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 <= 2e-275) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 2e+245) {
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 <= 2d-275) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 2d+245) 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 <= 2e-275) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+245) {
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 <= 2e-275: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 2e+245: 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 <= 2e-275) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+245) 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 <= 2e-275)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 2e+245)
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, 2e-275], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+245], 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 2 \cdot 10^{-275}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+245}:\\
\;\;\;\;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)))) < 1.99999999999999987e-275Initial program 69.8%
associate-/r*70.7%
Simplified70.7%
if 1.99999999999999987e-275 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000009e245Initial program 99.2%
if 2.00000000000000009e245 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 38.7%
add-sqr-sqrt38.7%
pow238.7%
pow1/238.7%
sqrt-pow138.7%
metadata-eval38.7%
Applied egg-rr38.7%
pow-pow38.7%
metadata-eval38.7%
pow1/238.7%
sqrt-div36.4%
clear-num36.3%
sqrt-div38.7%
associate-*r/41.8%
un-div-inv41.8%
associate-*r/38.7%
*-commutative38.7%
associate-/l*41.9%
Applied egg-rr41.9%
associate-*r/38.7%
*-commutative38.7%
associate-/l*41.8%
Simplified41.8%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= A -5e-310)
(* c0_m (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l)))
(* c0_m (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0_m * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else {
tmp = c0_m * (sqrt(A) * sqrt(((1.0 / 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 (a <= (-5d-310)) then
tmp = c0_m * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else
tmp = c0_m * (sqrt(a) * sqrt(((1.0d0 / 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 (A <= -5e-310) {
tmp = c0_m * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else {
tmp = c0_m * (Math.sqrt(A) * Math.sqrt(((1.0 / 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 A <= -5e-310: tmp = c0_m * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) else: tmp = c0_m * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0_m * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); else tmp = Float64(c0_m * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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 (A <= -5e-310)
tmp = c0_m * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
else
tmp = c0_m * (sqrt(A) * sqrt(((1.0 / 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[A, -5e-310], N[(c0$95$m * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / 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}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0\_m \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.2%
associate-/r*71.0%
sqrt-div38.8%
div-inv38.7%
Applied egg-rr38.7%
associate-*r/38.8%
*-rgt-identity38.8%
Simplified38.8%
frac-2neg38.8%
sqrt-div46.9%
Applied egg-rr46.9%
if -4.999999999999985e-310 < A Initial program 75.2%
pow1/275.2%
div-inv75.2%
unpow-prod-down86.6%
pow1/286.6%
associate-/r*87.6%
Applied egg-rr87.6%
unpow1/287.6%
Simplified87.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -5e+96)
(/ c0_m (/ (sqrt l) (sqrt (/ A V))))
(if (<= (* V l) -4e-268)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ (/ c0_m (sqrt l)) (sqrt (/ V A)))
(if (<= (* V l) 4e+271)
(* c0_m (* (sqrt A) (sqrt (/ (/ 1.0 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) <= -5e+96) {
tmp = c0_m / (sqrt(l) / sqrt((A / V)));
} else if ((V * l) <= -4e-268) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = (c0_m / sqrt(l)) / sqrt((V / A));
} else if ((V * l) <= 4e+271) {
tmp = c0_m * (sqrt(A) * sqrt(((1.0 / 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) <= (-5d+96)) then
tmp = c0_m / (sqrt(l) / sqrt((a / v)))
else if ((v * l) <= (-4d-268)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = (c0_m / sqrt(l)) / sqrt((v / a))
else if ((v * l) <= 4d+271) then
tmp = c0_m * (sqrt(a) * sqrt(((1.0d0 / 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) <= -5e+96) {
tmp = c0_m / (Math.sqrt(l) / Math.sqrt((A / V)));
} else if ((V * l) <= -4e-268) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = (c0_m / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((V * l) <= 4e+271) {
tmp = c0_m * (Math.sqrt(A) * Math.sqrt(((1.0 / 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) <= -5e+96: tmp = c0_m / (math.sqrt(l) / math.sqrt((A / V))) elif (V * l) <= -4e-268: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = (c0_m / math.sqrt(l)) / math.sqrt((V / A)) elif (V * l) <= 4e+271: tmp = c0_m * (math.sqrt(A) * math.sqrt(((1.0 / 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) <= -5e+96) tmp = Float64(c0_m / Float64(sqrt(l) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -4e-268) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(Float64(c0_m / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= 4e+271) tmp = Float64(c0_m * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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) <= -5e+96)
tmp = c0_m / (sqrt(l) / sqrt((A / V)));
elseif ((V * l) <= -4e-268)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = (c0_m / sqrt(l)) / sqrt((V / A));
elseif ((V * l) <= 4e+271)
tmp = c0_m * (sqrt(A) * sqrt(((1.0 / 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], -5e+96], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-268], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+271], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / 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 -5 \cdot 10^{+96}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-268}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+271}:\\
\;\;\;\;c0\_m \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000004e96Initial program 62.5%
add-sqr-sqrt62.3%
pow262.3%
pow1/262.3%
sqrt-pow162.5%
metadata-eval62.5%
Applied egg-rr62.5%
pow-pow62.5%
metadata-eval62.5%
pow1/262.5%
sqrt-div0.0%
clear-num0.0%
sqrt-div60.7%
associate-*r/62.7%
un-div-inv62.8%
associate-*r/60.8%
*-commutative60.8%
associate-/l*64.9%
Applied egg-rr64.9%
associate-*r/60.8%
*-commutative60.8%
associate-/l*62.8%
Simplified62.8%
sqrt-prod40.6%
*-commutative40.6%
sqrt-div0.0%
associate-/r/0.0%
sqrt-div42.6%
div-inv42.4%
Applied egg-rr42.4%
associate-*r/42.6%
*-rgt-identity42.6%
Simplified42.6%
if -5.0000000000000004e96 < (*.f64 V l) < -3.99999999999999983e-268Initial program 87.8%
if -3.99999999999999983e-268 < (*.f64 V l) < 0.0Initial program 35.9%
add-sqr-sqrt35.9%
pow235.9%
pow1/235.9%
sqrt-pow135.9%
metadata-eval35.9%
Applied egg-rr35.9%
pow-pow35.9%
metadata-eval35.9%
pow1/235.9%
sqrt-div11.4%
clear-num11.4%
sqrt-div35.8%
associate-*r/51.4%
un-div-inv51.5%
clear-num51.4%
associate-*r/35.9%
*-commutative35.9%
associate-/l*51.5%
Applied egg-rr51.5%
clear-num51.5%
add-cbrt-cube41.2%
unpow241.2%
cbrt-prod44.5%
sqrt-prod45.2%
times-frac45.2%
unpow245.2%
cbrt-prod51.3%
pow251.3%
Applied egg-rr51.3%
associate-*r/51.3%
associate-*l/51.4%
unpow251.4%
rem-3cbrt-lft52.2%
Simplified52.2%
if 0.0 < (*.f64 V l) < 3.99999999999999981e271Initial program 84.5%
pow1/284.5%
div-inv84.5%
unpow-prod-down99.5%
pow1/299.5%
associate-/r*99.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
if 3.99999999999999981e271 < (*.f64 V l) Initial program 54.8%
add-sqr-sqrt54.7%
pow254.7%
pow1/254.7%
sqrt-pow154.7%
metadata-eval54.7%
Applied egg-rr54.7%
pow-pow54.8%
metadata-eval54.8%
pow1/254.8%
pow154.8%
*-commutative54.8%
metadata-eval54.8%
metadata-eval54.8%
pow-sqr43.1%
pow-prod-down43.3%
swap-sqr42.6%
add-sqr-sqrt42.6%
pow242.6%
metadata-eval42.6%
Applied egg-rr42.6%
unpow1/242.6%
associate-*l/42.3%
*-commutative42.3%
times-frac54.2%
Simplified54.2%
unpow254.2%
*-un-lft-identity54.2%
times-frac60.0%
Applied egg-rr60.0%
Final simplification77.4%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -5e+96)
(/ c0_m (/ (sqrt l) (sqrt (/ A V))))
(if (<= (* V l) -4e-268)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ (/ c0_m (sqrt l)) (sqrt (/ V A)))
(if (<= (* V l) 4e+271)
(* 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) <= -5e+96) {
tmp = c0_m / (sqrt(l) / sqrt((A / V)));
} else if ((V * l) <= -4e-268) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = (c0_m / sqrt(l)) / sqrt((V / A));
} else if ((V * l) <= 4e+271) {
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) <= (-5d+96)) then
tmp = c0_m / (sqrt(l) / sqrt((a / v)))
else if ((v * l) <= (-4d-268)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = (c0_m / sqrt(l)) / sqrt((v / a))
else if ((v * l) <= 4d+271) 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) <= -5e+96) {
tmp = c0_m / (Math.sqrt(l) / Math.sqrt((A / V)));
} else if ((V * l) <= -4e-268) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = (c0_m / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((V * l) <= 4e+271) {
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) <= -5e+96: tmp = c0_m / (math.sqrt(l) / math.sqrt((A / V))) elif (V * l) <= -4e-268: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = (c0_m / math.sqrt(l)) / math.sqrt((V / A)) elif (V * l) <= 4e+271: 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) <= -5e+96) tmp = Float64(c0_m / Float64(sqrt(l) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -4e-268) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(Float64(c0_m / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= 4e+271) 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) <= -5e+96)
tmp = c0_m / (sqrt(l) / sqrt((A / V)));
elseif ((V * l) <= -4e-268)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = (c0_m / sqrt(l)) / sqrt((V / A));
elseif ((V * l) <= 4e+271)
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], -5e+96], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-268], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+271], 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 -5 \cdot 10^{+96}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-268}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+271}:\\
\;\;\;\;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) < -5.0000000000000004e96Initial program 62.5%
add-sqr-sqrt62.3%
pow262.3%
pow1/262.3%
sqrt-pow162.5%
metadata-eval62.5%
Applied egg-rr62.5%
pow-pow62.5%
metadata-eval62.5%
pow1/262.5%
sqrt-div0.0%
clear-num0.0%
sqrt-div60.7%
associate-*r/62.7%
un-div-inv62.8%
associate-*r/60.8%
*-commutative60.8%
associate-/l*64.9%
Applied egg-rr64.9%
associate-*r/60.8%
*-commutative60.8%
associate-/l*62.8%
Simplified62.8%
sqrt-prod40.6%
*-commutative40.6%
sqrt-div0.0%
associate-/r/0.0%
sqrt-div42.6%
div-inv42.4%
Applied egg-rr42.4%
associate-*r/42.6%
*-rgt-identity42.6%
Simplified42.6%
if -5.0000000000000004e96 < (*.f64 V l) < -3.99999999999999983e-268Initial program 87.8%
if -3.99999999999999983e-268 < (*.f64 V l) < 0.0Initial program 35.9%
add-sqr-sqrt35.9%
pow235.9%
pow1/235.9%
sqrt-pow135.9%
metadata-eval35.9%
Applied egg-rr35.9%
pow-pow35.9%
metadata-eval35.9%
pow1/235.9%
sqrt-div11.4%
clear-num11.4%
sqrt-div35.8%
associate-*r/51.4%
un-div-inv51.5%
clear-num51.4%
associate-*r/35.9%
*-commutative35.9%
associate-/l*51.5%
Applied egg-rr51.5%
clear-num51.5%
add-cbrt-cube41.2%
unpow241.2%
cbrt-prod44.5%
sqrt-prod45.2%
times-frac45.2%
unpow245.2%
cbrt-prod51.3%
pow251.3%
Applied egg-rr51.3%
associate-*r/51.3%
associate-*l/51.4%
unpow251.4%
rem-3cbrt-lft52.2%
Simplified52.2%
if 0.0 < (*.f64 V l) < 3.99999999999999981e271Initial program 84.5%
sqrt-div99.4%
div-inv99.5%
Applied egg-rr99.5%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 3.99999999999999981e271 < (*.f64 V l) Initial program 54.8%
add-sqr-sqrt54.7%
pow254.7%
pow1/254.7%
sqrt-pow154.7%
metadata-eval54.7%
Applied egg-rr54.7%
pow-pow54.8%
metadata-eval54.8%
pow1/254.8%
pow154.8%
*-commutative54.8%
metadata-eval54.8%
metadata-eval54.8%
pow-sqr43.1%
pow-prod-down43.3%
swap-sqr42.6%
add-sqr-sqrt42.6%
pow242.6%
metadata-eval42.6%
Applied egg-rr42.6%
unpow1/242.6%
associate-*l/42.3%
*-commutative42.3%
times-frac54.2%
Simplified54.2%
unpow254.2%
*-un-lft-identity54.2%
times-frac60.0%
Applied egg-rr60.0%
Final simplification77.3%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(*
c0_s
(if (<= (* V l) -5e+96)
(/ c0_m (/ (sqrt l) t_0))
(if (<= (* V l) -5e-259)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(* c0_m (/ t_0 (sqrt l)))
(if (<= (* V l) 4e+271)
(* 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 t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -5e+96) {
tmp = c0_m / (sqrt(l) / t_0);
} else if ((V * l) <= -5e-259) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (t_0 / sqrt(l));
} else if ((V * l) <= 4e+271) {
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) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-5d+96)) then
tmp = c0_m / (sqrt(l) / t_0)
else if ((v * l) <= (-5d-259)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0_m * (t_0 / sqrt(l))
else if ((v * l) <= 4d+271) 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 t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -5e+96) {
tmp = c0_m / (Math.sqrt(l) / t_0);
} else if ((V * l) <= -5e-259) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (t_0 / Math.sqrt(l));
} else if ((V * l) <= 4e+271) {
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): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -5e+96: tmp = c0_m / (math.sqrt(l) / t_0) elif (V * l) <= -5e-259: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0_m * (t_0 / math.sqrt(l)) elif (V * l) <= 4e+271: 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) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -5e+96) tmp = Float64(c0_m / Float64(sqrt(l) / t_0)); elseif (Float64(V * l) <= -5e-259) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= 4e+271) 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)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -5e+96)
tmp = c0_m / (sqrt(l) / t_0);
elseif ((V * l) <= -5e-259)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0_m * (t_0 / sqrt(l));
elseif ((V * l) <= 4e+271)
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_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e+96], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-259], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+271], 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])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+96}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{\ell}}{t\_0}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-259}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0\_m \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+271}:\\
\;\;\;\;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}
\end{array}
if (*.f64 V l) < -5.0000000000000004e96Initial program 62.5%
add-sqr-sqrt62.3%
pow262.3%
pow1/262.3%
sqrt-pow162.5%
metadata-eval62.5%
Applied egg-rr62.5%
pow-pow62.5%
metadata-eval62.5%
pow1/262.5%
sqrt-div0.0%
clear-num0.0%
sqrt-div60.7%
associate-*r/62.7%
un-div-inv62.8%
associate-*r/60.8%
*-commutative60.8%
associate-/l*64.9%
Applied egg-rr64.9%
associate-*r/60.8%
*-commutative60.8%
associate-/l*62.8%
Simplified62.8%
sqrt-prod40.6%
*-commutative40.6%
sqrt-div0.0%
associate-/r/0.0%
sqrt-div42.6%
div-inv42.4%
Applied egg-rr42.4%
associate-*r/42.6%
*-rgt-identity42.6%
Simplified42.6%
if -5.0000000000000004e96 < (*.f64 V l) < -4.99999999999999977e-259Initial program 87.5%
if -4.99999999999999977e-259 < (*.f64 V l) < 0.0Initial program 39.7%
associate-/r*54.4%
sqrt-div52.0%
div-inv51.9%
Applied egg-rr51.9%
associate-*r/52.0%
*-rgt-identity52.0%
Simplified52.0%
if 0.0 < (*.f64 V l) < 3.99999999999999981e271Initial program 84.5%
sqrt-div99.4%
div-inv99.5%
Applied egg-rr99.5%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 3.99999999999999981e271 < (*.f64 V l) Initial program 54.8%
add-sqr-sqrt54.7%
pow254.7%
pow1/254.7%
sqrt-pow154.7%
metadata-eval54.7%
Applied egg-rr54.7%
pow-pow54.8%
metadata-eval54.8%
pow1/254.8%
pow154.8%
*-commutative54.8%
metadata-eval54.8%
metadata-eval54.8%
pow-sqr43.1%
pow-prod-down43.3%
swap-sqr42.6%
add-sqr-sqrt42.6%
pow242.6%
metadata-eval42.6%
Applied egg-rr42.6%
unpow1/242.6%
associate-*l/42.3%
*-commutative42.3%
times-frac54.2%
Simplified54.2%
unpow254.2%
*-un-lft-identity54.2%
times-frac60.0%
Applied egg-rr60.0%
Final simplification76.9%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (/ (sqrt (/ A V)) (sqrt l)))))
(*
c0_s
(if (<= (* V l) -5e+96)
t_0
(if (<= (* V l) -5e-259)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 4e+271)
(* 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 t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -5e+96) {
tmp = t_0;
} else if ((V * l) <= -5e-259) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+271) {
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) :: t_0
real(8) :: tmp
t_0 = c0_m * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-5d+96)) then
tmp = t_0
else if ((v * l) <= (-5d-259)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 4d+271) 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 t_0 = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -5e+96) {
tmp = t_0;
} else if ((V * l) <= -5e-259) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+271) {
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): t_0 = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -5e+96: tmp = t_0 elif (V * l) <= -5e-259: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 4e+271: 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) t_0 = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -5e+96) tmp = t_0; elseif (Float64(V * l) <= -5e-259) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 4e+271) 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)
t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -5e+96)
tmp = t_0;
elseif ((V * l) <= -5e-259)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 4e+271)
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_] := Block[{t$95$0 = N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e+96], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-259], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 4e+271], 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])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+96}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-259}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+271}:\\
\;\;\;\;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}
\end{array}
if (*.f64 V l) < -5.0000000000000004e96 or -4.99999999999999977e-259 < (*.f64 V l) < 0.0Initial program 53.1%
associate-/r*60.5%
sqrt-div46.4%
div-inv46.3%
Applied egg-rr46.3%
associate-*r/46.4%
*-rgt-identity46.4%
Simplified46.4%
if -5.0000000000000004e96 < (*.f64 V l) < -4.99999999999999977e-259Initial program 87.5%
if 0.0 < (*.f64 V l) < 3.99999999999999981e271Initial program 84.5%
sqrt-div99.4%
div-inv99.5%
Applied egg-rr99.5%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 3.99999999999999981e271 < (*.f64 V l) Initial program 54.8%
add-sqr-sqrt54.7%
pow254.7%
pow1/254.7%
sqrt-pow154.7%
metadata-eval54.7%
Applied egg-rr54.7%
pow-pow54.8%
metadata-eval54.8%
pow1/254.8%
pow154.8%
*-commutative54.8%
metadata-eval54.8%
metadata-eval54.8%
pow-sqr43.1%
pow-prod-down43.3%
swap-sqr42.6%
add-sqr-sqrt42.6%
pow242.6%
metadata-eval42.6%
Applied egg-rr42.6%
unpow1/242.6%
associate-*l/42.3%
*-commutative42.3%
times-frac54.2%
Simplified54.2%
unpow254.2%
*-un-lft-identity54.2%
times-frac60.0%
Applied egg-rr60.0%
Final simplification76.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 (<= (* c0_m (sqrt (/ A (* V l)))) 2e+245)
(* c0_m (sqrt (* A (/ (/ 1.0 V) l))))
(* 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 tmp;
if ((c0_m * sqrt((A / (V * l)))) <= 2e+245) {
tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
} 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) :: tmp
if ((c0_m * sqrt((a / (v * l)))) <= 2d+245) then
tmp = c0_m * sqrt((a * ((1.0d0 / v) / l)))
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 tmp;
if ((c0_m * Math.sqrt((A / (V * l)))) <= 2e+245) {
tmp = c0_m * Math.sqrt((A * ((1.0 / V) / l)));
} 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): tmp = 0 if (c0_m * math.sqrt((A / (V * l)))) <= 2e+245: tmp = c0_m * math.sqrt((A * ((1.0 / V) / l))) 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) tmp = 0.0 if (Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) <= 2e+245) tmp = Float64(c0_m * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); 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)
tmp = 0.0;
if ((c0_m * sqrt((A / (V * l)))) <= 2e+245)
tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
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_] := N[(c0$95$s * If[LessEqual[N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e+245], N[(c0$95$m * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $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])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 2 \cdot 10^{+245}:\\
\;\;\;\;c0\_m \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000009e245Initial program 78.3%
clear-num78.0%
associate-/r/78.3%
associate-/r*78.6%
Applied egg-rr78.6%
if 2.00000000000000009e245 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 38.7%
associate-/r*41.9%
clear-num41.9%
sqrt-div41.8%
metadata-eval41.8%
div-inv41.8%
clear-num41.8%
Applied egg-rr41.8%
*-commutative41.8%
associate-*l/38.7%
associate-/l*41.8%
Simplified41.8%
inv-pow41.8%
sqrt-pow241.9%
associate-*r/38.8%
*-commutative38.8%
associate-/l*41.9%
metadata-eval41.9%
Applied egg-rr41.9%
associate-*r/38.8%
*-commutative38.8%
associate-/l*41.9%
Simplified41.9%
Final simplification74.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 (/ A (* V l))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 5e+299)))
(sqrt (* (/ A l) (* c0_m (/ c0_m 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 <= 5e+299)) {
tmp = sqrt(((A / l) * (c0_m * (c0_m / 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 <= 5d+299))) then
tmp = sqrt(((a / l) * (c0_m * (c0_m / 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 <= 5e+299)) {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / 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 <= 5e+299): tmp = math.sqrt(((A / l) * (c0_m * (c0_m / 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 <= 5e+299)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / 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 <= 5e+299)))
tmp = sqrt(((A / l) * (c0_m * (c0_m / 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, 5e+299]], $MachinePrecision]], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / 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 5 \cdot 10^{+299}\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{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 5.0000000000000003e299 < (/.f64 A (*.f64 V l)) Initial program 35.1%
add-sqr-sqrt35.1%
pow235.1%
pow1/235.1%
sqrt-pow135.1%
metadata-eval35.1%
Applied egg-rr35.1%
pow-pow35.1%
metadata-eval35.1%
pow1/235.1%
pow135.1%
*-commutative35.1%
metadata-eval35.1%
metadata-eval35.1%
pow-sqr26.5%
pow-prod-down26.5%
swap-sqr25.9%
add-sqr-sqrt25.9%
pow225.9%
metadata-eval25.9%
Applied egg-rr25.9%
unpow1/225.9%
associate-*l/28.9%
*-commutative28.9%
times-frac31.7%
Simplified31.7%
unpow231.7%
*-un-lft-identity31.7%
times-frac33.8%
Applied egg-rr33.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000003e299Initial program 99.4%
Final simplification73.0%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (* c0_s (* 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 73.5%
herbie shell --seed 2024102
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))