
(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 16 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) -5e+145)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -4e-307)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0_m (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 2e+274)
(* (sqrt A) (/ c0_m (sqrt (* V l))))
(sqrt (/ (* A (* c0_m (/ c0_m V))) l))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+145) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -4e-307) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 2e+274) {
tmp = sqrt(A) * (c0_m / sqrt((V * l)));
} else {
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d+145)) then
tmp = c0_m * (sqrt((a / -l)) / sqrt(-v))
else if ((v * l) <= (-4d-307)) then
tmp = c0_m * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0_m / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 2d+274) then
tmp = sqrt(a) * (c0_m / sqrt((v * l)))
else
tmp = sqrt(((a * (c0_m * (c0_m / v))) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+145) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -4e-307) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 2e+274) {
tmp = Math.sqrt(A) * (c0_m / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -5e+145: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -4e-307: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0_m / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 2e+274: tmp = math.sqrt(A) * (c0_m / math.sqrt((V * l))) else: tmp = math.sqrt(((A * (c0_m * (c0_m / V))) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+145) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -4e-307) 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(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 2e+274) tmp = Float64(sqrt(A) * Float64(c0_m / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / V))) / l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e+145)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -4e-307)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 2e+274)
tmp = sqrt(A) * (c0_m / sqrt((V * l)));
else
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e+145], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-307], 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[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+274], N[(N[Sqrt[A], $MachinePrecision] * N[(c0$95$m / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+145}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\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^{+274}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0\_m}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999967e145Initial program 77.3%
Taylor expanded in c0 around 0 77.3%
*-commutative77.3%
associate-/r*82.7%
Simplified82.7%
frac-2neg82.7%
sqrt-div41.5%
distribute-neg-frac241.5%
Applied egg-rr41.5%
distribute-frac-neg241.5%
distribute-frac-neg41.5%
Simplified41.5%
if -4.99999999999999967e145 < (*.f64 V l) < -3.99999999999999964e-307Initial program 88.6%
frac-2neg88.6%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -3.99999999999999964e-307 < (*.f64 V l) < -0.0Initial program 26.6%
Taylor expanded in c0 around 0 26.6%
*-commutative26.6%
associate-/r*47.2%
Simplified47.2%
*-commutative47.2%
clear-num47.0%
sqrt-div47.0%
metadata-eval47.0%
div-inv47.1%
clear-num47.1%
clear-num47.1%
un-div-inv47.2%
/-rgt-identity47.2%
Applied egg-rr47.2%
associate-*r/26.6%
*-commutative26.6%
associate-/l*47.2%
Simplified47.2%
*-commutative47.2%
sqrt-prod29.6%
Applied egg-rr29.6%
if -0.0 < (*.f64 V l) < 1.99999999999999984e274Initial program 84.7%
sqrt-div98.9%
associate-*r/94.7%
Applied egg-rr94.7%
*-commutative94.7%
associate-/l*96.3%
Simplified96.3%
if 1.99999999999999984e274 < (*.f64 V l) Initial program 23.9%
add-sqr-sqrt23.9%
sqrt-unprod23.9%
*-commutative23.9%
*-commutative23.9%
swap-sqr22.8%
add-sqr-sqrt22.8%
pow222.8%
Applied egg-rr22.8%
associate-*l/22.6%
*-commutative22.6%
times-frac35.7%
Simplified35.7%
associate-*l/35.9%
Applied egg-rr35.9%
unpow235.9%
associate-/l*42.5%
Applied egg-rr42.5%
Final simplification78.7%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) 0.0)
(/ (/ (sqrt (- A)) (sqrt (- V))) (/ (sqrt l) c0_m))
(if (<= (* V l) 2e+274)
(* (sqrt A) (/ c0_m (sqrt (* V l))))
(sqrt (/ (* A (* c0_m (/ c0_m V))) l))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = (sqrt(-A) / sqrt(-V)) / (sqrt(l) / c0_m);
} else if ((V * l) <= 2e+274) {
tmp = sqrt(A) * (c0_m / sqrt((V * l)));
} else {
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = (sqrt(-a) / sqrt(-v)) / (sqrt(l) / c0_m)
else if ((v * l) <= 2d+274) then
tmp = sqrt(a) * (c0_m / sqrt((v * l)))
else
tmp = sqrt(((a * (c0_m * (c0_m / v))) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = (Math.sqrt(-A) / Math.sqrt(-V)) / (Math.sqrt(l) / c0_m);
} else if ((V * l) <= 2e+274) {
tmp = Math.sqrt(A) * (c0_m / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = (math.sqrt(-A) / math.sqrt(-V)) / (math.sqrt(l) / c0_m) elif (V * l) <= 2e+274: tmp = math.sqrt(A) * (c0_m / math.sqrt((V * l))) else: tmp = math.sqrt(((A * (c0_m * (c0_m / V))) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / Float64(sqrt(l) / c0_m)); elseif (Float64(V * l) <= 2e+274) tmp = Float64(sqrt(A) * Float64(c0_m / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / V))) / l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = (sqrt(-A) / sqrt(-V)) / (sqrt(l) / c0_m);
elseif ((V * l) <= 2e+274)
tmp = sqrt(A) * (c0_m / sqrt((V * l)));
else
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+274], N[(N[Sqrt[A], $MachinePrecision] * N[(c0$95$m / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\frac{\sqrt{\ell}}{c0\_m}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0\_m}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0Initial program 72.2%
associate-/r*73.7%
sqrt-div33.0%
associate-*r/32.4%
Applied egg-rr32.4%
*-commutative32.4%
associate-/l*31.0%
Simplified31.0%
clear-num31.0%
un-div-inv31.1%
Applied egg-rr31.1%
frac-2neg31.1%
sqrt-div34.4%
Applied egg-rr34.4%
if -0.0 < (*.f64 V l) < 1.99999999999999984e274Initial program 84.7%
sqrt-div98.9%
associate-*r/94.7%
Applied egg-rr94.7%
*-commutative94.7%
associate-/l*96.3%
Simplified96.3%
if 1.99999999999999984e274 < (*.f64 V l) Initial program 23.9%
add-sqr-sqrt23.9%
sqrt-unprod23.9%
*-commutative23.9%
*-commutative23.9%
swap-sqr22.8%
add-sqr-sqrt22.8%
pow222.8%
Applied egg-rr22.8%
associate-*l/22.6%
*-commutative22.6%
times-frac35.7%
Simplified35.7%
associate-*l/35.9%
Applied egg-rr35.9%
unpow235.9%
associate-/l*42.5%
Applied egg-rr42.5%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) 0.0)
(* (/ (sqrt (- A)) (sqrt (- V))) (/ c0_m (sqrt l)))
(if (<= (* V l) 2e+274)
(* (sqrt A) (/ c0_m (sqrt (* V l))))
(sqrt (/ (* A (* c0_m (/ c0_m V))) l))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = (sqrt(-A) / sqrt(-V)) * (c0_m / sqrt(l));
} else if ((V * l) <= 2e+274) {
tmp = sqrt(A) * (c0_m / sqrt((V * l)));
} else {
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = (sqrt(-a) / sqrt(-v)) * (c0_m / sqrt(l))
else if ((v * l) <= 2d+274) then
tmp = sqrt(a) * (c0_m / sqrt((v * l)))
else
tmp = sqrt(((a * (c0_m * (c0_m / v))) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = (Math.sqrt(-A) / Math.sqrt(-V)) * (c0_m / Math.sqrt(l));
} else if ((V * l) <= 2e+274) {
tmp = Math.sqrt(A) * (c0_m / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = (math.sqrt(-A) / math.sqrt(-V)) * (c0_m / math.sqrt(l)) elif (V * l) <= 2e+274: tmp = math.sqrt(A) * (c0_m / math.sqrt((V * l))) else: tmp = math.sqrt(((A * (c0_m * (c0_m / V))) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * Float64(c0_m / sqrt(l))); elseif (Float64(V * l) <= 2e+274) tmp = Float64(sqrt(A) * Float64(c0_m / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / V))) / l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = (sqrt(-A) / sqrt(-V)) * (c0_m / sqrt(l));
elseif ((V * l) <= 2e+274)
tmp = sqrt(A) * (c0_m / sqrt((V * l)));
else
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+274], N[(N[Sqrt[A], $MachinePrecision] * N[(c0$95$m / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \frac{c0\_m}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0\_m}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0Initial program 72.2%
associate-/r*73.7%
sqrt-div33.0%
associate-*r/32.4%
Applied egg-rr32.4%
*-commutative32.4%
associate-/l*31.0%
Simplified31.0%
frac-2neg31.1%
sqrt-div34.4%
Applied egg-rr34.3%
if -0.0 < (*.f64 V l) < 1.99999999999999984e274Initial program 84.7%
sqrt-div98.9%
associate-*r/94.7%
Applied egg-rr94.7%
*-commutative94.7%
associate-/l*96.3%
Simplified96.3%
if 1.99999999999999984e274 < (*.f64 V l) Initial program 23.9%
add-sqr-sqrt23.9%
sqrt-unprod23.9%
*-commutative23.9%
*-commutative23.9%
swap-sqr22.8%
add-sqr-sqrt22.8%
pow222.8%
Applied egg-rr22.8%
associate-*l/22.6%
*-commutative22.6%
times-frac35.7%
Simplified35.7%
associate-*l/35.9%
Applied egg-rr35.9%
unpow235.9%
associate-/l*42.5%
Applied egg-rr42.5%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= V -1e-309)
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(* c0_m (/ (sqrt A) (* (sqrt l) (sqrt V)))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (V <= -1e-309) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else {
tmp = c0_m * (sqrt(A) / (sqrt(l) * sqrt(V)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-1d-309)) then
tmp = c0_m * (sqrt((a / -l)) / sqrt(-v))
else
tmp = c0_m * (sqrt(a) / (sqrt(l) * sqrt(v)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if (V <= -1e-309) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else {
tmp = c0_m * (Math.sqrt(A) / (Math.sqrt(l) * Math.sqrt(V)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if V <= -1e-309: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) else: tmp = c0_m * (math.sqrt(A) / (math.sqrt(l) * math.sqrt(V))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (V <= -1e-309) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); else tmp = Float64(c0_m * Float64(sqrt(A) / Float64(sqrt(l) * sqrt(V)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if (V <= -1e-309)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
else
tmp = c0_m * (sqrt(A) / (sqrt(l) * sqrt(V)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[V, -1e-309], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \leq -1 \cdot 10^{-309}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}\\
\end{array}
\end{array}
if V < -1.000000000000002e-309Initial program 73.3%
Taylor expanded in c0 around 0 73.3%
*-commutative73.3%
associate-/r*70.2%
Simplified70.2%
frac-2neg70.2%
sqrt-div83.7%
distribute-neg-frac283.7%
Applied egg-rr83.7%
distribute-frac-neg283.7%
distribute-frac-neg83.7%
Simplified83.7%
if -1.000000000000002e-309 < V Initial program 75.7%
associate-/r*74.4%
sqrt-div38.4%
associate-*r/37.4%
Applied egg-rr37.4%
*-commutative37.4%
associate-/l*38.4%
Simplified38.4%
*-commutative38.4%
clear-num38.4%
sqrt-div45.8%
frac-times44.1%
*-un-lft-identity44.1%
Applied egg-rr44.1%
associate-*l/44.7%
associate-/r/46.5%
*-commutative46.5%
Simplified46.5%
Final simplification63.5%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -2e+302)
(* (sqrt (/ A V)) (* c0_m (pow l -0.5)))
(if (<= (* V l) -4e-307)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0_m (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 2e+274)
(* (sqrt A) (/ c0_m (sqrt (* V l))))
(sqrt (/ (* A (* c0_m (/ c0_m V))) l))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+302) {
tmp = sqrt((A / V)) * (c0_m * pow(l, -0.5));
} else if ((V * l) <= -4e-307) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 2e+274) {
tmp = sqrt(A) * (c0_m / sqrt((V * l)));
} else {
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-2d+302)) then
tmp = sqrt((a / v)) * (c0_m * (l ** (-0.5d0)))
else if ((v * l) <= (-4d-307)) then
tmp = c0_m * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0_m / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 2d+274) then
tmp = sqrt(a) * (c0_m / sqrt((v * l)))
else
tmp = sqrt(((a * (c0_m * (c0_m / v))) / l))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+302) {
tmp = Math.sqrt((A / V)) * (c0_m * Math.pow(l, -0.5));
} else if ((V * l) <= -4e-307) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0_m / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 2e+274) {
tmp = Math.sqrt(A) * (c0_m / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m / V))) / l));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -2e+302: tmp = math.sqrt((A / V)) * (c0_m * math.pow(l, -0.5)) elif (V * l) <= -4e-307: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0_m / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 2e+274: tmp = math.sqrt(A) * (c0_m / math.sqrt((V * l))) else: tmp = math.sqrt(((A * (c0_m * (c0_m / V))) / l)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+302) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0_m * (l ^ -0.5))); elseif (Float64(V * l) <= -4e-307) 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(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 2e+274) tmp = Float64(sqrt(A) * Float64(c0_m / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / V))) / l)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+302)
tmp = sqrt((A / V)) * (c0_m * (l ^ -0.5));
elseif ((V * l) <= -4e-307)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0_m / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 2e+274)
tmp = sqrt(A) * (c0_m / sqrt((V * l)));
else
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -2e+302], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0$95$m * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-307], 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[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+274], N[(N[Sqrt[A], $MachinePrecision] * N[(c0$95$m / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+302}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \left(c0\_m \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-307}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\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^{+274}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0\_m}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000002e302Initial program 30.3%
associate-/r*47.9%
sqrt-div27.6%
associate-*r/27.8%
Applied egg-rr27.8%
*-commutative27.8%
associate-/l*27.9%
Simplified27.9%
clear-num27.8%
associate-/r/27.9%
pow1/227.9%
pow-flip27.9%
metadata-eval27.9%
Applied egg-rr27.9%
if -2.0000000000000002e302 < (*.f64 V l) < -3.99999999999999964e-307Initial program 91.1%
frac-2neg91.1%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -3.99999999999999964e-307 < (*.f64 V l) < -0.0Initial program 26.6%
Taylor expanded in c0 around 0 26.6%
*-commutative26.6%
associate-/r*47.2%
Simplified47.2%
*-commutative47.2%
clear-num47.0%
sqrt-div47.0%
metadata-eval47.0%
div-inv47.1%
clear-num47.1%
clear-num47.1%
un-div-inv47.2%
/-rgt-identity47.2%
Applied egg-rr47.2%
associate-*r/26.6%
*-commutative26.6%
associate-/l*47.2%
Simplified47.2%
*-commutative47.2%
sqrt-prod29.6%
Applied egg-rr29.6%
if -0.0 < (*.f64 V l) < 1.99999999999999984e274Initial program 84.7%
sqrt-div98.9%
associate-*r/94.7%
Applied egg-rr94.7%
*-commutative94.7%
associate-/l*96.3%
Simplified96.3%
if 1.99999999999999984e274 < (*.f64 V l) Initial program 23.9%
add-sqr-sqrt23.9%
sqrt-unprod23.9%
*-commutative23.9%
*-commutative23.9%
swap-sqr22.8%
add-sqr-sqrt22.8%
pow222.8%
Applied egg-rr22.8%
associate-*l/22.6%
*-commutative22.6%
times-frac35.7%
Simplified35.7%
associate-*l/35.9%
Applied egg-rr35.9%
unpow235.9%
associate-/l*42.5%
Applied egg-rr42.5%
Final simplification83.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 4e-317)
(/ (sqrt (/ A V)) (/ (sqrt l) c0_m))
(if (<= t_0 5e+292)
(* c0_m (sqrt t_0))
(sqrt (/ (* A (* c0_m (* c0_m (/ 1.0 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 <= 4e-317) {
tmp = sqrt((A / V)) / (sqrt(l) / c0_m);
} else if (t_0 <= 5e+292) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 4d-317) then
tmp = sqrt((a / v)) / (sqrt(l) / c0_m)
else if (t_0 <= 5d+292) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((a * (c0_m * (c0_m * (1.0d0 / 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 <= 4e-317) {
tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0_m);
} else if (t_0 <= 5e+292) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 4e-317: tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0_m) elif t_0 <= 5e+292: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 4e-317) tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0_m)); elseif (t_0 <= 5e+292) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m * Float64(1.0 / 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 <= 4e-317)
tmp = sqrt((A / V)) / (sqrt(l) / c0_m);
elseif (t_0 <= 5e+292)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / 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, 4e-317], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+292], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-317}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0\_m}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \left(c0\_m \cdot \frac{1}{V}\right)\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.99999993e-317Initial program 28.2%
associate-/r*39.2%
sqrt-div35.4%
associate-*r/35.4%
Applied egg-rr35.4%
*-commutative35.4%
associate-/l*35.4%
Simplified35.4%
clear-num35.4%
un-div-inv35.4%
Applied egg-rr35.4%
if 3.99999993e-317 < (/.f64 A (*.f64 V l)) < 4.9999999999999996e292Initial program 99.5%
if 4.9999999999999996e292 < (/.f64 A (*.f64 V l)) Initial program 34.5%
add-sqr-sqrt11.2%
sqrt-unprod11.3%
*-commutative11.3%
*-commutative11.3%
swap-sqr10.9%
add-sqr-sqrt10.9%
pow210.9%
Applied egg-rr10.9%
associate-*l/14.8%
*-commutative14.8%
times-frac15.2%
Simplified15.2%
associate-*l/19.2%
Applied egg-rr19.2%
div-inv19.2%
unpow219.2%
associate-*l*30.5%
Applied egg-rr30.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 4e-317)
(* (/ c0_m (sqrt l)) (sqrt (/ A V)))
(if (<= t_0 5e+292)
(* c0_m (sqrt t_0))
(sqrt (/ (* A (* c0_m (* c0_m (/ 1.0 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 <= 4e-317) {
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
} else if (t_0 <= 5e+292) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 4d-317) then
tmp = (c0_m / sqrt(l)) * sqrt((a / v))
else if (t_0 <= 5d+292) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((a * (c0_m * (c0_m * (1.0d0 / 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 <= 4e-317) {
tmp = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
} else if (t_0 <= 5e+292) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 4e-317: tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V)) elif t_0 <= 5e+292: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 4e-317) tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V))); elseif (t_0 <= 5e+292) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m * Float64(1.0 / 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 <= 4e-317)
tmp = (c0_m / sqrt(l)) * sqrt((A / V));
elseif (t_0 <= 5e+292)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / 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, 4e-317], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+292], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-317}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \left(c0\_m \cdot \frac{1}{V}\right)\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.99999993e-317Initial program 28.2%
associate-/r*39.2%
sqrt-div35.4%
associate-*r/35.4%
Applied egg-rr35.4%
*-commutative35.4%
associate-/l*35.4%
Simplified35.4%
if 3.99999993e-317 < (/.f64 A (*.f64 V l)) < 4.9999999999999996e292Initial program 99.5%
if 4.9999999999999996e292 < (/.f64 A (*.f64 V l)) Initial program 34.5%
add-sqr-sqrt11.2%
sqrt-unprod11.3%
*-commutative11.3%
*-commutative11.3%
swap-sqr10.9%
add-sqr-sqrt10.9%
pow210.9%
Applied egg-rr10.9%
associate-*l/14.8%
*-commutative14.8%
times-frac15.2%
Simplified15.2%
associate-*l/19.2%
Applied egg-rr19.2%
div-inv19.2%
unpow219.2%
associate-*l*30.5%
Applied egg-rr30.5%
Final simplification75.0%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 4e-317)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= t_0 5e+292)
(* c0_m (sqrt t_0))
(sqrt (/ (* A (* c0_m (* c0_m (/ 1.0 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 <= 4e-317) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if (t_0 <= 5e+292) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 4d-317) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if (t_0 <= 5d+292) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((a * (c0_m * (c0_m * (1.0d0 / 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 <= 4e-317) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (t_0 <= 5e+292) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 4e-317: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif t_0 <= 5e+292: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 4e-317) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (t_0 <= 5e+292) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m * Float64(1.0 / 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 <= 4e-317)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif (t_0 <= 5e+292)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / 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, 4e-317], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+292], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-317}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \left(c0\_m \cdot \frac{1}{V}\right)\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.99999993e-317Initial program 28.2%
associate-/r*39.2%
sqrt-div35.4%
associate-*r/35.4%
Applied egg-rr35.4%
associate-/l*35.4%
Simplified35.4%
if 3.99999993e-317 < (/.f64 A (*.f64 V l)) < 4.9999999999999996e292Initial program 99.5%
if 4.9999999999999996e292 < (/.f64 A (*.f64 V l)) Initial program 34.5%
add-sqr-sqrt11.2%
sqrt-unprod11.3%
*-commutative11.3%
*-commutative11.3%
swap-sqr10.9%
add-sqr-sqrt10.9%
pow210.9%
Applied egg-rr10.9%
associate-*l/14.8%
*-commutative14.8%
times-frac15.2%
Simplified15.2%
associate-*l/19.2%
Applied egg-rr19.2%
div-inv19.2%
unpow219.2%
associate-*l*30.5%
Applied egg-rr30.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 5e+292)
(* c0_m (sqrt t_0))
(sqrt (/ (* A (* c0_m (* c0_m (/ 1.0 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 <= 0.0) {
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
} else if (t_0 <= 5e+292) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 0.0d0) then
tmp = sqrt(((a * (c0_m * (c0_m / v))) / l))
else if (t_0 <= 5d+292) then
tmp = c0_m * sqrt(t_0)
else
tmp = sqrt(((a * (c0_m * (c0_m * (1.0d0 / 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 <= 0.0) {
tmp = Math.sqrt(((A * (c0_m * (c0_m / V))) / l));
} else if (t_0 <= 5e+292) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 0.0: tmp = math.sqrt(((A * (c0_m * (c0_m / V))) / l)) elif t_0 <= 5e+292: tmp = c0_m * math.sqrt(t_0) else: tmp = math.sqrt(((A * (c0_m * (c0_m * (1.0 / 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 <= 0.0) tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / V))) / l)); elseif (t_0 <= 5e+292) tmp = Float64(c0_m * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m * Float64(1.0 / 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 <= 0.0)
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
elseif (t_0 <= 5e+292)
tmp = c0_m * sqrt(t_0);
else
tmp = sqrt(((A * (c0_m * (c0_m * (1.0 / 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, 0.0], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+292], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \left(c0\_m \cdot \frac{1}{V}\right)\right)}{\ell}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 27.5%
add-sqr-sqrt27.5%
sqrt-unprod27.5%
*-commutative27.5%
*-commutative27.5%
swap-sqr26.7%
add-sqr-sqrt26.7%
pow226.7%
Applied egg-rr26.7%
associate-*l/31.1%
*-commutative31.1%
times-frac38.3%
Simplified38.3%
associate-*l/38.3%
Applied egg-rr38.3%
unpow238.3%
associate-/l*45.3%
Applied egg-rr45.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999996e292Initial program 99.2%
if 4.9999999999999996e292 < (/.f64 A (*.f64 V l)) Initial program 34.5%
add-sqr-sqrt11.2%
sqrt-unprod11.3%
*-commutative11.3%
*-commutative11.3%
swap-sqr10.9%
add-sqr-sqrt10.9%
pow210.9%
Applied egg-rr10.9%
associate-*l/14.8%
*-commutative14.8%
times-frac15.2%
Simplified15.2%
associate-*l/19.2%
Applied egg-rr19.2%
div-inv19.2%
unpow219.2%
associate-*l*30.5%
Applied egg-rr30.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 (or (<= t_0 0.0) (not (<= t_0 5e+292)))
(sqrt (/ (* A (* c0_m (/ c0_m V))) l))
(* c0_m (sqrt t_0))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+292)) {
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
} else {
tmp = c0_m * sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+292))) then
tmp = sqrt(((a * (c0_m * (c0_m / v))) / l))
else
tmp = c0_m * sqrt(t_0)
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+292)) {
tmp = Math.sqrt(((A * (c0_m * (c0_m / V))) / l));
} else {
tmp = c0_m * Math.sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+292): tmp = math.sqrt(((A * (c0_m * (c0_m / V))) / l)) else: tmp = c0_m * math.sqrt(t_0) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+292)) tmp = sqrt(Float64(Float64(A * Float64(c0_m * Float64(c0_m / V))) / l)); else tmp = Float64(c0_m * sqrt(t_0)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+292)))
tmp = sqrt(((A * (c0_m * (c0_m / V))) / l));
else
tmp = c0_m * sqrt(t_0);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+292]], $MachinePrecision]], N[Sqrt[N[(N[(A * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $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^{+292}\right):\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.9999999999999996e292 < (/.f64 A (*.f64 V l)) Initial program 31.3%
add-sqr-sqrt18.6%
sqrt-unprod18.6%
*-commutative18.6%
*-commutative18.6%
swap-sqr18.0%
add-sqr-sqrt18.0%
pow218.0%
Applied egg-rr18.0%
associate-*l/22.2%
*-commutative22.2%
times-frac25.6%
Simplified25.6%
associate-*l/27.8%
Applied egg-rr27.8%
unpow227.8%
associate-/l*37.1%
Applied egg-rr37.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999996e292Initial program 99.2%
Final simplification76.7%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 1e+290)))
(sqrt (* (* c0_m (/ c0_m V)) (/ A l)))
(* c0_m (sqrt t_0))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+290)) {
tmp = sqrt(((c0_m * (c0_m / V)) * (A / l)));
} else {
tmp = c0_m * sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+290))) then
tmp = sqrt(((c0_m * (c0_m / v)) * (a / l)))
else
tmp = c0_m * sqrt(t_0)
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+290)) {
tmp = Math.sqrt(((c0_m * (c0_m / V)) * (A / l)));
} else {
tmp = c0_m * Math.sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 1e+290): tmp = math.sqrt(((c0_m * (c0_m / V)) * (A / l))) else: tmp = c0_m * math.sqrt(t_0) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 1e+290)) tmp = sqrt(Float64(Float64(c0_m * Float64(c0_m / V)) * Float64(A / l))); else tmp = Float64(c0_m * sqrt(t_0)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 1e+290)))
tmp = sqrt(((c0_m * (c0_m / V)) * (A / l)));
else
tmp = c0_m * sqrt(t_0);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+290]], $MachinePrecision]], N[Sqrt[N[(N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 10^{+290}\right):\\
\;\;\;\;\sqrt{\left(c0\_m \cdot \frac{c0\_m}{V}\right) \cdot \frac{A}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 1.00000000000000006e290 < (/.f64 A (*.f64 V l)) Initial program 32.1%
add-sqr-sqrt18.4%
sqrt-unprod18.5%
*-commutative18.5%
*-commutative18.5%
swap-sqr17.8%
add-sqr-sqrt17.8%
pow217.8%
Applied egg-rr17.8%
associate-*l/21.9%
*-commutative21.9%
times-frac25.4%
Simplified25.4%
unpow227.5%
associate-/l*36.8%
Applied egg-rr33.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000006e290Initial program 99.2%
Final simplification75.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 4e+269)))
(/ c0_m (sqrt (* V (/ l A))))
(* 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 <= 4e+269)) {
tmp = c0_m / sqrt((V * (l / A)));
} 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 <= 4d+269))) then
tmp = c0_m / sqrt((v * (l / a)))
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 <= 4e+269)) {
tmp = c0_m / Math.sqrt((V * (l / A)));
} 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 <= 4e+269): tmp = c0_m / math.sqrt((V * (l / A))) 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 <= 4e+269)) tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); 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 <= 4e+269)))
tmp = c0_m / sqrt((V * (l / A)));
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, 4e+269]], $MachinePrecision]], N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $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 4 \cdot 10^{+269}\right):\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.0000000000000002e269 < (/.f64 A (*.f64 V l)) Initial program 34.6%
Taylor expanded in c0 around 0 34.6%
*-commutative34.6%
associate-/r*44.5%
Simplified44.5%
*-commutative44.5%
clear-num44.5%
sqrt-div45.3%
metadata-eval45.3%
div-inv45.3%
clear-num45.3%
clear-num45.3%
un-div-inv45.3%
/-rgt-identity45.3%
Applied egg-rr45.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e269Initial program 99.4%
Final simplification78.7%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (or (<= t_0 0.0) (not (<= t_0 1e+275)))
(* c0_m (sqrt (/ (/ A V) l)))
(* c0_m (sqrt t_0))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+275)) {
tmp = c0_m * sqrt(((A / V) / l));
} else {
tmp = c0_m * sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+275))) then
tmp = c0_m * sqrt(((a / v) / l))
else
tmp = c0_m * sqrt(t_0)
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+275)) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else {
tmp = c0_m * Math.sqrt(t_0);
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 1e+275): tmp = c0_m * math.sqrt(((A / V) / l)) else: tmp = c0_m * math.sqrt(t_0) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 1e+275)) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0_m * sqrt(t_0)); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 1e+275)))
tmp = c0_m * sqrt(((A / V) / l));
else
tmp = c0_m * sqrt(t_0);
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+275]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 10^{+275}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 9.9999999999999996e274 < (/.f64 A (*.f64 V l)) Initial program 33.9%
associate-/r*44.9%
Simplified44.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e274Initial program 99.4%
Final simplification78.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 (* V (/ l A))))
(if (<= t_0 1e+275)
(* c0_m (sqrt t_0))
(/ c0_m (sqrt (* l (/ V A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m / sqrt((V * (l / A)));
} else if (t_0 <= 1e+275) {
tmp = c0_m * sqrt(t_0);
} else {
tmp = c0_m / sqrt((l * (V / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0_m / sqrt((v * (l / a)))
else if (t_0 <= 1d+275) then
tmp = c0_m * sqrt(t_0)
else
tmp = c0_m / sqrt((l * (v / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0_m / Math.sqrt((V * (l / A)));
} else if (t_0 <= 1e+275) {
tmp = c0_m * Math.sqrt(t_0);
} else {
tmp = c0_m / Math.sqrt((l * (V / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0_m / math.sqrt((V * (l / A))) elif t_0 <= 1e+275: tmp = c0_m * math.sqrt(t_0) else: tmp = c0_m / math.sqrt((l * (V / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 1e+275) tmp = Float64(c0_m * sqrt(t_0)); else tmp = Float64(c0_m / sqrt(Float64(l * Float64(V / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0_m / sqrt((V * (l / A)));
elseif (t_0 <= 1e+275)
tmp = c0_m * sqrt(t_0);
else
tmp = c0_m / sqrt((l * (V / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+275], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t\_0 \leq 10^{+275}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 27.5%
Taylor expanded in c0 around 0 27.5%
*-commutative27.5%
associate-/r*38.8%
Simplified38.8%
*-commutative38.8%
clear-num38.8%
sqrt-div38.8%
metadata-eval38.8%
div-inv38.7%
clear-num38.8%
clear-num38.8%
un-div-inv38.8%
/-rgt-identity38.8%
Applied egg-rr38.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e274Initial program 99.4%
if 9.9999999999999996e274 < (/.f64 A (*.f64 V l)) Initial program 38.8%
Taylor expanded in c0 around 0 38.8%
*-commutative38.8%
associate-/r*49.6%
Simplified49.6%
*-commutative49.6%
clear-num49.5%
sqrt-div51.0%
metadata-eval51.0%
div-inv51.0%
clear-num51.0%
clear-num51.0%
un-div-inv51.1%
/-rgt-identity51.1%
Applied egg-rr51.1%
associate-*r/40.3%
*-commutative40.3%
associate-/l*49.6%
Simplified49.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(*
c0_s
(if (<= t_0 0.0)
(* c0_m (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+275)
(* 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 <= 0.0) {
tmp = c0_m * sqrt(((A / l) / V));
} else if (t_0 <= 1e+275) {
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 <= 0.0d0) then
tmp = c0_m * sqrt(((a / l) / v))
else if (t_0 <= 1d+275) 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 <= 0.0) {
tmp = c0_m * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+275) {
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 <= 0.0: tmp = c0_m * math.sqrt(((A / l) / V)) elif t_0 <= 1e+275: 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 <= 0.0) tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+275) 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 <= 0.0)
tmp = c0_m * sqrt(((A / l) / V));
elseif (t_0 <= 1e+275)
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, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+275], 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 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+275}:\\
\;\;\;\;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)) < 0.0Initial program 27.5%
Taylor expanded in c0 around 0 27.5%
*-commutative27.5%
associate-/r*38.8%
Simplified38.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e274Initial program 99.4%
if 9.9999999999999996e274 < (/.f64 A (*.f64 V l)) Initial program 38.8%
associate-/r*49.6%
Simplified49.6%
Final simplification78.7%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (* c0_s (* 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 74.6%
herbie shell --seed 2024130
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))