
(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 11 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-302)
(* c0_m (/ (/ (sqrt (- A)) (sqrt l)) (sqrt (- V))))
(if (<= (* V l) 0.0)
(sqrt (* (/ A l) (* c0_m (/ c0_m V))))
(if (<= (* V l) 2e+259)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ 1.0 (* (/ 1.0 c0_m) (sqrt (/ l (/ A V))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-302) {
tmp = c0_m * ((sqrt(-A) / sqrt(l)) / sqrt(-V));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if ((V * l) <= 2e+259) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / 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 * l) <= (-5d-302)) then
tmp = c0_m * ((sqrt(-a) / sqrt(l)) / sqrt(-v))
else if ((v * l) <= 0.0d0) then
tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
else if ((v * l) <= 2d+259) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = 1.0d0 / ((1.0d0 / c0_m) * sqrt((l / (a / 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 * l) <= -5e-302) {
tmp = c0_m * ((Math.sqrt(-A) / Math.sqrt(l)) / Math.sqrt(-V));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if ((V * l) <= 2e+259) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = 1.0 / ((1.0 / c0_m) * Math.sqrt((l / (A / V))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -5e-302: tmp = c0_m * ((math.sqrt(-A) / math.sqrt(l)) / math.sqrt(-V)) elif (V * l) <= 0.0: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V)))) elif (V * l) <= 2e+259: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = 1.0 / ((1.0 / c0_m) * math.sqrt((l / (A / V)))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-302) tmp = Float64(c0_m * Float64(Float64(sqrt(Float64(-A)) / sqrt(l)) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V)))); elseif (Float64(V * l) <= 2e+259) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(1.0 / Float64(Float64(1.0 / c0_m) * sqrt(Float64(l / Float64(A / V))))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-302)
tmp = c0_m * ((sqrt(-A) / sqrt(l)) / sqrt(-V));
elseif ((V * l) <= 0.0)
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
elseif ((V * l) <= 2e+259)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e-302], N[(c0$95$m * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+259], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / c0$95$m), $MachinePrecision] * N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\
\;\;\;\;c0\_m \cdot \frac{\frac{\sqrt{-A}}{\sqrt{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+259}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{c0\_m} \cdot \sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000033e-302Initial program 80.8%
associate-/r*80.5%
div-inv80.4%
div-inv80.5%
associate-*l*81.5%
Applied egg-rr81.5%
frac-times80.7%
metadata-eval80.7%
div-inv80.8%
associate-/l/81.5%
frac-2neg81.5%
sqrt-div45.9%
distribute-neg-frac245.9%
Applied egg-rr45.9%
frac-2neg45.9%
sqrt-div52.2%
remove-double-neg52.2%
Applied egg-rr52.2%
if -5.00000000000000033e-302 < (*.f64 V l) < 0.0Initial program 44.2%
add-sqr-sqrt35.1%
sqrt-unprod35.2%
*-commutative35.2%
*-commutative35.2%
swap-sqr34.8%
add-sqr-sqrt34.8%
pow234.8%
Applied egg-rr34.8%
associate-*l/34.4%
*-commutative34.4%
times-frac43.4%
Simplified43.4%
unpow243.4%
*-un-lft-identity43.4%
times-frac47.4%
Applied egg-rr47.4%
if 0.0 < (*.f64 V l) < 2e259Initial program 86.5%
sqrt-div98.0%
associate-*r/92.3%
Applied egg-rr92.3%
associate-/l*98.0%
Simplified98.0%
if 2e259 < (*.f64 V l) Initial program 52.0%
associate-/r*76.1%
div-inv76.0%
div-inv76.1%
associate-*l*52.0%
Applied egg-rr52.0%
associate-*r*76.1%
div-inv76.0%
clear-num76.0%
associate-*l/76.2%
*-un-lft-identity76.2%
Applied egg-rr76.2%
Applied egg-rr76.1%
clear-num76.2%
associate-/r/76.2%
clear-num76.2%
un-div-inv76.2%
Applied egg-rr76.2%
Final simplification72.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 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 1e-251)
(* c0_m (sqrt (/ (/ 1.0 l) (/ V A))))
(if (<= t_0 4e+307) t_0 (sqrt (* (/ A l) (* c0_m (/ c0_m V)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-251) {
tmp = c0_m * sqrt(((1.0 / l) / (V / A)));
} else if (t_0 <= 4e+307) {
tmp = t_0;
} else {
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 1d-251) then
tmp = c0_m * sqrt(((1.0d0 / l) / (v / a)))
else if (t_0 <= 4d+307) then
tmp = t_0
else
tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-251) {
tmp = c0_m * Math.sqrt(((1.0 / l) / (V / A)));
} else if (t_0 <= 4e+307) {
tmp = t_0;
} else {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 1e-251: tmp = c0_m * math.sqrt(((1.0 / l) / (V / A))) elif t_0 <= 4e+307: tmp = t_0 else: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V)))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 1e-251) tmp = Float64(c0_m * sqrt(Float64(Float64(1.0 / l) / Float64(V / A)))); elseif (t_0 <= 4e+307) tmp = t_0; else tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 1e-251)
tmp = c0_m * sqrt(((1.0 / l) / (V / A)));
elseif (t_0 <= 4e+307)
tmp = t_0;
else
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-251], N[(c0$95$m * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+307], t$95$0, N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-251}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000002e-251Initial program 73.8%
associate-/r*80.1%
div-inv80.1%
div-inv80.1%
associate-*l*74.3%
Applied egg-rr74.3%
associate-*r*80.1%
div-inv80.1%
clear-num79.2%
associate-*l/79.8%
*-un-lft-identity79.8%
Applied egg-rr79.8%
if 1.00000000000000002e-251 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999994e307Initial program 98.6%
if 3.99999999999999994e307 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 49.4%
add-sqr-sqrt49.4%
sqrt-unprod49.4%
*-commutative49.4%
*-commutative49.4%
swap-sqr49.0%
add-sqr-sqrt49.0%
pow249.0%
Applied egg-rr49.0%
associate-*l/55.2%
*-commutative55.2%
times-frac59.0%
Simplified59.0%
unpow259.0%
*-un-lft-identity59.0%
times-frac64.6%
Applied egg-rr64.6%
Final simplification82.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (or (<= t_0 2e-273) (not (<= t_0 2e+266)))
(* c0_m (sqrt (/ (/ A V) l)))
t_0))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 2e-273) || !(t_0 <= 2e+266)) {
tmp = c0_m * sqrt(((A / V) / l));
} else {
tmp = 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 = c0_m * sqrt((a / (v * l)))
if ((t_0 <= 2d-273) .or. (.not. (t_0 <= 2d+266))) then
tmp = c0_m * sqrt(((a / v) / l))
else
tmp = 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 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 2e-273) || !(t_0 <= 2e+266)) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 2e-273) or not (t_0 <= 2e+266): tmp = c0_m * math.sqrt(((A / V) / l)) else: tmp = t_0 return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 2e-273) || !(t_0 <= 2e+266)) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 2e-273) || ~((t_0 <= 2e+266)))
tmp = c0_m * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 2e-273], N[Not[LessEqual[t$95$0, 2e+266]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+266}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e-273 or 2.0000000000000001e266 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 69.9%
associate-/r*76.0%
Simplified76.0%
if 2e-273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e266Initial program 99.7%
Final simplification81.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 1e-251)
(* c0_m (sqrt (/ (/ 1.0 l) (/ V A))))
(if (<= t_0 5e+199) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-251) {
tmp = c0_m * sqrt(((1.0 / l) / (V / A)));
} else if (t_0 <= 5e+199) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 1d-251) then
tmp = c0_m * sqrt(((1.0d0 / l) / (v / a)))
else if (t_0 <= 5d+199) then
tmp = t_0
else
tmp = c0_m / sqrt((v * (l / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-251) {
tmp = c0_m * Math.sqrt(((1.0 / l) / (V / A)));
} else if (t_0 <= 5e+199) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 1e-251: tmp = c0_m * math.sqrt(((1.0 / l) / (V / A))) elif t_0 <= 5e+199: tmp = t_0 else: tmp = c0_m / math.sqrt((V * (l / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 1e-251) tmp = Float64(c0_m * sqrt(Float64(Float64(1.0 / l) / Float64(V / A)))); elseif (t_0 <= 5e+199) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 1e-251)
tmp = c0_m * sqrt(((1.0 / l) / (V / A)));
elseif (t_0 <= 5e+199)
tmp = t_0;
else
tmp = c0_m / sqrt((V * (l / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-251], N[(c0$95$m * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+199], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-251}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+199}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000002e-251Initial program 73.8%
associate-/r*80.1%
div-inv80.1%
div-inv80.1%
associate-*l*74.3%
Applied egg-rr74.3%
associate-*r*80.1%
div-inv80.1%
clear-num79.2%
associate-*l/79.8%
*-un-lft-identity79.8%
Applied egg-rr79.8%
if 1.00000000000000002e-251 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e199Initial program 99.7%
if 4.9999999999999998e199 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 59.3%
associate-/r*61.1%
div-inv61.0%
div-inv61.0%
associate-*l*58.6%
Applied egg-rr58.6%
associate-*r*61.0%
div-inv61.0%
sqrt-prod36.1%
sqrt-div36.1%
metadata-eval36.1%
div-inv36.1%
clear-num35.9%
un-div-inv36.0%
sqrt-div23.0%
associate-/r/23.0%
sqrt-div39.0%
sqrt-prod61.1%
*-commutative61.1%
Applied egg-rr61.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 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 2e-273)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+199) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-273) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 5e+199) {
tmp = t_0;
} else {
tmp = c0_m / sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 2d-273) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 5d+199) then
tmp = t_0
else
tmp = c0_m / sqrt((v * (l / a)))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-273) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+199) {
tmp = t_0;
} else {
tmp = c0_m / Math.sqrt((V * (l / A)));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-273: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 5e+199: tmp = t_0 else: tmp = c0_m / math.sqrt((V * (l / A))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-273) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+199) tmp = t_0; else tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A)))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-273)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 5e+199)
tmp = t_0;
else
tmp = c0_m / sqrt((V * (l / A)));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-273], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+199], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+199}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e-273Initial program 73.5%
associate-/r*79.9%
Simplified79.9%
if 2e-273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e199Initial program 99.7%
if 4.9999999999999998e199 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 59.3%
associate-/r*61.1%
div-inv61.0%
div-inv61.0%
associate-*l*58.6%
Applied egg-rr58.6%
associate-*r*61.0%
div-inv61.0%
sqrt-prod36.1%
sqrt-div36.1%
metadata-eval36.1%
div-inv36.1%
clear-num35.9%
un-div-inv36.0%
sqrt-div23.0%
associate-/r/23.0%
sqrt-div39.0%
sqrt-prod61.1%
*-commutative61.1%
Applied egg-rr61.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 (* c0_m (sqrt (/ A (* V l))))))
(*
c0_s
(if (<= t_0 2e-273)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+182) t_0 (* c0_m (sqrt (/ (/ A l) V))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-273) {
tmp = c0_m * sqrt(((A / V) / l));
} else if (t_0 <= 1e+182) {
tmp = t_0;
} else {
tmp = c0_m * sqrt(((A / l) / V));
}
return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0_m * sqrt((a / (v * l)))
if (t_0 <= 2d-273) then
tmp = c0_m * sqrt(((a / v) / l))
else if (t_0 <= 1d+182) then
tmp = t_0
else
tmp = c0_m * sqrt(((a / l) / v))
end if
code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double t_0 = c0_m * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-273) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+182) {
tmp = t_0;
} else {
tmp = c0_m * Math.sqrt(((A / l) / V));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): t_0 = c0_m * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-273: tmp = c0_m * math.sqrt(((A / V) / l)) elif t_0 <= 1e+182: tmp = t_0 else: tmp = c0_m * math.sqrt(((A / l) / V)) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-273) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+182) tmp = t_0; else tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
t_0 = c0_m * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-273)
tmp = c0_m * sqrt(((A / V) / l));
elseif (t_0 <= 1e+182)
tmp = t_0;
else
tmp = c0_m * sqrt(((A / l) / V));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-273], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+182], t$95$0, N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+182}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e-273Initial program 73.5%
associate-/r*79.9%
Simplified79.9%
if 2e-273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e182Initial program 99.6%
if 1.0000000000000001e182 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 63.1%
Taylor expanded in c0 around 0 63.1%
*-commutative63.1%
associate-/r*64.7%
Simplified64.7%
Final simplification81.3%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -5e-302)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(sqrt (* (/ A l) (* c0_m (/ c0_m V))))
(if (<= (* V l) 2e+259)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ 1.0 (* (/ 1.0 c0_m) (sqrt (/ l (/ A V)))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -5e-302) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if ((V * l) <= 2e+259) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -5e-302) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if ((V * l) <= 2e+259) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = 1.0 / ((1.0 / c0_m) * Math.sqrt((l / (A / V))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -5e-302: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V)))) elif (V * l) <= 2e+259: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = 1.0 / ((1.0 / c0_m) * math.sqrt((l / (A / V)))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -5e-302) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V)))); elseif (Float64(V * l) <= 2e+259) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(1.0 / Float64(Float64(1.0 / c0_m) * sqrt(Float64(l / Float64(A / V))))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -5e-302)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
elseif ((V * l) <= 2e+259)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-302], 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[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+259], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / c0$95$m), $MachinePrecision] * N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+259}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{c0\_m} \cdot \sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 45.5%
associate-/r*77.3%
div-inv77.3%
div-inv77.2%
associate-*l*49.6%
Applied egg-rr49.6%
frac-times45.5%
metadata-eval45.5%
div-inv45.5%
associate-/l/77.1%
frac-2neg77.1%
sqrt-div50.2%
distribute-neg-frac250.2%
Applied egg-rr50.2%
if -inf.0 < (*.f64 V l) < -5.00000000000000033e-302Initial program 89.7%
frac-2neg89.7%
sqrt-div99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
Applied egg-rr99.6%
if -5.00000000000000033e-302 < (*.f64 V l) < 0.0Initial program 44.2%
add-sqr-sqrt35.1%
sqrt-unprod35.2%
*-commutative35.2%
*-commutative35.2%
swap-sqr34.8%
add-sqr-sqrt34.8%
pow234.8%
Applied egg-rr34.8%
associate-*l/34.4%
*-commutative34.4%
times-frac43.4%
Simplified43.4%
unpow243.4%
*-un-lft-identity43.4%
times-frac47.4%
Applied egg-rr47.4%
if 0.0 < (*.f64 V l) < 2e259Initial program 86.5%
sqrt-div98.0%
associate-*r/92.3%
Applied egg-rr92.3%
associate-/l*98.0%
Simplified98.0%
if 2e259 < (*.f64 V l) Initial program 52.0%
associate-/r*76.1%
div-inv76.0%
div-inv76.1%
associate-*l*52.0%
Applied egg-rr52.0%
associate-*r*76.1%
div-inv76.0%
clear-num76.0%
associate-*l/76.2%
*-un-lft-identity76.2%
Applied egg-rr76.2%
Applied egg-rr76.1%
clear-num76.2%
associate-/r/76.2%
clear-num76.2%
un-div-inv76.2%
Applied egg-rr76.2%
Final simplification87.8%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) (- INFINITY))
(/ (* c0_m (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -5e-302)
(* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(sqrt (* (/ A l) (* c0_m (/ c0_m V))))
(if (<= (* V l) 2e+259)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ 1.0 (* (/ 1.0 c0_m) (sqrt (/ l (/ A V)))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0_m * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -5e-302) {
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if ((V * l) <= 2e+259) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
}
return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0_m * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -5e-302) {
tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if ((V * l) <= 2e+259) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = 1.0 / ((1.0 / c0_m) * Math.sqrt((l / (A / V))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = (c0_m * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -5e-302: tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V)))) elif (V * l) <= 2e+259: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = 1.0 / ((1.0 / c0_m) * math.sqrt((l / (A / V)))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0_m * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -5e-302) tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V)))); elseif (Float64(V * l) <= 2e+259) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(1.0 / Float64(Float64(1.0 / c0_m) * sqrt(Float64(l / Float64(A / V))))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0_m * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -5e-302)
tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
elseif ((V * l) <= 2e+259)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-302], 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[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+259], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / c0$95$m), $MachinePrecision] * N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+259}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{c0\_m} \cdot \sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 45.5%
*-commutative45.5%
associate-/r*77.3%
sqrt-div48.0%
associate-*l/48.0%
Applied egg-rr48.0%
if -inf.0 < (*.f64 V l) < -5.00000000000000033e-302Initial program 89.7%
frac-2neg89.7%
sqrt-div99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
Applied egg-rr99.6%
if -5.00000000000000033e-302 < (*.f64 V l) < 0.0Initial program 44.2%
add-sqr-sqrt35.1%
sqrt-unprod35.2%
*-commutative35.2%
*-commutative35.2%
swap-sqr34.8%
add-sqr-sqrt34.8%
pow234.8%
Applied egg-rr34.8%
associate-*l/34.4%
*-commutative34.4%
times-frac43.4%
Simplified43.4%
unpow243.4%
*-un-lft-identity43.4%
times-frac47.4%
Applied egg-rr47.4%
if 0.0 < (*.f64 V l) < 2e259Initial program 86.5%
sqrt-div98.0%
associate-*r/92.3%
Applied egg-rr92.3%
associate-/l*98.0%
Simplified98.0%
if 2e259 < (*.f64 V l) Initial program 52.0%
associate-/r*76.1%
div-inv76.0%
div-inv76.1%
associate-*l*52.0%
Applied egg-rr52.0%
associate-*r*76.1%
div-inv76.0%
clear-num76.0%
associate-*l/76.2%
*-un-lft-identity76.2%
Applied egg-rr76.2%
Applied egg-rr76.1%
clear-num76.2%
associate-/r/76.2%
clear-num76.2%
un-div-inv76.2%
Applied egg-rr76.2%
Final simplification87.6%
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
:precision binary64
(*
c0_s
(if (<= (* V l) -2e+285)
(* c0_m (sqrt (/ (/ A V) l)))
(if (<= (* V l) -1e-290)
(* c0_m (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(sqrt (* (/ A l) (* c0_m (/ c0_m V))))
(if (<= (* V l) 2e+259)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ 1.0 (* (/ 1.0 c0_m) (sqrt (/ l (/ A V)))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+285) {
tmp = c0_m * sqrt(((A / V) / l));
} else if ((V * l) <= -1e-290) {
tmp = c0_m * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if ((V * l) <= 2e+259) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / 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 * l) <= (-2d+285)) then
tmp = c0_m * sqrt(((a / v) / l))
else if ((v * l) <= (-1d-290)) then
tmp = c0_m * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
else if ((v * l) <= 2d+259) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = 1.0d0 / ((1.0d0 / c0_m) * sqrt((l / (a / 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 * l) <= -2e+285) {
tmp = c0_m * Math.sqrt(((A / V) / l));
} else if ((V * l) <= -1e-290) {
tmp = c0_m * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if ((V * l) <= 2e+259) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = 1.0 / ((1.0 / c0_m) * Math.sqrt((l / (A / V))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -2e+285: tmp = c0_m * math.sqrt(((A / V) / l)) elif (V * l) <= -1e-290: tmp = c0_m * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V)))) elif (V * l) <= 2e+259: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = 1.0 / ((1.0 / c0_m) * math.sqrt((l / (A / V)))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+285) tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(V * l) <= -1e-290) tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V)))); elseif (Float64(V * l) <= 2e+259) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(1.0 / Float64(Float64(1.0 / c0_m) * sqrt(Float64(l / Float64(A / V))))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+285)
tmp = c0_m * sqrt(((A / V) / l));
elseif ((V * l) <= -1e-290)
tmp = c0_m * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
elseif ((V * l) <= 2e+259)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -2e+285], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-290], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+259], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / c0$95$m), $MachinePrecision] * N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+285}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-290}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+259}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{c0\_m} \cdot \sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e285Initial program 53.5%
associate-/r*79.4%
Simplified79.4%
if -2e285 < (*.f64 V l) < -1.0000000000000001e-290Initial program 90.4%
if -1.0000000000000001e-290 < (*.f64 V l) < 0.0Initial program 42.7%
add-sqr-sqrt33.7%
sqrt-unprod33.8%
*-commutative33.8%
*-commutative33.8%
swap-sqr33.4%
add-sqr-sqrt33.4%
pow233.4%
Applied egg-rr33.4%
associate-*l/33.1%
*-commutative33.1%
times-frac41.7%
Simplified41.7%
unpow241.7%
*-un-lft-identity41.7%
times-frac45.5%
Applied egg-rr45.5%
if 0.0 < (*.f64 V l) < 2e259Initial program 86.5%
sqrt-div98.0%
associate-*r/92.3%
Applied egg-rr92.3%
associate-/l*98.0%
Simplified98.0%
if 2e259 < (*.f64 V l) Initial program 52.0%
associate-/r*76.1%
div-inv76.0%
div-inv76.1%
associate-*l*52.0%
Applied egg-rr52.0%
associate-*r*76.1%
div-inv76.0%
clear-num76.0%
associate-*l/76.2%
*-un-lft-identity76.2%
Applied egg-rr76.2%
Applied egg-rr76.1%
clear-num76.2%
associate-/r/76.2%
clear-num76.2%
un-div-inv76.2%
Applied egg-rr76.2%
Final simplification86.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) -5e-302)
(* c0_m (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 0.0)
(sqrt (* (/ A l) (* c0_m (/ c0_m V))))
(if (<= (* V l) 2e+259)
(* c0_m (/ (sqrt A) (sqrt (* V l))))
(/ 1.0 (* (/ 1.0 c0_m) (sqrt (/ l (/ A V))))))))))c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-302) {
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 0.0) {
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if ((V * l) <= 2e+259) {
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
} else {
tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / 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 * l) <= (-5d-302)) then
tmp = c0_m * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 0.0d0) then
tmp = sqrt(((a / l) * (c0_m * (c0_m / v))))
else if ((v * l) <= 2d+259) then
tmp = c0_m * (sqrt(a) / sqrt((v * l)))
else
tmp = 1.0d0 / ((1.0d0 / c0_m) * sqrt((l / (a / 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 * l) <= -5e-302) {
tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt(((A / l) * (c0_m * (c0_m / V))));
} else if ((V * l) <= 2e+259) {
tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = 1.0 / ((1.0 / c0_m) * Math.sqrt((l / (A / V))));
}
return c0_s * tmp;
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): tmp = 0 if (V * l) <= -5e-302: tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 0.0: tmp = math.sqrt(((A / l) * (c0_m * (c0_m / V)))) elif (V * l) <= 2e+259: tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = 1.0 / ((1.0 / c0_m) * math.sqrt((l / (A / V)))) return c0_s * tmp
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-302) tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(Float64(A / l) * Float64(c0_m * Float64(c0_m / V)))); elseif (Float64(V * l) <= 2e+259) tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(1.0 / Float64(Float64(1.0 / c0_m) * sqrt(Float64(l / Float64(A / V))))); end return Float64(c0_s * tmp) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-302)
tmp = c0_m * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 0.0)
tmp = sqrt(((A / l) * (c0_m * (c0_m / V))));
elseif ((V * l) <= 2e+259)
tmp = c0_m * (sqrt(A) / sqrt((V * l)));
else
tmp = 1.0 / ((1.0 / c0_m) * sqrt((l / (A / V))));
end
tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -5e-302], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+259], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / c0$95$m), $MachinePrecision] * N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-302}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0\_m \cdot \frac{c0\_m}{V}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+259}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{c0\_m} \cdot \sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000033e-302Initial program 80.8%
associate-/r*80.5%
sqrt-div48.5%
associate-*r/47.6%
Applied egg-rr47.6%
associate-/l*48.5%
Simplified48.5%
if -5.00000000000000033e-302 < (*.f64 V l) < 0.0Initial program 44.2%
add-sqr-sqrt35.1%
sqrt-unprod35.2%
*-commutative35.2%
*-commutative35.2%
swap-sqr34.8%
add-sqr-sqrt34.8%
pow234.8%
Applied egg-rr34.8%
associate-*l/34.4%
*-commutative34.4%
times-frac43.4%
Simplified43.4%
unpow243.4%
*-un-lft-identity43.4%
times-frac47.4%
Applied egg-rr47.4%
if 0.0 < (*.f64 V l) < 2e259Initial program 86.5%
sqrt-div98.0%
associate-*r/92.3%
Applied egg-rr92.3%
associate-/l*98.0%
Simplified98.0%
if 2e259 < (*.f64 V l) Initial program 52.0%
associate-/r*76.1%
div-inv76.0%
div-inv76.1%
associate-*l*52.0%
Applied egg-rr52.0%
associate-*r*76.1%
div-inv76.0%
clear-num76.0%
associate-*l/76.2%
*-un-lft-identity76.2%
Applied egg-rr76.2%
Applied egg-rr76.1%
clear-num76.2%
associate-/r/76.2%
clear-num76.2%
un-div-inv76.2%
Applied egg-rr76.2%
Final simplification70.9%
c0\_m = (fabs.f64 c0) c0\_s = (copysign.f64 #s(literal 1 binary64) c0) NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0_s c0_m A V l) :precision binary64 (* c0_s (* c0_m (sqrt (/ A (* V l))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
return c0_s * (c0_m * sqrt((A / (V * l))));
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
real(8), intent (in) :: c0_s
real(8), intent (in) :: c0_m
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0_s * (c0_m * sqrt((a / (v * l))))
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
return c0_s * (c0_m * Math.sqrt((A / (V * l))));
}
c0\_m = math.fabs(c0) c0\_s = math.copysign(1.0, c0) [c0_m, A, V, l] = sort([c0_m, A, V, l]) def code(c0_s, c0_m, A, V, l): return c0_s * (c0_m * math.sqrt((A / (V * l))))
c0\_m = abs(c0) c0\_s = copysign(1.0, c0) c0_m, A, V, l = sort([c0_m, A, V, l]) function code(c0_s, c0_m, A, V, l) return Float64(c0_s * Float64(c0_m * sqrt(Float64(A / Float64(V * l))))) end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp = code(c0_s, c0_m, A, V, l)
tmp = c0_s * (c0_m * sqrt((A / (V * l))));
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)
\end{array}
Initial program 77.0%
herbie shell --seed 2024147
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))