
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* (pow l -0.5) (* c0 (sqrt (/ A V))))
(if (<= (* V l) -4e-318)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (/ 1.0 (sqrt (* l (/ V A)))))
(if (<= (* V l) 4e+273)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = pow(l, -0.5) * (c0 * sqrt((A / V)));
} else if ((V * l) <= -4e-318) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
} else if ((V * l) <= 4e+273) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = Math.pow(l, -0.5) * (c0 * Math.sqrt((A / V)));
} else if ((V * l) <= -4e-318) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
} else if ((V * l) <= 4e+273) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = math.pow(l, -0.5) * (c0 * math.sqrt((A / V))) elif (V * l) <= -4e-318: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) elif (V * l) <= 4e+273: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64((l ^ -0.5) * Float64(c0 * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -4e-318) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); elseif (Float64(V * l) <= 4e+273) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (l ^ -0.5) * (c0 * sqrt((A / V)));
elseif ((V * l) <= -4e-318)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (1.0 / sqrt((l * (V / A))));
elseif ((V * l) <= 4e+273)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-318], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+273], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;{\ell}^{-0.5} \cdot \left(c0 \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-318}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+273}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 23.0%
*-commutative23.0%
sqrt-div0.0%
associate-*l/0.0%
Applied egg-rr0.0%
sqrt-prod0.0%
associate-/r*0.0%
*-commutative0.0%
associate-*r/0.0%
sqrt-div43.8%
un-div-inv44.0%
metadata-eval44.0%
sqrt-div44.1%
*-commutative44.1%
inv-pow44.1%
sqrt-pow144.1%
metadata-eval44.1%
Applied egg-rr44.1%
if -inf.0 < (*.f64 V l) < -3.9999999e-318Initial program 84.7%
frac-2neg84.7%
sqrt-div98.8%
distribute-rgt-neg-in98.8%
Applied egg-rr98.8%
if -3.9999999e-318 < (*.f64 V l) < -0.0Initial program 37.3%
associate-/r*70.0%
clear-num70.0%
sqrt-div73.6%
metadata-eval73.6%
div-inv73.6%
clear-num73.6%
Applied egg-rr73.6%
if -0.0 < (*.f64 V l) < 3.99999999999999978e273Initial program 87.9%
sqrt-div99.4%
associate-*r/96.6%
Applied egg-rr96.6%
*-commutative96.6%
associate-/l*96.9%
associate-/r/99.4%
Simplified99.4%
if 3.99999999999999978e273 < (*.f64 V l) Initial program 54.7%
frac-2neg54.7%
div-inv54.7%
distribute-rgt-neg-in54.7%
Applied egg-rr54.7%
Taylor expanded in A around 0 54.7%
associate-/l/86.1%
Simplified86.1%
Final simplification91.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 2e-292)
(* c0 (sqrt (* (/ A l) (/ 1.0 V))))
(if (<= t_0 1e+307) t_0 (* c0 (/ 1.0 (sqrt (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-292) {
tmp = c0 * sqrt(((A / l) * (1.0 / V)));
} else if (t_0 <= 1e+307) {
tmp = t_0;
} else {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 2d-292) then
tmp = c0 * sqrt(((a / l) * (1.0d0 / v)))
else if (t_0 <= 1d+307) then
tmp = t_0
else
tmp = c0 * (1.0d0 / sqrt((l * (v / a))))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-292) {
tmp = c0 * Math.sqrt(((A / l) * (1.0 / V)));
} else if (t_0 <= 1e+307) {
tmp = t_0;
} else {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-292: tmp = c0 * math.sqrt(((A / l) * (1.0 / V))) elif t_0 <= 1e+307: tmp = t_0 else: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-292) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) * Float64(1.0 / V)))); elseif (t_0 <= 1e+307) tmp = t_0; else tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-292)
tmp = c0 * sqrt(((A / l) * (1.0 / V)));
elseif (t_0 <= 1e+307)
tmp = t_0;
else
tmp = c0 * (1.0 / sqrt((l * (V / A))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-292], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+307], t$95$0, N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-292}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+307}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e-292Initial program 70.2%
*-un-lft-identity70.2%
times-frac76.8%
Applied egg-rr76.8%
if 2.0000000000000001e-292 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999986e306Initial program 99.1%
if 9.99999999999999986e306 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 40.1%
associate-/r*57.6%
clear-num57.6%
sqrt-div59.7%
metadata-eval59.7%
div-inv59.7%
clear-num59.6%
Applied egg-rr59.6%
Final simplification80.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 2e-292)
(* c0 (sqrt (* (/ A l) (/ 1.0 V))))
(if (<= t_0 1e+307) t_0 (* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-292) {
tmp = c0 * sqrt(((A / l) * (1.0 / V)));
} else if (t_0 <= 1e+307) {
tmp = t_0;
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 2d-292) then
tmp = c0 * sqrt(((a / l) * (1.0d0 / v)))
else if (t_0 <= 1d+307) then
tmp = t_0
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-292) {
tmp = c0 * Math.sqrt(((A / l) * (1.0 / V)));
} else if (t_0 <= 1e+307) {
tmp = t_0;
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-292: tmp = c0 * math.sqrt(((A / l) * (1.0 / V))) elif t_0 <= 1e+307: tmp = t_0 else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-292) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) * Float64(1.0 / V)))); elseif (t_0 <= 1e+307) tmp = t_0; else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-292)
tmp = c0 * sqrt(((A / l) * (1.0 / V)));
elseif (t_0 <= 1e+307)
tmp = t_0;
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-292], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+307], t$95$0, N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-292}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+307}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e-292Initial program 70.2%
*-un-lft-identity70.2%
times-frac76.8%
Applied egg-rr76.8%
if 2.0000000000000001e-292 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999986e306Initial program 99.1%
if 9.99999999999999986e306 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 40.1%
*-commutative40.1%
associate-/l/57.6%
Simplified57.6%
Final simplification80.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (sqrt (* (/ A l) (/ 1.0 V))))
(if (<= (* V l) -5e-255)
(/ (sqrt (/ A (* V l))) (/ 1.0 c0))
(if (<= (* V l) 0.0)
(* c0 (/ 1.0 (sqrt (* l (/ V A)))))
(if (<= (* V l) 4e+273)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * sqrt(((A / l) * (1.0 / V)));
} else if ((V * l) <= -5e-255) {
tmp = sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
} else if ((V * l) <= 4e+273) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * Math.sqrt(((A / l) * (1.0 / V)));
} else if ((V * l) <= -5e-255) {
tmp = Math.sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
} else if ((V * l) <= 4e+273) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * math.sqrt(((A / l) * (1.0 / V))) elif (V * l) <= -5e-255: tmp = math.sqrt((A / (V * l))) / (1.0 / c0) elif (V * l) <= 0.0: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) elif (V * l) <= 4e+273: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) * Float64(1.0 / V)))); elseif (Float64(V * l) <= -5e-255) tmp = Float64(sqrt(Float64(A / Float64(V * l))) / Float64(1.0 / c0)); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); elseif (Float64(V * l) <= 4e+273) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * sqrt(((A / l) * (1.0 / V)));
elseif ((V * l) <= -5e-255)
tmp = sqrt((A / (V * l))) / (1.0 / c0);
elseif ((V * l) <= 0.0)
tmp = c0 * (1.0 / sqrt((l * (V / A))));
elseif ((V * l) <= 4e+273)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-255], N[(N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+273], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-255}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V \cdot \ell}}}{\frac{1}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+273}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 23.0%
*-un-lft-identity23.0%
times-frac52.3%
Applied egg-rr52.3%
if -inf.0 < (*.f64 V l) < -4.9999999999999996e-255Initial program 88.8%
frac-2neg88.8%
div-inv88.7%
distribute-rgt-neg-in88.7%
Applied egg-rr88.7%
Taylor expanded in A around 0 88.8%
associate-/l/81.1%
Simplified81.1%
*-commutative81.1%
associate-/l/88.8%
sqrt-div0.0%
associate-/r/0.0%
div-inv0.0%
associate-/r*0.0%
sqrt-div88.8%
*-commutative88.8%
Applied egg-rr88.8%
if -4.9999999999999996e-255 < (*.f64 V l) < -0.0Initial program 41.4%
associate-/r*66.9%
clear-num66.9%
sqrt-div69.7%
metadata-eval69.7%
div-inv69.7%
clear-num69.7%
Applied egg-rr69.7%
if -0.0 < (*.f64 V l) < 3.99999999999999978e273Initial program 87.9%
sqrt-div99.4%
associate-*r/96.6%
Applied egg-rr96.6%
*-commutative96.6%
associate-/l*96.9%
associate-/r/99.4%
Simplified99.4%
if 3.99999999999999978e273 < (*.f64 V l) Initial program 54.7%
frac-2neg54.7%
div-inv54.7%
distribute-rgt-neg-in54.7%
Applied egg-rr54.7%
Taylor expanded in A around 0 54.7%
associate-/l/86.1%
Simplified86.1%
Final simplification86.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ c0 (/ (sqrt l) (sqrt (/ A V))))))
(if (<= (* V l) -1e+226)
t_0
(if (<= (* V l) -5e-255)
(/ (sqrt (/ A (* V l))) (/ 1.0 c0))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 4e+273)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) / sqrt((A / V)));
double tmp;
if ((V * l) <= -1e+226) {
tmp = t_0;
} else if ((V * l) <= -5e-255) {
tmp = sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+273) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = c0 / (sqrt(l) / sqrt((a / v)))
if ((v * l) <= (-1d+226)) then
tmp = t_0
else if ((v * l) <= (-5d-255)) then
tmp = sqrt((a / (v * l))) / (1.0d0 / c0)
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 4d+273) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
double tmp;
if ((V * l) <= -1e+226) {
tmp = t_0;
} else if ((V * l) <= -5e-255) {
tmp = Math.sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+273) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(l) / math.sqrt((A / V))) tmp = 0 if (V * l) <= -1e+226: tmp = t_0 elif (V * l) <= -5e-255: tmp = math.sqrt((A / (V * l))) / (1.0 / c0) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 4e+273: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))) tmp = 0.0 if (Float64(V * l) <= -1e+226) tmp = t_0; elseif (Float64(V * l) <= -5e-255) tmp = Float64(sqrt(Float64(A / Float64(V * l))) / Float64(1.0 / c0)); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 4e+273) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 / (sqrt(l) / sqrt((A / V)));
tmp = 0.0;
if ((V * l) <= -1e+226)
tmp = t_0;
elseif ((V * l) <= -5e-255)
tmp = sqrt((A / (V * l))) / (1.0 / c0);
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 4e+273)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+226], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-255], N[(N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 4e+273], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+226}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-255}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V \cdot \ell}}}{\frac{1}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+273}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999961e225 or -4.9999999999999996e-255 < (*.f64 V l) < -0.0Initial program 41.4%
associate-/r*64.9%
sqrt-div45.5%
associate-*r/45.5%
Applied egg-rr45.5%
associate-/l*45.5%
Simplified45.5%
if -9.99999999999999961e225 < (*.f64 V l) < -4.9999999999999996e-255Initial program 90.2%
frac-2neg90.2%
div-inv90.1%
distribute-rgt-neg-in90.1%
Applied egg-rr90.1%
Taylor expanded in A around 0 90.2%
associate-/l/81.6%
Simplified81.6%
*-commutative81.6%
associate-/l/90.2%
sqrt-div0.0%
associate-/r/0.0%
div-inv0.0%
associate-/r*0.0%
sqrt-div90.2%
*-commutative90.2%
Applied egg-rr90.2%
if -0.0 < (*.f64 V l) < 3.99999999999999978e273Initial program 87.9%
sqrt-div99.4%
associate-*r/96.6%
Applied egg-rr96.6%
*-commutative96.6%
associate-/l*96.9%
associate-/r/99.4%
Simplified99.4%
if 3.99999999999999978e273 < (*.f64 V l) Initial program 54.7%
frac-2neg54.7%
div-inv54.7%
distribute-rgt-neg-in54.7%
Applied egg-rr54.7%
Taylor expanded in A around 0 54.7%
associate-/l/86.1%
Simplified86.1%
Final simplification80.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -1e+226)
(/ (* c0 t_0) (sqrt l))
(if (<= (* V l) -5e-255)
(/ (sqrt (/ A (* V l))) (/ 1.0 c0))
(if (<= (* V l) 0.0)
(/ c0 (/ (sqrt l) t_0))
(if (<= (* V l) 4e+273)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -1e+226) {
tmp = (c0 * t_0) / sqrt(l);
} else if ((V * l) <= -5e-255) {
tmp = sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) / t_0);
} else if ((V * l) <= 4e+273) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-1d+226)) then
tmp = (c0 * t_0) / sqrt(l)
else if ((v * l) <= (-5d-255)) then
tmp = sqrt((a / (v * l))) / (1.0d0 / c0)
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) / t_0)
else if ((v * l) <= 4d+273) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+226) {
tmp = (c0 * t_0) / Math.sqrt(l);
} else if ((V * l) <= -5e-255) {
tmp = Math.sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) / t_0);
} else if ((V * l) <= 4e+273) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+226: tmp = (c0 * t_0) / math.sqrt(l) elif (V * l) <= -5e-255: tmp = math.sqrt((A / (V * l))) / (1.0 / c0) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) / t_0) elif (V * l) <= 4e+273: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -1e+226) tmp = Float64(Float64(c0 * t_0) / sqrt(l)); elseif (Float64(V * l) <= -5e-255) tmp = Float64(sqrt(Float64(A / Float64(V * l))) / Float64(1.0 / c0)); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) / t_0)); elseif (Float64(V * l) <= 4e+273) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+226)
tmp = (c0 * t_0) / sqrt(l);
elseif ((V * l) <= -5e-255)
tmp = sqrt((A / (V * l))) / (1.0 / c0);
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) / t_0);
elseif ((V * l) <= 4e+273)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+226], N[(N[(c0 * t$95$0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-255], N[(N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+273], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+226}:\\
\;\;\;\;\frac{c0 \cdot t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-255}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V \cdot \ell}}}{\frac{1}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{t\_0}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+273}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999961e225Initial program 41.6%
*-commutative41.6%
associate-/r*60.5%
sqrt-div41.9%
associate-*l/41.9%
Applied egg-rr41.9%
if -9.99999999999999961e225 < (*.f64 V l) < -4.9999999999999996e-255Initial program 90.2%
frac-2neg90.2%
div-inv90.1%
distribute-rgt-neg-in90.1%
Applied egg-rr90.1%
Taylor expanded in A around 0 90.2%
associate-/l/81.6%
Simplified81.6%
*-commutative81.6%
associate-/l/90.2%
sqrt-div0.0%
associate-/r/0.0%
div-inv0.0%
associate-/r*0.0%
sqrt-div90.2%
*-commutative90.2%
Applied egg-rr90.2%
if -4.9999999999999996e-255 < (*.f64 V l) < -0.0Initial program 41.4%
associate-/r*66.9%
sqrt-div47.2%
associate-*r/47.2%
Applied egg-rr47.2%
associate-/l*47.2%
Simplified47.2%
if -0.0 < (*.f64 V l) < 3.99999999999999978e273Initial program 87.9%
sqrt-div99.4%
associate-*r/96.6%
Applied egg-rr96.6%
*-commutative96.6%
associate-/l*96.9%
associate-/r/99.4%
Simplified99.4%
if 3.99999999999999978e273 < (*.f64 V l) Initial program 54.7%
frac-2neg54.7%
div-inv54.7%
distribute-rgt-neg-in54.7%
Applied egg-rr54.7%
Taylor expanded in A around 0 54.7%
associate-/l/86.1%
Simplified86.1%
Final simplification80.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -1e+226)
(/ (* c0 t_0) (sqrt l))
(if (<= (* V l) -5e-255)
(/ (sqrt (/ A (* V l))) (/ 1.0 c0))
(if (<= (* V l) 0.0)
(* c0 (* (pow l -0.5) t_0))
(if (<= (* V l) 4e+273)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -1e+226) {
tmp = (c0 * t_0) / sqrt(l);
} else if ((V * l) <= -5e-255) {
tmp = sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = c0 * (pow(l, -0.5) * t_0);
} else if ((V * l) <= 4e+273) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-1d+226)) then
tmp = (c0 * t_0) / sqrt(l)
else if ((v * l) <= (-5d-255)) then
tmp = sqrt((a / (v * l))) / (1.0d0 / c0)
else if ((v * l) <= 0.0d0) then
tmp = c0 * ((l ** (-0.5d0)) * t_0)
else if ((v * l) <= 4d+273) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+226) {
tmp = (c0 * t_0) / Math.sqrt(l);
} else if ((V * l) <= -5e-255) {
tmp = Math.sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.pow(l, -0.5) * t_0);
} else if ((V * l) <= 4e+273) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+226: tmp = (c0 * t_0) / math.sqrt(l) elif (V * l) <= -5e-255: tmp = math.sqrt((A / (V * l))) / (1.0 / c0) elif (V * l) <= 0.0: tmp = c0 * (math.pow(l, -0.5) * t_0) elif (V * l) <= 4e+273: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -1e+226) tmp = Float64(Float64(c0 * t_0) / sqrt(l)); elseif (Float64(V * l) <= -5e-255) tmp = Float64(sqrt(Float64(A / Float64(V * l))) / Float64(1.0 / c0)); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64((l ^ -0.5) * t_0)); elseif (Float64(V * l) <= 4e+273) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+226)
tmp = (c0 * t_0) / sqrt(l);
elseif ((V * l) <= -5e-255)
tmp = sqrt((A / (V * l))) / (1.0 / c0);
elseif ((V * l) <= 0.0)
tmp = c0 * ((l ^ -0.5) * t_0);
elseif ((V * l) <= 4e+273)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+226], N[(N[(c0 * t$95$0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-255], N[(N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+273], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+226}:\\
\;\;\;\;\frac{c0 \cdot t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-255}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V \cdot \ell}}}{\frac{1}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot t\_0\right)\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+273}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999961e225Initial program 41.6%
*-commutative41.6%
associate-/r*60.5%
sqrt-div41.9%
associate-*l/41.9%
Applied egg-rr41.9%
if -9.99999999999999961e225 < (*.f64 V l) < -4.9999999999999996e-255Initial program 90.2%
frac-2neg90.2%
div-inv90.1%
distribute-rgt-neg-in90.1%
Applied egg-rr90.1%
Taylor expanded in A around 0 90.2%
associate-/l/81.6%
Simplified81.6%
*-commutative81.6%
associate-/l/90.2%
sqrt-div0.0%
associate-/r/0.0%
div-inv0.0%
associate-/r*0.0%
sqrt-div90.2%
*-commutative90.2%
Applied egg-rr90.2%
if -4.9999999999999996e-255 < (*.f64 V l) < -0.0Initial program 41.4%
frac-2neg41.4%
div-inv39.7%
distribute-rgt-neg-in39.7%
Applied egg-rr39.7%
un-div-inv41.4%
distribute-rgt-neg-out41.4%
frac-2neg41.4%
associate-/r*66.9%
div-inv66.9%
sqrt-unprod47.4%
*-commutative47.4%
inv-pow47.4%
sqrt-pow147.4%
metadata-eval47.4%
Applied egg-rr47.4%
if -0.0 < (*.f64 V l) < 3.99999999999999978e273Initial program 87.9%
sqrt-div99.4%
associate-*r/96.6%
Applied egg-rr96.6%
*-commutative96.6%
associate-/l*96.9%
associate-/r/99.4%
Simplified99.4%
if 3.99999999999999978e273 < (*.f64 V l) Initial program 54.7%
frac-2neg54.7%
div-inv54.7%
distribute-rgt-neg-in54.7%
Applied egg-rr54.7%
Taylor expanded in A around 0 54.7%
associate-/l/86.1%
Simplified86.1%
Final simplification80.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -4e+201)
(* (pow l -0.5) (* c0 t_0))
(if (<= (* V l) -5e-255)
(/ (sqrt (/ A (* V l))) (/ 1.0 c0))
(if (<= (* V l) 0.0)
(* c0 (* (pow l -0.5) t_0))
(if (<= (* V l) 4e+273)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -4e+201) {
tmp = pow(l, -0.5) * (c0 * t_0);
} else if ((V * l) <= -5e-255) {
tmp = sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = c0 * (pow(l, -0.5) * t_0);
} else if ((V * l) <= 4e+273) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-4d+201)) then
tmp = (l ** (-0.5d0)) * (c0 * t_0)
else if ((v * l) <= (-5d-255)) then
tmp = sqrt((a / (v * l))) / (1.0d0 / c0)
else if ((v * l) <= 0.0d0) then
tmp = c0 * ((l ** (-0.5d0)) * t_0)
else if ((v * l) <= 4d+273) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -4e+201) {
tmp = Math.pow(l, -0.5) * (c0 * t_0);
} else if ((V * l) <= -5e-255) {
tmp = Math.sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.pow(l, -0.5) * t_0);
} else if ((V * l) <= 4e+273) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -4e+201: tmp = math.pow(l, -0.5) * (c0 * t_0) elif (V * l) <= -5e-255: tmp = math.sqrt((A / (V * l))) / (1.0 / c0) elif (V * l) <= 0.0: tmp = c0 * (math.pow(l, -0.5) * t_0) elif (V * l) <= 4e+273: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -4e+201) tmp = Float64((l ^ -0.5) * Float64(c0 * t_0)); elseif (Float64(V * l) <= -5e-255) tmp = Float64(sqrt(Float64(A / Float64(V * l))) / Float64(1.0 / c0)); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64((l ^ -0.5) * t_0)); elseif (Float64(V * l) <= 4e+273) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -4e+201)
tmp = (l ^ -0.5) * (c0 * t_0);
elseif ((V * l) <= -5e-255)
tmp = sqrt((A / (V * l))) / (1.0 / c0);
elseif ((V * l) <= 0.0)
tmp = c0 * ((l ^ -0.5) * t_0);
elseif ((V * l) <= 4e+273)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -4e+201], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-255], N[(N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+273], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+201}:\\
\;\;\;\;{\ell}^{-0.5} \cdot \left(c0 \cdot t\_0\right)\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-255}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V \cdot \ell}}}{\frac{1}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot t\_0\right)\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+273}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.00000000000000015e201Initial program 44.5%
*-commutative44.5%
sqrt-div0.0%
associate-*l/0.0%
Applied egg-rr0.0%
sqrt-prod0.0%
associate-/r*0.0%
*-commutative0.0%
associate-*r/0.0%
sqrt-div37.2%
un-div-inv37.2%
metadata-eval37.2%
sqrt-div37.3%
*-commutative37.3%
inv-pow37.3%
sqrt-pow137.2%
metadata-eval37.2%
Applied egg-rr37.2%
if -4.00000000000000015e201 < (*.f64 V l) < -4.9999999999999996e-255Initial program 91.2%
frac-2neg91.2%
div-inv91.1%
distribute-rgt-neg-in91.1%
Applied egg-rr91.1%
Taylor expanded in A around 0 91.2%
associate-/l/82.2%
Simplified82.2%
*-commutative82.2%
associate-/l/91.2%
sqrt-div0.0%
associate-/r/0.0%
div-inv0.0%
associate-/r*0.0%
sqrt-div91.2%
*-commutative91.2%
Applied egg-rr91.2%
if -4.9999999999999996e-255 < (*.f64 V l) < -0.0Initial program 41.4%
frac-2neg41.4%
div-inv39.7%
distribute-rgt-neg-in39.7%
Applied egg-rr39.7%
un-div-inv41.4%
distribute-rgt-neg-out41.4%
frac-2neg41.4%
associate-/r*66.9%
div-inv66.9%
sqrt-unprod47.4%
*-commutative47.4%
inv-pow47.4%
sqrt-pow147.4%
metadata-eval47.4%
Applied egg-rr47.4%
if -0.0 < (*.f64 V l) < 3.99999999999999978e273Initial program 87.9%
sqrt-div99.4%
associate-*r/96.6%
Applied egg-rr96.6%
*-commutative96.6%
associate-/l*96.9%
associate-/r/99.4%
Simplified99.4%
if 3.99999999999999978e273 < (*.f64 V l) Initial program 54.7%
frac-2neg54.7%
div-inv54.7%
distribute-rgt-neg-in54.7%
Applied egg-rr54.7%
Taylor expanded in A around 0 54.7%
associate-/l/86.1%
Simplified86.1%
Final simplification80.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -4e+201)
(* (pow l -0.5) (* c0 t_0))
(if (<= (* V l) -5e-255)
(/ (sqrt (/ A (* V l))) (/ 1.0 c0))
(if (<= (* V l) 0.0)
(* c0 (* t_0 (sqrt (/ 1.0 l))))
(if (<= (* V l) 4e+273)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -4e+201) {
tmp = pow(l, -0.5) * (c0 * t_0);
} else if ((V * l) <= -5e-255) {
tmp = sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 * sqrt((1.0 / l)));
} else if ((V * l) <= 4e+273) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-4d+201)) then
tmp = (l ** (-0.5d0)) * (c0 * t_0)
else if ((v * l) <= (-5d-255)) then
tmp = sqrt((a / (v * l))) / (1.0d0 / c0)
else if ((v * l) <= 0.0d0) then
tmp = c0 * (t_0 * sqrt((1.0d0 / l)))
else if ((v * l) <= 4d+273) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -4e+201) {
tmp = Math.pow(l, -0.5) * (c0 * t_0);
} else if ((V * l) <= -5e-255) {
tmp = Math.sqrt((A / (V * l))) / (1.0 / c0);
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 * Math.sqrt((1.0 / l)));
} else if ((V * l) <= 4e+273) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -4e+201: tmp = math.pow(l, -0.5) * (c0 * t_0) elif (V * l) <= -5e-255: tmp = math.sqrt((A / (V * l))) / (1.0 / c0) elif (V * l) <= 0.0: tmp = c0 * (t_0 * math.sqrt((1.0 / l))) elif (V * l) <= 4e+273: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -4e+201) tmp = Float64((l ^ -0.5) * Float64(c0 * t_0)); elseif (Float64(V * l) <= -5e-255) tmp = Float64(sqrt(Float64(A / Float64(V * l))) / Float64(1.0 / c0)); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(t_0 * sqrt(Float64(1.0 / l)))); elseif (Float64(V * l) <= 4e+273) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -4e+201)
tmp = (l ^ -0.5) * (c0 * t_0);
elseif ((V * l) <= -5e-255)
tmp = sqrt((A / (V * l))) / (1.0 / c0);
elseif ((V * l) <= 0.0)
tmp = c0 * (t_0 * sqrt((1.0 / l)));
elseif ((V * l) <= 4e+273)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -4e+201], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-255], N[(N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(t$95$0 * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+273], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+201}:\\
\;\;\;\;{\ell}^{-0.5} \cdot \left(c0 \cdot t\_0\right)\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-255}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V \cdot \ell}}}{\frac{1}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(t\_0 \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+273}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.00000000000000015e201Initial program 44.5%
*-commutative44.5%
sqrt-div0.0%
associate-*l/0.0%
Applied egg-rr0.0%
sqrt-prod0.0%
associate-/r*0.0%
*-commutative0.0%
associate-*r/0.0%
sqrt-div37.2%
un-div-inv37.2%
metadata-eval37.2%
sqrt-div37.3%
*-commutative37.3%
inv-pow37.3%
sqrt-pow137.2%
metadata-eval37.2%
Applied egg-rr37.2%
if -4.00000000000000015e201 < (*.f64 V l) < -4.9999999999999996e-255Initial program 91.2%
frac-2neg91.2%
div-inv91.1%
distribute-rgt-neg-in91.1%
Applied egg-rr91.1%
Taylor expanded in A around 0 91.2%
associate-/l/82.2%
Simplified82.2%
*-commutative82.2%
associate-/l/91.2%
sqrt-div0.0%
associate-/r/0.0%
div-inv0.0%
associate-/r*0.0%
sqrt-div91.2%
*-commutative91.2%
Applied egg-rr91.2%
if -4.9999999999999996e-255 < (*.f64 V l) < -0.0Initial program 41.4%
pow1/241.4%
associate-/r*66.9%
div-inv66.9%
unpow-prod-down47.4%
pow1/247.4%
Applied egg-rr47.4%
unpow1/247.4%
Simplified47.4%
if -0.0 < (*.f64 V l) < 3.99999999999999978e273Initial program 87.9%
sqrt-div99.4%
associate-*r/96.6%
Applied egg-rr96.6%
*-commutative96.6%
associate-/l*96.9%
associate-/r/99.4%
Simplified99.4%
if 3.99999999999999978e273 < (*.f64 V l) Initial program 54.7%
frac-2neg54.7%
div-inv54.7%
distribute-rgt-neg-in54.7%
Applied egg-rr54.7%
Taylor expanded in A around 0 54.7%
associate-/l/86.1%
Simplified86.1%
Final simplification80.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+301)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+301)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 2d+301))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+301)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 2e+301): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 2e+301)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 2e+301)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2e+301]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 2 \cdot 10^{+301}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 2.00000000000000011e301 < (/.f64 A (*.f64 V l)) Initial program 35.1%
*-commutative35.1%
associate-/l/56.0%
Simplified56.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000011e301Initial program 99.4%
Final simplification81.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 1e-308)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+301) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-308) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+301) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 1d-308) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+301) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-308) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+301) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-308: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+301: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-308) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+301) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-308)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+301)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-308], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+301], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 10^{-308}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999999999999991e-309Initial program 36.3%
frac-2neg36.3%
div-inv36.3%
distribute-rgt-neg-in36.3%
Applied egg-rr36.3%
Taylor expanded in A around 0 36.3%
associate-/l/55.4%
Simplified55.4%
if 9.9999999999999991e-309 < (/.f64 A (*.f64 V l)) < 2.00000000000000011e301Initial program 99.5%
if 2.00000000000000011e301 < (/.f64 A (*.f64 V l)) Initial program 36.0%
*-commutative36.0%
associate-/l/56.3%
Simplified56.3%
Final simplification81.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
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
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 73.5%
Final simplification73.5%
herbie shell --seed 2024034
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))