
(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
(let* ((t_0 (sqrt (- A))))
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* (/ t_0 (sqrt (- V))) (/ c0_m (sqrt l)))
(if (<= (* V l) -1e-304)
(* c0_m (/ t_0 (sqrt (* V (- l)))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+301)))
(sqrt (/ (* c0_m (/ A l)) (/ V c0_m)))
(/ c0_m (/ (sqrt (* V l)) (sqrt A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = sqrt(-A);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (t_0 / sqrt(-V)) * (c0_m / sqrt(l));
} else if ((V * l) <= -1e-304) {
tmp = c0_m * (t_0 / sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+301)) {
tmp = sqrt(((c0_m * (A / l)) / (V / c0_m)));
} else {
tmp = c0_m / (sqrt((V * l)) / sqrt(A));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = Math.sqrt(-A);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (t_0 / Math.sqrt(-V)) * (c0_m / Math.sqrt(l));
} else if ((V * l) <= -1e-304) {
tmp = c0_m * (t_0 / Math.sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+301)) {
tmp = Math.sqrt(((c0_m * (A / l)) / (V / c0_m)));
} else {
tmp = c0_m / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = math.sqrt(-A) tmp = 0 if (V * l) <= -math.inf: tmp = (t_0 / math.sqrt(-V)) * (c0_m / math.sqrt(l)) elif (V * l) <= -1e-304: tmp = c0_m * (t_0 / math.sqrt((V * -l))) elif ((V * l) <= 0.0) or not ((V * l) <= 1e+301): tmp = math.sqrt(((c0_m * (A / l)) / (V / c0_m))) else: tmp = c0_m / (math.sqrt((V * l)) / math.sqrt(A)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = sqrt(Float64(-A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(t_0 / sqrt(Float64(-V))) * Float64(c0_m / sqrt(l))); elseif (Float64(V * l) <= -1e-304) tmp = Float64(c0_m * Float64(t_0 / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+301)) tmp = sqrt(Float64(Float64(c0_m * Float64(A / l)) / Float64(V / c0_m))); else tmp = Float64(c0_m / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = sqrt(-A);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (t_0 / sqrt(-V)) * (c0_m / sqrt(l));
elseif ((V * l) <= -1e-304)
tmp = c0_m * (t_0 / sqrt((V * -l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+301)))
tmp = sqrt(((c0_m * (A / l)) / (V / c0_m)));
else
tmp = c0_m / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[(-A)], $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], 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], -1e-304], N[(c0$95$m * N[(t$95$0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+301]], $MachinePrecision]], N[Sqrt[N[(N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{-A}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{-V}} \cdot \frac{c0\_m}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-304}:\\
\;\;\;\;c0\_m \cdot \frac{t\_0}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+301}\right):\\
\;\;\;\;\sqrt{\frac{c0\_m \cdot \frac{A}{\ell}}{\frac{V}{c0\_m}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 48.2%
associate-/r*77.9%
sqrt-div38.3%
associate-*r/38.5%
Applied egg-rr38.5%
*-commutative38.5%
associate-/l*38.5%
Simplified38.5%
frac-2neg38.5%
sqrt-div38.5%
Applied egg-rr38.5%
if -inf.0 < (*.f64 V l) < -9.99999999999999971e-305Initial program 80.9%
frac-2neg80.9%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -9.99999999999999971e-305 < (*.f64 V l) < 0.0 or 1.00000000000000005e301 < (*.f64 V l) Initial program 34.5%
add-sqr-sqrt24.7%
sqrt-unprod24.8%
*-commutative24.8%
*-commutative24.8%
swap-sqr24.4%
add-sqr-sqrt24.4%
pow224.4%
Applied egg-rr24.4%
associate-*l/22.3%
*-commutative22.3%
times-frac37.6%
Simplified37.6%
unpow237.6%
*-un-lft-identity37.6%
times-frac41.8%
Applied egg-rr41.8%
/-rgt-identity41.8%
associate-*r*43.8%
clear-num43.8%
un-div-inv43.8%
Applied egg-rr43.8%
if 0.0 < (*.f64 V l) < 1.00000000000000005e301Initial program 85.4%
associate-/r*75.8%
div-inv75.7%
div-inv75.7%
associate-*l*85.4%
Applied egg-rr85.4%
associate-*l/85.4%
*-un-lft-identity85.4%
Applied egg-rr85.4%
associate-*r/71.8%
div-inv71.8%
clear-num70.6%
metadata-eval70.6%
un-div-inv70.6%
clear-num71.4%
add-sqr-sqrt71.2%
frac-times71.3%
sqrt-unprod71.1%
add-sqr-sqrt71.3%
un-div-inv71.4%
Applied egg-rr71.4%
associate-*r/83.4%
sqrt-div98.7%
Applied egg-rr98.7%
Final simplification86.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
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-304)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+301)))
(sqrt (/ (* c0_m (/ A l)) (/ V c0_m)))
(/ c0_m (/ (sqrt (* V l)) (sqrt A))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-304) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+301)) {
tmp = sqrt(((c0_m * (A / l)) / (V / c0_m)));
} else {
tmp = c0_m / (sqrt((V * l)) / sqrt(A));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-304) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+301)) {
tmp = Math.sqrt(((c0_m * (A / l)) / (V / c0_m)));
} else {
tmp = c0_m / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-304: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif ((V * l) <= 0.0) or not ((V * l) <= 1e+301): tmp = math.sqrt(((c0_m * (A / l)) / (V / c0_m))) else: tmp = c0_m / (math.sqrt((V * l)) / math.sqrt(A)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-304) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+301)) tmp = sqrt(Float64(Float64(c0_m * Float64(A / l)) / Float64(V / c0_m))); else tmp = Float64(c0_m / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-304)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+301)))
tmp = sqrt(((c0_m * (A / l)) / (V / c0_m)));
else
tmp = c0_m / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-304], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+301]], $MachinePrecision]], N[Sqrt[N[(N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-304}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+301}\right):\\
\;\;\;\;\sqrt{\frac{c0\_m \cdot \frac{A}{\ell}}{\frac{V}{c0\_m}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 48.2%
associate-/r*77.9%
sqrt-div38.3%
associate-*r/38.5%
Applied egg-rr38.5%
associate-/l*38.3%
Simplified38.3%
if -inf.0 < (*.f64 V l) < -9.99999999999999971e-305Initial program 80.9%
frac-2neg80.9%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -9.99999999999999971e-305 < (*.f64 V l) < 0.0 or 1.00000000000000005e301 < (*.f64 V l) Initial program 34.5%
add-sqr-sqrt24.7%
sqrt-unprod24.8%
*-commutative24.8%
*-commutative24.8%
swap-sqr24.4%
add-sqr-sqrt24.4%
pow224.4%
Applied egg-rr24.4%
associate-*l/22.3%
*-commutative22.3%
times-frac37.6%
Simplified37.6%
unpow237.6%
*-un-lft-identity37.6%
times-frac41.8%
Applied egg-rr41.8%
/-rgt-identity41.8%
associate-*r*43.8%
clear-num43.8%
un-div-inv43.8%
Applied egg-rr43.8%
if 0.0 < (*.f64 V l) < 1.00000000000000005e301Initial program 85.4%
associate-/r*75.8%
div-inv75.7%
div-inv75.7%
associate-*l*85.4%
Applied egg-rr85.4%
associate-*l/85.4%
*-un-lft-identity85.4%
Applied egg-rr85.4%
associate-*r/71.8%
div-inv71.8%
clear-num70.6%
metadata-eval70.6%
un-div-inv70.6%
clear-num71.4%
add-sqr-sqrt71.2%
frac-times71.3%
sqrt-unprod71.1%
add-sqr-sqrt71.3%
un-div-inv71.4%
Applied egg-rr71.4%
associate-*r/83.4%
sqrt-div98.7%
Applied egg-rr98.7%
Final simplification86.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 1e-310)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= t_0 5e+306)
(* c0_m (sqrt t_0))
(sqrt (/ (* c0_m (/ A 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 <= 1e-310) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if (t_0 <= 5e+306) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((c0_m * (A / 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 <= 1d-310) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if (t_0 <= 5d+306) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((c0_m * (a / 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 <= 1e-310) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (t_0 <= 5e+306) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((c0_m * (A / 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 <= 1e-310: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif t_0 <= 5e+306: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((c0_m * (A / 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 <= 1e-310) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (t_0 <= 5e+306) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(c0_m * Float64(A / 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 <= 1e-310)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif (t_0 <= 5e+306)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((c0_m * (A / 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, 1e-310], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-310}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{c0\_m \cdot \frac{A}{\ell}}{\frac{V}{c0\_m}}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.999999999999969e-311Initial program 35.8%
associate-/r*50.0%
sqrt-div34.4%
associate-*r/34.3%
Applied egg-rr34.3%
associate-/l*34.4%
Simplified34.4%
if 9.999999999999969e-311 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 99.5%
if 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 36.9%
add-sqr-sqrt18.9%
sqrt-unprod19.1%
*-commutative19.1%
*-commutative19.1%
swap-sqr18.8%
add-sqr-sqrt18.8%
pow218.8%
Applied egg-rr18.8%
associate-*l/21.3%
*-commutative21.3%
times-frac27.2%
Simplified27.2%
unpow227.2%
*-un-lft-identity27.2%
times-frac29.0%
Applied egg-rr29.0%
/-rgt-identity29.0%
associate-*r*30.9%
clear-num30.9%
un-div-inv30.9%
Applied egg-rr30.9%
Final simplification71.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 (or (<= t_0 0.0) (not (<= t_0 5e+306)))
(sqrt (/ (* c0_m (/ A l)) (/ V c0_m)))
(* c0_m (sqrt t_0))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
tmp = sqrt(((c0_m * (A / l)) / (V / c0_m)));
} else {
tmp = c0_m * sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+306))) then
tmp = sqrt(((c0_m * (a / l)) / (v / c0_m)))
else
tmp = c0_m * sqrt(t_0)
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
tmp = Math.sqrt(((c0_m * (A / l)) / (V / c0_m)));
} else {
tmp = c0_m * Math.sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+306): tmp = math.sqrt(((c0_m * (A / l)) / (V / c0_m))) else: tmp = c0_m * math.sqrt(t_0) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) tmp = sqrt(Float64(Float64(c0_m * Float64(A / l)) / Float64(V / c0_m))); else tmp = Float64(c0_m * sqrt(t_0)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+306)))
tmp = sqrt(((c0_m * (A / l)) / (V / c0_m)));
else
tmp = c0_m * sqrt(t_0);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+306]], $MachinePrecision]], N[Sqrt[N[(N[(c0$95$m * N[(A / l), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+306}\right):\\
\;\;\;\;\sqrt{\frac{c0\_m \cdot \frac{A}{\ell}}{\frac{V}{c0\_m}}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 35.6%
add-sqr-sqrt27.1%
sqrt-unprod27.2%
*-commutative27.2%
*-commutative27.2%
swap-sqr26.7%
add-sqr-sqrt26.7%
pow226.7%
Applied egg-rr26.7%
associate-*l/30.6%
*-commutative30.6%
times-frac34.5%
Simplified34.5%
unpow234.5%
*-un-lft-identity34.5%
times-frac40.0%
Applied egg-rr40.0%
/-rgt-identity40.0%
associate-*r*41.8%
clear-num41.8%
un-div-inv41.8%
Applied egg-rr41.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
Final simplification75.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 5e+306)))
(sqrt (* (/ A l) (/ c0_m (/ V c0_m))))
(* c0_m (sqrt t_0))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
tmp = sqrt(((A / l) * (c0_m / (V / c0_m))));
} else {
tmp = c0_m * sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+306))) then
tmp = sqrt(((a / l) * (c0_m / (v / c0_m))))
else
tmp = c0_m * sqrt(t_0)
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
tmp = Math.sqrt(((A / l) * (c0_m / (V / c0_m))));
} else {
tmp = c0_m * Math.sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+306): tmp = math.sqrt(((A / l) * (c0_m / (V / c0_m)))) else: tmp = c0_m * math.sqrt(t_0) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m / Float64(V / c0_m)))); else tmp = Float64(c0_m * sqrt(t_0)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+306)))
tmp = sqrt(((A / l) * (c0_m / (V / c0_m))));
else
tmp = c0_m * sqrt(t_0);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+306]], $MachinePrecision]], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m / N[(V / c0$95$m), $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 5 \cdot 10^{+306}\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \frac{c0\_m}{\frac{V}{c0\_m}}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 35.6%
add-sqr-sqrt27.1%
sqrt-unprod27.2%
*-commutative27.2%
*-commutative27.2%
swap-sqr26.7%
add-sqr-sqrt26.7%
pow226.7%
Applied egg-rr26.7%
associate-*l/30.6%
*-commutative30.6%
times-frac34.5%
Simplified34.5%
unpow234.5%
*-un-lft-identity34.5%
times-frac40.0%
Applied egg-rr40.0%
/-rgt-identity40.0%
clear-num40.0%
un-div-inv40.0%
Applied egg-rr40.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
Final simplification74.4%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 0.0)
(/ c0_m (sqrt (/ l (/ A V))))
(if (<= t_0 5e+306)
(* 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 = c0_m / sqrt((l / (A / V)));
} else if (t_0 <= 5e+306) {
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 = c0_m / sqrt((l / (a / v)))
else if (t_0 <= 5d+306) 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 = c0_m / Math.sqrt((l / (A / V)));
} else if (t_0 <= 5e+306) {
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 = c0_m / math.sqrt((l / (A / V))) elif t_0 <= 5e+306: 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 = Float64(c0_m / sqrt(Float64(l / Float64(A / V)))); elseif (t_0 <= 5e+306) 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 = c0_m / sqrt((l / (A / V)));
elseif (t_0 <= 5e+306)
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[(c0$95$m / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], 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:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;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 34.5%
associate-/r*49.8%
div-inv49.8%
div-inv49.8%
associate-*l*38.2%
Applied egg-rr38.2%
div-inv38.2%
*-commutative38.2%
associate-*l/49.8%
frac-2neg49.8%
sqrt-div35.8%
associate-*l/35.8%
*-un-lft-identity35.8%
distribute-neg-frac235.8%
Applied egg-rr35.8%
distribute-frac-neg235.8%
distribute-frac-neg35.8%
Simplified35.8%
clear-num35.8%
un-div-inv35.8%
sqrt-undiv49.9%
add-sqr-sqrt23.9%
sqrt-unprod17.1%
sqr-neg17.1%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod9.6%
sqr-neg9.6%
sqrt-unprod16.5%
add-sqr-sqrt49.9%
Applied egg-rr49.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
if 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 36.9%
associate-/r*48.4%
div-inv48.4%
div-inv48.4%
associate-*l*36.9%
Applied egg-rr36.9%
associate-*l/36.9%
*-un-lft-identity36.9%
Applied egg-rr36.9%
associate-*r/48.3%
div-inv48.4%
clear-num48.4%
metadata-eval48.4%
un-div-inv48.4%
clear-num48.4%
add-sqr-sqrt48.4%
frac-times48.4%
sqrt-unprod50.2%
add-sqr-sqrt50.3%
inv-pow50.3%
sqrt-pow250.3%
metadata-eval50.3%
Applied egg-rr50.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 (or (<= t_0 0.0) (not (<= t_0 5e+306)))
(* c0_m (sqrt (/ (/ A l) V)))
(* c0_m (sqrt t_0))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
tmp = c0_m * sqrt(((A / l) / V));
} else {
tmp = c0_m * sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+306))) then
tmp = c0_m * sqrt(((a / l) / v))
else
tmp = c0_m * sqrt(t_0)
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else {
tmp = c0_m * Math.sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+306): tmp = c0_m * math.sqrt(((A / l) / V)) else: tmp = c0_m * math.sqrt(t_0) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); else tmp = Float64(c0_m * sqrt(t_0)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+306)))
tmp = c0_m * sqrt(((A / l) / V));
else
tmp = c0_m * sqrt(t_0);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+306]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+306}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 35.6%
Taylor expanded in c0 around 0 35.6%
*-commutative35.6%
associate-/r*49.1%
Simplified49.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
Final simplification78.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 1e-310) (not (<= t_0 5e+300)))
(* 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 <= 1e-310) || !(t_0 <= 5e+300)) {
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 <= 1d-310) .or. (.not. (t_0 <= 5d+300))) 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 <= 1e-310) || !(t_0 <= 5e+300)) {
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 <= 1e-310) or not (t_0 <= 5e+300): 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 <= 1e-310) || !(t_0 <= 5e+300)) 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 <= 1e-310) || ~((t_0 <= 5e+300)))
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, 1e-310], N[Not[LessEqual[t$95$0, 5e+300]], $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 10^{-310} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+300}\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)) < 9.999999999999969e-311 or 5.00000000000000026e300 < (/.f64 A (*.f64 V l)) Initial program 36.9%
associate-/r*48.8%
Simplified48.8%
if 9.999999999999969e-311 < (/.f64 A (*.f64 V l)) < 5.00000000000000026e300Initial program 99.5%
Final simplification77.7%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 0.0)
(/ c0_m (sqrt (/ l (/ A V))))
(if (<= t_0 5e+306)
(* 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((l / (A / V)));
} else if (t_0 <= 5e+306) {
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((l / (a / v)))
else if (t_0 <= 5d+306) 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((l / (A / V)));
} else if (t_0 <= 5e+306) {
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((l / (A / V))) elif t_0 <= 5e+306: 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(l / Float64(A / V)))); elseif (t_0 <= 5e+306) 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((l / (A / V)));
elseif (t_0 <= 5e+306)
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[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], 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:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;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 34.5%
associate-/r*49.8%
div-inv49.8%
div-inv49.8%
associate-*l*38.2%
Applied egg-rr38.2%
div-inv38.2%
*-commutative38.2%
associate-*l/49.8%
frac-2neg49.8%
sqrt-div35.8%
associate-*l/35.8%
*-un-lft-identity35.8%
distribute-neg-frac235.8%
Applied egg-rr35.8%
distribute-frac-neg235.8%
distribute-frac-neg35.8%
Simplified35.8%
clear-num35.8%
un-div-inv35.8%
sqrt-undiv49.9%
add-sqr-sqrt23.9%
sqrt-unprod17.1%
sqr-neg17.1%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod9.6%
sqr-neg9.6%
sqrt-unprod16.5%
add-sqr-sqrt49.9%
Applied egg-rr49.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
if 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 36.9%
associate-/r*48.4%
div-inv48.4%
div-inv48.4%
associate-*l*36.9%
Applied egg-rr36.9%
associate-*l/36.9%
*-un-lft-identity36.9%
Applied egg-rr36.9%
associate-*r/48.3%
div-inv48.4%
clear-num48.4%
metadata-eval48.4%
un-div-inv48.4%
clear-num48.4%
add-sqr-sqrt48.4%
frac-times48.4%
sqrt-unprod50.2%
add-sqr-sqrt50.3%
un-div-inv50.3%
Applied egg-rr50.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 (* l (/ V A))))
(if (<= t_0 5e+306)
(* 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((l * (V / A)));
} else if (t_0 <= 5e+306) {
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((l * (v / a)))
else if (t_0 <= 5d+306) 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((l * (V / A)));
} else if (t_0 <= 5e+306) {
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((l * (V / A))) elif t_0 <= 5e+306: 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(l * Float64(V / A)))); elseif (t_0 <= 5e+306) 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((l * (V / A)));
elseif (t_0 <= 5e+306)
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[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], 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:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;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 34.5%
associate-/r*49.8%
div-inv49.8%
div-inv49.8%
associate-*l*38.2%
Applied egg-rr38.2%
associate-*l/38.2%
*-un-lft-identity38.2%
Applied egg-rr38.2%
associate-*r/49.8%
div-inv49.8%
clear-num49.8%
metadata-eval49.8%
un-div-inv49.8%
clear-num49.8%
add-sqr-sqrt49.8%
frac-times49.8%
sqrt-unprod49.7%
add-sqr-sqrt49.8%
un-div-inv49.9%
Applied egg-rr49.9%
associate-*r/34.5%
*-commutative34.5%
associate-/l*49.8%
Simplified49.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
if 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 36.9%
associate-/r*48.4%
div-inv48.4%
div-inv48.4%
associate-*l*36.9%
Applied egg-rr36.9%
associate-*l/36.9%
*-un-lft-identity36.9%
Applied egg-rr36.9%
associate-*r/48.3%
div-inv48.4%
clear-num48.4%
metadata-eval48.4%
un-div-inv48.4%
clear-num48.4%
add-sqr-sqrt48.4%
frac-times48.4%
sqrt-unprod50.2%
add-sqr-sqrt50.3%
un-div-inv50.3%
Applied egg-rr50.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 l) V)))
(if (<= t_0 5e+306)
(* 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 / l) / V));
} else if (t_0 <= 5e+306) {
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 / l) / v))
else if (t_0 <= 5d+306) 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 / l) / V));
} else if (t_0 <= 5e+306) {
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 / l) / V)) elif t_0 <= 5e+306: 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 / l) / V))); elseif (t_0 <= 5e+306) 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 / l) / V));
elseif (t_0 <= 5e+306)
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 / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], 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}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;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 34.5%
Taylor expanded in c0 around 0 34.5%
*-commutative34.5%
associate-/r*49.8%
Simplified49.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306Initial program 98.7%
if 4.99999999999999993e306 < (/.f64 A (*.f64 V l)) Initial program 36.9%
associate-/r*48.4%
div-inv48.4%
div-inv48.4%
associate-*l*36.9%
Applied egg-rr36.9%
associate-*l/36.9%
*-un-lft-identity36.9%
Applied egg-rr36.9%
associate-*r/48.3%
div-inv48.4%
clear-num48.4%
metadata-eval48.4%
un-div-inv48.4%
clear-num48.4%
add-sqr-sqrt48.4%
frac-times48.4%
sqrt-unprod50.2%
add-sqr-sqrt50.3%
un-div-inv50.3%
Applied egg-rr50.3%
Final simplification78.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 (* 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 72.6%
herbie shell --seed 2024135
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))