
(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 #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 (- l))) (sqrt (- V))))))
(*
c0_s
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -1e-294)
(* c0_m (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* V l) 4e-319)
t_0
(if (<= (* V l) 2e+281)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* A (* (/ c0_m l) (/ 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 / -l)) / sqrt(-V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -1e-294) {
tmp = c0_m * (sqrt(-A) / sqrt((l * -V)));
} else if ((V * l) <= 4e-319) {
tmp = t_0;
} else if ((V * l) <= 2e+281) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt((A * ((c0_m / l) * (c0_m / V))));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -1e-294) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((V * l) <= 4e-319) {
tmp = t_0;
} else if ((V * l) <= 2e+281) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt((A * ((c0_m / l) * (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 / -l)) / math.sqrt(-V)) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -1e-294: tmp = c0_m * (math.sqrt(-A) / math.sqrt((l * -V))) elif (V * l) <= 4e-319: tmp = t_0 elif (V * l) <= 2e+281: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt((A * ((c0_m / l) * (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 / Float64(-l))) / sqrt(Float64(-V)))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -1e-294) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(V * l) <= 4e-319) tmp = t_0; elseif (Float64(V * l) <= 2e+281) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(A * Float64(Float64(c0_m / l) * 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 / -l)) / sqrt(-V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -1e-294)
tmp = c0_m * (sqrt(-A) / sqrt((l * -V)));
elseif ((V * l) <= 4e-319)
tmp = t_0;
elseif ((V * l) <= 2e+281)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((A * ((c0_m / l) * (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 / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-294], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 2e+281], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(A * N[(N[(c0$95$m / l), $MachinePrecision] * 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}{-\ell}}}{\sqrt{-V}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-294}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{\ell} \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -1.00000000000000002e-294 < (*.f64 V l) < 4.0000049e-319Initial program 42.4%
associate-/r*72.4%
div-inv72.4%
div-inv72.4%
associate-*l*40.7%
Applied egg-rr40.7%
frac-times40.7%
metadata-eval40.7%
div-inv42.4%
associate-/l/72.5%
frac-2neg72.5%
sqrt-div54.6%
distribute-neg-frac254.6%
Applied egg-rr54.6%
distribute-frac-neg254.6%
distribute-frac-neg54.6%
Simplified54.6%
if -inf.0 < (*.f64 V l) < -1.00000000000000002e-294Initial program 88.9%
frac-2neg88.9%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if 4.0000049e-319 < (*.f64 V l) < 2.0000000000000001e281Initial program 87.4%
sqrt-div99.5%
associate-*r/98.1%
Applied egg-rr98.1%
associate-/l*99.5%
Simplified99.5%
if 2.0000000000000001e281 < (*.f64 V l) Initial program 19.4%
associate-/r*67.4%
div-inv67.3%
div-inv67.3%
associate-*l*25.9%
Applied egg-rr25.9%
sqrt-prod25.9%
div-inv25.9%
associate-*r*25.6%
*-commutative25.6%
div-inv25.6%
frac-times19.1%
metadata-eval19.1%
sqrt-div19.1%
metadata-eval19.1%
div-inv19.1%
add-sqr-sqrt19.1%
sqrt-unprod19.1%
frac-times18.2%
Applied egg-rr17.9%
associate-/l*18.4%
associate-/r*26.2%
Simplified26.2%
associate-/l/18.4%
unpow218.4%
times-frac46.9%
Applied egg-rr46.9%
Final simplification89.2%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 4e+276)))
(/ c0_m (sqrt (* V (/ l A))))
t_0))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+276)) {
tmp = c0_m / sqrt((V * (l / A)));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+276))) then
tmp = c0_m / sqrt((v * (l / a)))
else
tmp = t_0
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+276)) {
tmp = c0_m / Math.sqrt((V * (l / A)));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+276): tmp = c0_m / math.sqrt((V * (l / A))) else: tmp = t_0 return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+276)) tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); else tmp = t_0; end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+276)))
tmp = c0_m / sqrt((V * (l / A)));
else
tmp = t_0;
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+276]], $MachinePrecision]], N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+276}\right):\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 4.0000000000000002e276 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 67.2%
associate-/r*73.7%
div-inv73.7%
div-inv73.7%
associate-*l*67.2%
Applied egg-rr67.2%
sqrt-prod38.1%
div-inv38.2%
*-commutative38.2%
div-inv38.1%
frac-times37.6%
metadata-eval37.6%
sqrt-div38.4%
metadata-eval38.4%
associate-/r/38.3%
un-div-inv38.4%
sqrt-undiv66.9%
Applied egg-rr66.9%
associate-*r/72.5%
Simplified72.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e276Initial program 98.6%
Final simplification80.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 4e+231)))
(* c0_m (sqrt (/ (/ A V) l)))
t_0))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+231)) {
tmp = c0_m * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+231))) then
tmp = c0_m * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+231)) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+231): tmp = c0_m * math.sqrt(((A / V) / l)) else: tmp = t_0 return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+231)) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+231)))
tmp = c0_m * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+231]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+231}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 4.0000000000000002e231 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 67.9%
associate-/r*74.3%
Simplified74.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e231Initial program 98.5%
Final simplification81.4%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(sqrt (* A (* (/ c0_m l) (/ c0_m V))))
(if (<= t_0 4e+276) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt((A * ((c0_m / l) * (c0_m / V))));
} else if (t_0 <= 4e+276) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = sqrt((a * ((c0_m / l) * (c0_m / v))))
else if (t_0 <= 4d+276) then
tmp = t_0
else
tmp = c0_m / sqrt((v * (l / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt((A * ((c0_m / l) * (c0_m / V))));
} else if (t_0 <= 4e+276) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt((A * ((c0_m / l) * (c0_m / V)))) elif t_0 <= 4e+276: tmp = t_0 else: tmp = c0_m / math.sqrt((V * (l / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(A * Float64(Float64(c0_m / l) * Float64(c0_m / V)))); elseif (t_0 <= 4e+276) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt((A * ((c0_m / l) * (c0_m / V))));
elseif (t_0 <= 4e+276)
tmp = t_0;
else
tmp = c0_m / sqrt((V * (l / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(A * N[(N[(c0$95$m / l), $MachinePrecision] * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+276], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{\ell} \cdot \frac{c0\_m}{V}\right)}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+276}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 67.4%
associate-/r*73.2%
div-inv73.2%
div-inv73.2%
associate-*l*67.6%
Applied egg-rr67.6%
sqrt-prod38.9%
div-inv38.9%
associate-*r*38.1%
*-commutative38.1%
div-inv38.1%
frac-times37.5%
metadata-eval37.5%
sqrt-div38.4%
metadata-eval38.4%
div-inv38.4%
add-sqr-sqrt6.2%
sqrt-unprod6.3%
frac-times6.3%
Applied egg-rr14.9%
associate-/l*14.9%
associate-/r*15.8%
Simplified15.8%
associate-/l/14.9%
unpow214.9%
times-frac19.5%
Applied egg-rr19.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e276Initial program 98.6%
if 4.0000000000000002e276 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.9%
associate-/r*76.6%
div-inv76.6%
div-inv76.6%
associate-*l*64.7%
Applied egg-rr64.7%
sqrt-prod33.2%
div-inv33.3%
*-commutative33.3%
div-inv33.2%
frac-times33.3%
metadata-eval33.3%
sqrt-div33.2%
metadata-eval33.2%
associate-/r/33.2%
un-div-inv33.2%
sqrt-undiv65.9%
Applied egg-rr65.9%
associate-*r/76.5%
Simplified76.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 4e-269)
(/ c0_m (sqrt (* l (/ V A))))
(if (<= t_0 4e+276) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-269) {
tmp = c0_m / sqrt((l * (V / A)));
} else if (t_0 <= 4e+276) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 4d-269) then
tmp = c0_m / sqrt((l * (v / a)))
else if (t_0 <= 4d+276) then
tmp = t_0
else
tmp = c0_m / sqrt((v * (l / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-269) {
tmp = c0_m / Math.sqrt((l * (V / A)));
} else if (t_0 <= 4e+276) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 4e-269: tmp = c0_m / math.sqrt((l * (V / A))) elif t_0 <= 4e+276: tmp = t_0 else: tmp = c0_m / math.sqrt((V * (l / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-269) tmp = Float64(c0_m / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 4e+276) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-269)
tmp = c0_m / sqrt((l * (V / A)));
elseif (t_0 <= 4e+276)
tmp = t_0;
else
tmp = c0_m / sqrt((V * (l / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 4e-269], N[(c0$95$m / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+276], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-269}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+276}:\\
\;\;\;\;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)))) < 3.9999999999999998e-269Initial program 67.8%
associate-/r*72.6%
div-inv72.5%
div-inv72.5%
associate-*l*68.1%
Applied egg-rr68.1%
sqrt-prod39.0%
div-inv39.1%
*-commutative39.1%
div-inv39.0%
frac-times38.4%
metadata-eval38.4%
sqrt-div39.3%
metadata-eval39.3%
associate-/r/39.3%
un-div-inv39.3%
sqrt-undiv67.5%
Applied egg-rr67.5%
*-commutative67.5%
associate-/l*71.6%
Simplified71.6%
if 3.9999999999999998e-269 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e276Initial program 98.5%
if 4.0000000000000002e276 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.9%
associate-/r*76.6%
div-inv76.6%
div-inv76.6%
associate-*l*64.7%
Applied egg-rr64.7%
sqrt-prod33.2%
div-inv33.3%
*-commutative33.3%
div-inv33.2%
frac-times33.3%
metadata-eval33.3%
sqrt-div33.2%
metadata-eval33.2%
associate-/r/33.2%
un-div-inv33.2%
sqrt-undiv65.9%
Applied egg-rr65.9%
associate-*r/76.5%
Simplified76.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
(*
c0_s
(if (<= (* V l) (- INFINITY))
(/ c0_m (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) -2e-270)
(* c0_m (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* V l) 4e-319)
(* c0_m (sqrt (* (/ A V) (/ 1.0 l))))
(if (<= (* V l) 2e+281)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* A (* (/ c0_m l) (/ c0_m V))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0_m / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= -2e-270) {
tmp = c0_m * (sqrt(-A) / sqrt((l * -V)));
} else if ((V * l) <= 4e-319) {
tmp = c0_m * sqrt(((A / V) * (1.0 / l)));
} else if ((V * l) <= 2e+281) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt((A * ((c0_m / l) * (c0_m / V))));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0_m / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= -2e-270) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((V * l) <= 4e-319) {
tmp = c0_m * Math.sqrt(((A / V) * (1.0 / l)));
} else if ((V * l) <= 2e+281) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt((A * ((c0_m / l) * (c0_m / V))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0_m / (math.sqrt((V / A)) * math.sqrt(l)) elif (V * l) <= -2e-270: tmp = c0_m * (math.sqrt(-A) / math.sqrt((l * -V))) elif (V * l) <= 4e-319: tmp = c0_m * math.sqrt(((A / V) * (1.0 / l))) elif (V * l) <= 2e+281: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt((A * ((c0_m / l) * (c0_m / V)))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0_m / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= -2e-270) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(V * l) <= 4e-319) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); elseif (Float64(V * l) <= 2e+281) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(A * Float64(Float64(c0_m / l) * Float64(c0_m / V)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0_m / (sqrt((V / A)) * sqrt(l));
elseif ((V * l) <= -2e-270)
tmp = c0_m * (sqrt(-A) / sqrt((l * -V)));
elseif ((V * l) <= 4e-319)
tmp = c0_m * sqrt(((A / V) * (1.0 / l)));
elseif ((V * l) <= 2e+281)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((A * ((c0_m / l) * (c0_m / V))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0$95$m / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-270], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+281], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(A * N[(N[(c0$95$m / l), $MachinePrecision] * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-270}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{\ell} \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 36.3%
associate-/r*68.0%
div-inv68.0%
div-inv68.0%
associate-*l*36.3%
Applied egg-rr36.3%
sqrt-prod0.0%
div-inv0.0%
*-commutative0.0%
div-inv0.0%
frac-times0.0%
metadata-eval0.0%
sqrt-div0.0%
metadata-eval0.0%
associate-/r/0.0%
un-div-inv0.0%
sqrt-undiv36.3%
Applied egg-rr36.3%
*-commutative36.3%
associate-/l*68.2%
Simplified68.2%
*-commutative68.2%
sqrt-prod52.2%
Applied egg-rr52.2%
if -inf.0 < (*.f64 V l) < -2.0000000000000001e-270Initial program 88.7%
frac-2neg88.7%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -2.0000000000000001e-270 < (*.f64 V l) < 4.0000049e-319Initial program 52.8%
associate-/r*78.8%
div-inv78.8%
Applied egg-rr78.8%
if 4.0000049e-319 < (*.f64 V l) < 2.0000000000000001e281Initial program 87.4%
sqrt-div99.5%
associate-*r/98.1%
Applied egg-rr98.1%
associate-/l*99.5%
Simplified99.5%
if 2.0000000000000001e281 < (*.f64 V l) Initial program 19.4%
associate-/r*67.4%
div-inv67.3%
div-inv67.3%
associate-*l*25.9%
Applied egg-rr25.9%
sqrt-prod25.9%
div-inv25.9%
associate-*r*25.6%
*-commutative25.6%
div-inv25.6%
frac-times19.1%
metadata-eval19.1%
sqrt-div19.1%
metadata-eval19.1%
div-inv19.1%
add-sqr-sqrt19.1%
sqrt-unprod19.1%
frac-times18.2%
Applied egg-rr17.9%
associate-/l*18.4%
associate-/r*26.2%
Simplified26.2%
associate-/l/18.4%
unpow218.4%
times-frac46.9%
Applied egg-rr46.9%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -5e+140)
(/ c0_m (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) -2e-88)
(/ 1.0 (/ (sqrt (/ (* V l) A)) c0_m))
(if (<= (* V l) 4e-319)
(* c0_m (pow (* l (/ V A)) -0.5))
(if (<= (* V l) 2e+281)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* A (* (/ c0_m l) (/ 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+140) {
tmp = c0_m / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= -2e-88) {
tmp = 1.0 / (sqrt(((V * l) / A)) / c0_m);
} else if ((V * l) <= 4e-319) {
tmp = c0_m * pow((l * (V / A)), -0.5);
} else if ((V * l) <= 2e+281) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt((A * ((c0_m / l) * (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+140)) then
tmp = c0_m / (sqrt((v / a)) * sqrt(l))
else if ((v * l) <= (-2d-88)) then
tmp = 1.0d0 / (sqrt(((v * l) / a)) / c0_m)
else if ((v * l) <= 4d-319) then
tmp = c0_m * ((l * (v / a)) ** (-0.5d0))
else if ((v * l) <= 2d+281) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt((a * ((c0_m / l) * (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+140) {
tmp = c0_m / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= -2e-88) {
tmp = 1.0 / (Math.sqrt(((V * l) / A)) / c0_m);
} else if ((V * l) <= 4e-319) {
tmp = c0_m * Math.pow((l * (V / A)), -0.5);
} else if ((V * l) <= 2e+281) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt((A * ((c0_m / l) * (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+140: tmp = c0_m / (math.sqrt((V / A)) * math.sqrt(l)) elif (V * l) <= -2e-88: tmp = 1.0 / (math.sqrt(((V * l) / A)) / c0_m) elif (V * l) <= 4e-319: tmp = c0_m * math.pow((l * (V / A)), -0.5) elif (V * l) <= 2e+281: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt((A * ((c0_m / l) * (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+140) tmp = Float64(c0_m / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= -2e-88) tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(V * l) / A)) / c0_m)); elseif (Float64(V * l) <= 4e-319) tmp = Float64(c0_m * (Float64(l * Float64(V / A)) ^ -0.5)); elseif (Float64(V * l) <= 2e+281) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(A * Float64(Float64(c0_m / l) * 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+140)
tmp = c0_m / (sqrt((V / A)) * sqrt(l));
elseif ((V * l) <= -2e-88)
tmp = 1.0 / (sqrt(((V * l) / A)) / c0_m);
elseif ((V * l) <= 4e-319)
tmp = c0_m * ((l * (V / A)) ^ -0.5);
elseif ((V * l) <= 2e+281)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((A * ((c0_m / l) * (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+140], N[(c0$95$m / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-88], N[(1.0 / N[(N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / c0$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], N[(c0$95$m * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+281], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(A * N[(N[(c0$95$m / l), $MachinePrecision] * 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^{+140}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-88}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0\_m}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{\ell} \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000008e140Initial program 63.6%
associate-/r*73.0%
div-inv73.0%
div-inv73.0%
associate-*l*63.5%
Applied egg-rr63.5%
sqrt-prod0.0%
div-inv0.0%
*-commutative0.0%
div-inv0.0%
frac-times0.0%
metadata-eval0.0%
sqrt-div0.0%
metadata-eval0.0%
associate-/r/0.0%
un-div-inv0.0%
sqrt-undiv61.9%
Applied egg-rr61.9%
*-commutative61.9%
associate-/l*72.1%
Simplified72.1%
*-commutative72.1%
sqrt-prod52.6%
Applied egg-rr52.6%
if -5.00000000000000008e140 < (*.f64 V l) < -1.99999999999999987e-88Initial program 99.5%
associate-/r*84.9%
div-inv84.9%
div-inv84.9%
associate-*l*99.3%
Applied egg-rr99.3%
sqrt-prod0.0%
div-inv0.0%
associate-*r*0.0%
*-commutative0.0%
div-inv0.0%
frac-times0.0%
metadata-eval0.0%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
clear-num0.0%
associate-/r*0.0%
sqrt-undiv99.6%
Applied egg-rr99.6%
if -1.99999999999999987e-88 < (*.f64 V l) < 4.0000049e-319Initial program 66.7%
associate-/r*75.4%
div-inv75.4%
div-inv75.4%
associate-*l*65.2%
Applied egg-rr65.2%
sqrt-prod8.9%
div-inv8.9%
*-commutative8.9%
div-inv8.9%
frac-times8.9%
metadata-eval8.9%
sqrt-div9.8%
metadata-eval9.8%
associate-/r/9.8%
un-div-inv9.8%
sqrt-undiv66.7%
Applied egg-rr66.7%
associate-*r/77.4%
Simplified77.4%
clear-num77.4%
associate-*r/66.7%
associate-/r/66.7%
pow1/266.7%
associate-*r/77.4%
pow-flip77.5%
associate-*r/66.8%
*-commutative66.8%
*-un-lft-identity66.8%
times-frac75.5%
/-rgt-identity75.5%
metadata-eval75.5%
Applied egg-rr75.5%
if 4.0000049e-319 < (*.f64 V l) < 2.0000000000000001e281Initial program 87.4%
sqrt-div99.5%
associate-*r/98.1%
Applied egg-rr98.1%
associate-/l*99.5%
Simplified99.5%
if 2.0000000000000001e281 < (*.f64 V l) Initial program 19.4%
associate-/r*67.4%
div-inv67.3%
div-inv67.3%
associate-*l*25.9%
Applied egg-rr25.9%
sqrt-prod25.9%
div-inv25.9%
associate-*r*25.6%
*-commutative25.6%
div-inv25.6%
frac-times19.1%
metadata-eval19.1%
sqrt-div19.1%
metadata-eval19.1%
div-inv19.1%
add-sqr-sqrt19.1%
sqrt-unprod19.1%
frac-times18.2%
Applied egg-rr17.9%
associate-/l*18.4%
associate-/r*26.2%
Simplified26.2%
associate-/l/18.4%
unpow218.4%
times-frac46.9%
Applied egg-rr46.9%
Final simplification82.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
(*
c0_s
(if (<= (* V l) -5e+140)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-88)
(/ 1.0 (/ (sqrt (/ (* V l) A)) c0_m))
(if (<= (* V l) 4e-319)
(* c0_m (pow (* l (/ V A)) -0.5))
(if (<= (* V l) 2e+281)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* A (* (/ c0_m l) (/ 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+140) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-88) {
tmp = 1.0 / (sqrt(((V * l) / A)) / c0_m);
} else if ((V * l) <= 4e-319) {
tmp = c0_m * pow((l * (V / A)), -0.5);
} else if ((V * l) <= 2e+281) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt((A * ((c0_m / l) * (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+140)) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-2d-88)) then
tmp = 1.0d0 / (sqrt(((v * l) / a)) / c0_m)
else if ((v * l) <= 4d-319) then
tmp = c0_m * ((l * (v / a)) ** (-0.5d0))
else if ((v * l) <= 2d+281) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt((a * ((c0_m / l) * (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+140) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-88) {
tmp = 1.0 / (Math.sqrt(((V * l) / A)) / c0_m);
} else if ((V * l) <= 4e-319) {
tmp = c0_m * Math.pow((l * (V / A)), -0.5);
} else if ((V * l) <= 2e+281) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt((A * ((c0_m / l) * (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+140: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-88: tmp = 1.0 / (math.sqrt(((V * l) / A)) / c0_m) elif (V * l) <= 4e-319: tmp = c0_m * math.pow((l * (V / A)), -0.5) elif (V * l) <= 2e+281: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt((A * ((c0_m / l) * (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+140) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-88) tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(V * l) / A)) / c0_m)); elseif (Float64(V * l) <= 4e-319) tmp = Float64(c0_m * (Float64(l * Float64(V / A)) ^ -0.5)); elseif (Float64(V * l) <= 2e+281) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(A * Float64(Float64(c0_m / l) * 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+140)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-88)
tmp = 1.0 / (sqrt(((V * l) / A)) / c0_m);
elseif ((V * l) <= 4e-319)
tmp = c0_m * ((l * (V / A)) ^ -0.5);
elseif ((V * l) <= 2e+281)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((A * ((c0_m / l) * (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+140], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-88], N[(1.0 / N[(N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / c0$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], N[(c0$95$m * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+281], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(A * N[(N[(c0$95$m / l), $MachinePrecision] * 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^{+140}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-88}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0\_m}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{\ell} \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000008e140Initial program 63.6%
associate-/r*73.0%
sqrt-div52.6%
associate-*r/49.2%
Applied egg-rr49.2%
associate-/l*52.6%
Simplified52.6%
if -5.00000000000000008e140 < (*.f64 V l) < -1.99999999999999987e-88Initial program 99.5%
associate-/r*84.9%
div-inv84.9%
div-inv84.9%
associate-*l*99.3%
Applied egg-rr99.3%
sqrt-prod0.0%
div-inv0.0%
associate-*r*0.0%
*-commutative0.0%
div-inv0.0%
frac-times0.0%
metadata-eval0.0%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
clear-num0.0%
associate-/r*0.0%
sqrt-undiv99.6%
Applied egg-rr99.6%
if -1.99999999999999987e-88 < (*.f64 V l) < 4.0000049e-319Initial program 66.7%
associate-/r*75.4%
div-inv75.4%
div-inv75.4%
associate-*l*65.2%
Applied egg-rr65.2%
sqrt-prod8.9%
div-inv8.9%
*-commutative8.9%
div-inv8.9%
frac-times8.9%
metadata-eval8.9%
sqrt-div9.8%
metadata-eval9.8%
associate-/r/9.8%
un-div-inv9.8%
sqrt-undiv66.7%
Applied egg-rr66.7%
associate-*r/77.4%
Simplified77.4%
clear-num77.4%
associate-*r/66.7%
associate-/r/66.7%
pow1/266.7%
associate-*r/77.4%
pow-flip77.5%
associate-*r/66.8%
*-commutative66.8%
*-un-lft-identity66.8%
times-frac75.5%
/-rgt-identity75.5%
metadata-eval75.5%
Applied egg-rr75.5%
if 4.0000049e-319 < (*.f64 V l) < 2.0000000000000001e281Initial program 87.4%
sqrt-div99.5%
associate-*r/98.1%
Applied egg-rr98.1%
associate-/l*99.5%
Simplified99.5%
if 2.0000000000000001e281 < (*.f64 V l) Initial program 19.4%
associate-/r*67.4%
div-inv67.3%
div-inv67.3%
associate-*l*25.9%
Applied egg-rr25.9%
sqrt-prod25.9%
div-inv25.9%
associate-*r*25.6%
*-commutative25.6%
div-inv25.6%
frac-times19.1%
metadata-eval19.1%
sqrt-div19.1%
metadata-eval19.1%
div-inv19.1%
add-sqr-sqrt19.1%
sqrt-unprod19.1%
frac-times18.2%
Applied egg-rr17.9%
associate-/l*18.4%
associate-/r*26.2%
Simplified26.2%
associate-/l/18.4%
unpow218.4%
times-frac46.9%
Applied egg-rr46.9%
Final simplification82.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 (sqrt (* A (* (/ c0_m l) (/ c0_m V))))))
(*
c0_s
(if (<= (* V l) -5e+276)
t_0
(if (<= (* V l) -2e-88)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 4e-319)
(* c0_m (pow (* l (/ V A)) -0.5))
(if (<= (* V l) 2e+281)
(* c0_m (/ (sqrt A) (sqrt (* 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 = sqrt((A * ((c0_m / l) * (c0_m / V))));
double tmp;
if ((V * l) <= -5e+276) {
tmp = t_0;
} else if ((V * l) <= -2e-88) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 4e-319) {
tmp = c0_m * pow((l * (V / A)), -0.5);
} else if ((V * l) <= 2e+281) {
tmp = c0_m * (sqrt(A) / sqrt((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 = sqrt((a * ((c0_m / l) * (c0_m / v))))
if ((v * l) <= (-5d+276)) then
tmp = t_0
else if ((v * l) <= (-2d-88)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 4d-319) then
tmp = c0_m * ((l * (v / a)) ** (-0.5d0))
else if ((v * l) <= 2d+281) then
tmp = c0_m * (sqrt(a) / sqrt((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 = Math.sqrt((A * ((c0_m / l) * (c0_m / V))));
double tmp;
if ((V * l) <= -5e+276) {
tmp = t_0;
} else if ((V * l) <= -2e-88) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 4e-319) {
tmp = c0_m * Math.pow((l * (V / A)), -0.5);
} else if ((V * l) <= 2e+281) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((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 = math.sqrt((A * ((c0_m / l) * (c0_m / V)))) tmp = 0 if (V * l) <= -5e+276: tmp = t_0 elif (V * l) <= -2e-88: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 4e-319: tmp = c0_m * math.pow((l * (V / A)), -0.5) elif (V * l) <= 2e+281: tmp = c0_m * (math.sqrt(A) / math.sqrt((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 = sqrt(Float64(A * Float64(Float64(c0_m / l) * Float64(c0_m / V)))) tmp = 0.0 if (Float64(V * l) <= -5e+276) tmp = t_0; elseif (Float64(V * l) <= -2e-88) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 4e-319) tmp = Float64(c0_m * (Float64(l * Float64(V / A)) ^ -0.5)); elseif (Float64(V * l) <= 2e+281) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(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 = sqrt((A * ((c0_m / l) * (c0_m / V))));
tmp = 0.0;
if ((V * l) <= -5e+276)
tmp = t_0;
elseif ((V * l) <= -2e-88)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 4e-319)
tmp = c0_m * ((l * (V / A)) ^ -0.5);
elseif ((V * l) <= 2e+281)
tmp = c0_m * (sqrt(A) / sqrt((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[Sqrt[N[(A * N[(N[(c0$95$m / l), $MachinePrecision] * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e+276], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-88], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], N[(c0$95$m * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+281], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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 := \sqrt{A \cdot \left(\frac{c0\_m}{\ell} \cdot \frac{c0\_m}{V}\right)}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+276}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-88}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000001e276 or 2.0000000000000001e281 < (*.f64 V l) Initial program 37.9%
associate-/r*67.6%
div-inv67.6%
div-inv67.6%
associate-*l*40.0%
Applied egg-rr40.0%
sqrt-prod8.1%
div-inv8.1%
associate-*r*8.0%
*-commutative8.0%
div-inv8.0%
frac-times5.9%
metadata-eval5.9%
sqrt-div5.9%
metadata-eval5.9%
div-inv5.9%
add-sqr-sqrt5.9%
sqrt-unprod5.9%
frac-times5.7%
Applied egg-rr29.3%
associate-/l*31.5%
associate-/r*34.0%
Simplified34.0%
associate-/l/31.5%
unpow231.5%
times-frac46.9%
Applied egg-rr46.9%
if -5.00000000000000001e276 < (*.f64 V l) < -1.99999999999999987e-88Initial program 95.5%
if -1.99999999999999987e-88 < (*.f64 V l) < 4.0000049e-319Initial program 66.7%
associate-/r*75.4%
div-inv75.4%
div-inv75.4%
associate-*l*65.2%
Applied egg-rr65.2%
sqrt-prod8.9%
div-inv8.9%
*-commutative8.9%
div-inv8.9%
frac-times8.9%
metadata-eval8.9%
sqrt-div9.8%
metadata-eval9.8%
associate-/r/9.8%
un-div-inv9.8%
sqrt-undiv66.7%
Applied egg-rr66.7%
associate-*r/77.4%
Simplified77.4%
clear-num77.4%
associate-*r/66.7%
associate-/r/66.7%
pow1/266.7%
associate-*r/77.4%
pow-flip77.5%
associate-*r/66.8%
*-commutative66.8%
*-un-lft-identity66.8%
times-frac75.5%
/-rgt-identity75.5%
metadata-eval75.5%
Applied egg-rr75.5%
if 4.0000049e-319 < (*.f64 V l) < 2.0000000000000001e281Initial program 87.4%
sqrt-div99.5%
associate-*r/98.1%
Applied egg-rr98.1%
associate-/l*99.5%
Simplified99.5%
Final simplification84.9%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (* 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 76.9%
herbie shell --seed 2024137
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))