
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -1e-320)
(* c0_m (* (/ (sqrt (- A)) (sqrt (- V))) (pow l -0.5)))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+275)))
(sqrt (* (/ A l) (* c0_m (/ c0_m V))))
(/ c0_m (/ (sqrt (* V l)) (sqrt 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 tmp;
if ((V * l) <= -1e-320) {
tmp = c0_m * ((sqrt(-A) / sqrt(-V)) * pow(l, -0.5));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+275)) {
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
} else {
tmp = c0_m / (sqrt((V * l)) / sqrt(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) :: tmp
if ((v * l) <= (-1d-320)) then
tmp = c0_m * ((sqrt(-a) / sqrt(-v)) * (l ** (-0.5d0)))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 1d+275))) then
tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
else
tmp = c0_m / (sqrt((v * l)) / sqrt(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 tmp;
if ((V * l) <= -1e-320) {
tmp = c0_m * ((Math.sqrt(-A) / Math.sqrt(-V)) * Math.pow(l, -0.5));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+275)) {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
} else {
tmp = c0_m / (Math.sqrt((V * l)) / Math.sqrt(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): tmp = 0 if (V * l) <= -1e-320: tmp = c0_m * ((math.sqrt(-A) / math.sqrt(-V)) * math.pow(l, -0.5)) elif ((V * l) <= 0.0) or not ((V * l) <= 1e+275): tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V)))) else: tmp = c0_m / (math.sqrt((V * l)) / math.sqrt(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) tmp = 0.0 if (Float64(V * l) <= -1e-320) tmp = Float64(c0_m * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * (l ^ -0.5))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+275)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V)))); else tmp = Float64(c0_m / Float64(sqrt(Float64(V * l)) / sqrt(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)
tmp = 0.0;
if ((V * l) <= -1e-320)
tmp = c0_m * ((sqrt(-A) / sqrt(-V)) * (l ^ -0.5));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+275)))
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
else
tmp = c0_m / (sqrt((V * l)) / sqrt(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_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -1e-320], N[(c0$95$m * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+275]], $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[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $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 -1 \cdot 10^{-320}:\\
\;\;\;\;c0\_m \cdot \left(\frac{\sqrt{-A}}{\sqrt{-V}} \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+275}\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99989e-321Initial program 77.4%
associate-/r*70.9%
clear-num69.5%
sqrt-div69.5%
metadata-eval69.5%
clear-num69.5%
associate-/r*76.9%
clear-num76.9%
associate-/l*73.8%
Applied egg-rr73.8%
/-rgt-identity73.8%
clear-num73.8%
metadata-eval73.8%
sqrt-div73.7%
associate-*r/76.8%
clear-num77.4%
Applied egg-rr77.4%
remove-double-div77.4%
associate-/r*70.9%
frac-2neg70.9%
distribute-frac-neg270.9%
sqrt-undiv43.7%
div-inv43.7%
add-sqr-sqrt0.0%
sqrt-unprod5.4%
sqr-neg5.4%
sqrt-unprod3.2%
add-sqr-sqrt3.2%
pow1/23.2%
pow-flip3.2%
add-sqr-sqrt3.2%
sqrt-unprod27.4%
sqr-neg27.4%
sqrt-unprod38.2%
add-sqr-sqrt38.2%
metadata-eval38.2%
Applied egg-rr38.2%
frac-2neg38.2%
sqrt-div49.1%
Applied egg-rr49.1%
if -9.99989e-321 < (*.f64 V l) < -0.0 or 9.9999999999999996e274 < (*.f64 V l) Initial program 37.1%
add-sqr-sqrt26.4%
sqrt-unprod26.7%
*-commutative26.7%
*-commutative26.7%
swap-sqr25.9%
add-sqr-sqrt25.9%
pow225.9%
Applied egg-rr25.9%
associate-*l/25.8%
*-commutative25.8%
times-frac31.0%
Simplified31.0%
div-inv31.0%
unpow231.0%
associate-*l*36.7%
Applied egg-rr36.7%
Taylor expanded in c0 around 0 36.7%
if -0.0 < (*.f64 V l) < 9.9999999999999996e274Initial program 88.5%
associate-/r*78.1%
div-inv78.0%
div-inv78.0%
associate-*l*88.4%
Applied egg-rr88.4%
frac-times88.5%
metadata-eval88.5%
div-inv88.5%
clear-num87.0%
associate-*r/77.8%
sqrt-div77.7%
metadata-eval77.7%
un-div-inv77.6%
associate-*r/87.8%
Applied egg-rr87.8%
associate-/l*77.6%
Simplified77.6%
associate-*r/87.8%
sqrt-div99.4%
Applied egg-rr99.4%
Final simplification64.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 (or (<= t_0 0.0) (not (<= t_0 2e+276)))
(* 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 <= 2e+276)) {
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 <= 2d+276))) 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 <= 2e+276)) {
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 <= 2e+276): 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 <= 2e+276)) 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 <= 2e+276)))
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, 2e+276]], $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 2 \cdot 10^{+276}\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 2.0000000000000001e276 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 61.9%
*-commutative61.9%
associate-/l/66.4%
Simplified66.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e276Initial program 99.5%
Final simplification76.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 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+263) t_0 (* c0_m (sqrt (/ (/ A l) V))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 1e+263) {
tmp = t_0;
} else {
tmp = c0_m * sqrt(((A / l) / V));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 1d+263) then
tmp = t_0
else
tmp = c0_m * sqrt(((a / l) / v))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+263) {
tmp = t_0;
} else {
tmp = c0_m * Math.sqrt(((A / l) / V));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 1e+263: tmp = t_0 else: tmp = c0_m * math.sqrt(((A / l) / V)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+263) tmp = t_0; else tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 1e+263)
tmp = t_0;
else
tmp = c0_m * sqrt(((A / l) / V));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+263], t$95$0, N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+263}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 63.3%
*-commutative63.3%
associate-/l/66.3%
Simplified66.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000002e263Initial program 99.5%
if 1.00000000000000002e263 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 57.8%
Taylor expanded in c0 around 0 57.8%
*-commutative57.8%
associate-/r*68.9%
Simplified68.9%
Final simplification76.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
(*
c0_s
(if (<= V -5e-310)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(/ (/ (* c0_m (sqrt A)) (sqrt V)) (sqrt l)))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else {
tmp = ((c0_m * sqrt(A)) / sqrt(V)) / sqrt(l);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-5d-310)) then
tmp = c0_m * (sqrt((a / -l)) / sqrt(-v))
else
tmp = ((c0_m * sqrt(a)) / sqrt(v)) / sqrt(l)
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else {
tmp = ((c0_m * Math.sqrt(A)) / Math.sqrt(V)) / Math.sqrt(l);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if V <= -5e-310: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) else: tmp = ((c0_m * math.sqrt(A)) / math.sqrt(V)) / math.sqrt(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 (V <= -5e-310) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); else tmp = Float64(Float64(Float64(c0_m * sqrt(A)) / sqrt(V)) / sqrt(l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if (V <= -5e-310)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
else
tmp = ((c0_m * sqrt(A)) / sqrt(V)) / sqrt(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[V, -5e-310], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c0$95$m * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $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 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m \cdot \sqrt{A}}{\sqrt{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if V < -4.999999999999985e-310Initial program 71.9%
associate-/r*70.4%
div-inv70.3%
div-inv70.3%
associate-*l*72.2%
Applied egg-rr72.2%
frac-times71.9%
metadata-eval71.9%
div-inv71.9%
associate-/l/72.7%
frac-2neg72.7%
sqrt-div89.6%
distribute-neg-frac289.6%
Applied egg-rr89.6%
distribute-frac-neg289.6%
distribute-frac-neg89.6%
Simplified89.6%
if -4.999999999999985e-310 < V Initial program 74.5%
associate-/r*72.5%
div-inv72.4%
div-inv72.4%
associate-*l*75.3%
Applied egg-rr75.3%
sqrt-prod43.9%
associate-*r*42.4%
*-commutative42.4%
frac-times41.1%
metadata-eval41.1%
sqrt-div41.1%
metadata-eval41.1%
div-inv41.1%
sqrt-prod47.8%
associate-/r*47.5%
*-commutative47.5%
Applied egg-rr47.5%
Final simplification68.7%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -5e+291)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -1e-320)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+275)))
(sqrt (* (/ A l) (* c0_m (/ c0_m V))))
(/ c0_m (/ (sqrt (* V l)) (sqrt 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 tmp;
if ((V * l) <= -5e+291) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -1e-320) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+275)) {
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
} else {
tmp = c0_m / (sqrt((V * l)) / sqrt(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) :: tmp
if ((v * l) <= (-5d+291)) then
tmp = c0_m * (sqrt((a / -l)) / sqrt(-v))
else if ((v * l) <= (-1d-320)) then
tmp = c0_m * (sqrt(-a) / sqrt((v * -l)))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 1d+275))) then
tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
else
tmp = c0_m / (sqrt((v * l)) / sqrt(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 tmp;
if ((V * l) <= -5e+291) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -1e-320) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+275)) {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
} else {
tmp = c0_m / (Math.sqrt((V * l)) / Math.sqrt(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): tmp = 0 if (V * l) <= -5e+291: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -1e-320: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif ((V * l) <= 0.0) or not ((V * l) <= 1e+275): tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V)))) else: tmp = c0_m / (math.sqrt((V * l)) / math.sqrt(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) tmp = 0.0 if (Float64(V * l) <= -5e+291) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -1e-320) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+275)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V)))); else tmp = Float64(c0_m / Float64(sqrt(Float64(V * l)) / sqrt(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)
tmp = 0.0;
if ((V * l) <= -5e+291)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -1e-320)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+275)))
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
else
tmp = c0_m / (sqrt((V * l)) / sqrt(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_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e+291], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-320], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+275]], $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[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $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^{+291}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-320}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+275}\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000001e291Initial program 38.4%
associate-/r*65.3%
div-inv65.2%
div-inv65.2%
associate-*l*38.6%
Applied egg-rr38.6%
frac-times38.4%
metadata-eval38.4%
div-inv38.4%
associate-/l/65.1%
frac-2neg65.1%
sqrt-div49.8%
distribute-neg-frac249.8%
Applied egg-rr49.8%
distribute-frac-neg249.8%
distribute-frac-neg49.8%
Simplified49.8%
if -5.0000000000000001e291 < (*.f64 V l) < -9.99989e-321Initial program 83.0%
frac-2neg83.0%
sqrt-div98.8%
*-commutative98.8%
distribute-rgt-neg-in98.8%
Applied egg-rr98.8%
if -9.99989e-321 < (*.f64 V l) < -0.0 or 9.9999999999999996e274 < (*.f64 V l) Initial program 37.1%
add-sqr-sqrt26.4%
sqrt-unprod26.7%
*-commutative26.7%
*-commutative26.7%
swap-sqr25.9%
add-sqr-sqrt25.9%
pow225.9%
Applied egg-rr25.9%
associate-*l/25.8%
*-commutative25.8%
times-frac31.0%
Simplified31.0%
div-inv31.0%
unpow231.0%
associate-*l*36.7%
Applied egg-rr36.7%
Taylor expanded in c0 around 0 36.7%
if -0.0 < (*.f64 V l) < 9.9999999999999996e274Initial program 88.5%
associate-/r*78.1%
div-inv78.0%
div-inv78.0%
associate-*l*88.4%
Applied egg-rr88.4%
frac-times88.5%
metadata-eval88.5%
div-inv88.5%
clear-num87.0%
associate-*r/77.8%
sqrt-div77.7%
metadata-eval77.7%
un-div-inv77.6%
associate-*r/87.8%
Applied egg-rr87.8%
associate-/l*77.6%
Simplified77.6%
associate-*r/87.8%
sqrt-div99.4%
Applied egg-rr99.4%
Final simplification83.7%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* (sqrt (/ A V)) (/ c0_m (sqrt l)))
(if (<= (* V l) -1e-320)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+275)))
(sqrt (* (/ A l) (* c0_m (/ c0_m V))))
(/ c0_m (/ (sqrt (* V l)) (sqrt 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 tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = sqrt((A / V)) * (c0_m / sqrt(l));
} else if ((V * l) <= -1e-320) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+275)) {
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
} else {
tmp = c0_m / (sqrt((V * l)) / sqrt(A));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((A / V)) * (c0_m / Math.sqrt(l));
} else if ((V * l) <= -1e-320) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+275)) {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
} else {
tmp = c0_m / (Math.sqrt((V * l)) / Math.sqrt(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): tmp = 0 if (V * l) <= -math.inf: tmp = math.sqrt((A / V)) * (c0_m / math.sqrt(l)) elif (V * l) <= -1e-320: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif ((V * l) <= 0.0) or not ((V * l) <= 1e+275): tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V)))) else: tmp = c0_m / (math.sqrt((V * l)) / math.sqrt(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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0_m / sqrt(l))); elseif (Float64(V * l) <= -1e-320) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+275)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V)))); else tmp = Float64(c0_m / Float64(sqrt(Float64(V * l)) / sqrt(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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = sqrt((A / V)) * (c0_m / sqrt(l));
elseif ((V * l) <= -1e-320)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+275)))
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
else
tmp = c0_m / (sqrt((V * l)) / sqrt(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_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-320], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+275]], $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[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $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:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0\_m}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-320}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+275}\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 21.9%
associate-/r*56.0%
sqrt-div36.3%
associate-*r/36.4%
Applied egg-rr36.4%
*-commutative36.4%
associate-/l*36.7%
Simplified36.7%
if -inf.0 < (*.f64 V l) < -9.99989e-321Initial program 83.4%
frac-2neg83.4%
sqrt-div98.8%
*-commutative98.8%
distribute-rgt-neg-in98.8%
Applied egg-rr98.8%
if -9.99989e-321 < (*.f64 V l) < -0.0 or 9.9999999999999996e274 < (*.f64 V l) Initial program 37.1%
add-sqr-sqrt26.4%
sqrt-unprod26.7%
*-commutative26.7%
*-commutative26.7%
swap-sqr25.9%
add-sqr-sqrt25.9%
pow225.9%
Applied egg-rr25.9%
associate-*l/25.8%
*-commutative25.8%
times-frac31.0%
Simplified31.0%
div-inv31.0%
unpow231.0%
associate-*l*36.7%
Applied egg-rr36.7%
Taylor expanded in c0 around 0 36.7%
if -0.0 < (*.f64 V l) < 9.9999999999999996e274Initial program 88.5%
associate-/r*78.1%
div-inv78.0%
div-inv78.0%
associate-*l*88.4%
Applied egg-rr88.4%
frac-times88.5%
metadata-eval88.5%
div-inv88.5%
clear-num87.0%
associate-*r/77.8%
sqrt-div77.7%
metadata-eval77.7%
un-div-inv77.6%
associate-*r/87.8%
Applied egg-rr87.8%
associate-/l*77.6%
Simplified77.6%
associate-*r/87.8%
sqrt-div99.4%
Applied egg-rr99.4%
Final simplification83.7%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 1e-315)
(* c0_m (* (pow l -0.5) (sqrt (/ A V))))
(if (<= t_0 1e+298)
(* c0_m (sqrt t_0))
(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 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = c0_m * (pow(l, -0.5) * sqrt((A / V)));
} else if (t_0 <= 1e+298) {
tmp = c0_m * sqrt(t_0);
} 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 = a / (v * l)
if (t_0 <= 1d-315) then
tmp = c0_m * ((l ** (-0.5d0)) * sqrt((a / v)))
else if (t_0 <= 1d+298) then
tmp = c0_m * sqrt(t_0)
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 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = c0_m * (Math.pow(l, -0.5) * Math.sqrt((A / V)));
} else if (t_0 <= 1e+298) {
tmp = c0_m * Math.sqrt(t_0);
} 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 = A / (V * l) tmp = 0 if t_0 <= 1e-315: tmp = c0_m * (math.pow(l, -0.5) * math.sqrt((A / V))) elif t_0 <= 1e+298: tmp = c0_m * math.sqrt(t_0) 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-315) tmp = Float64(c0_m * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); elseif (t_0 <= 1e+298) tmp = Float64(c0_m * sqrt(t_0)); 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-315)
tmp = c0_m * ((l ^ -0.5) * sqrt((A / V)));
elseif (t_0 <= 1e+298)
tmp = c0_m * sqrt(t_0);
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-315], N[(c0$95$m * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+298], N[(c0$95$m * N[Sqrt[t$95$0], $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{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-315}:\\
\;\;\;\;c0\_m \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;t\_0 \leq 10^{+298}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.999999985e-316Initial program 34.1%
associate-/r*49.6%
clear-num46.7%
sqrt-div46.6%
metadata-eval46.6%
clear-num46.6%
associate-/r*32.0%
clear-num32.0%
associate-/l*46.6%
Applied egg-rr46.6%
/-rgt-identity46.6%
clear-num46.6%
metadata-eval46.6%
sqrt-div46.6%
associate-*r/32.0%
clear-num34.1%
Applied egg-rr34.1%
remove-double-div34.1%
associate-/r*49.6%
frac-2neg49.6%
distribute-frac-neg249.6%
sqrt-undiv34.8%
div-inv34.9%
add-sqr-sqrt13.5%
sqrt-unprod16.3%
sqr-neg16.3%
sqrt-unprod6.1%
add-sqr-sqrt12.0%
pow1/212.0%
pow-flip12.0%
add-sqr-sqrt12.0%
sqrt-unprod34.3%
sqr-neg34.3%
sqrt-unprod40.8%
add-sqr-sqrt40.8%
metadata-eval40.8%
Applied egg-rr40.8%
if 9.999999985e-316 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e297Initial program 99.5%
if 9.9999999999999996e297 < (/.f64 A (*.f64 V l)) Initial program 35.4%
add-sqr-sqrt22.5%
sqrt-unprod22.7%
*-commutative22.7%
*-commutative22.7%
swap-sqr22.1%
add-sqr-sqrt22.1%
pow222.1%
Applied egg-rr22.1%
associate-*l/24.8%
*-commutative24.8%
times-frac28.5%
Simplified28.5%
div-inv28.5%
unpow228.5%
associate-*l*34.0%
Applied egg-rr34.0%
Taylor expanded in c0 around 0 34.0%
Final simplification74.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 (/ A (* V l))))
(*
c0_s
(if (<= t_0 1e-315)
(* (sqrt (/ A V)) (/ c0_m (sqrt l)))
(if (<= t_0 1e+298)
(* c0_m (sqrt t_0))
(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 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = sqrt((A / V)) * (c0_m / sqrt(l));
} else if (t_0 <= 1e+298) {
tmp = c0_m * sqrt(t_0);
} 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 = a / (v * l)
if (t_0 <= 1d-315) then
tmp = sqrt((a / v)) * (c0_m / sqrt(l))
else if (t_0 <= 1d+298) then
tmp = c0_m * sqrt(t_0)
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 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = Math.sqrt((A / V)) * (c0_m / Math.sqrt(l));
} else if (t_0 <= 1e+298) {
tmp = c0_m * Math.sqrt(t_0);
} 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 = A / (V * l) tmp = 0 if t_0 <= 1e-315: tmp = math.sqrt((A / V)) * (c0_m / math.sqrt(l)) elif t_0 <= 1e+298: tmp = c0_m * math.sqrt(t_0) 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-315) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0_m / sqrt(l))); elseif (t_0 <= 1e+298) tmp = Float64(c0_m * sqrt(t_0)); 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-315)
tmp = sqrt((A / V)) * (c0_m / sqrt(l));
elseif (t_0 <= 1e+298)
tmp = c0_m * sqrt(t_0);
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-315], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+298], N[(c0$95$m * N[Sqrt[t$95$0], $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{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-315}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0\_m}{\sqrt{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+298}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.999999985e-316Initial program 34.1%
associate-/r*49.6%
sqrt-div40.8%
associate-*r/40.8%
Applied egg-rr40.8%
*-commutative40.8%
associate-/l*40.9%
Simplified40.9%
if 9.999999985e-316 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e297Initial program 99.5%
if 9.9999999999999996e297 < (/.f64 A (*.f64 V l)) Initial program 35.4%
add-sqr-sqrt22.5%
sqrt-unprod22.7%
*-commutative22.7%
*-commutative22.7%
swap-sqr22.1%
add-sqr-sqrt22.1%
pow222.1%
Applied egg-rr22.1%
associate-*l/24.8%
*-commutative24.8%
times-frac28.5%
Simplified28.5%
div-inv28.5%
unpow228.5%
associate-*l*34.0%
Applied egg-rr34.0%
Taylor expanded in c0 around 0 34.0%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 1e-315)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= t_0 1e+298)
(* c0_m (sqrt t_0))
(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 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if (t_0 <= 1e+298) {
tmp = c0_m * sqrt(t_0);
} 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 = a / (v * l)
if (t_0 <= 1d-315) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if (t_0 <= 1d+298) then
tmp = c0_m * sqrt(t_0)
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 = A / (V * l);
double tmp;
if (t_0 <= 1e-315) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (t_0 <= 1e+298) {
tmp = c0_m * Math.sqrt(t_0);
} 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 = A / (V * l) tmp = 0 if t_0 <= 1e-315: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif t_0 <= 1e+298: tmp = c0_m * math.sqrt(t_0) 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-315) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (t_0 <= 1e+298) tmp = Float64(c0_m * sqrt(t_0)); 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-315)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif (t_0 <= 1e+298)
tmp = c0_m * sqrt(t_0);
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-315], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+298], N[(c0$95$m * N[Sqrt[t$95$0], $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{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-315}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+298}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.999999985e-316Initial program 34.1%
associate-/r*49.6%
sqrt-div40.8%
associate-*r/40.8%
Applied egg-rr40.8%
associate-/l*40.8%
Simplified40.8%
if 9.999999985e-316 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e297Initial program 99.5%
if 9.9999999999999996e297 < (/.f64 A (*.f64 V l)) Initial program 35.4%
add-sqr-sqrt22.5%
sqrt-unprod22.7%
*-commutative22.7%
*-commutative22.7%
swap-sqr22.1%
add-sqr-sqrt22.1%
pow222.1%
Applied egg-rr22.1%
associate-*l/24.8%
*-commutative24.8%
times-frac28.5%
Simplified28.5%
div-inv28.5%
unpow228.5%
associate-*l*34.0%
Applied egg-rr34.0%
Taylor expanded in c0 around 0 34.0%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 1e+298)))
(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 <= 1e+298)) {
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 <= 1d+298))) 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 <= 1e+298)) {
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 <= 1e+298): 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 <= 1e+298)) 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 <= 1e+298)))
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, 1e+298]], $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 10^{+298}\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 9.9999999999999996e297 < (/.f64 A (*.f64 V l)) Initial program 33.6%
add-sqr-sqrt26.9%
sqrt-unprod27.0%
*-commutative27.0%
*-commutative27.0%
swap-sqr26.2%
add-sqr-sqrt26.3%
pow226.3%
Applied egg-rr26.3%
associate-*l/29.6%
*-commutative29.6%
times-frac31.9%
Simplified31.9%
div-inv31.9%
unpow231.9%
associate-*l*36.8%
Applied egg-rr36.8%
Taylor expanded in c0 around 0 36.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e297Initial program 99.0%
Final simplification74.4%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 0.0)
(/ c0_m (pow (/ (/ A V) l) -0.5))
(if (<= t_0 1e+298)
(* c0_m (sqrt t_0))
(/ c0_m (sqrt (* l (/ V A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m / pow(((A / V) / l), -0.5);
} else if (t_0 <= 1e+298) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = c0_m / sqrt((l * (V / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0_m / (((a / v) / l) ** (-0.5d0))
else if (t_0 <= 1d+298) then
tmp = c0_m * sqrt(t_0)
else
tmp = c0_m / sqrt((l * (v / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m / Math.pow(((A / V) / l), -0.5);
} else if (t_0 <= 1e+298) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = c0_m / Math.sqrt((l * (V / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0_m / math.pow(((A / V) / l), -0.5) elif t_0 <= 1e+298: tmp = c0_m * math.sqrt(t_0) else: tmp = c0_m / math.sqrt((l * (V / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m / (Float64(Float64(A / V) / l) ^ -0.5)); elseif (t_0 <= 1e+298) tmp = Float64(c0_m * sqrt(t_0)); else tmp = Float64(c0_m / sqrt(Float64(l * Float64(V / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m / (((A / V) / l) ^ -0.5);
elseif (t_0 <= 1e+298)
tmp = c0_m * sqrt(t_0);
else
tmp = c0_m / sqrt((l * (V / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+298], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{c0\_m}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\mathbf{elif}\;t\_0 \leq 10^{+298}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 31.7%
associate-/r*49.1%
clear-num47.3%
sqrt-div47.2%
metadata-eval47.2%
clear-num47.2%
associate-/r*31.7%
clear-num31.7%
associate-/l*47.2%
Applied egg-rr47.2%
/-rgt-identity47.2%
clear-num47.2%
metadata-eval47.2%
sqrt-div47.2%
associate-*r/31.7%
clear-num31.7%
Applied egg-rr31.7%
pow1/231.7%
pow-flip31.7%
metadata-eval31.7%
Applied egg-rr31.7%
associate-/r*49.1%
Simplified49.1%
un-div-inv49.2%
sqr-pow49.1%
associate-/r*49.1%
associate-/r*31.7%
metadata-eval31.7%
associate-/r*31.7%
metadata-eval31.7%
Applied egg-rr31.7%
associate-/l/31.7%
pow-sqr31.7%
metadata-eval31.7%
associate-/r*49.2%
Simplified49.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e297Initial program 99.0%
if 9.9999999999999996e297 < (/.f64 A (*.f64 V l)) Initial program 35.4%
associate-/r*50.1%
clear-num50.1%
sqrt-div51.5%
metadata-eval51.5%
clear-num50.0%
associate-/r*35.4%
clear-num36.8%
associate-/l*50.0%
Applied egg-rr50.0%
/-rgt-identity50.0%
clear-num50.0%
metadata-eval50.0%
sqrt-div50.0%
associate-*r/35.4%
clear-num35.4%
Applied egg-rr35.4%
pow1/235.4%
pow-flip35.4%
metadata-eval35.4%
Applied egg-rr35.4%
associate-/r*50.0%
Simplified50.0%
un-div-inv50.0%
add-sqr-sqrt49.9%
sqrt-unprod50.0%
pow-prod-up50.0%
metadata-eval50.0%
inv-pow50.0%
clear-num51.5%
div-inv51.5%
clear-num51.5%
Applied egg-rr51.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 (/ A (* V l))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+298)
(* c0_m (sqrt t_0))
(/ c0_m (sqrt (* l (/ V A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 1e+298) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = c0_m / sqrt((l * (V / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 1d+298) then
tmp = c0_m * sqrt(t_0)
else
tmp = c0_m / sqrt((l * (v / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+298) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = c0_m / Math.sqrt((l * (V / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 1e+298: tmp = c0_m * math.sqrt(t_0) else: tmp = c0_m / math.sqrt((l * (V / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+298) tmp = Float64(c0_m * sqrt(t_0)); else tmp = Float64(c0_m / sqrt(Float64(l * Float64(V / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 1e+298)
tmp = c0_m * sqrt(t_0);
else
tmp = c0_m / sqrt((l * (V / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+298], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+298}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 31.7%
*-commutative31.7%
associate-/l/49.1%
Simplified49.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e297Initial program 99.0%
if 9.9999999999999996e297 < (/.f64 A (*.f64 V l)) Initial program 35.4%
associate-/r*50.1%
clear-num50.1%
sqrt-div51.5%
metadata-eval51.5%
clear-num50.0%
associate-/r*35.4%
clear-num36.8%
associate-/l*50.0%
Applied egg-rr50.0%
/-rgt-identity50.0%
clear-num50.0%
metadata-eval50.0%
sqrt-div50.0%
associate-*r/35.4%
clear-num35.4%
Applied egg-rr35.4%
pow1/235.4%
pow-flip35.4%
metadata-eval35.4%
Applied egg-rr35.4%
associate-/r*50.0%
Simplified50.0%
un-div-inv50.0%
add-sqr-sqrt49.9%
sqrt-unprod50.0%
pow-prod-up50.0%
metadata-eval50.0%
inv-pow50.0%
clear-num51.5%
div-inv51.5%
clear-num51.5%
Applied egg-rr51.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 (* 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.2%
herbie shell --seed 2024167
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))