
(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 14 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 (sqrt (- A))))
(*
c0_s
(if (<= (* V l) -1e+180)
(* (/ t_0 (sqrt (- V))) (/ c0_m (sqrt l)))
(if (<= (* V l) -5e-279)
(/ c0_m (/ (sqrt (* V (- l))) t_0))
(if (<= (* V l) 5e-317)
(sqrt (* (/ c0_m V) (* c0_m (/ A l))))
(if (<= (* V l) 5e+306)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (/ (* A (* c0_m (/ c0_m V))) l)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = sqrt(-A);
double tmp;
if ((V * l) <= -1e+180) {
tmp = (t_0 / sqrt(-V)) * (c0_m / sqrt(l));
} else if ((V * l) <= -5e-279) {
tmp = c0_m / (sqrt((V * -l)) / t_0);
} else if ((V * l) <= 5e-317) {
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(-a)
if ((v * l) <= (-1d+180)) then
tmp = (t_0 / sqrt(-v)) * (c0_m / sqrt(l))
else if ((v * l) <= (-5d-279)) then
tmp = c0_m / (sqrt((v * -l)) / t_0)
else if ((v * l) <= 5d-317) then
tmp = sqrt(((c0_m / v) * (c0_m * (a / l))))
else if ((v * l) <= 5d+306) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt(((a * (c0_m * (c0_m / v))) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = Math.sqrt(-A);
double tmp;
if ((V * l) <= -1e+180) {
tmp = (t_0 / Math.sqrt(-V)) * (c0_m / Math.sqrt(l));
} else if ((V * l) <= -5e-279) {
tmp = c0_m / (Math.sqrt((V * -l)) / t_0);
} else if ((V * l) <= 5e-317) {
tmp = Math.sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = math.sqrt(-A) tmp = 0 if (V * l) <= -1e+180: tmp = (t_0 / math.sqrt(-V)) * (c0_m / math.sqrt(l)) elif (V * l) <= -5e-279: tmp = c0_m / (math.sqrt((V * -l)) / t_0) elif (V * l) <= 5e-317: tmp = math.sqrt(((c0_m / V) * (c0_m * (A / l)))) elif (V * l) <= 5e+306: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A * (c0_m * (c0_m / V))) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = sqrt(Float64(-A)) tmp = 0.0 if (Float64(V * l) <= -1e+180) tmp = Float64(Float64(t_0 / sqrt(Float64(-V))) * Float64(c0_m / sqrt(l))); elseif (Float64(V * l) <= -5e-279) tmp = Float64(c0_m / Float64(sqrt(Float64(V * Float64(-l))) / t_0)); elseif (Float64(V * l) <= 5e-317) tmp = sqrt(Float64(Float64(c0_m / V) * Float64(c0_m * Float64(A / l)))); elseif (Float64(V * l) <= 5e+306) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / V))) / l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = sqrt(-A);
tmp = 0.0;
if ((V * l) <= -1e+180)
tmp = (t_0 / sqrt(-V)) * (c0_m / sqrt(l));
elseif ((V * l) <= -5e-279)
tmp = c0_m / (sqrt((V * -l)) / t_0);
elseif ((V * l) <= 5e-317)
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
elseif ((V * l) <= 5e+306)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[(-A)], $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -1e+180], N[(N[(t$95$0 / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-279], N[(c0$95$m / N[(N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-317], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+306], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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])\\
\\
\begin{array}{l}
t_0 := \sqrt{-A}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+180}:\\
\;\;\;\;\frac{t\_0}{\sqrt{-V}} \cdot \frac{c0\_m}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-279}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{V \cdot \left(-\ell\right)}}{t\_0}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-317}:\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \left(c0\_m \cdot \frac{A}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -1e180Initial program 55.7%
associate-/r*76.3%
sqrt-div32.3%
associate-*r/32.3%
Applied egg-rr32.3%
*-commutative32.3%
associate-/l*32.3%
Simplified32.3%
frac-2neg32.3%
sqrt-div35.5%
Applied egg-rr35.5%
if -1e180 < (*.f64 V l) < -4.99999999999999969e-279Initial program 85.1%
associate-/r*73.2%
clear-num72.8%
sqrt-div72.8%
metadata-eval72.8%
clear-num72.8%
associate-/r*83.5%
clear-num84.1%
associate-/l*71.8%
Applied egg-rr71.8%
un-div-inv72.0%
associate-*r/84.3%
*-commutative84.3%
associate-/l*71.7%
Applied egg-rr71.7%
associate-*r/84.3%
*-commutative84.3%
frac-2neg84.3%
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 -4.99999999999999969e-279 < (*.f64 V l) < 5.00000017e-317Initial program 51.4%
add-sqr-sqrt30.5%
sqrt-unprod30.8%
*-commutative30.8%
*-commutative30.8%
swap-sqr29.0%
add-sqr-sqrt29.0%
pow229.0%
Applied egg-rr29.0%
associate-*l/29.0%
*-commutative29.0%
times-frac30.9%
Simplified30.9%
associate-*l/31.1%
Applied egg-rr31.1%
div-inv31.1%
unpow231.1%
associate-*r*38.7%
*-commutative38.7%
associate-*r/41.0%
*-commutative41.0%
associate-*l*41.1%
un-div-inv41.2%
Applied egg-rr41.2%
if 5.00000017e-317 < (*.f64 V l) < 4.99999999999999993e306Initial program 80.8%
sqrt-div99.1%
associate-*r/93.2%
Applied egg-rr93.2%
associate-/l*99.1%
Simplified99.1%
if 4.99999999999999993e306 < (*.f64 V l) Initial program 48.2%
add-sqr-sqrt48.2%
sqrt-unprod48.2%
*-commutative48.2%
*-commutative48.2%
swap-sqr47.4%
add-sqr-sqrt47.4%
pow247.4%
Applied egg-rr47.4%
associate-*l/47.3%
*-commutative47.3%
times-frac51.4%
Simplified51.4%
associate-*l/55.5%
Applied egg-rr55.5%
unpow255.5%
associate-/l*59.7%
Applied egg-rr59.7%
Final simplification80.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+287)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -5e-279)
(/ c0_m (/ (sqrt (* V (- l))) (sqrt (- A))))
(if (<= (* V l) 5e-317)
(sqrt (* (/ c0_m V) (* c0_m (/ A l))))
(if (<= (* V l) 5e+306)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (/ (* A (* c0_m (/ c0_m 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) <= -1e+287) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -5e-279) {
tmp = c0_m / (sqrt((V * -l)) / sqrt(-A));
} else if ((V * l) <= 5e-317) {
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A * (c0_m * (c0_m / 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) <= (-1d+287)) then
tmp = c0_m * (sqrt((a / -l)) / sqrt(-v))
else if ((v * l) <= (-5d-279)) then
tmp = c0_m / (sqrt((v * -l)) / sqrt(-a))
else if ((v * l) <= 5d-317) then
tmp = sqrt(((c0_m / v) * (c0_m * (a / l))))
else if ((v * l) <= 5d+306) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt(((a * (c0_m * (c0_m / 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) <= -1e+287) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -5e-279) {
tmp = c0_m / (Math.sqrt((V * -l)) / Math.sqrt(-A));
} else if ((V * l) <= 5e-317) {
tmp = Math.sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m / 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) <= -1e+287: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -5e-279: tmp = c0_m / (math.sqrt((V * -l)) / math.sqrt(-A)) elif (V * l) <= 5e-317: tmp = math.sqrt(((c0_m / V) * (c0_m * (A / l)))) elif (V * l) <= 5e+306: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A * (c0_m * (c0_m / 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) <= -1e+287) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -5e-279) tmp = Float64(c0_m / Float64(sqrt(Float64(V * Float64(-l))) / sqrt(Float64(-A)))); elseif (Float64(V * l) <= 5e-317) tmp = sqrt(Float64(Float64(c0_m / V) * Float64(c0_m * Float64(A / l)))); elseif (Float64(V * l) <= 5e+306) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / 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) <= -1e+287)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -5e-279)
tmp = c0_m / (sqrt((V * -l)) / sqrt(-A));
elseif ((V * l) <= 5e-317)
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
elseif ((V * l) <= 5e+306)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A * (c0_m * (c0_m / 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], -1e+287], 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-279], N[(c0$95$m / N[(N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-317], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+306], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 \cdot \ell \leq -1 \cdot 10^{+287}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-279}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{V \cdot \left(-\ell\right)}}{\sqrt{-A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-317}:\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \left(c0\_m \cdot \frac{A}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.0000000000000001e287Initial program 31.7%
Taylor expanded in c0 around 0 31.7%
*-commutative31.7%
associate-/r*79.7%
Simplified79.7%
frac-2neg79.7%
sqrt-div33.7%
distribute-neg-frac233.7%
Applied egg-rr33.7%
distribute-frac-neg233.7%
distribute-neg-frac33.7%
Simplified33.7%
if -1.0000000000000001e287 < (*.f64 V l) < -4.99999999999999969e-279Initial program 84.2%
associate-/r*73.2%
clear-num72.9%
sqrt-div72.8%
metadata-eval72.8%
clear-num72.8%
associate-/r*82.9%
clear-num83.4%
associate-/l*73.1%
Applied egg-rr73.1%
un-div-inv73.3%
associate-*r/83.6%
*-commutative83.6%
associate-/l*71.9%
Applied egg-rr71.9%
associate-*r/83.6%
*-commutative83.6%
frac-2neg83.6%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -4.99999999999999969e-279 < (*.f64 V l) < 5.00000017e-317Initial program 51.4%
add-sqr-sqrt30.5%
sqrt-unprod30.8%
*-commutative30.8%
*-commutative30.8%
swap-sqr29.0%
add-sqr-sqrt29.0%
pow229.0%
Applied egg-rr29.0%
associate-*l/29.0%
*-commutative29.0%
times-frac30.9%
Simplified30.9%
associate-*l/31.1%
Applied egg-rr31.1%
div-inv31.1%
unpow231.1%
associate-*r*38.7%
*-commutative38.7%
associate-*r/41.0%
*-commutative41.0%
associate-*l*41.1%
un-div-inv41.2%
Applied egg-rr41.2%
if 5.00000017e-317 < (*.f64 V l) < 4.99999999999999993e306Initial program 80.8%
sqrt-div99.1%
associate-*r/93.2%
Applied egg-rr93.2%
associate-/l*99.1%
Simplified99.1%
if 4.99999999999999993e306 < (*.f64 V l) Initial program 48.2%
add-sqr-sqrt48.2%
sqrt-unprod48.2%
*-commutative48.2%
*-commutative48.2%
swap-sqr47.4%
add-sqr-sqrt47.4%
pow247.4%
Applied egg-rr47.4%
associate-*l/47.3%
*-commutative47.3%
times-frac51.4%
Simplified51.4%
associate-*l/55.5%
Applied egg-rr55.5%
unpow255.5%
associate-/l*59.7%
Applied egg-rr59.7%
Final simplification83.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -1e+287)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -5e-279)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-317)
(sqrt (* (/ c0_m V) (* c0_m (/ A l))))
(if (<= (* V l) 5e+306)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (/ (* A (* c0_m (/ c0_m 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) <= -1e+287) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -5e-279) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-317) {
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A * (c0_m * (c0_m / 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) <= (-1d+287)) then
tmp = c0_m * (sqrt((a / -l)) / sqrt(-v))
else if ((v * l) <= (-5d-279)) then
tmp = c0_m * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 5d-317) then
tmp = sqrt(((c0_m / v) * (c0_m * (a / l))))
else if ((v * l) <= 5d+306) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt(((a * (c0_m * (c0_m / 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) <= -1e+287) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -5e-279) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-317) {
tmp = Math.sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m / 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) <= -1e+287: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -5e-279: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-317: tmp = math.sqrt(((c0_m / V) * (c0_m * (A / l)))) elif (V * l) <= 5e+306: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A * (c0_m * (c0_m / 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) <= -1e+287) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -5e-279) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-317) tmp = sqrt(Float64(Float64(c0_m / V) * Float64(c0_m * Float64(A / l)))); elseif (Float64(V * l) <= 5e+306) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / 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) <= -1e+287)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -5e-279)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-317)
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
elseif ((V * l) <= 5e+306)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A * (c0_m * (c0_m / 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], -1e+287], 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-279], 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-317], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+306], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 \cdot \ell \leq -1 \cdot 10^{+287}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-279}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-317}:\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \left(c0\_m \cdot \frac{A}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.0000000000000001e287Initial program 31.7%
Taylor expanded in c0 around 0 31.7%
*-commutative31.7%
associate-/r*79.7%
Simplified79.7%
frac-2neg79.7%
sqrt-div33.7%
distribute-neg-frac233.7%
Applied egg-rr33.7%
distribute-frac-neg233.7%
distribute-neg-frac33.7%
Simplified33.7%
if -1.0000000000000001e287 < (*.f64 V l) < -4.99999999999999969e-279Initial program 84.2%
frac-2neg84.2%
sqrt-div99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
if -4.99999999999999969e-279 < (*.f64 V l) < 5.00000017e-317Initial program 51.4%
add-sqr-sqrt30.5%
sqrt-unprod30.8%
*-commutative30.8%
*-commutative30.8%
swap-sqr29.0%
add-sqr-sqrt29.0%
pow229.0%
Applied egg-rr29.0%
associate-*l/29.0%
*-commutative29.0%
times-frac30.9%
Simplified30.9%
associate-*l/31.1%
Applied egg-rr31.1%
div-inv31.1%
unpow231.1%
associate-*r*38.7%
*-commutative38.7%
associate-*r/41.0%
*-commutative41.0%
associate-*l*41.1%
un-div-inv41.2%
Applied egg-rr41.2%
if 5.00000017e-317 < (*.f64 V l) < 4.99999999999999993e306Initial program 80.8%
sqrt-div99.1%
associate-*r/93.2%
Applied egg-rr93.2%
associate-/l*99.1%
Simplified99.1%
if 4.99999999999999993e306 < (*.f64 V l) Initial program 48.2%
add-sqr-sqrt48.2%
sqrt-unprod48.2%
*-commutative48.2%
*-commutative48.2%
swap-sqr47.4%
add-sqr-sqrt47.4%
pow247.4%
Applied egg-rr47.4%
associate-*l/47.3%
*-commutative47.3%
times-frac51.4%
Simplified51.4%
associate-*l/55.5%
Applied egg-rr55.5%
unpow255.5%
associate-/l*59.7%
Applied egg-rr59.7%
Final simplification83.5%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -1e+180)
(* (/ c0_m (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -5e-279)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-317)
(sqrt (* (/ c0_m V) (* c0_m (/ A l))))
(if (<= (* V l) 5e+306)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (/ (* A (* c0_m (/ c0_m 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) <= -1e+180) {
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -5e-279) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-317) {
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A * (c0_m * (c0_m / 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) <= (-1d+180)) then
tmp = (c0_m / sqrt(l)) * sqrt((a / v))
else if ((v * l) <= (-5d-279)) then
tmp = c0_m * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 5d-317) then
tmp = sqrt(((c0_m / v) * (c0_m * (a / l))))
else if ((v * l) <= 5d+306) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt(((a * (c0_m * (c0_m / 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) <= -1e+180) {
tmp = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -5e-279) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-317) {
tmp = Math.sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m / 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) <= -1e+180: tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -5e-279: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-317: tmp = math.sqrt(((c0_m / V) * (c0_m * (A / l)))) elif (V * l) <= 5e+306: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A * (c0_m * (c0_m / 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) <= -1e+180) tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -5e-279) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-317) tmp = sqrt(Float64(Float64(c0_m / V) * Float64(c0_m * Float64(A / l)))); elseif (Float64(V * l) <= 5e+306) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / 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) <= -1e+180)
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -5e-279)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-317)
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
elseif ((V * l) <= 5e+306)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A * (c0_m * (c0_m / 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], -1e+180], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-279], 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-317], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+306], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 \cdot \ell \leq -1 \cdot 10^{+180}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-279}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-317}:\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \left(c0\_m \cdot \frac{A}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e180Initial program 55.7%
associate-/r*76.3%
sqrt-div32.3%
associate-*r/32.3%
Applied egg-rr32.3%
*-commutative32.3%
associate-/l*32.3%
Simplified32.3%
if -1e180 < (*.f64 V l) < -4.99999999999999969e-279Initial program 85.1%
frac-2neg85.1%
sqrt-div99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
if -4.99999999999999969e-279 < (*.f64 V l) < 5.00000017e-317Initial program 51.4%
add-sqr-sqrt30.5%
sqrt-unprod30.8%
*-commutative30.8%
*-commutative30.8%
swap-sqr29.0%
add-sqr-sqrt29.0%
pow229.0%
Applied egg-rr29.0%
associate-*l/29.0%
*-commutative29.0%
times-frac30.9%
Simplified30.9%
associate-*l/31.1%
Applied egg-rr31.1%
div-inv31.1%
unpow231.1%
associate-*r*38.7%
*-commutative38.7%
associate-*r/41.0%
*-commutative41.0%
associate-*l*41.1%
un-div-inv41.2%
Applied egg-rr41.2%
if 5.00000017e-317 < (*.f64 V l) < 4.99999999999999993e306Initial program 80.8%
sqrt-div99.1%
associate-*r/93.2%
Applied egg-rr93.2%
associate-/l*99.1%
Simplified99.1%
if 4.99999999999999993e306 < (*.f64 V l) Initial program 48.2%
add-sqr-sqrt48.2%
sqrt-unprod48.2%
*-commutative48.2%
*-commutative48.2%
swap-sqr47.4%
add-sqr-sqrt47.4%
pow247.4%
Applied egg-rr47.4%
associate-*l/47.3%
*-commutative47.3%
times-frac51.4%
Simplified51.4%
associate-*l/55.5%
Applied egg-rr55.5%
unpow255.5%
associate-/l*59.7%
Applied egg-rr59.7%
Final simplification79.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) -5e+255)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= (* V l) -1e-226)
(* c0_m (sqrt (* A (* (/ 1.0 V) (/ 1.0 l)))))
(if (<= (* V l) 5e-317)
(sqrt (* (/ c0_m V) (* c0_m (/ A l))))
(if (<= (* V l) 5e+306)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (/ (* A (* c0_m (/ c0_m V))) l))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+255) {
tmp = c0_m * sqrt(((A / V) / l));
} else if ((V * l) <= -1e-226) {
tmp = c0_m * sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 5e-317) {
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d+255)) then
tmp = c0_m * sqrt(((a / v) / l))
else if ((v * l) <= (-1d-226)) then
tmp = c0_m * sqrt((a * ((1.0d0 / v) * (1.0d0 / l))))
else if ((v * l) <= 5d-317) then
tmp = sqrt(((c0_m / v) * (c0_m * (a / l))))
else if ((v * l) <= 5d+306) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt(((a * (c0_m * (c0_m / v))) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+255) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if ((V * l) <= -1e-226) {
tmp = c0_m * Math.sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 5e-317) {
tmp = Math.sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -5e+255: tmp = c0_m * math.sqrt(((A / V) / l)) elif (V * l) <= -1e-226: tmp = c0_m * math.sqrt((A * ((1.0 / V) * (1.0 / l)))) elif (V * l) <= 5e-317: tmp = math.sqrt(((c0_m / V) * (c0_m * (A / l)))) elif (V * l) <= 5e+306: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A * (c0_m * (c0_m / V))) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+255) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(V * l) <= -1e-226) tmp = Float64(c0_m * sqrt(Float64(A * Float64(Float64(1.0 / V) * Float64(1.0 / l))))); elseif (Float64(V * l) <= 5e-317) tmp = sqrt(Float64(Float64(c0_m / V) * Float64(c0_m * Float64(A / l)))); elseif (Float64(V * l) <= 5e+306) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / V))) / l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e+255)
tmp = c0_m * sqrt(((A / V) / l));
elseif ((V * l) <= -1e-226)
tmp = c0_m * sqrt((A * ((1.0 / V) * (1.0 / l))));
elseif ((V * l) <= 5e-317)
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
elseif ((V * l) <= 5e+306)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e+255], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-226], N[(c0$95$m * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-317], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+306], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 \cdot \ell \leq -5 \cdot 10^{+255}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-226}:\\
\;\;\;\;c0\_m \cdot \sqrt{A \cdot \left(\frac{1}{V} \cdot \frac{1}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-317}:\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \left(c0\_m \cdot \frac{A}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000002e255Initial program 41.7%
associate-/r*73.7%
Simplified73.7%
if -5.0000000000000002e255 < (*.f64 V l) < -9.99999999999999921e-227Initial program 85.4%
associate-/r*74.7%
div-inv74.7%
div-inv74.6%
associate-*l*85.4%
Applied egg-rr85.4%
if -9.99999999999999921e-227 < (*.f64 V l) < 5.00000017e-317Initial program 51.4%
add-sqr-sqrt29.0%
sqrt-unprod29.4%
*-commutative29.4%
*-commutative29.4%
swap-sqr27.6%
add-sqr-sqrt27.6%
pow227.6%
Applied egg-rr27.6%
associate-*l/27.6%
*-commutative27.6%
times-frac29.4%
Simplified29.4%
associate-*l/29.7%
Applied egg-rr29.7%
div-inv29.6%
unpow229.6%
associate-*r*36.8%
*-commutative36.8%
associate-*r/39.0%
*-commutative39.0%
associate-*l*39.1%
un-div-inv39.2%
Applied egg-rr39.2%
if 5.00000017e-317 < (*.f64 V l) < 4.99999999999999993e306Initial program 80.8%
sqrt-div99.1%
associate-*r/93.2%
Applied egg-rr93.2%
associate-/l*99.1%
Simplified99.1%
if 4.99999999999999993e306 < (*.f64 V l) Initial program 48.2%
add-sqr-sqrt48.2%
sqrt-unprod48.2%
*-commutative48.2%
*-commutative48.2%
swap-sqr47.4%
add-sqr-sqrt47.4%
pow247.4%
Applied egg-rr47.4%
associate-*l/47.3%
*-commutative47.3%
times-frac51.4%
Simplified51.4%
associate-*l/55.5%
Applied egg-rr55.5%
unpow255.5%
associate-/l*59.7%
Applied egg-rr59.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) -1e-226)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 5e-317)
(sqrt (* (/ c0_m V) (* c0_m (/ A l))))
(if (<= (* V l) 5e+306)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (/ (* A (* c0_m (/ c0_m 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) <= -1e-226) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 5e-317) {
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A * (c0_m * (c0_m / 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) <= (-1d-226)) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 5d-317) then
tmp = sqrt(((c0_m / v) * (c0_m * (a / l))))
else if ((v * l) <= 5d+306) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt(((a * (c0_m * (c0_m / 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) <= -1e-226) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 5e-317) {
tmp = Math.sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if ((V * l) <= 5e+306) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m / 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) <= -1e-226: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 5e-317: tmp = math.sqrt(((c0_m / V) * (c0_m * (A / l)))) elif (V * l) <= 5e+306: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A * (c0_m * (c0_m / 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) <= -1e-226) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 5e-317) tmp = sqrt(Float64(Float64(c0_m / V) * Float64(c0_m * Float64(A / l)))); elseif (Float64(V * l) <= 5e+306) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / 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) <= -1e-226)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 5e-317)
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
elseif ((V * l) <= 5e+306)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A * (c0_m * (c0_m / 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], -1e-226], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-317], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+306], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 \cdot \ell \leq -1 \cdot 10^{-226}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-317}:\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \left(c0\_m \cdot \frac{A}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999921e-227Initial program 77.4%
associate-/r*74.5%
sqrt-div39.8%
associate-*r/37.8%
Applied egg-rr37.8%
associate-/l*39.8%
Simplified39.8%
if -9.99999999999999921e-227 < (*.f64 V l) < 5.00000017e-317Initial program 51.4%
add-sqr-sqrt29.0%
sqrt-unprod29.4%
*-commutative29.4%
*-commutative29.4%
swap-sqr27.6%
add-sqr-sqrt27.6%
pow227.6%
Applied egg-rr27.6%
associate-*l/27.6%
*-commutative27.6%
times-frac29.4%
Simplified29.4%
associate-*l/29.7%
Applied egg-rr29.7%
div-inv29.6%
unpow229.6%
associate-*r*36.8%
*-commutative36.8%
associate-*r/39.0%
*-commutative39.0%
associate-*l*39.1%
un-div-inv39.2%
Applied egg-rr39.2%
if 5.00000017e-317 < (*.f64 V l) < 4.99999999999999993e306Initial program 80.8%
sqrt-div99.1%
associate-*r/93.2%
Applied egg-rr93.2%
associate-/l*99.1%
Simplified99.1%
if 4.99999999999999993e306 < (*.f64 V l) Initial program 48.2%
add-sqr-sqrt48.2%
sqrt-unprod48.2%
*-commutative48.2%
*-commutative48.2%
swap-sqr47.4%
add-sqr-sqrt47.4%
pow247.4%
Applied egg-rr47.4%
associate-*l/47.3%
*-commutative47.3%
times-frac51.4%
Simplified51.4%
associate-*l/55.5%
Applied egg-rr55.5%
unpow255.5%
associate-/l*59.7%
Applied egg-rr59.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 (or (<= t_0 2e-312) (not (<= t_0 1e+305)))
(sqrt (* (/ c0_m V) (* c0_m (/ A 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 <= 2e-312) || !(t_0 <= 1e+305)) {
tmp = sqrt(((c0_m / V) * (c0_m * (A / 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 <= 2d-312) .or. (.not. (t_0 <= 1d+305))) then
tmp = sqrt(((c0_m / v) * (c0_m * (a / 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 <= 2e-312) || !(t_0 <= 1e+305)) {
tmp = Math.sqrt(((c0_m / V) * (c0_m * (A / 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 <= 2e-312) or not (t_0 <= 1e+305): tmp = math.sqrt(((c0_m / V) * (c0_m * (A / 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 <= 2e-312) || !(t_0 <= 1e+305)) tmp = sqrt(Float64(Float64(c0_m / V) * Float64(c0_m * Float64(A / 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 <= 2e-312) || ~((t_0 <= 1e+305)))
tmp = sqrt(((c0_m / V) * (c0_m * (A / 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, 2e-312], N[Not[LessEqual[t$95$0, 1e+305]], $MachinePrecision]], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m * N[(A / l), $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 2 \cdot 10^{-312} \lor \neg \left(t\_0 \leq 10^{+305}\right):\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \left(c0\_m \cdot \frac{A}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000000000019e-312 or 9.9999999999999994e304 < (/.f64 A (*.f64 V l)) Initial program 36.4%
add-sqr-sqrt27.3%
sqrt-unprod27.5%
*-commutative27.5%
*-commutative27.5%
swap-sqr26.9%
add-sqr-sqrt26.9%
pow226.9%
Applied egg-rr26.9%
associate-*l/30.4%
*-commutative30.4%
times-frac32.3%
Simplified32.3%
associate-*l/32.6%
Applied egg-rr32.6%
div-inv32.6%
unpow232.6%
associate-*r*35.2%
*-commutative35.2%
associate-*r/34.9%
*-commutative34.9%
associate-*l*36.9%
un-div-inv36.9%
Applied egg-rr36.9%
if 2.0000000000019e-312 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e304Initial program 98.3%
Final simplification72.1%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 2e-312)
(sqrt (/ (* c0_m (/ A l)) (/ V c0_m)))
(if (<= t_0 1e+305)
(* c0_m (sqrt t_0))
(sqrt (/ (* A c0_m) (* l (/ V c0_m)))))))))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 <= 2e-312) {
tmp = sqrt(((c0_m * (A / l)) / (V / c0_m)));
} else if (t_0 <= 1e+305) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
}
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 <= 2d-312) then
tmp = sqrt(((c0_m * (a / l)) / (v / c0_m)))
else if (t_0 <= 1d+305) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((a * c0_m) / (l * (v / c0_m))))
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 <= 2e-312) {
tmp = Math.sqrt(((c0_m * (A / l)) / (V / c0_m)));
} else if (t_0 <= 1e+305) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A * c0_m) / (l * (V / c0_m))));
}
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 <= 2e-312: tmp = math.sqrt(((c0_m * (A / l)) / (V / c0_m))) elif t_0 <= 1e+305: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((A * c0_m) / (l * (V / c0_m)))) 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 <= 2e-312) tmp = sqrt(Float64(Float64(c0_m * Float64(A / l)) / Float64(V / c0_m))); elseif (t_0 <= 1e+305) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A * c0_m) / Float64(l * Float64(V / c0_m)))); 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 <= 2e-312)
tmp = sqrt(((c0_m * (A / l)) / (V / c0_m)));
elseif (t_0 <= 1e+305)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
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, 2e-312], N[Sqrt[N[(N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * c0$95$m), $MachinePrecision] / N[(l * N[(V / c0$95$m), $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 2 \cdot 10^{-312}:\\
\;\;\;\;\sqrt{\frac{c0\_m \cdot \frac{A}{\ell}}{\frac{V}{c0\_m}}}\\
\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot c0\_m}{\ell \cdot \frac{V}{c0\_m}}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000000000019e-312Initial program 38.6%
add-sqr-sqrt37.0%
sqrt-unprod37.1%
*-commutative37.1%
*-commutative37.1%
swap-sqr36.4%
add-sqr-sqrt36.4%
pow236.4%
Applied egg-rr36.4%
associate-*l/39.5%
*-commutative39.5%
times-frac43.4%
Simplified43.4%
associate-*l/45.2%
Applied egg-rr45.2%
div-inv45.2%
unpow245.2%
associate-*r*47.1%
*-commutative47.1%
associate-*r/43.6%
*-commutative43.6%
associate-*l*45.5%
un-div-inv45.5%
Applied egg-rr45.5%
*-commutative45.5%
clear-num45.5%
un-div-inv45.6%
Applied egg-rr45.6%
if 2.0000000000019e-312 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e304Initial program 98.3%
if 9.9999999999999994e304 < (/.f64 A (*.f64 V l)) Initial program 34.5%
add-sqr-sqrt18.5%
sqrt-unprod18.7%
*-commutative18.7%
*-commutative18.7%
swap-sqr18.2%
add-sqr-sqrt18.2%
pow218.2%
Applied egg-rr18.2%
associate-*l/22.1%
*-commutative22.1%
times-frac22.1%
Simplified22.1%
associate-*l/21.1%
Applied egg-rr21.1%
div-inv21.1%
unpow221.1%
associate-*r*24.3%
*-commutative24.3%
associate-*r/27.0%
*-commutative27.0%
associate-*l*29.0%
un-div-inv29.0%
Applied egg-rr29.0%
clear-num29.0%
associate-*r/34.4%
frac-times34.3%
*-un-lft-identity34.3%
*-commutative34.3%
Applied egg-rr34.3%
Final simplification73.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 2e-312)
(sqrt (* (/ c0_m V) (* c0_m (/ A l))))
(if (<= t_0 1e+305)
(* c0_m (sqrt t_0))
(sqrt (/ (* A c0_m) (* l (/ V c0_m)))))))))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 <= 2e-312) {
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if (t_0 <= 1e+305) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
}
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 <= 2d-312) then
tmp = sqrt(((c0_m / v) * (c0_m * (a / l))))
else if (t_0 <= 1d+305) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((a * c0_m) / (l * (v / c0_m))))
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 <= 2e-312) {
tmp = Math.sqrt(((c0_m / V) * (c0_m * (A / l))));
} else if (t_0 <= 1e+305) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A * c0_m) / (l * (V / c0_m))));
}
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 <= 2e-312: tmp = math.sqrt(((c0_m / V) * (c0_m * (A / l)))) elif t_0 <= 1e+305: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((A * c0_m) / (l * (V / c0_m)))) 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 <= 2e-312) tmp = sqrt(Float64(Float64(c0_m / V) * Float64(c0_m * Float64(A / l)))); elseif (t_0 <= 1e+305) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A * c0_m) / Float64(l * Float64(V / c0_m)))); 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 <= 2e-312)
tmp = sqrt(((c0_m / V) * (c0_m * (A / l))));
elseif (t_0 <= 1e+305)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
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, 2e-312], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * c0$95$m), $MachinePrecision] / N[(l * N[(V / c0$95$m), $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 2 \cdot 10^{-312}:\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \left(c0\_m \cdot \frac{A}{\ell}\right)}\\
\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot c0\_m}{\ell \cdot \frac{V}{c0\_m}}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000000000019e-312Initial program 38.6%
add-sqr-sqrt37.0%
sqrt-unprod37.1%
*-commutative37.1%
*-commutative37.1%
swap-sqr36.4%
add-sqr-sqrt36.4%
pow236.4%
Applied egg-rr36.4%
associate-*l/39.5%
*-commutative39.5%
times-frac43.4%
Simplified43.4%
associate-*l/45.2%
Applied egg-rr45.2%
div-inv45.2%
unpow245.2%
associate-*r*47.1%
*-commutative47.1%
associate-*r/43.6%
*-commutative43.6%
associate-*l*45.5%
un-div-inv45.5%
Applied egg-rr45.5%
if 2.0000000000019e-312 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e304Initial program 98.3%
if 9.9999999999999994e304 < (/.f64 A (*.f64 V l)) Initial program 34.5%
add-sqr-sqrt18.5%
sqrt-unprod18.7%
*-commutative18.7%
*-commutative18.7%
swap-sqr18.2%
add-sqr-sqrt18.2%
pow218.2%
Applied egg-rr18.2%
associate-*l/22.1%
*-commutative22.1%
times-frac22.1%
Simplified22.1%
associate-*l/21.1%
Applied egg-rr21.1%
div-inv21.1%
unpow221.1%
associate-*r*24.3%
*-commutative24.3%
associate-*r/27.0%
*-commutative27.0%
associate-*l*29.0%
un-div-inv29.0%
Applied egg-rr29.0%
clear-num29.0%
associate-*r/34.4%
frac-times34.3%
*-un-lft-identity34.3%
*-commutative34.3%
Applied egg-rr34.3%
Final simplification73.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 0.0)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+305)
(* 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 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 1e+305) {
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 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 1d+305) 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 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+305) {
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 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 1e+305: 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 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+305) 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 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 1e+305)
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, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], 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 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;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)) < 0.0Initial program 37.9%
associate-/r*58.1%
Simplified58.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e304Initial program 97.7%
if 9.9999999999999994e304 < (/.f64 A (*.f64 V l)) Initial program 34.5%
add-sqr-sqrt18.5%
sqrt-unprod18.7%
*-commutative18.7%
*-commutative18.7%
swap-sqr18.2%
add-sqr-sqrt18.2%
pow218.2%
Applied egg-rr18.2%
associate-*l/22.1%
*-commutative22.1%
times-frac22.1%
Simplified22.1%
unpow221.1%
associate-/l*24.3%
Applied egg-rr27.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 2e+195)))
(* 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 <= 2e+195)) {
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 <= 2d+195))) 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 <= 2e+195)) {
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 <= 2e+195): 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 <= 2e+195)) 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 <= 2e+195)))
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, 2e+195]], $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 2 \cdot 10^{+195}\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 1.99999999999999995e195 < (/.f64 A (*.f64 V l)) Initial program 43.4%
associate-/r*54.9%
Simplified54.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.99999999999999995e195Initial program 98.4%
Final simplification77.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 2e+254)
(* c0_m (sqrt 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 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 2e+254) {
tmp = c0_m * sqrt(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 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 2d+254) then
tmp = c0_m * sqrt(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 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+254) {
tmp = c0_m * Math.sqrt(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 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 2e+254: tmp = c0_m * math.sqrt(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(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 <= 2e+254) tmp = Float64(c0_m * sqrt(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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 2e+254)
tmp = c0_m * sqrt(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[(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, 2e+254], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], 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 := \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 2 \cdot 10^{+254}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 37.9%
associate-/r*58.1%
Simplified58.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.9999999999999999e254Initial program 98.4%
if 1.9999999999999999e254 < (/.f64 A (*.f64 V l)) Initial program 41.6%
associate-/r*52.1%
clear-num52.1%
sqrt-div52.6%
metadata-eval52.6%
clear-num52.1%
associate-/r*41.6%
clear-num42.2%
associate-/l*51.5%
Applied egg-rr51.5%
un-div-inv51.5%
associate-*r/42.2%
*-commutative42.2%
associate-/l*52.6%
Applied egg-rr52.6%
associate-*r/42.2%
*-commutative42.2%
associate-/l*51.5%
Simplified51.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 2e+259)
(* c0_m (sqrt 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 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 2e+259) {
tmp = c0_m * sqrt(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 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 2d+259) then
tmp = c0_m * sqrt(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 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+259) {
tmp = c0_m * Math.sqrt(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 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 2e+259: tmp = c0_m * math.sqrt(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(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 <= 2e+259) tmp = Float64(c0_m * sqrt(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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 2e+259)
tmp = c0_m * sqrt(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[(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, 2e+259], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], 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 := \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 2 \cdot 10^{+259}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 37.9%
associate-/r*58.1%
Simplified58.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 2e259Initial program 97.9%
if 2e259 < (/.f64 A (*.f64 V l)) Initial program 40.1%
Taylor expanded in c0 around 0 40.1%
*-commutative40.1%
associate-/r*48.3%
Simplified48.3%
Final simplification77.9%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (* c0_s (* c0_m (sqrt (/ A (* V l))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
return c0_s * (c0_m * sqrt((A / (V * l))));
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0_s * (c0_m * sqrt((a / (v * l))))
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
return c0_s * (c0_m * Math.sqrt((A / (V * l))));
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): return c0_s * (c0_m * math.sqrt((A / (V * l))))
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) return Float64(c0_s * Float64(c0_m * sqrt(Float64(A / Float64(V * l))))) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp = code(c0_s, c0_m, A, V, l)
tmp = c0_s * (c0_m * sqrt((A / (V * l))));
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)
\end{array}
Initial program 71.9%
herbie shell --seed 2024136
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))