
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(/ (sqrt (* A (* c0_m (/ c0_m V)))) (sqrt l))
(if (<= (* V l) -6e-287)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 2e+297)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* A (* (/ c0_m V) (/ c0_m 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) <= -((double) INFINITY)) {
tmp = sqrt((A * (c0_m * (c0_m / V)))) / sqrt(l);
} else if ((V * l) <= -6e-287) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 2e+297) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt((A * ((c0_m / V) * (c0_m / 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 tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((A * (c0_m * (c0_m / V)))) / Math.sqrt(l);
} else if ((V * l) <= -6e-287) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 2e+297) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt((A * ((c0_m / V) * (c0_m / 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) <= -math.inf: tmp = math.sqrt((A * (c0_m * (c0_m / V)))) / math.sqrt(l) elif (V * l) <= -6e-287: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 2e+297: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt((A * ((c0_m / V) * (c0_m / 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) <= Float64(-Inf)) tmp = Float64(sqrt(Float64(A * Float64(c0_m * Float64(c0_m / V)))) / sqrt(l)); elseif (Float64(V * l) <= -6e-287) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 2e+297) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / 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) <= -Inf)
tmp = sqrt((A * (c0_m * (c0_m / V)))) / sqrt(l);
elseif ((V * l) <= -6e-287)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 2e+297)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((A * ((c0_m / V) * (c0_m / 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], (-Infinity)], N[(N[Sqrt[N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -6e-287], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+297], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / 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 -\infty:\\
\;\;\;\;\frac{\sqrt{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -6 \cdot 10^{-287}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+297}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 38.7%
*-commutative38.7%
associate-/r*45.6%
sqrt-div36.0%
associate-*l/36.0%
Applied egg-rr36.0%
add-sqr-sqrt35.8%
sqrt-unprod36.0%
swap-sqr35.7%
add-sqr-sqrt35.6%
pow235.6%
Applied egg-rr35.6%
associate-*l/29.0%
associate-/l*35.9%
Simplified35.9%
unpow235.9%
associate-/l*35.8%
Applied egg-rr35.8%
if -inf.0 < (*.f64 V l) < -5.99999999999999984e-287Initial program 88.8%
frac-2neg88.8%
sqrt-div99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Simplified99.3%
if -5.99999999999999984e-287 < (*.f64 V l) < -0.0Initial program 30.2%
associate-/r*51.1%
sqrt-div29.9%
div-inv29.8%
Applied egg-rr29.8%
associate-*r/29.9%
*-rgt-identity29.9%
Simplified29.9%
if -0.0 < (*.f64 V l) < 2e297Initial program 79.4%
sqrt-div98.5%
div-inv98.4%
Applied egg-rr98.4%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
if 2e297 < (*.f64 V l) Initial program 45.0%
associate-/r*45.0%
clear-num45.0%
sqrt-div45.0%
metadata-eval45.0%
div-inv45.0%
clear-num45.0%
Applied egg-rr45.0%
*-commutative45.0%
associate-*l/45.0%
associate-/l*45.0%
Simplified45.0%
un-div-inv45.0%
*-commutative45.0%
associate-*l/45.0%
associate-*r/45.0%
un-div-inv45.0%
add-sqr-sqrt45.0%
sqrt-unprod45.0%
un-div-inv45.0%
un-div-inv45.0%
frac-times43.5%
pow243.5%
add-sqr-sqrt43.5%
Applied egg-rr43.5%
associate-*r/43.5%
*-commutative43.5%
associate-/r/43.8%
Simplified43.8%
unpow243.8%
*-commutative43.8%
times-frac58.2%
Applied egg-rr58.2%
Final simplification82.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 (<= A -5e-310)
(/ (* (/ (sqrt (- A)) (sqrt (- V))) c0_m) (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 tmp;
if (A <= -5e-310) {
tmp = ((sqrt(-A) / sqrt(-V)) * c0_m) / sqrt(l);
} 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 (a <= (-5d-310)) then
tmp = ((sqrt(-a) / sqrt(-v)) * c0_m) / sqrt(l)
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 (A <= -5e-310) {
tmp = ((Math.sqrt(-A) / Math.sqrt(-V)) * c0_m) / 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): tmp = 0 if A <= -5e-310: tmp = ((math.sqrt(-A) / math.sqrt(-V)) * c0_m) / 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) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * c0_m) / 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)
tmp = 0.0;
if (A <= -5e-310)
tmp = ((sqrt(-A) / sqrt(-V)) * c0_m) / 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_] := N[(c0$95$s * If[LessEqual[A, -5e-310], N[(N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0$95$m), $MachinePrecision] / N[Sqrt[l], $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}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0\_m}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.8%
*-commutative72.8%
associate-/r*73.0%
sqrt-div37.2%
associate-*l/35.6%
Applied egg-rr35.6%
frac-2neg35.6%
sqrt-div44.1%
Applied egg-rr44.1%
if -4.999999999999985e-310 < A Initial program 68.3%
sqrt-div83.9%
div-inv83.8%
Applied egg-rr83.8%
associate-*r/83.9%
*-rgt-identity83.9%
Simplified83.9%
Final simplification64.9%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= A -5e-310)
(* c0_m (/ (/ (sqrt (- A)) (sqrt (- V))) (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 tmp;
if (A <= -5e-310) {
tmp = c0_m * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} 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 (a <= (-5d-310)) then
tmp = c0_m * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
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 (A <= -5e-310) {
tmp = c0_m * ((Math.sqrt(-A) / Math.sqrt(-V)) / 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): tmp = 0 if A <= -5e-310: tmp = c0_m * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) else: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0_m * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); else tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0_m * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
else
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[A, -5e-310], N[(c0$95$m * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(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}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0\_m \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.8%
associate-/r*73.0%
sqrt-div37.2%
div-inv37.1%
Applied egg-rr37.1%
associate-*r/37.2%
*-rgt-identity37.2%
Simplified37.2%
frac-2neg35.6%
sqrt-div44.1%
Applied egg-rr44.1%
if -4.999999999999985e-310 < A Initial program 68.3%
sqrt-div83.9%
div-inv83.8%
Applied egg-rr83.8%
associate-*r/83.9%
*-rgt-identity83.9%
Simplified83.9%
Final simplification64.9%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (/ (sqrt (/ A V)) (sqrt l)))))
(*
c0_s
(if (<= (* V l) -1e+118)
t_0
(if (<= (* V l) -2e-124)
(* c0_m (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 2e+297)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* A (* (/ c0_m V) (/ c0_m 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+118) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0_m * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 2e+297) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt((A * ((c0_m / V) * (c0_m / 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+118)) then
tmp = t_0
else if ((v * l) <= (-2d-124)) then
tmp = c0_m * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 2d+297) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt((a * ((c0_m / v) * (c0_m / 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+118) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0_m * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 2e+297) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt((A * ((c0_m / V) * (c0_m / 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+118: tmp = t_0 elif (V * l) <= -2e-124: tmp = c0_m * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 2e+297: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt((A * ((c0_m / V) * (c0_m / 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+118) tmp = t_0; elseif (Float64(V * l) <= -2e-124) tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 2e+297) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / 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+118)
tmp = t_0;
elseif ((V * l) <= -2e-124)
tmp = c0_m * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 2e+297)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((A * ((c0_m / V) * (c0_m / 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+118], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-124], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 2e+297], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / 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^{+118}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-124}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+297}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999967e117 or -1.99999999999999987e-124 < (*.f64 V l) < -0.0Initial program 54.3%
associate-/r*64.3%
sqrt-div35.0%
div-inv34.9%
Applied egg-rr34.9%
associate-*r/35.0%
*-rgt-identity35.0%
Simplified35.0%
if -9.99999999999999967e117 < (*.f64 V l) < -1.99999999999999987e-124Initial program 92.9%
associate-/r*80.1%
clear-num80.0%
sqrt-div80.7%
metadata-eval80.7%
div-inv78.0%
clear-num78.0%
Applied egg-rr78.0%
*-commutative78.0%
associate-*l/95.3%
associate-/l*82.8%
Simplified82.8%
inv-pow82.8%
sqrt-pow282.8%
*-commutative82.8%
associate-*l/95.6%
associate-*r/78.1%
metadata-eval78.1%
Applied egg-rr78.1%
associate-*r/95.6%
*-commutative95.6%
associate-/l*82.8%
Simplified82.8%
Taylor expanded in V around 0 95.6%
if -0.0 < (*.f64 V l) < 2e297Initial program 79.4%
sqrt-div98.5%
div-inv98.4%
Applied egg-rr98.4%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
if 2e297 < (*.f64 V l) Initial program 45.0%
associate-/r*45.0%
clear-num45.0%
sqrt-div45.0%
metadata-eval45.0%
div-inv45.0%
clear-num45.0%
Applied egg-rr45.0%
*-commutative45.0%
associate-*l/45.0%
associate-/l*45.0%
Simplified45.0%
un-div-inv45.0%
*-commutative45.0%
associate-*l/45.0%
associate-*r/45.0%
un-div-inv45.0%
add-sqr-sqrt45.0%
sqrt-unprod45.0%
un-div-inv45.0%
un-div-inv45.0%
frac-times43.5%
pow243.5%
add-sqr-sqrt43.5%
Applied egg-rr43.5%
associate-*r/43.5%
*-commutative43.5%
associate-/r/43.8%
Simplified43.8%
unpow243.8%
*-commutative43.8%
times-frac58.2%
Applied egg-rr58.2%
Final simplification72.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+118)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-124)
(* c0_m (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0)
(/ c0_m (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 2e+297)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(sqrt (* A (* (/ c0_m V) (/ c0_m 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+118) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-124) {
tmp = c0_m * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 2e+297) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt((A * ((c0_m / V) * (c0_m / 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+118)) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-2d-124)) then
tmp = c0_m * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = c0_m / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 2d+297) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt((a * ((c0_m / v) * (c0_m / 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+118) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-124) {
tmp = c0_m * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 2e+297) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt((A * ((c0_m / V) * (c0_m / 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+118: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-124: tmp = c0_m * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = c0_m / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 2e+297: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt((A * ((c0_m / V) * (c0_m / 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+118) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-124) tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 2e+297) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / 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+118)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-124)
tmp = c0_m * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 2e+297)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((A * ((c0_m / V) * (c0_m / 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+118], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-124], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+297], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / 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 -1 \cdot 10^{+118}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-124}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+297}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999967e117Initial program 68.5%
associate-/r*71.1%
sqrt-div52.6%
div-inv52.5%
Applied egg-rr52.5%
associate-*r/52.6%
*-rgt-identity52.6%
Simplified52.6%
if -9.99999999999999967e117 < (*.f64 V l) < -1.99999999999999987e-124Initial program 92.9%
associate-/r*80.1%
clear-num80.0%
sqrt-div80.7%
metadata-eval80.7%
div-inv78.0%
clear-num78.0%
Applied egg-rr78.0%
*-commutative78.0%
associate-*l/95.3%
associate-/l*82.8%
Simplified82.8%
inv-pow82.8%
sqrt-pow282.8%
*-commutative82.8%
associate-*l/95.6%
associate-*r/78.1%
metadata-eval78.1%
Applied egg-rr78.1%
associate-*r/95.6%
*-commutative95.6%
associate-/l*82.8%
Simplified82.8%
Taylor expanded in V around 0 95.6%
if -1.99999999999999987e-124 < (*.f64 V l) < -0.0Initial program 44.8%
associate-/r*59.8%
clear-num59.8%
sqrt-div63.4%
metadata-eval63.4%
div-inv63.4%
clear-num63.4%
Applied egg-rr63.4%
*-commutative63.4%
associate-*l/44.8%
associate-/l*63.4%
Simplified63.4%
un-div-inv63.4%
*-commutative63.4%
associate-*l/44.7%
associate-*r/63.4%
sqrt-prod23.2%
associate-/r*23.2%
Applied egg-rr23.2%
associate-/r*23.2%
Simplified23.2%
if -0.0 < (*.f64 V l) < 2e297Initial program 79.4%
sqrt-div98.5%
div-inv98.4%
Applied egg-rr98.4%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
if 2e297 < (*.f64 V l) Initial program 45.0%
associate-/r*45.0%
clear-num45.0%
sqrt-div45.0%
metadata-eval45.0%
div-inv45.0%
clear-num45.0%
Applied egg-rr45.0%
*-commutative45.0%
associate-*l/45.0%
associate-/l*45.0%
Simplified45.0%
un-div-inv45.0%
*-commutative45.0%
associate-*l/45.0%
associate-*r/45.0%
un-div-inv45.0%
add-sqr-sqrt45.0%
sqrt-unprod45.0%
un-div-inv45.0%
un-div-inv45.0%
frac-times43.5%
pow243.5%
add-sqr-sqrt43.5%
Applied egg-rr43.5%
associate-*r/43.5%
*-commutative43.5%
associate-/r/43.8%
Simplified43.8%
unpow243.8%
*-commutative43.8%
times-frac58.2%
Applied egg-rr58.2%
Final simplification72.2%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (sqrt (* A (* (/ c0_m V) (/ c0_m l))))))
(*
c0_s
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -6e-287)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 2e+297)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
t_0)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = sqrt((A * ((c0_m / V) * (c0_m / l))));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -6e-287) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 2e+297) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = t_0;
}
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 * ((c0_m / V) * (c0_m / l))));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -6e-287) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 2e+297) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = math.sqrt((A * ((c0_m / V) * (c0_m / l)))) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -6e-287: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 2e+297: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = t_0 return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / l)))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -6e-287) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 2e+297) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = t_0; end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = sqrt((A * ((c0_m / V) * (c0_m / l))));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -6e-287)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 2e+297)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = t_0;
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -6e-287], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+297], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -6 \cdot 10^{-287}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+297}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or 2e297 < (*.f64 V l) Initial program 41.8%
associate-/r*45.3%
clear-num45.3%
sqrt-div45.2%
metadata-eval45.2%
div-inv45.2%
clear-num45.2%
Applied egg-rr45.2%
*-commutative45.2%
associate-*l/41.8%
associate-/l*45.2%
Simplified45.2%
un-div-inv45.2%
*-commutative45.2%
associate-*l/41.8%
associate-*r/45.2%
un-div-inv45.2%
add-sqr-sqrt45.3%
sqrt-unprod45.2%
un-div-inv45.2%
un-div-inv45.2%
frac-times44.0%
pow244.0%
add-sqr-sqrt44.0%
Applied egg-rr44.0%
associate-*r/40.5%
*-commutative40.5%
associate-/r/40.6%
Simplified40.6%
unpow240.6%
*-commutative40.6%
times-frac65.5%
Applied egg-rr65.5%
if -inf.0 < (*.f64 V l) < -5.99999999999999984e-287Initial program 88.8%
frac-2neg88.8%
sqrt-div99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Simplified99.3%
if -5.99999999999999984e-287 < (*.f64 V l) < -0.0Initial program 30.2%
associate-/r*51.1%
sqrt-div29.9%
div-inv29.8%
Applied egg-rr29.8%
associate-*r/29.9%
*-rgt-identity29.9%
Simplified29.9%
if -0.0 < (*.f64 V l) < 2e297Initial program 79.4%
sqrt-div98.5%
div-inv98.4%
Applied egg-rr98.4%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
Final simplification84.2%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 2e+302)))
(sqrt (* A (* (/ c0_m V) (/ c0_m 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+302)) {
tmp = sqrt((A * ((c0_m / V) * (c0_m / 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+302))) then
tmp = sqrt((a * ((c0_m / v) * (c0_m / 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+302)) {
tmp = Math.sqrt((A * ((c0_m / V) * (c0_m / 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+302): tmp = math.sqrt((A * ((c0_m / V) * (c0_m / 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+302)) tmp = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / 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+302)))
tmp = sqrt((A * ((c0_m / V) * (c0_m / 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+302]], $MachinePrecision]], N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / 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 0 \lor \neg \left(t\_0 \leq 2 \cdot 10^{+302}\right):\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 2.0000000000000002e302 < (/.f64 A (*.f64 V l)) Initial program 34.6%
associate-/r*43.0%
clear-num43.0%
sqrt-div45.8%
metadata-eval45.8%
div-inv45.8%
clear-num45.8%
Applied egg-rr45.8%
*-commutative45.8%
associate-*l/37.5%
associate-/l*47.4%
Simplified47.4%
un-div-inv47.4%
*-commutative47.4%
associate-*l/37.5%
associate-*r/45.8%
un-div-inv45.8%
add-sqr-sqrt29.8%
sqrt-unprod27.5%
un-div-inv27.5%
un-div-inv27.6%
frac-times24.4%
pow224.4%
add-sqr-sqrt24.4%
Applied egg-rr24.4%
associate-*r/22.7%
*-commutative22.7%
associate-/r/29.5%
Simplified29.5%
unpow229.5%
*-commutative29.5%
times-frac48.1%
Applied egg-rr48.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000002e302Initial program 99.3%
Final simplification76.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)
(sqrt (* A (* c0_m (/ c0_m (* V l)))))
(if (<= t_0 2e+302)
(* c0_m (sqrt t_0))
(* c0_m (pow (* V (/ l A)) -0.5)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt((A * (c0_m * (c0_m / (V * l)))));
} else if (t_0 <= 2e+302) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = c0_m * pow((V * (l / A)), -0.5);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = sqrt((a * (c0_m * (c0_m / (v * l)))))
else if (t_0 <= 2d+302) then
tmp = c0_m * sqrt(t_0)
else
tmp = c0_m * ((v * (l / a)) ** (-0.5d0))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt((A * (c0_m * (c0_m / (V * l)))));
} else if (t_0 <= 2e+302) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = c0_m * Math.pow((V * (l / A)), -0.5);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt((A * (c0_m * (c0_m / (V * l))))) elif t_0 <= 2e+302: tmp = c0_m * math.sqrt(t_0) else: tmp = c0_m * math.pow((V * (l / A)), -0.5) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(A * Float64(c0_m * Float64(c0_m / Float64(V * l))))); elseif (t_0 <= 2e+302) tmp = Float64(c0_m * sqrt(t_0)); else tmp = Float64(c0_m * (Float64(V * Float64(l / A)) ^ -0.5)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt((A * (c0_m * (c0_m / (V * l)))));
elseif (t_0 <= 2e+302)
tmp = c0_m * sqrt(t_0);
else
tmp = c0_m * ((V * (l / A)) ^ -0.5);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(A * N[(c0$95$m * N[(c0$95$m / N[(V * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 2e+302], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V \cdot \ell}\right)}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 38.3%
associate-/r*40.3%
clear-num40.3%
sqrt-div40.2%
metadata-eval40.2%
div-inv40.2%
clear-num40.2%
Applied egg-rr40.2%
*-commutative40.2%
associate-*l/38.3%
associate-/l*40.2%
Simplified40.2%
un-div-inv40.2%
*-commutative40.2%
associate-*l/38.3%
associate-*r/40.2%
un-div-inv40.2%
add-sqr-sqrt40.3%
sqrt-unprod40.2%
un-div-inv40.2%
un-div-inv40.2%
frac-times39.3%
pow239.3%
add-sqr-sqrt39.3%
Applied egg-rr39.3%
associate-*r/37.3%
*-commutative37.3%
associate-/r/45.5%
Simplified45.5%
unpow245.5%
associate-/l*52.3%
Applied egg-rr52.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000002e302Initial program 99.3%
if 2.0000000000000002e302 < (/.f64 A (*.f64 V l)) Initial program 31.9%
associate-/r*44.9%
clear-num44.9%
sqrt-div49.8%
metadata-eval49.8%
div-inv49.8%
clear-num49.9%
Applied egg-rr49.9%
*-commutative49.9%
associate-*l/37.0%
associate-/l*52.7%
Simplified52.7%
inv-pow52.7%
sqrt-pow252.7%
*-commutative52.7%
associate-*l/37.0%
associate-*r/49.9%
metadata-eval49.9%
Applied egg-rr49.9%
associate-*r/37.0%
*-commutative37.0%
associate-/l*52.7%
Simplified52.7%
Final simplification78.4%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 2e+302)
(* c0_m (sqrt t_0))
(* c0_m (pow (* V (/ l A)) -0.5))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e+302) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = c0_m * pow((V * (l / A)), -0.5);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 2d+302) then
tmp = c0_m * sqrt(t_0)
else
tmp = c0_m * ((v * (l / a)) ** (-0.5d0))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e+302) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = c0_m * Math.pow((V * (l / A)), -0.5);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e+302: tmp = c0_m * math.sqrt(t_0) else: tmp = c0_m * math.pow((V * (l / A)), -0.5) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e+302) tmp = Float64(c0_m * sqrt(t_0)); else tmp = Float64(c0_m * (Float64(V * Float64(l / A)) ^ -0.5)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e+302)
tmp = c0_m * sqrt(t_0);
else
tmp = c0_m * ((V * (l / A)) ^ -0.5);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e+302], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000000000000002e302Initial program 83.9%
if 2.0000000000000002e302 < (/.f64 A (*.f64 V l)) Initial program 31.9%
associate-/r*44.9%
clear-num44.9%
sqrt-div49.8%
metadata-eval49.8%
div-inv49.8%
clear-num49.9%
Applied egg-rr49.9%
*-commutative49.9%
associate-*l/37.0%
associate-/l*52.7%
Simplified52.7%
inv-pow52.7%
sqrt-pow252.7%
*-commutative52.7%
associate-*l/37.0%
associate-*r/49.9%
metadata-eval49.9%
Applied egg-rr49.9%
associate-*r/37.0%
*-commutative37.0%
associate-/l*52.7%
Simplified52.7%
Final simplification75.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 (/ A (* V l))))
(*
c0_s
(if (<= t_0 2e+276) (* c0_m (sqrt t_0)) (* 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) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e+276) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = c0_m * sqrt(((A / 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 = a / (v * l)
if (t_0 <= 2d+276) then
tmp = c0_m * sqrt(t_0)
else
tmp = c0_m * sqrt(((a / 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 = A / (V * l);
double tmp;
if (t_0 <= 2e+276) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = c0_m * Math.sqrt(((A / 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 = A / (V * l) tmp = 0 if t_0 <= 2e+276: tmp = c0_m * math.sqrt(t_0) else: tmp = c0_m * math.sqrt(((A / 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e+276) tmp = Float64(c0_m * sqrt(t_0)); else tmp = Float64(c0_m * sqrt(Float64(Float64(A / 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e+276)
tmp = c0_m * sqrt(t_0);
else
tmp = c0_m * sqrt(((A / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e+276], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $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^{+276}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000000000000001e276Initial program 83.6%
if 2.0000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 34.9%
associate-/r*47.3%
Simplified47.3%
Final simplification73.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 (/ A (* V l))))
(*
c0_s
(if (<= t_0 2e+302) (* 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 <= 2e+302) {
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 <= 2d+302) 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 <= 2e+302) {
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 <= 2e+302: 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 <= 2e+302) 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 <= 2e+302)
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, 2e+302], 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 2 \cdot 10^{+302}:\\
\;\;\;\;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)) < 2.0000000000000002e302Initial program 83.9%
if 2.0000000000000002e302 < (/.f64 A (*.f64 V l)) Initial program 31.9%
associate-/r*44.9%
clear-num44.9%
sqrt-div49.8%
metadata-eval49.8%
div-inv49.8%
clear-num49.9%
Applied egg-rr49.9%
*-commutative49.9%
associate-*l/37.0%
associate-/l*52.7%
Simplified52.7%
un-div-inv52.6%
*-commutative52.6%
associate-*l/37.0%
associate-*r/49.9%
Applied egg-rr49.9%
associate-*r/37.0%
*-commutative37.0%
associate-/l*52.6%
Simplified52.6%
Final simplification75.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 (* 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 70.5%
Final simplification70.5%
herbie shell --seed 2024067
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))