
(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 15 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))))
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* (/ c0_m (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -1e-295)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-319)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) 5e+293)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* (/ t_0 l) (/ t_0 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);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -1e-295) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-319) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= 5e+293) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((t_0 / l) * (t_0 / 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);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -1e-295) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-319) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= 5e+293) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((t_0 / l) * (t_0 / 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) tmp = 0 if (V * l) <= -math.inf: tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -1e-295: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-319: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= 5e+293: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((t_0 / l) * (t_0 / 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(A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -1e-295) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-319) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= 5e+293) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(t_0 / l) * Float64(t_0 / 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);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -1e-295)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-319)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= 5e+293)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((t_0 / l) * (t_0 / 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[A], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-295], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+293], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(t$95$0 / l), $MachinePrecision] * N[(t$95$0 / 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{A}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+293}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{t\_0}{\ell} \cdot \frac{t\_0}{V}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 25.7%
add-sqr-sqrt25.7%
sqrt-unprod25.7%
*-commutative25.7%
*-commutative25.7%
swap-sqr24.8%
add-sqr-sqrt24.8%
pow224.8%
Applied egg-rr24.8%
associate-/r*24.7%
Simplified24.7%
sqrt-prod31.4%
sqrt-undiv7.3%
sqrt-undiv31.4%
associate-/l/24.8%
frac-2neg24.8%
distribute-rgt-neg-out24.8%
sqrt-undiv24.8%
sqrt-pow125.7%
metadata-eval25.7%
pow125.7%
associate-*l/25.7%
*-commutative25.7%
sqrt-prod21.2%
times-frac21.3%
sqrt-div14.8%
frac-2neg14.8%
Applied egg-rr14.8%
if -inf.0 < (*.f64 V l) < -1.00000000000000006e-295Initial program 89.0%
frac-2neg89.0%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -1.00000000000000006e-295 < (*.f64 V l) < 4.9999937e-319Initial program 32.7%
clear-num32.7%
associate-/r/30.9%
associate-/r*30.9%
Applied egg-rr30.9%
associate-*l/59.5%
associate-*r/59.4%
associate-*l/59.5%
*-un-lft-identity59.5%
Applied egg-rr59.5%
frac-2neg59.5%
sqrt-div42.5%
distribute-neg-frac242.5%
Applied egg-rr42.5%
if 4.9999937e-319 < (*.f64 V l) < 5.00000000000000033e293Initial program 87.5%
sqrt-div99.4%
div-inv99.4%
Applied egg-rr99.4%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 5.00000000000000033e293 < (*.f64 V l) Initial program 20.2%
add-sqr-sqrt20.2%
sqrt-unprod20.2%
*-commutative20.2%
*-commutative20.2%
swap-sqr19.2%
add-sqr-sqrt19.2%
pow219.2%
Applied egg-rr19.2%
associate-/r*19.1%
Simplified19.1%
*-commutative19.1%
associate-/l/19.2%
associate-*r/18.9%
*-commutative18.9%
Applied egg-rr18.9%
add-sqr-sqrt18.9%
*-commutative18.9%
times-frac25.9%
sqrt-prod25.9%
sqrt-pow125.5%
metadata-eval25.5%
pow125.5%
sqrt-prod31.7%
sqrt-pow145.3%
metadata-eval45.3%
pow145.3%
Applied egg-rr45.3%
Final simplification84.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 l) (- INFINITY))
(* (/ c0_m (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -1e-295)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-319)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) 2e+234)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(* c0_m (/ (sqrt A) (* (sqrt l) (sqrt 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(l)) * sqrt((A / V));
} else if ((V * l) <= -1e-295) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-319) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= 2e+234) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0_m * (sqrt(A) / (sqrt(l) * sqrt(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(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -1e-295) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-319) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= 2e+234) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0_m * (Math.sqrt(A) / (Math.sqrt(l) * Math.sqrt(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(l)) * math.sqrt((A / V)) elif (V * l) <= -1e-295: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-319: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= 2e+234: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0_m * (math.sqrt(A) / (math.sqrt(l) * math.sqrt(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(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -1e-295) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-319) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= 2e+234) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0_m * Float64(sqrt(A) / Float64(sqrt(l) * sqrt(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(l)) * sqrt((A / V));
elseif ((V * l) <= -1e-295)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-319)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= 2e+234)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = c0_m * (sqrt(A) / (sqrt(l) * sqrt(V)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-295], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+234], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[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{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+234}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 25.7%
add-sqr-sqrt25.7%
sqrt-unprod25.7%
*-commutative25.7%
*-commutative25.7%
swap-sqr24.8%
add-sqr-sqrt24.8%
pow224.8%
Applied egg-rr24.8%
associate-/r*24.7%
Simplified24.7%
sqrt-prod31.4%
sqrt-undiv7.3%
sqrt-undiv31.4%
associate-/l/24.8%
frac-2neg24.8%
distribute-rgt-neg-out24.8%
sqrt-undiv24.8%
sqrt-pow125.7%
metadata-eval25.7%
pow125.7%
associate-*l/25.7%
*-commutative25.7%
sqrt-prod21.2%
times-frac21.3%
sqrt-div14.8%
frac-2neg14.8%
Applied egg-rr14.8%
if -inf.0 < (*.f64 V l) < -1.00000000000000006e-295Initial program 89.0%
frac-2neg89.0%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -1.00000000000000006e-295 < (*.f64 V l) < 4.9999937e-319Initial program 32.7%
clear-num32.7%
associate-/r/30.9%
associate-/r*30.9%
Applied egg-rr30.9%
associate-*l/59.5%
associate-*r/59.4%
associate-*l/59.5%
*-un-lft-identity59.5%
Applied egg-rr59.5%
frac-2neg59.5%
sqrt-div42.5%
distribute-neg-frac242.5%
Applied egg-rr42.5%
if 4.9999937e-319 < (*.f64 V l) < 2.00000000000000004e234Initial program 88.3%
sqrt-div99.4%
div-inv99.4%
Applied egg-rr99.4%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 2.00000000000000004e234 < (*.f64 V l) Initial program 23.8%
clear-num23.8%
associate-/r/23.8%
associate-/r*27.1%
Applied egg-rr27.1%
*-commutative27.1%
associate-/l/23.8%
div-inv23.8%
frac-2neg23.8%
distribute-rgt-neg-out23.8%
sqrt-undiv0.0%
associate-*r/0.0%
sqrt-prod0.0%
associate-/r*0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod19.8%
sqr-neg19.8%
sqrt-unprod58.3%
add-sqr-sqrt58.3%
Applied egg-rr58.3%
associate-/l/58.5%
associate-/l*58.6%
*-commutative58.6%
Simplified58.6%
Final simplification84.8%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (sqrt (- V))) (t_1 (* c0_m (sqrt A))))
(*
c0_s
(if (<= (* V l) -1e-295)
(* c0_m (/ (/ 1.0 (/ t_0 (sqrt (- A)))) (sqrt l)))
(if (<= (* V l) 5e-319)
(* c0_m (/ (sqrt (/ A (- l))) t_0))
(if (<= (* V l) 5e+293)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* (/ t_1 l) (/ t_1 V)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = sqrt(-V);
double t_1 = c0_m * sqrt(A);
double tmp;
if ((V * l) <= -1e-295) {
tmp = c0_m * ((1.0 / (t_0 / sqrt(-A))) / sqrt(l));
} else if ((V * l) <= 5e-319) {
tmp = c0_m * (sqrt((A / -l)) / t_0);
} else if ((V * l) <= 5e+293) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((t_1 / l) * (t_1 / 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) :: t_1
real(8) :: tmp
t_0 = sqrt(-v)
t_1 = c0_m * sqrt(a)
if ((v * l) <= (-1d-295)) then
tmp = c0_m * ((1.0d0 / (t_0 / sqrt(-a))) / sqrt(l))
else if ((v * l) <= 5d-319) then
tmp = c0_m * (sqrt((a / -l)) / t_0)
else if ((v * l) <= 5d+293) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt(((t_1 / l) * (t_1 / v)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = Math.sqrt(-V);
double t_1 = c0_m * Math.sqrt(A);
double tmp;
if ((V * l) <= -1e-295) {
tmp = c0_m * ((1.0 / (t_0 / Math.sqrt(-A))) / Math.sqrt(l));
} else if ((V * l) <= 5e-319) {
tmp = c0_m * (Math.sqrt((A / -l)) / t_0);
} else if ((V * l) <= 5e+293) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((t_1 / l) * (t_1 / V)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = math.sqrt(-V) t_1 = c0_m * math.sqrt(A) tmp = 0 if (V * l) <= -1e-295: tmp = c0_m * ((1.0 / (t_0 / math.sqrt(-A))) / math.sqrt(l)) elif (V * l) <= 5e-319: tmp = c0_m * (math.sqrt((A / -l)) / t_0) elif (V * l) <= 5e+293: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((t_1 / l) * (t_1 / V))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = sqrt(Float64(-V)) t_1 = Float64(c0_m * sqrt(A)) tmp = 0.0 if (Float64(V * l) <= -1e-295) tmp = Float64(c0_m * Float64(Float64(1.0 / Float64(t_0 / sqrt(Float64(-A)))) / sqrt(l))); elseif (Float64(V * l) <= 5e-319) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / t_0)); elseif (Float64(V * l) <= 5e+293) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(t_1 / l) * Float64(t_1 / V))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = sqrt(-V);
t_1 = c0_m * sqrt(A);
tmp = 0.0;
if ((V * l) <= -1e-295)
tmp = c0_m * ((1.0 / (t_0 / sqrt(-A))) / sqrt(l));
elseif ((V * l) <= 5e-319)
tmp = c0_m * (sqrt((A / -l)) / t_0);
elseif ((V * l) <= 5e+293)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((t_1 / l) * (t_1 / V)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[(-V)], $MachinePrecision]}, Block[{t$95$1 = N[(c0$95$m * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -1e-295], N[(c0$95$m * N[(N[(1.0 / N[(t$95$0 / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+293], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(t$95$1 / l), $MachinePrecision] * N[(t$95$1 / 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 := \sqrt{-V}\\
t_1 := c0\_m \cdot \sqrt{A}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\
\;\;\;\;c0\_m \cdot \frac{\frac{1}{\frac{t\_0}{\sqrt{-A}}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{t\_0}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+293}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{t\_1}{\ell} \cdot \frac{t\_1}{V}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000006e-295Initial program 81.0%
associate-/r*74.9%
sqrt-div35.1%
div-inv35.1%
Applied egg-rr35.1%
associate-*r/35.1%
*-rgt-identity35.1%
Simplified35.1%
clear-num35.2%
sqrt-div35.2%
metadata-eval35.2%
Applied egg-rr35.2%
frac-2neg35.2%
sqrt-div41.2%
Applied egg-rr41.2%
if -1.00000000000000006e-295 < (*.f64 V l) < 4.9999937e-319Initial program 32.7%
clear-num32.7%
associate-/r/30.9%
associate-/r*30.9%
Applied egg-rr30.9%
associate-*l/59.5%
associate-*r/59.4%
associate-*l/59.5%
*-un-lft-identity59.5%
Applied egg-rr59.5%
frac-2neg59.5%
sqrt-div42.5%
distribute-neg-frac242.5%
Applied egg-rr42.5%
if 4.9999937e-319 < (*.f64 V l) < 5.00000000000000033e293Initial program 87.5%
sqrt-div99.4%
div-inv99.4%
Applied egg-rr99.4%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 5.00000000000000033e293 < (*.f64 V l) Initial program 20.2%
add-sqr-sqrt20.2%
sqrt-unprod20.2%
*-commutative20.2%
*-commutative20.2%
swap-sqr19.2%
add-sqr-sqrt19.2%
pow219.2%
Applied egg-rr19.2%
associate-/r*19.1%
Simplified19.1%
*-commutative19.1%
associate-/l/19.2%
associate-*r/18.9%
*-commutative18.9%
Applied egg-rr18.9%
add-sqr-sqrt18.9%
*-commutative18.9%
times-frac25.9%
sqrt-prod25.9%
sqrt-pow125.5%
metadata-eval25.5%
pow125.5%
sqrt-prod31.7%
sqrt-pow145.3%
metadata-eval45.3%
pow145.3%
Applied egg-rr45.3%
Final simplification63.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 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+274) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 5e+274) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 5d+274) then
tmp = t_0
else
tmp = c0_m / sqrt((v * (l / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+274) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 5e+274: tmp = t_0 else: tmp = c0_m / math.sqrt((V * (l / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+274) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 5e+274)
tmp = t_0;
else
tmp = c0_m / sqrt((V * (l / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+274], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;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 70.8%
associate-/r*72.4%
Simplified72.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e274Initial program 99.3%
if 4.9999999999999998e274 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 45.2%
clear-num45.2%
associate-/r/45.2%
associate-/r*45.2%
Applied egg-rr45.2%
associate-*l/50.0%
sqrt-div37.8%
associate-*l/37.7%
*-un-lft-identity37.7%
clear-num37.9%
un-div-inv37.7%
sqrt-undiv51.2%
div-inv51.1%
clear-num51.1%
Applied egg-rr51.1%
*-commutative51.1%
associate-*l/45.2%
associate-*r/51.1%
Simplified51.1%
Final simplification75.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 (<= t_0 5e-305)
(* c0_m (sqrt (* (/ A V) (/ 1.0 l))))
(if (<= t_0 5e+274) 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 <= 5e-305) {
tmp = c0_m * sqrt(((A / V) * (1.0 / l)));
} else if (t_0 <= 5e+274) {
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 <= 5d-305) then
tmp = c0_m * sqrt(((a / v) * (1.0d0 / l)))
else if (t_0 <= 5d+274) 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 <= 5e-305) {
tmp = c0_m * Math.sqrt(((A / V) * (1.0 / l)));
} else if (t_0 <= 5e+274) {
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 <= 5e-305: tmp = c0_m * math.sqrt(((A / V) * (1.0 / l))) elif t_0 <= 5e+274: 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 <= 5e-305) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); elseif (t_0 <= 5e+274) 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 <= 5e-305)
tmp = c0_m * sqrt(((A / V) * (1.0 / l)));
elseif (t_0 <= 5e+274)
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, 5e-305], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+274], 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 5 \cdot 10^{-305}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;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)))) < 4.99999999999999985e-305Initial program 70.8%
associate-/r*72.4%
div-inv72.3%
Applied egg-rr72.3%
if 4.99999999999999985e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e274Initial program 99.3%
if 4.9999999999999998e274 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 45.2%
clear-num45.2%
associate-/r/45.2%
associate-/r*45.2%
Applied egg-rr45.2%
associate-*l/50.0%
sqrt-div37.8%
associate-*l/37.7%
*-un-lft-identity37.7%
clear-num37.9%
un-div-inv37.7%
sqrt-undiv51.2%
div-inv51.1%
clear-num51.1%
Applied egg-rr51.1%
*-commutative51.1%
associate-*l/45.2%
associate-*r/51.1%
Simplified51.1%
Final simplification75.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)) (sqrt l)))))
(*
c0_s
(if (<= (* V l) -1e+202)
t_0
(if (<= (* V l) -1e-108)
(* c0_m (sqrt (/ A (* V l))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+255)))
t_0
(* c0_m (/ (sqrt A) (sqrt (* V l))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -1e+202) {
tmp = t_0;
} else if ((V * l) <= -1e-108) {
tmp = c0_m * sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+255)) {
tmp = t_0;
} else {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-1d+202)) then
tmp = t_0
else if ((v * l) <= (-1d-108)) then
tmp = c0_m * sqrt((a / (v * l)))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 1d+255))) then
tmp = t_0
else
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -1e+202) {
tmp = t_0;
} else if ((V * l) <= -1e-108) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+255)) {
tmp = t_0;
} else {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -1e+202: tmp = t_0 elif (V * l) <= -1e-108: tmp = c0_m * math.sqrt((A / (V * l))) elif ((V * l) <= 0.0) or not ((V * l) <= 1e+255): tmp = t_0 else: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -1e+202) tmp = t_0; elseif (Float64(V * l) <= -1e-108) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+255)) tmp = t_0; else tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -1e+202)
tmp = t_0;
elseif ((V * l) <= -1e-108)
tmp = c0_m * sqrt((A / (V * l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+255)))
tmp = t_0;
else
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -1e+202], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-108], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+255]], $MachinePrecision]], t$95$0, N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+202}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+255}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -9.999999999999999e201 or -1.00000000000000004e-108 < (*.f64 V l) < -0.0 or 9.99999999999999988e254 < (*.f64 V l) Initial program 49.4%
associate-/r*63.2%
sqrt-div35.7%
div-inv35.6%
Applied egg-rr35.6%
associate-*r/35.7%
*-rgt-identity35.7%
Simplified35.7%
if -9.999999999999999e201 < (*.f64 V l) < -1.00000000000000004e-108Initial program 96.2%
if -0.0 < (*.f64 V l) < 9.99999999999999988e254Initial program 87.0%
sqrt-div98.9%
div-inv98.8%
Applied egg-rr98.8%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
Final simplification72.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 (sqrt (/ A V))))
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* (/ c0_m (sqrt l)) t_0)
(if (<= (* V l) -1e-108)
(* c0_m (sqrt (/ A (* V l))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+255)))
(* c0_m (/ t_0 (sqrt l)))
(* c0_m (/ (sqrt A) (sqrt (* V l))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0_m / sqrt(l)) * t_0;
} else if ((V * l) <= -1e-108) {
tmp = c0_m * sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+255)) {
tmp = c0_m * (t_0 / sqrt(l));
} else {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0_m / Math.sqrt(l)) * t_0;
} else if ((V * l) <= -1e-108) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+255)) {
tmp = c0_m * (t_0 / Math.sqrt(l));
} else {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -math.inf: tmp = (c0_m / math.sqrt(l)) * t_0 elif (V * l) <= -1e-108: tmp = c0_m * math.sqrt((A / (V * l))) elif ((V * l) <= 0.0) or not ((V * l) <= 1e+255): tmp = c0_m * (t_0 / math.sqrt(l)) else: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0_m / sqrt(l)) * t_0); elseif (Float64(V * l) <= -1e-108) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+255)) tmp = Float64(c0_m * Float64(t_0 / sqrt(l))); else tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0_m / sqrt(l)) * t_0;
elseif ((V * l) <= -1e-108)
tmp = c0_m * sqrt((A / (V * l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+255)))
tmp = c0_m * (t_0 / sqrt(l));
else
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-108], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+255]], $MachinePrecision]], N[(c0$95$m * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+255}\right):\\
\;\;\;\;c0\_m \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 25.7%
add-sqr-sqrt25.7%
sqrt-unprod25.7%
*-commutative25.7%
*-commutative25.7%
swap-sqr24.8%
add-sqr-sqrt24.8%
pow224.8%
Applied egg-rr24.8%
associate-/r*24.7%
Simplified24.7%
sqrt-prod31.4%
sqrt-undiv7.3%
sqrt-undiv31.4%
associate-/l/24.8%
frac-2neg24.8%
distribute-rgt-neg-out24.8%
sqrt-undiv24.8%
sqrt-pow125.7%
metadata-eval25.7%
pow125.7%
associate-*l/25.7%
*-commutative25.7%
sqrt-prod21.2%
times-frac21.3%
sqrt-div14.8%
frac-2neg14.8%
Applied egg-rr14.8%
if -inf.0 < (*.f64 V l) < -1.00000000000000004e-108Initial program 95.1%
if -1.00000000000000004e-108 < (*.f64 V l) < -0.0 or 9.99999999999999988e254 < (*.f64 V l) Initial program 49.7%
associate-/r*63.8%
sqrt-div35.4%
div-inv35.4%
Applied egg-rr35.4%
associate-*r/35.4%
*-rgt-identity35.4%
Simplified35.4%
if -0.0 < (*.f64 V l) < 9.99999999999999988e254Initial program 87.0%
sqrt-div98.9%
div-inv98.8%
Applied egg-rr98.8%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
Final simplification73.0%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* (/ c0_m (sqrt l)) t_0)
(if (<= (* V l) -1e-108)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(* c0_m (/ t_0 (sqrt l)))
(if (<= (* V l) 1e+255)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ (/ c0_m (sqrt V)) (sqrt (/ 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 = sqrt((A / V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0_m / sqrt(l)) * t_0;
} else if ((V * l) <= -1e-108) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (t_0 / sqrt(l));
} else if ((V * l) <= 1e+255) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = (c0_m / sqrt(V)) / sqrt((l / 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 t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0_m / Math.sqrt(l)) * t_0;
} else if ((V * l) <= -1e-108) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (t_0 / Math.sqrt(l));
} else if ((V * l) <= 1e+255) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = (c0_m / Math.sqrt(V)) / Math.sqrt((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 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -math.inf: tmp = (c0_m / math.sqrt(l)) * t_0 elif (V * l) <= -1e-108: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0_m * (t_0 / math.sqrt(l)) elif (V * l) <= 1e+255: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = (c0_m / math.sqrt(V)) / math.sqrt((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 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0_m / sqrt(l)) * t_0); elseif (Float64(V * l) <= -1e-108) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= 1e+255) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(Float64(c0_m / sqrt(V)) / sqrt(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 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0_m / sqrt(l)) * t_0;
elseif ((V * l) <= -1e-108)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0_m * (t_0 / sqrt(l));
elseif ((V * l) <= 1e+255)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = (c0_m / sqrt(V)) / sqrt((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[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-108], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / 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])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0\_m \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 25.7%
add-sqr-sqrt25.7%
sqrt-unprod25.7%
*-commutative25.7%
*-commutative25.7%
swap-sqr24.8%
add-sqr-sqrt24.8%
pow224.8%
Applied egg-rr24.8%
associate-/r*24.7%
Simplified24.7%
sqrt-prod31.4%
sqrt-undiv7.3%
sqrt-undiv31.4%
associate-/l/24.8%
frac-2neg24.8%
distribute-rgt-neg-out24.8%
sqrt-undiv24.8%
sqrt-pow125.7%
metadata-eval25.7%
pow125.7%
associate-*l/25.7%
*-commutative25.7%
sqrt-prod21.2%
times-frac21.3%
sqrt-div14.8%
frac-2neg14.8%
Applied egg-rr14.8%
if -inf.0 < (*.f64 V l) < -1.00000000000000004e-108Initial program 95.1%
if -1.00000000000000004e-108 < (*.f64 V l) < -0.0Initial program 55.7%
associate-/r*68.3%
sqrt-div31.9%
div-inv31.9%
Applied egg-rr31.9%
associate-*r/31.9%
*-rgt-identity31.9%
Simplified31.9%
if -0.0 < (*.f64 V l) < 9.99999999999999988e254Initial program 87.0%
sqrt-div98.9%
div-inv98.8%
Applied egg-rr98.8%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 9.99999999999999988e254 < (*.f64 V l) Initial program 25.0%
clear-num25.0%
associate-/r/25.0%
associate-/r*28.6%
Applied egg-rr28.6%
associate-*l/45.1%
sqrt-div50.1%
associate-*l/50.0%
*-un-lft-identity50.0%
clear-num50.1%
un-div-inv50.0%
sqrt-undiv40.3%
div-inv40.3%
clear-num40.3%
Applied egg-rr40.3%
*-commutative40.3%
associate-*l/25.0%
associate-*r/40.3%
Simplified40.3%
*-un-lft-identity40.3%
sqrt-prod50.2%
times-frac50.0%
Applied egg-rr50.0%
associate-*r/50.2%
associate-*l/50.1%
*-lft-identity50.1%
Simplified50.1%
Final simplification73.0%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* (/ c0_m (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -1e-108)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(* c0_m (/ (pow (/ V A) -0.5) (sqrt l)))
(if (<= (* V l) 1e+255)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ (/ c0_m (sqrt V)) (sqrt (/ 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 tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -1e-108) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (pow((V / A), -0.5) / sqrt(l));
} else if ((V * l) <= 1e+255) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = (c0_m / sqrt(V)) / sqrt((l / 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 = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -1e-108) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (Math.pow((V / A), -0.5) / Math.sqrt(l));
} else if ((V * l) <= 1e+255) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = (c0_m / Math.sqrt(V)) / Math.sqrt((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): tmp = 0 if (V * l) <= -math.inf: tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -1e-108: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0_m * (math.pow((V / A), -0.5) / math.sqrt(l)) elif (V * l) <= 1e+255: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = (c0_m / math.sqrt(V)) / math.sqrt((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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -1e-108) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m * Float64((Float64(V / A) ^ -0.5) / sqrt(l))); elseif (Float64(V * l) <= 1e+255) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(Float64(c0_m / sqrt(V)) / sqrt(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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -1e-108)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0_m * (((V / A) ^ -0.5) / sqrt(l));
elseif ((V * l) <= 1e+255)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = (c0_m / sqrt(V)) / sqrt((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_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-108], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / 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:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0\_m \cdot \frac{{\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 25.7%
add-sqr-sqrt25.7%
sqrt-unprod25.7%
*-commutative25.7%
*-commutative25.7%
swap-sqr24.8%
add-sqr-sqrt24.8%
pow224.8%
Applied egg-rr24.8%
associate-/r*24.7%
Simplified24.7%
sqrt-prod31.4%
sqrt-undiv7.3%
sqrt-undiv31.4%
associate-/l/24.8%
frac-2neg24.8%
distribute-rgt-neg-out24.8%
sqrt-undiv24.8%
sqrt-pow125.7%
metadata-eval25.7%
pow125.7%
associate-*l/25.7%
*-commutative25.7%
sqrt-prod21.2%
times-frac21.3%
sqrt-div14.8%
frac-2neg14.8%
Applied egg-rr14.8%
if -inf.0 < (*.f64 V l) < -1.00000000000000004e-108Initial program 95.1%
if -1.00000000000000004e-108 < (*.f64 V l) < -0.0Initial program 55.7%
associate-/r*68.3%
sqrt-div31.9%
div-inv31.9%
Applied egg-rr31.9%
associate-*r/31.9%
*-rgt-identity31.9%
Simplified31.9%
clear-num31.9%
sqrt-div32.3%
metadata-eval32.3%
Applied egg-rr32.3%
inv-pow32.3%
sqrt-pow232.4%
metadata-eval32.4%
Applied egg-rr32.4%
if -0.0 < (*.f64 V l) < 9.99999999999999988e254Initial program 87.0%
sqrt-div98.9%
div-inv98.8%
Applied egg-rr98.8%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 9.99999999999999988e254 < (*.f64 V l) Initial program 25.0%
clear-num25.0%
associate-/r/25.0%
associate-/r*28.6%
Applied egg-rr28.6%
associate-*l/45.1%
sqrt-div50.1%
associate-*l/50.0%
*-un-lft-identity50.0%
clear-num50.1%
un-div-inv50.0%
sqrt-undiv40.3%
div-inv40.3%
clear-num40.3%
Applied egg-rr40.3%
*-commutative40.3%
associate-*l/25.0%
associate-*r/40.3%
Simplified40.3%
*-un-lft-identity40.3%
sqrt-prod50.2%
times-frac50.0%
Applied egg-rr50.0%
associate-*r/50.2%
associate-*l/50.1%
*-lft-identity50.1%
Simplified50.1%
Final simplification73.2%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -1e+202)
(* (* c0_m (sqrt (/ A V))) (pow l -0.5))
(if (<= (* V l) -1e-108)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(* c0_m (/ (pow (/ V A) -0.5) (sqrt l)))
(if (<= (* V l) 1e+255)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ (/ c0_m (sqrt V)) (sqrt (/ 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 tmp;
if ((V * l) <= -1e+202) {
tmp = (c0_m * sqrt((A / V))) * pow(l, -0.5);
} else if ((V * l) <= -1e-108) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (pow((V / A), -0.5) / sqrt(l));
} else if ((V * l) <= 1e+255) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = (c0_m / sqrt(V)) / sqrt((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) :: tmp
if ((v * l) <= (-1d+202)) then
tmp = (c0_m * sqrt((a / v))) * (l ** (-0.5d0))
else if ((v * l) <= (-1d-108)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0_m * (((v / a) ** (-0.5d0)) / sqrt(l))
else if ((v * l) <= 1d+255) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = (c0_m / sqrt(v)) / sqrt((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 tmp;
if ((V * l) <= -1e+202) {
tmp = (c0_m * Math.sqrt((A / V))) * Math.pow(l, -0.5);
} else if ((V * l) <= -1e-108) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (Math.pow((V / A), -0.5) / Math.sqrt(l));
} else if ((V * l) <= 1e+255) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = (c0_m / Math.sqrt(V)) / Math.sqrt((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): tmp = 0 if (V * l) <= -1e+202: tmp = (c0_m * math.sqrt((A / V))) * math.pow(l, -0.5) elif (V * l) <= -1e-108: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0_m * (math.pow((V / A), -0.5) / math.sqrt(l)) elif (V * l) <= 1e+255: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = (c0_m / math.sqrt(V)) / math.sqrt((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) tmp = 0.0 if (Float64(V * l) <= -1e+202) tmp = Float64(Float64(c0_m * sqrt(Float64(A / V))) * (l ^ -0.5)); elseif (Float64(V * l) <= -1e-108) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m * Float64((Float64(V / A) ^ -0.5) / sqrt(l))); elseif (Float64(V * l) <= 1e+255) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(Float64(c0_m / sqrt(V)) / sqrt(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)
tmp = 0.0;
if ((V * l) <= -1e+202)
tmp = (c0_m * sqrt((A / V))) * (l ^ -0.5);
elseif ((V * l) <= -1e-108)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0_m * (((V / A) ^ -0.5) / sqrt(l));
elseif ((V * l) <= 1e+255)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = (c0_m / sqrt(V)) / sqrt((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_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -1e+202], N[(N[(c0$95$m * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-108], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / 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^{+202}:\\
\;\;\;\;\left(c0\_m \cdot \sqrt{\frac{A}{V}}\right) \cdot {\ell}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0\_m \cdot \frac{{\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.999999999999999e201Initial program 48.2%
add-sqr-sqrt34.6%
sqrt-unprod26.4%
*-commutative26.4%
*-commutative26.4%
swap-sqr25.8%
add-sqr-sqrt25.8%
pow225.8%
Applied egg-rr25.8%
associate-/r*25.7%
Simplified25.7%
*-commutative25.7%
sqrt-prod29.8%
sqrt-pow161.2%
metadata-eval61.2%
pow161.2%
sqrt-undiv36.7%
associate-*r/36.7%
div-inv36.7%
pow1/236.7%
pow-flip36.7%
metadata-eval36.7%
Applied egg-rr36.7%
if -9.999999999999999e201 < (*.f64 V l) < -1.00000000000000004e-108Initial program 96.2%
if -1.00000000000000004e-108 < (*.f64 V l) < -0.0Initial program 55.7%
associate-/r*68.3%
sqrt-div31.9%
div-inv31.9%
Applied egg-rr31.9%
associate-*r/31.9%
*-rgt-identity31.9%
Simplified31.9%
clear-num31.9%
sqrt-div32.3%
metadata-eval32.3%
Applied egg-rr32.3%
inv-pow32.3%
sqrt-pow232.4%
metadata-eval32.4%
Applied egg-rr32.4%
if -0.0 < (*.f64 V l) < 9.99999999999999988e254Initial program 87.0%
sqrt-div98.9%
div-inv98.8%
Applied egg-rr98.8%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 9.99999999999999988e254 < (*.f64 V l) Initial program 25.0%
clear-num25.0%
associate-/r/25.0%
associate-/r*28.6%
Applied egg-rr28.6%
associate-*l/45.1%
sqrt-div50.1%
associate-*l/50.0%
*-un-lft-identity50.0%
clear-num50.1%
un-div-inv50.0%
sqrt-undiv40.3%
div-inv40.3%
clear-num40.3%
Applied egg-rr40.3%
*-commutative40.3%
associate-*l/25.0%
associate-*r/40.3%
Simplified40.3%
*-un-lft-identity40.3%
sqrt-prod50.2%
times-frac50.0%
Applied egg-rr50.0%
associate-*r/50.2%
associate-*l/50.1%
*-lft-identity50.1%
Simplified50.1%
Final simplification72.8%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* (/ c0_m (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -4e-250)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-319)
(/ c0_m (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+255)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ (/ c0_m (sqrt V)) (sqrt (/ 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 tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -4e-250) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-319) {
tmp = c0_m / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+255) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = (c0_m / sqrt(V)) / sqrt((l / 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 = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -4e-250) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-319) {
tmp = c0_m / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 1e+255) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = (c0_m / Math.sqrt(V)) / Math.sqrt((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): tmp = 0 if (V * l) <= -math.inf: tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -4e-250: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-319: tmp = c0_m / math.sqrt((V * (l / A))) elif (V * l) <= 1e+255: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = (c0_m / math.sqrt(V)) / math.sqrt((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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -4e-250) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-319) tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+255) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(Float64(c0_m / sqrt(V)) / sqrt(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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -4e-250)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-319)
tmp = c0_m / sqrt((V * (l / A)));
elseif ((V * l) <= 1e+255)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = (c0_m / sqrt(V)) / sqrt((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_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-250], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / 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:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-250}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 25.7%
add-sqr-sqrt25.7%
sqrt-unprod25.7%
*-commutative25.7%
*-commutative25.7%
swap-sqr24.8%
add-sqr-sqrt24.8%
pow224.8%
Applied egg-rr24.8%
associate-/r*24.7%
Simplified24.7%
sqrt-prod31.4%
sqrt-undiv7.3%
sqrt-undiv31.4%
associate-/l/24.8%
frac-2neg24.8%
distribute-rgt-neg-out24.8%
sqrt-undiv24.8%
sqrt-pow125.7%
metadata-eval25.7%
pow125.7%
associate-*l/25.7%
*-commutative25.7%
sqrt-prod21.2%
times-frac21.3%
sqrt-div14.8%
frac-2neg14.8%
Applied egg-rr14.8%
if -inf.0 < (*.f64 V l) < -4.0000000000000002e-250Initial program 88.6%
frac-2neg88.6%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
distribute-rgt-neg-out99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Simplified99.5%
if -4.0000000000000002e-250 < (*.f64 V l) < 4.9999937e-319Initial program 40.0%
clear-num40.0%
associate-/r/38.3%
associate-/r*38.3%
Applied egg-rr38.3%
associate-*l/63.8%
sqrt-div27.2%
associate-*l/27.2%
*-un-lft-identity27.2%
clear-num27.2%
un-div-inv27.1%
sqrt-undiv65.1%
div-inv65.1%
clear-num65.1%
Applied egg-rr65.1%
*-commutative65.1%
associate-*l/40.0%
associate-*r/65.2%
Simplified65.2%
if 4.9999937e-319 < (*.f64 V l) < 9.99999999999999988e254Initial program 87.4%
sqrt-div99.4%
div-inv99.4%
Applied egg-rr99.4%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 9.99999999999999988e254 < (*.f64 V l) Initial program 25.0%
clear-num25.0%
associate-/r/25.0%
associate-/r*28.6%
Applied egg-rr28.6%
associate-*l/45.1%
sqrt-div50.1%
associate-*l/50.0%
*-un-lft-identity50.0%
clear-num50.1%
un-div-inv50.0%
sqrt-undiv40.3%
div-inv40.3%
clear-num40.3%
Applied egg-rr40.3%
*-commutative40.3%
associate-*l/25.0%
associate-*r/40.3%
Simplified40.3%
*-un-lft-identity40.3%
sqrt-prod50.2%
times-frac50.0%
Applied egg-rr50.0%
associate-*r/50.2%
associate-*l/50.1%
*-lft-identity50.1%
Simplified50.1%
Final simplification86.8%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* (/ c0_m (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -1e-295)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-319)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) 1e+255)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ (/ c0_m (sqrt V)) (sqrt (/ 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 tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -1e-295) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-319) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= 1e+255) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = (c0_m / sqrt(V)) / sqrt((l / 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 = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -1e-295) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-319) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= 1e+255) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = (c0_m / Math.sqrt(V)) / Math.sqrt((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): tmp = 0 if (V * l) <= -math.inf: tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -1e-295: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-319: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= 1e+255: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = (c0_m / math.sqrt(V)) / math.sqrt((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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -1e-295) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-319) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= 1e+255) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(Float64(c0_m / sqrt(V)) / sqrt(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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -1e-295)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-319)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= 1e+255)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = (c0_m / sqrt(V)) / sqrt((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_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-295], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], 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+255], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / 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:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 25.7%
add-sqr-sqrt25.7%
sqrt-unprod25.7%
*-commutative25.7%
*-commutative25.7%
swap-sqr24.8%
add-sqr-sqrt24.8%
pow224.8%
Applied egg-rr24.8%
associate-/r*24.7%
Simplified24.7%
sqrt-prod31.4%
sqrt-undiv7.3%
sqrt-undiv31.4%
associate-/l/24.8%
frac-2neg24.8%
distribute-rgt-neg-out24.8%
sqrt-undiv24.8%
sqrt-pow125.7%
metadata-eval25.7%
pow125.7%
associate-*l/25.7%
*-commutative25.7%
sqrt-prod21.2%
times-frac21.3%
sqrt-div14.8%
frac-2neg14.8%
Applied egg-rr14.8%
if -inf.0 < (*.f64 V l) < -1.00000000000000006e-295Initial program 89.0%
frac-2neg89.0%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -1.00000000000000006e-295 < (*.f64 V l) < 4.9999937e-319Initial program 32.7%
clear-num32.7%
associate-/r/30.9%
associate-/r*30.9%
Applied egg-rr30.9%
associate-*l/59.5%
associate-*r/59.4%
associate-*l/59.5%
*-un-lft-identity59.5%
Applied egg-rr59.5%
frac-2neg59.5%
sqrt-div42.5%
distribute-neg-frac242.5%
Applied egg-rr42.5%
if 4.9999937e-319 < (*.f64 V l) < 9.99999999999999988e254Initial program 87.4%
sqrt-div99.4%
div-inv99.4%
Applied egg-rr99.4%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 9.99999999999999988e254 < (*.f64 V l) Initial program 25.0%
clear-num25.0%
associate-/r/25.0%
associate-/r*28.6%
Applied egg-rr28.6%
associate-*l/45.1%
sqrt-div50.1%
associate-*l/50.0%
*-un-lft-identity50.0%
clear-num50.1%
un-div-inv50.0%
sqrt-undiv40.3%
div-inv40.3%
clear-num40.3%
Applied egg-rr40.3%
*-commutative40.3%
associate-*l/25.0%
associate-*r/40.3%
Simplified40.3%
*-un-lft-identity40.3%
sqrt-prod50.2%
times-frac50.0%
Applied egg-rr50.0%
associate-*r/50.2%
associate-*l/50.1%
*-lft-identity50.1%
Simplified50.1%
Final simplification84.4%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -2e-179)
(* c0_m (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* V l) 5e-319)
(/ c0_m (sqrt (* V (/ l A))))
(* c0_m (/ (sqrt A) (sqrt (* V l))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-179) {
tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 5e-319) {
tmp = c0_m / sqrt((V * (l / A)));
} else {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-2d-179)) then
tmp = c0_m * sqrt((a * ((1.0d0 / v) / l)))
else if ((v * l) <= 5d-319) then
tmp = c0_m / sqrt((v * (l / a)))
else
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-179) {
tmp = c0_m * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 5e-319) {
tmp = c0_m / Math.sqrt((V * (l / A)));
} else {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -2e-179: tmp = c0_m * math.sqrt((A * ((1.0 / V) / l))) elif (V * l) <= 5e-319: tmp = c0_m / math.sqrt((V * (l / A))) else: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e-179) tmp = Float64(c0_m * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(V * l) <= 5e-319) tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e-179)
tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
elseif ((V * l) <= 5e-319)
tmp = c0_m / sqrt((V * (l / A)));
else
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -2e-179], N[(c0$95$m * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{-179}:\\
\;\;\;\;c0\_m \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e-179Initial program 83.5%
clear-num83.4%
associate-/r/83.4%
associate-/r*85.0%
Applied egg-rr85.0%
if -2e-179 < (*.f64 V l) < 4.9999937e-319Initial program 45.4%
clear-num45.3%
associate-/r/44.1%
associate-/r*44.1%
Applied egg-rr44.1%
associate-*l/62.6%
sqrt-div27.6%
associate-*l/27.6%
*-un-lft-identity27.6%
clear-num27.6%
un-div-inv27.6%
sqrt-undiv63.6%
div-inv63.6%
clear-num63.6%
Applied egg-rr63.6%
*-commutative63.6%
associate-*l/45.4%
associate-*r/61.8%
Simplified61.8%
if 4.9999937e-319 < (*.f64 V l) Initial program 78.5%
sqrt-div88.8%
div-inv88.7%
Applied egg-rr88.7%
associate-*r/88.8%
*-rgt-identity88.8%
Simplified88.8%
Final simplification82.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 5e+306)))
(* c0_m (sqrt (/ (/ A V) l)))
(* c0_m (sqrt t_0))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
tmp = c0_m * sqrt(((A / V) / l));
} else {
tmp = c0_m * sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+306))) then
tmp = c0_m * sqrt(((a / v) / l))
else
tmp = c0_m * sqrt(t_0)
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else {
tmp = c0_m * Math.sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+306): tmp = c0_m * math.sqrt(((A / V) / l)) else: tmp = c0_m * math.sqrt(t_0) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0_m * sqrt(t_0)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+306)))
tmp = c0_m * sqrt(((A / V) / l));
else
tmp = c0_m * sqrt(t_0);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+306]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+306}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 29.8%
associate-/r*44.5%
Simplified44.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
Final simplification79.0%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (* c0_s (* c0_m (sqrt (/ A (* V l))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
return c0_s * (c0_m * sqrt((A / (V * l))));
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0_s * (c0_m * sqrt((a / (v * l))))
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
return c0_s * (c0_m * Math.sqrt((A / (V * l))));
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): return c0_s * (c0_m * math.sqrt((A / (V * l))))
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) return Float64(c0_s * Float64(c0_m * sqrt(Float64(A / Float64(V * l))))) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp = code(c0_s, c0_m, A, V, l)
tmp = c0_s * (c0_m * sqrt((A / (V * l))));
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)
\end{array}
Initial program 73.7%
Final simplification73.7%
herbie shell --seed 2024072
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))