
(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 (<= (* l V) -5e+218)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* l V) -1e-255)
(* (pow (- 0.0 A) 0.5) (* c0 (sqrt (/ -1.0 (* l V)))))
(if (<= (* l V) 5e-311)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* l V) 2e+289)
(/ (* c0 (sqrt A)) (sqrt (* l V)))
(/ c0 (/ (sqrt (- 0.0 V)) (sqrt (/ (- 0.0 A) l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -5e+218) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((l * V) <= -1e-255) {
tmp = pow((0.0 - A), 0.5) * (c0 * sqrt((-1.0 / (l * V))));
} else if ((l * V) <= 5e-311) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((l * V) <= 2e+289) {
tmp = (c0 * sqrt(A)) / sqrt((l * V));
} else {
tmp = c0 / (sqrt((0.0 - V)) / sqrt(((0.0 - A) / 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) :: tmp
if ((l * v) <= (-5d+218)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((l * v) <= (-1d-255)) then
tmp = ((0.0d0 - a) ** 0.5d0) * (c0 * sqrt(((-1.0d0) / (l * v))))
else if ((l * v) <= 5d-311) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((l * v) <= 2d+289) then
tmp = (c0 * sqrt(a)) / sqrt((l * v))
else
tmp = c0 / (sqrt((0.0d0 - v)) / sqrt(((0.0d0 - a) / 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 tmp;
if ((l * V) <= -5e+218) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((l * V) <= -1e-255) {
tmp = Math.pow((0.0 - A), 0.5) * (c0 * Math.sqrt((-1.0 / (l * V))));
} else if ((l * V) <= 5e-311) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((l * V) <= 2e+289) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((l * V));
} else {
tmp = c0 / (Math.sqrt((0.0 - V)) / Math.sqrt(((0.0 - A) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -5e+218: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (l * V) <= -1e-255: tmp = math.pow((0.0 - A), 0.5) * (c0 * math.sqrt((-1.0 / (l * V)))) elif (l * V) <= 5e-311: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (l * V) <= 2e+289: tmp = (c0 * math.sqrt(A)) / math.sqrt((l * V)) else: tmp = c0 / (math.sqrt((0.0 - V)) / math.sqrt(((0.0 - A) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -5e+218) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(l * V) <= -1e-255) tmp = Float64((Float64(0.0 - A) ^ 0.5) * Float64(c0 * sqrt(Float64(-1.0 / Float64(l * V))))); elseif (Float64(l * V) <= 5e-311) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(l * V) <= 2e+289) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(l * V))); else tmp = Float64(c0 / Float64(sqrt(Float64(0.0 - V)) / sqrt(Float64(Float64(0.0 - A) / l)))); 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 ((l * V) <= -5e+218)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((l * V) <= -1e-255)
tmp = ((0.0 - A) ^ 0.5) * (c0 * sqrt((-1.0 / (l * V))));
elseif ((l * V) <= 5e-311)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((l * V) <= 2e+289)
tmp = (c0 * sqrt(A)) / sqrt((l * V));
else
tmp = c0 / (sqrt((0.0 - V)) / sqrt(((0.0 - A) / 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_] := If[LessEqual[N[(l * V), $MachinePrecision], -5e+218], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-255], N[(N[Power[N[(0.0 - A), $MachinePrecision], 0.5], $MachinePrecision] * N[(c0 * N[Sqrt[N[(-1.0 / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e-311], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e+289], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[(0.0 - A), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -5 \cdot 10^{+218}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-255}:\\
\;\;\;\;{\left(0 - A\right)}^{0.5} \cdot \left(c0 \cdot \sqrt{\frac{-1}{\ell \cdot V}}\right)\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+289}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{0 - V}}{\sqrt{\frac{0 - A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999983e218Initial program 52.4%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6446.9%
Applied egg-rr46.9%
if -4.99999999999999983e218 < (*.f64 V l) < -1e-255Initial program 90.3%
*-commutativeN/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
pow1/2N/A
associate-*l*N/A
*-lowering-*.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f64N/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
sub0-negN/A
neg-lowering-neg.f6499.5%
Applied egg-rr99.5%
if -1e-255 < (*.f64 V l) < 5.00000000000023e-311Initial program 56.5%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval74.6%
Applied egg-rr74.6%
if 5.00000000000023e-311 < (*.f64 V l) < 2.0000000000000001e289Initial program 89.1%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.8%
Applied egg-rr78.8%
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
pow1/2N/A
un-div-invN/A
sqrt-divN/A
unpow1/2N/A
associate-/r/N/A
associate-/r*N/A
unpow-prod-downN/A
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f6496.5%
Applied egg-rr96.5%
if 2.0000000000000001e289 < (*.f64 V l) Initial program 46.0%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6472.9%
Applied egg-rr72.9%
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-neg-frac2N/A
sub0-negN/A
/-lowering-/.f64N/A
--lowering--.f6464.8%
Applied egg-rr64.8%
Final simplification88.7%
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 (* l V))))))
(if (<= t_0 5e-279)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= t_0 2e+268) t_0 (/ c0 (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 / (l * V)));
double tmp;
if (t_0 <= 5e-279) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if (t_0 <= 2e+268) {
tmp = t_0;
} else {
tmp = c0 / 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 / (l * v)))
if (t_0 <= 5d-279) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if (t_0 <= 2d+268) then
tmp = t_0
else
tmp = c0 / 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 / (l * V)));
double tmp;
if (t_0 <= 5e-279) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if (t_0 <= 2e+268) {
tmp = t_0;
} else {
tmp = c0 / 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 / (l * V))) tmp = 0 if t_0 <= 5e-279: tmp = c0 * math.pow((V / (A / l)), -0.5) elif t_0 <= 2e+268: tmp = t_0 else: tmp = c0 / 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(l * V)))) tmp = 0.0 if (t_0 <= 5e-279) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (t_0 <= 2e+268) tmp = t_0; else tmp = Float64(c0 / 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 / (l * V)));
tmp = 0.0;
if (t_0 <= 5e-279)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif (t_0 <= 2e+268)
tmp = t_0;
else
tmp = c0 / 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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-279], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+268], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $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}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-279}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+268}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999969e-279Initial program 76.3%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval81.2%
Applied egg-rr81.2%
if 4.99999999999999969e-279 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.9999999999999999e268Initial program 97.6%
if 1.9999999999999999e268 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 45.2%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6457.5%
Applied egg-rr57.5%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6459.8%
Applied egg-rr59.8%
Final simplification83.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 (/ A (* l V))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+268) t_0 (/ c0 (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 / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+268) {
tmp = t_0;
} else {
tmp = c0 / 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 / (l * v)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+268) then
tmp = t_0
else
tmp = c0 / 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 / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+268) {
tmp = t_0;
} else {
tmp = c0 / 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 / (l * V))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+268: tmp = t_0 else: tmp = c0 / 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(l * V)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+268) tmp = t_0; else tmp = Float64(c0 / 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 / (l * V)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+268)
tmp = t_0;
else
tmp = c0 / 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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+268], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $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}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+268}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 75.4%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6473.7%
Applied egg-rr73.7%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.9999999999999999e268Initial program 97.7%
if 1.9999999999999999e268 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 45.2%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6457.5%
Applied egg-rr57.5%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6459.8%
Applied egg-rr59.8%
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
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+297) t_0 (* 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((A / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+297) {
tmp = t_0;
} 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((a / (l * v)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+297) then
tmp = t_0
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((A / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+297) {
tmp = t_0;
} 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((A / (l * V))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+297: tmp = t_0 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 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+297) tmp = t_0; 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((A / (l * V)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+297)
tmp = t_0;
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[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+297], t$95$0, 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 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+297}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 75.4%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6473.7%
Applied egg-rr73.7%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e297Initial program 97.7%
if 2e297 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 43.0%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6458.1%
Applied egg-rr58.1%
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 (let* ((t_0 (* c0 (sqrt (/ A (* l V))))) (t_1 (* c0 (sqrt (/ (/ A V) l))))) (if (<= t_0 0.0) t_1 (if (<= t_0 2e+268) t_0 t_1))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double t_1 = c0 * sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+268) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = c0 * sqrt((a / (l * v)))
t_1 = c0 * sqrt(((a / v) / l))
if (t_0 <= 0.0d0) then
tmp = t_1
else if (t_0 <= 2d+268) then
tmp = t_0
else
tmp = t_1
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 / (l * V)));
double t_1 = c0 * Math.sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+268) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) t_1 = c0 * math.sqrt(((A / V) / l)) tmp = 0 if t_0 <= 0.0: tmp = t_1 elif t_0 <= 2e+268: tmp = t_0 else: tmp = t_1 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(l * V)))) t_1 = Float64(c0 * sqrt(Float64(Float64(A / V) / l))) tmp = 0.0 if (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 2e+268) tmp = t_0; else tmp = t_1; 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 / (l * V)));
t_1 = c0 * sqrt(((A / V) / l));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = t_1;
elseif (t_0 <= 2e+268)
tmp = t_0;
else
tmp = t_1;
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 2e+268], t$95$0, t$95$1]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
t_1 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+268}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 1.9999999999999999e268 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 70.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6471.6%
Applied egg-rr71.6%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.9999999999999999e268Initial program 97.7%
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 (<= A -4e-310) (* c0 (/ (/ (pow (- 0.0 A) 0.5) (sqrt l)) (sqrt (- 0.0 V)))) (/ (* c0 (sqrt A)) (sqrt (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * ((pow((0.0 - A), 0.5) / sqrt(l)) / sqrt((0.0 - V)));
} else {
tmp = (c0 * sqrt(A)) / sqrt((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) :: tmp
if (a <= (-4d-310)) then
tmp = c0 * ((((0.0d0 - a) ** 0.5d0) / sqrt(l)) / sqrt((0.0d0 - v)))
else
tmp = (c0 * sqrt(a)) / sqrt((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 tmp;
if (A <= -4e-310) {
tmp = c0 * ((Math.pow((0.0 - A), 0.5) / Math.sqrt(l)) / Math.sqrt((0.0 - V)));
} else {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((l * V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 * ((math.pow((0.0 - A), 0.5) / math.sqrt(l)) / math.sqrt((0.0 - V))) else: tmp = (c0 * math.sqrt(A)) / math.sqrt((l * V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 * Float64(Float64((Float64(0.0 - A) ^ 0.5) / sqrt(l)) / sqrt(Float64(0.0 - V)))); else tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(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 (A <= -4e-310)
tmp = c0 * ((((0.0 - A) ^ 0.5) / sqrt(l)) / sqrt((0.0 - V)));
else
tmp = (c0 * sqrt(A)) / sqrt((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[A, -4e-310], N[(c0 * N[(N[(N[Power[N[(0.0 - A), $MachinePrecision], 0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\frac{{\left(0 - A\right)}^{0.5}}{\sqrt{\ell}}}{\sqrt{0 - V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 80.8%
associate-/r*N/A
sqrt-divN/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6443.2%
Applied egg-rr43.2%
if -3.999999999999988e-310 < A Initial program 77.9%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.6%
Applied egg-rr76.6%
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
pow1/2N/A
un-div-invN/A
sqrt-divN/A
unpow1/2N/A
associate-/r/N/A
associate-/r*N/A
unpow-prod-downN/A
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f6483.6%
Applied egg-rr83.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -5e+218)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* l V) -1e-255)
(* (pow (- 0.0 A) 0.5) (* c0 (sqrt (/ -1.0 (* l V)))))
(if (<= (* l V) 5e-311)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* l V) 2e+289)
(/ (* c0 (sqrt A)) (sqrt (* l V)))
(* c0 (/ (sqrt (/ (- 0.0 A) l)) (sqrt (- 0.0 V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -5e+218) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((l * V) <= -1e-255) {
tmp = pow((0.0 - A), 0.5) * (c0 * sqrt((-1.0 / (l * V))));
} else if ((l * V) <= 5e-311) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((l * V) <= 2e+289) {
tmp = (c0 * sqrt(A)) / sqrt((l * V));
} else {
tmp = c0 * (sqrt(((0.0 - A) / l)) / sqrt((0.0 - 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) :: tmp
if ((l * v) <= (-5d+218)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((l * v) <= (-1d-255)) then
tmp = ((0.0d0 - a) ** 0.5d0) * (c0 * sqrt(((-1.0d0) / (l * v))))
else if ((l * v) <= 5d-311) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((l * v) <= 2d+289) then
tmp = (c0 * sqrt(a)) / sqrt((l * v))
else
tmp = c0 * (sqrt(((0.0d0 - a) / l)) / sqrt((0.0d0 - 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 tmp;
if ((l * V) <= -5e+218) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((l * V) <= -1e-255) {
tmp = Math.pow((0.0 - A), 0.5) * (c0 * Math.sqrt((-1.0 / (l * V))));
} else if ((l * V) <= 5e-311) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((l * V) <= 2e+289) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((l * V));
} else {
tmp = c0 * (Math.sqrt(((0.0 - A) / l)) / Math.sqrt((0.0 - V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -5e+218: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (l * V) <= -1e-255: tmp = math.pow((0.0 - A), 0.5) * (c0 * math.sqrt((-1.0 / (l * V)))) elif (l * V) <= 5e-311: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (l * V) <= 2e+289: tmp = (c0 * math.sqrt(A)) / math.sqrt((l * V)) else: tmp = c0 * (math.sqrt(((0.0 - A) / l)) / math.sqrt((0.0 - V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -5e+218) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(l * V) <= -1e-255) tmp = Float64((Float64(0.0 - A) ^ 0.5) * Float64(c0 * sqrt(Float64(-1.0 / Float64(l * V))))); elseif (Float64(l * V) <= 5e-311) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(l * V) <= 2e+289) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(l * V))); else tmp = Float64(c0 * Float64(sqrt(Float64(Float64(0.0 - A) / l)) / sqrt(Float64(0.0 - 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 ((l * V) <= -5e+218)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((l * V) <= -1e-255)
tmp = ((0.0 - A) ^ 0.5) * (c0 * sqrt((-1.0 / (l * V))));
elseif ((l * V) <= 5e-311)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((l * V) <= 2e+289)
tmp = (c0 * sqrt(A)) / sqrt((l * V));
else
tmp = c0 * (sqrt(((0.0 - A) / l)) / sqrt((0.0 - 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[(l * V), $MachinePrecision], -5e+218], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-255], N[(N[Power[N[(0.0 - A), $MachinePrecision], 0.5], $MachinePrecision] * N[(c0 * N[Sqrt[N[(-1.0 / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e-311], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e+289], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(N[(0.0 - A), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -5 \cdot 10^{+218}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-255}:\\
\;\;\;\;{\left(0 - A\right)}^{0.5} \cdot \left(c0 \cdot \sqrt{\frac{-1}{\ell \cdot V}}\right)\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+289}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{0 - A}{\ell}}}{\sqrt{0 - V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999983e218Initial program 52.4%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6446.9%
Applied egg-rr46.9%
if -4.99999999999999983e218 < (*.f64 V l) < -1e-255Initial program 90.3%
*-commutativeN/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
pow1/2N/A
associate-*l*N/A
*-lowering-*.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f64N/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
sub0-negN/A
neg-lowering-neg.f6499.5%
Applied egg-rr99.5%
if -1e-255 < (*.f64 V l) < 5.00000000000023e-311Initial program 56.5%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval74.6%
Applied egg-rr74.6%
if 5.00000000000023e-311 < (*.f64 V l) < 2.0000000000000001e289Initial program 89.1%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.8%
Applied egg-rr78.8%
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
pow1/2N/A
un-div-invN/A
sqrt-divN/A
unpow1/2N/A
associate-/r/N/A
associate-/r*N/A
unpow-prod-downN/A
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f6496.5%
Applied egg-rr96.5%
if 2.0000000000000001e289 < (*.f64 V l) Initial program 46.0%
associate-/l/N/A
frac-2negN/A
sqrt-divN/A
distribute-frac-neg2N/A
pow1/2N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-frac-neg2N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6464.8%
Applied egg-rr64.8%
Final simplification88.7%
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 l) V)))))
(if (<= (* l V) -5e+176)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* l V) -1e-158)
(/ c0 (sqrt (/ (* l V) A)))
(if (<= (* l V) 1e-291)
t_0
(if (<= (* l V) 4e+102) (/ (sqrt A) (/ (sqrt (* l V)) c0)) t_0))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt(((A / l) / V));
double tmp;
if ((l * V) <= -5e+176) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((l * V) <= -1e-158) {
tmp = c0 / sqrt(((l * V) / A));
} else if ((l * V) <= 1e-291) {
tmp = t_0;
} else if ((l * V) <= 4e+102) {
tmp = sqrt(A) / (sqrt((l * V)) / c0);
} else {
tmp = 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 = c0 * sqrt(((a / l) / v))
if ((l * v) <= (-5d+176)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((l * v) <= (-1d-158)) then
tmp = c0 / sqrt(((l * v) / a))
else if ((l * v) <= 1d-291) then
tmp = t_0
else if ((l * v) <= 4d+102) then
tmp = sqrt(a) / (sqrt((l * v)) / c0)
else
tmp = 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 = c0 * Math.sqrt(((A / l) / V));
double tmp;
if ((l * V) <= -5e+176) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((l * V) <= -1e-158) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else if ((l * V) <= 1e-291) {
tmp = t_0;
} else if ((l * V) <= 4e+102) {
tmp = Math.sqrt(A) / (Math.sqrt((l * V)) / c0);
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt(((A / l) / V)) tmp = 0 if (l * V) <= -5e+176: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (l * V) <= -1e-158: tmp = c0 / math.sqrt(((l * V) / A)) elif (l * V) <= 1e-291: tmp = t_0 elif (l * V) <= 4e+102: tmp = math.sqrt(A) / (math.sqrt((l * V)) / c0) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(Float64(A / l) / V))) tmp = 0.0 if (Float64(l * V) <= -5e+176) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(l * V) <= -1e-158) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); elseif (Float64(l * V) <= 1e-291) tmp = t_0; elseif (Float64(l * V) <= 4e+102) tmp = Float64(sqrt(A) / Float64(sqrt(Float64(l * V)) / c0)); else tmp = 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 = c0 * sqrt(((A / l) / V));
tmp = 0.0;
if ((l * V) <= -5e+176)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((l * V) <= -1e-158)
tmp = c0 / sqrt(((l * V) / A));
elseif ((l * V) <= 1e-291)
tmp = t_0;
elseif ((l * V) <= 4e+102)
tmp = sqrt(A) / (sqrt((l * V)) / c0);
else
tmp = 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[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], -5e+176], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-158], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-291], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], 4e+102], N[(N[Sqrt[A], $MachinePrecision] / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{if}\;\ell \cdot V \leq -5 \cdot 10^{+176}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-158}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-291}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{+102}:\\
\;\;\;\;\frac{\sqrt{A}}{\frac{\sqrt{\ell \cdot V}}{c0}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 V l) < -5e176Initial program 55.8%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6440.0%
Applied egg-rr40.0%
if -5e176 < (*.f64 V l) < -1.00000000000000006e-158Initial program 94.0%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.9%
Applied egg-rr86.9%
associate-/r/N/A
*-commutativeN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6494.0%
Applied egg-rr94.0%
if -1.00000000000000006e-158 < (*.f64 V l) < 9.99999999999999962e-292 or 3.99999999999999991e102 < (*.f64 V l) Initial program 69.8%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6480.8%
Applied egg-rr80.8%
if 9.99999999999999962e-292 < (*.f64 V l) < 3.99999999999999991e102Initial program 88.2%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.4%
Applied egg-rr76.4%
*-commutativeN/A
associate-/l/N/A
associate-/r*N/A
clear-numN/A
associate-/r*N/A
sqrt-divN/A
unpow1/2N/A
associate-/r/N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f6497.0%
Applied egg-rr97.0%
Final simplification84.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -5e+176)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* l V) -1e-158)
(/ c0 (sqrt (/ (* l V) A)))
(if (<= (* l V) 1e-291)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* l V) 1e+176)
(* (sqrt A) (/ c0 (sqrt (* l V))))
(/ c0 (sqrt (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -5e+176) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((l * V) <= -1e-158) {
tmp = c0 / sqrt(((l * V) / A));
} else if ((l * V) <= 1e-291) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((l * V) <= 1e+176) {
tmp = sqrt(A) * (c0 / sqrt((l * V)));
} else {
tmp = c0 / 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) :: tmp
if ((l * v) <= (-5d+176)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((l * v) <= (-1d-158)) then
tmp = c0 / sqrt(((l * v) / a))
else if ((l * v) <= 1d-291) then
tmp = c0 * sqrt(((a / l) / v))
else if ((l * v) <= 1d+176) then
tmp = sqrt(a) * (c0 / sqrt((l * v)))
else
tmp = c0 / 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 tmp;
if ((l * V) <= -5e+176) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((l * V) <= -1e-158) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else if ((l * V) <= 1e-291) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if ((l * V) <= 1e+176) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((l * V)));
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -5e+176: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (l * V) <= -1e-158: tmp = c0 / math.sqrt(((l * V) / A)) elif (l * V) <= 1e-291: tmp = c0 * math.sqrt(((A / l) / V)) elif (l * V) <= 1e+176: tmp = math.sqrt(A) * (c0 / math.sqrt((l * V))) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -5e+176) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(l * V) <= -1e-158) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); elseif (Float64(l * V) <= 1e-291) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(l * V) <= 1e+176) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(l * V)))); else tmp = Float64(c0 / 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)
tmp = 0.0;
if ((l * V) <= -5e+176)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((l * V) <= -1e-158)
tmp = c0 / sqrt(((l * V) / A));
elseif ((l * V) <= 1e-291)
tmp = c0 * sqrt(((A / l) / V));
elseif ((l * V) <= 1e+176)
tmp = sqrt(A) * (c0 / sqrt((l * V)));
else
tmp = c0 / 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_] := If[LessEqual[N[(l * V), $MachinePrecision], -5e+176], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-158], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-291], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e+176], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -5 \cdot 10^{+176}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-158}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-291}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{+176}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5e176Initial program 55.8%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6440.0%
Applied egg-rr40.0%
if -5e176 < (*.f64 V l) < -1.00000000000000006e-158Initial program 94.0%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.9%
Applied egg-rr86.9%
associate-/r/N/A
*-commutativeN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6494.0%
Applied egg-rr94.0%
if -1.00000000000000006e-158 < (*.f64 V l) < 9.99999999999999962e-292Initial program 66.4%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.3%
Applied egg-rr78.3%
if 9.99999999999999962e-292 < (*.f64 V l) < 1e176Initial program 88.7%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.9%
Applied egg-rr76.9%
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
pow1/2N/A
un-div-invN/A
sqrt-divN/A
unpow1/2N/A
associate-/r/N/A
associate-/r*N/A
unpow-prod-downN/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6494.4%
Applied egg-rr94.4%
if 1e176 < (*.f64 V l) Initial program 65.7%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6480.9%
Applied egg-rr80.9%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6481.0%
Applied egg-rr81.0%
Final simplification83.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -5e+176)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* l V) -2e-266)
(/ c0 (sqrt (/ (* l V) A)))
(if (<= (* l V) 5e-311)
(* c0 (pow (/ V (/ A l)) -0.5))
(/ (* c0 (sqrt A)) (sqrt (* l V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -5e+176) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((l * V) <= -2e-266) {
tmp = c0 / sqrt(((l * V) / A));
} else if ((l * V) <= 5e-311) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else {
tmp = (c0 * sqrt(A)) / sqrt((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) :: tmp
if ((l * v) <= (-5d+176)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((l * v) <= (-2d-266)) then
tmp = c0 / sqrt(((l * v) / a))
else if ((l * v) <= 5d-311) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else
tmp = (c0 * sqrt(a)) / sqrt((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 tmp;
if ((l * V) <= -5e+176) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((l * V) <= -2e-266) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else if ((l * V) <= 5e-311) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((l * V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -5e+176: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (l * V) <= -2e-266: tmp = c0 / math.sqrt(((l * V) / A)) elif (l * V) <= 5e-311: tmp = c0 * math.pow((V / (A / l)), -0.5) else: tmp = (c0 * math.sqrt(A)) / math.sqrt((l * V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -5e+176) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(l * V) <= -2e-266) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); elseif (Float64(l * V) <= 5e-311) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); else tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(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 ((l * V) <= -5e+176)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((l * V) <= -2e-266)
tmp = c0 / sqrt(((l * V) / A));
elseif ((l * V) <= 5e-311)
tmp = c0 * ((V / (A / l)) ^ -0.5);
else
tmp = (c0 * sqrt(A)) / sqrt((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[(l * V), $MachinePrecision], -5e+176], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -2e-266], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e-311], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -5 \cdot 10^{+176}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq -2 \cdot 10^{-266}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5e176Initial program 55.8%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6440.0%
Applied egg-rr40.0%
if -5e176 < (*.f64 V l) < -2e-266Initial program 92.1%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.6%
Applied egg-rr86.6%
associate-/r/N/A
*-commutativeN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6492.1%
Applied egg-rr92.1%
if -2e-266 < (*.f64 V l) < 5.00000000000023e-311Initial program 54.1%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval73.2%
Applied egg-rr73.2%
if 5.00000000000023e-311 < (*.f64 V l) Initial program 83.4%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.0%
Applied egg-rr78.0%
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
pow1/2N/A
un-div-invN/A
sqrt-divN/A
unpow1/2N/A
associate-/r/N/A
associate-/r*N/A
unpow-prod-downN/A
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f6489.8%
Applied egg-rr89.8%
Final simplification83.2%
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 -1e-309) (* c0 (* (sqrt (/ (- 0.0 A) l)) (sqrt (/ -1.0 V)))) (* c0 (/ (sqrt (/ A l)) (sqrt V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -1e-309) {
tmp = c0 * (sqrt(((0.0 - A) / l)) * sqrt((-1.0 / V)));
} else {
tmp = c0 * (sqrt((A / l)) / sqrt(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) :: tmp
if (v <= (-1d-309)) then
tmp = c0 * (sqrt(((0.0d0 - a) / l)) * sqrt(((-1.0d0) / v)))
else
tmp = c0 * (sqrt((a / l)) / sqrt(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 tmp;
if (V <= -1e-309) {
tmp = c0 * (Math.sqrt(((0.0 - A) / l)) * Math.sqrt((-1.0 / V)));
} else {
tmp = c0 * (Math.sqrt((A / l)) / Math.sqrt(V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -1e-309: tmp = c0 * (math.sqrt(((0.0 - A) / l)) * math.sqrt((-1.0 / V))) else: tmp = c0 * (math.sqrt((A / l)) / math.sqrt(V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -1e-309) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(0.0 - A) / l)) * sqrt(Float64(-1.0 / V)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / l)) / sqrt(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 <= -1e-309)
tmp = c0 * (sqrt(((0.0 - A) / l)) * sqrt((-1.0 / V)));
else
tmp = c0 * (sqrt((A / l)) / sqrt(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[V, -1e-309], N[(c0 * N[(N[Sqrt[N[(N[(0.0 - A), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -1 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{0 - A}{\ell}} \cdot \sqrt{\frac{-1}{V}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{\ell}}}{\sqrt{V}}\\
\end{array}
\end{array}
if V < -1.000000000000002e-309Initial program 80.4%
frac-2negN/A
neg-mul-1N/A
distribute-rgt-neg-inN/A
times-fracN/A
sqrt-prodN/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-frac-neg2N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f6487.8%
Applied egg-rr87.8%
if -1.000000000000002e-309 < V Initial program 78.5%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.7%
Applied egg-rr76.7%
associate-/l/N/A
metadata-evalN/A
frac-timesN/A
clear-numN/A
associate-*l/N/A
sqrt-divN/A
div-invN/A
sqrt-undivN/A
pow1/2N/A
unpow1/2N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-undivN/A
div-invN/A
*-commutativeN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f6488.9%
Applied egg-rr88.9%
Final simplification88.3%
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 (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
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 / (l * v)))
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 / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 79.5%
Final simplification79.5%
herbie shell --seed 2024288
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))