
(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 14 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
(let* ((t_0 (sqrt (- 0.0 V))) (t_1 (sqrt (- 0.0 A))))
(if (<= (* V l) (- INFINITY))
(* (/ (/ c0 (sqrt l)) t_0) t_1)
(if (<= (* V l) -5e-255)
(* c0 (/ t_1 (sqrt (- 0.0 (fma l V 0.0)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (- 0.0 (/ A l))) t_0))
(if (<= (* V l) 1e+289)
(* c0 (/ (sqrt A) (sqrt (fma V l 0.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 = sqrt((0.0 - V));
double t_1 = sqrt((0.0 - A));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = ((c0 / sqrt(l)) / t_0) * t_1;
} else if ((V * l) <= -5e-255) {
tmp = c0 * (t_1 / sqrt((0.0 - fma(l, V, 0.0))));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((0.0 - (A / l))) / t_0);
} else if ((V * l) <= 1e+289) {
tmp = c0 * (sqrt(A) / sqrt(fma(V, l, 0.0)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(0.0 - V)) t_1 = sqrt(Float64(0.0 - A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(Float64(c0 / sqrt(l)) / t_0) * t_1); elseif (Float64(V * l) <= -5e-255) tmp = Float64(c0 * Float64(t_1 / sqrt(Float64(0.0 - fma(l, V, 0.0))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - Float64(A / l))) / t_0)); elseif (Float64(V * l) <= 1e+289) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(fma(V, l, 0.0)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return 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[(0.0 - V), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-255], N[(c0 * N[(t$95$1 / N[Sqrt[N[(0.0 - N[(l * V + 0.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+289], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l + 0.0), $MachinePrecision]], $MachinePrecision]), $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 := \sqrt{0 - V}\\
t_1 := \sqrt{0 - A}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{t\_0} \cdot t\_1\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-255}:\\
\;\;\;\;c0 \cdot \frac{t\_1}{\sqrt{0 - \mathsf{fma}\left(\ell, V, 0\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - \frac{A}{\ell}}}{t\_0}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+289}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 38.6%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6452.7
Applied egg-rr52.7%
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr54.6%
if -inf.0 < (*.f64 V l) < -4.9999999999999996e-255Initial program 86.7%
remove-double-divN/A
associate-/r/N/A
associate-/r*N/A
inv-powN/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
inv-powN/A
inv-powN/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
clear-numN/A
associate-/r*N/A
neg-mul-1N/A
distribute-lft-neg-inN/A
Applied egg-rr79.9%
div-invN/A
associate-*l/N/A
clear-numN/A
div-invN/A
associate-/r*N/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.3
Applied egg-rr99.3%
if -4.9999999999999996e-255 < (*.f64 V l) < 0.0Initial program 35.9%
remove-double-divN/A
associate-/r/N/A
associate-/r*N/A
inv-powN/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
inv-powN/A
inv-powN/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
clear-numN/A
associate-/r*N/A
neg-mul-1N/A
distribute-lft-neg-inN/A
Applied egg-rr57.0%
div-invN/A
associate-*l/N/A
clear-numN/A
frac-2negN/A
associate-*l/N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
div-invN/A
frac-2negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6441.1
Applied egg-rr41.1%
sub0-negN/A
neg-lowering-neg.f6441.1
Applied egg-rr41.1%
if 0.0 < (*.f64 V l) < 1.0000000000000001e289Initial program 80.4%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6499.4
Applied egg-rr99.4%
if 1.0000000000000001e289 < (*.f64 V l) Initial program 35.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6475.3
Applied egg-rr75.3%
Final simplification84.6%
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))))) (t_1 (* c0 (sqrt (/ (/ A V) l))))) (if (<= t_0 0.0) t_1 (if (<= t_0 1e+230) 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 / (V * l)));
double t_1 = c0 * sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 1e+230) {
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 / (v * l)))
t_1 = c0 * sqrt(((a / v) / l))
if (t_0 <= 0.0d0) then
tmp = t_1
else if (t_0 <= 1d+230) 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 / (V * l)));
double t_1 = c0 * Math.sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 1e+230) {
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 / (V * l))) t_1 = c0 * math.sqrt(((A / V) / l)) tmp = 0 if t_0 <= 0.0: tmp = t_1 elif t_0 <= 1e+230: 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(V * l)))) t_1 = Float64(c0 * sqrt(Float64(Float64(A / V) / l))) tmp = 0.0 if (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 1e+230) 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 / (V * l)));
t_1 = c0 * sqrt(((A / V) / l));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = t_1;
elseif (t_0 <= 1e+230)
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[(V * l), $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, 1e+230], 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}{V \cdot \ell}}\\
t_1 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+230}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 1.0000000000000001e230 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 60.6%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6466.6
Applied egg-rr66.6%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e230Initial program 99.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 l) -1e+262)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) -5e-255)
(* c0 (/ (sqrt (- 0.0 A)) (sqrt (- 0.0 (fma l V 0.0)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (- 0.0 (/ A l))) (sqrt (- 0.0 V))))
(if (<= (* V l) 1e+289)
(* c0 (/ (sqrt A) (sqrt (fma V l 0.0))))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+262) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= -5e-255) {
tmp = c0 * (sqrt((0.0 - A)) / sqrt((0.0 - fma(l, V, 0.0))));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
} else if ((V * l) <= 1e+289) {
tmp = c0 * (sqrt(A) / sqrt(fma(V, l, 0.0)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+262) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= -5e-255) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - A)) / sqrt(Float64(0.0 - fma(l, V, 0.0))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - Float64(A / l))) / sqrt(Float64(0.0 - V)))); elseif (Float64(V * l) <= 1e+289) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(fma(V, l, 0.0)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return 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], -1e+262], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-255], N[(c0 * N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - N[(l * V + 0.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+289], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l + 0.0), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+262}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-255}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - A}}{\sqrt{0 - \mathsf{fma}\left(\ell, V, 0\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - \frac{A}{\ell}}}{\sqrt{0 - V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+289}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e262Initial program 50.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
*-lowering-*.f64N/A
/-lowering-/.f6462.1
Applied egg-rr62.1%
clear-numN/A
un-div-invN/A
frac-2negN/A
distribute-frac-neg2N/A
sub0-negN/A
sqrt-undivN/A
sub0-negN/A
sqrt-undivN/A
associate-/r/N/A
Applied egg-rr44.3%
if -1e262 < (*.f64 V l) < -4.9999999999999996e-255Initial program 85.8%
remove-double-divN/A
associate-/r/N/A
associate-/r*N/A
inv-powN/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
inv-powN/A
inv-powN/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
clear-numN/A
associate-/r*N/A
neg-mul-1N/A
distribute-lft-neg-inN/A
Applied egg-rr78.6%
div-invN/A
associate-*l/N/A
clear-numN/A
div-invN/A
associate-/r*N/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.4
Applied egg-rr99.4%
if -4.9999999999999996e-255 < (*.f64 V l) < 0.0Initial program 35.9%
remove-double-divN/A
associate-/r/N/A
associate-/r*N/A
inv-powN/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
inv-powN/A
inv-powN/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
clear-numN/A
associate-/r*N/A
neg-mul-1N/A
distribute-lft-neg-inN/A
Applied egg-rr57.0%
div-invN/A
associate-*l/N/A
clear-numN/A
frac-2negN/A
associate-*l/N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
div-invN/A
frac-2negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6441.1
Applied egg-rr41.1%
sub0-negN/A
neg-lowering-neg.f6441.1
Applied egg-rr41.1%
if 0.0 < (*.f64 V l) < 1.0000000000000001e289Initial program 80.4%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6499.4
Applied egg-rr99.4%
if 1.0000000000000001e289 < (*.f64 V l) Initial program 35.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6475.3
Applied egg-rr75.3%
Final simplification82.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 l) (sqrt (/ V A))))))
(if (<= (* V l) -1e+262)
t_0
(if (<= (* V l) -5e-264)
(* c0 (/ (sqrt (- 0.0 A)) (sqrt (- 0.0 (fma l V 0.0)))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 1e+289)
(* c0 (/ (sqrt A) (sqrt (fma V l 0.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(l) * sqrt((V / A)));
double tmp;
if ((V * l) <= -1e+262) {
tmp = t_0;
} else if ((V * l) <= -5e-264) {
tmp = c0 * (sqrt((0.0 - A)) / sqrt((0.0 - fma(l, V, 0.0))));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+289) {
tmp = c0 * (sqrt(A) / sqrt(fma(V, l, 0.0)));
} else {
tmp = c0 * 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 / Float64(sqrt(l) * sqrt(Float64(V / A)))) tmp = 0.0 if (Float64(V * l) <= -1e+262) tmp = t_0; elseif (Float64(V * l) <= -5e-264) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - A)) / sqrt(Float64(0.0 - fma(l, V, 0.0))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 1e+289) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(fma(V, l, 0.0)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return 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[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+262], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-264], N[(c0 * N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - N[(l * V + 0.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+289], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l + 0.0), $MachinePrecision]], $MachinePrecision]), $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{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+262}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-264}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - A}}{\sqrt{0 - \mathsf{fma}\left(\ell, V, 0\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+289}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e262 or -5.0000000000000001e-264 < (*.f64 V l) < 0.0Initial program 39.6%
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
*-lowering-*.f64N/A
/-lowering-/.f6457.7
Applied egg-rr57.7%
clear-numN/A
un-div-invN/A
frac-2negN/A
distribute-frac-neg2N/A
sub0-negN/A
sqrt-undivN/A
sub0-negN/A
sqrt-undivN/A
associate-/r/N/A
Applied egg-rr38.9%
if -1e262 < (*.f64 V l) < -5.0000000000000001e-264Initial program 86.2%
remove-double-divN/A
associate-/r/N/A
associate-/r*N/A
inv-powN/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
inv-powN/A
inv-powN/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
clear-numN/A
associate-/r*N/A
neg-mul-1N/A
distribute-lft-neg-inN/A
Applied egg-rr79.2%
div-invN/A
associate-*l/N/A
clear-numN/A
div-invN/A
associate-/r*N/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-rgt-identityN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.4
Applied egg-rr99.4%
if 0.0 < (*.f64 V l) < 1.0000000000000001e289Initial program 80.4%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6499.4
Applied egg-rr99.4%
if 1.0000000000000001e289 < (*.f64 V l) Initial program 35.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6475.3
Applied egg-rr75.3%
Final simplification82.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 (/ A (* V l))))
(if (<= t_0 2e-313)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+280)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (* V (/ l A))))))))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 <= 2e-313) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+280) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / sqrt((V * (l / 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 = a / (v * l)
if (t_0 <= 2d-313) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+280) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / sqrt((v * (l / 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 = A / (V * l);
double tmp;
if (t_0 <= 2e-313) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+280) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
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 <= 2e-313: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+280: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((V * (l / A))) 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 <= 2e-313) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+280) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e-313)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+280)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / sqrt((V * (l / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-313], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+280], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $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 2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+280}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.99999999998e-313Initial program 39.3%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6455.4
Applied egg-rr55.4%
if 1.99999999998e-313 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e280Initial program 99.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
*-lowering-*.f64N/A
/-lowering-/.f6490.6
Applied egg-rr90.6%
Taylor expanded in V around 0
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.3
Simplified99.3%
if 2.0000000000000001e280 < (/.f64 A (*.f64 V l)) Initial program 29.3%
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
*-lowering-*.f64N/A
/-lowering-/.f6443.2
Applied egg-rr43.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 l) -1e+14)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+289)
(* c0 (/ (sqrt A) (sqrt (fma V l 0.0))))
(* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+14) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+289) {
tmp = c0 * (sqrt(A) / sqrt(fma(V, l, 0.0)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+14) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+289) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(fma(V, l, 0.0)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return 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], -1e+14], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+289], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l + 0.0), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+14}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+289}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e14Initial program 70.3%
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-/.f6447.8
Applied egg-rr47.8%
if -1e14 < (*.f64 V l) < 0.0Initial program 61.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
*-lowering-*.f64N/A
/-lowering-/.f6467.6
Applied egg-rr67.6%
if 0.0 < (*.f64 V l) < 1.0000000000000001e289Initial program 80.4%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6499.4
Applied egg-rr99.4%
if 1.0000000000000001e289 < (*.f64 V l) Initial program 35.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6475.3
Applied egg-rr75.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 (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 1e+289)
(* c0 (/ (sqrt A) (sqrt (fma V l 0.0))))
(* c0 (sqrt (/ (/ A V) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 1e+289) {
tmp = c0 * (sqrt(A) / sqrt(fma(V, l, 0.0)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 1e+289) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(fma(V, l, 0.0)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return 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], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+289], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l + 0.0), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+289}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 65.3%
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
*-lowering-*.f64N/A
/-lowering-/.f6468.4
Applied egg-rr68.4%
clear-numN/A
un-div-invN/A
frac-2negN/A
distribute-frac-neg2N/A
sub0-negN/A
sqrt-undivN/A
sub0-negN/A
sqrt-undivN/A
associate-/r/N/A
Applied egg-rr44.1%
if 0.0 < (*.f64 V l) < 1.0000000000000001e289Initial program 80.4%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6499.4
Applied egg-rr99.4%
if 1.0000000000000001e289 < (*.f64 V l) Initial program 35.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6475.3
Applied egg-rr75.3%
Final simplification66.4%
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) 0.0)
(/ c0 (sqrt (* V (* l (/ 1.0 A)))))
(if (<= (* V l) 1e+289)
(* c0 (/ (sqrt A) (sqrt (fma V l 0.0))))
(* c0 (sqrt (/ (/ A V) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l * (1.0 / A))));
} else if ((V * l) <= 1e+289) {
tmp = c0 * (sqrt(A) / sqrt(fma(V, l, 0.0)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l * Float64(1.0 / A))))); elseif (Float64(V * l) <= 1e+289) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(fma(V, l, 0.0)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return 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], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l * N[(1.0 / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+289], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l + 0.0), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \left(\ell \cdot \frac{1}{A}\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+289}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 65.3%
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
*-lowering-*.f64N/A
/-lowering-/.f6468.4
Applied egg-rr68.4%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6468.4
Applied egg-rr68.4%
if 0.0 < (*.f64 V l) < 1.0000000000000001e289Initial program 80.4%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6499.4
Applied egg-rr99.4%
if 1.0000000000000001e289 < (*.f64 V l) Initial program 35.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6475.3
Applied egg-rr75.3%
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
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+289)
(* c0 (/ (sqrt A) (sqrt (fma V l 0.0))))
(* c0 (sqrt (/ (/ A V) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+289) {
tmp = c0 * (sqrt(A) / sqrt(fma(V, l, 0.0)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+289) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(fma(V, l, 0.0)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return 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], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+289], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l + 0.0), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+289}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 65.3%
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
*-lowering-*.f64N/A
/-lowering-/.f6468.4
Applied egg-rr68.4%
if 0.0 < (*.f64 V l) < 1.0000000000000001e289Initial program 80.4%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6499.4
Applied egg-rr99.4%
if 1.0000000000000001e289 < (*.f64 V l) Initial program 35.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6475.3
Applied egg-rr75.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 (<= (* V l) 5e-299)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+287)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (sqrt (/ (* A (/ 1.0 V)) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 5e-299) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+287) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A * (1.0 / 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) :: tmp
if ((v * l) <= 5d-299) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 1d+287) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 * sqrt(((a * (1.0d0 / 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 tmp;
if ((V * l) <= 5e-299) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 1e+287) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A * (1.0 / V)) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 5e-299: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 1e+287: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A * (1.0 / V)) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 5e-299) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+287) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A * Float64(1.0 / V)) / 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 ((V * l) <= 5e-299)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 1e+287)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 * sqrt(((A * (1.0 / 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_] := If[LessEqual[N[(V * l), $MachinePrecision], 5e-299], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+287], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A * N[(1.0 / V), $MachinePrecision]), $MachinePrecision] / l), $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 5 \cdot 10^{-299}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+287}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 4.99999999999999956e-299Initial program 65.8%
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
*-lowering-*.f64N/A
/-lowering-/.f6468.8
Applied egg-rr68.8%
if 4.99999999999999956e-299 < (*.f64 V l) < 1.0000000000000001e287Initial program 79.7%
*-commutativeN/A
sqrt-divN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f6496.8
Applied egg-rr96.8%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6496.8
Applied egg-rr96.8%
if 1.0000000000000001e287 < (*.f64 V l) Initial program 39.3%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.5
Applied egg-rr76.5%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6476.5
Applied egg-rr76.5%
Final simplification79.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 l) 5e-299)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+287)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 5e-299) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+287) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= 5d-299) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 1d+287) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
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 tmp;
if ((V * l) <= 5e-299) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 1e+287) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} 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): tmp = 0 if (V * l) <= 5e-299: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 1e+287: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) 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) tmp = 0.0 if (Float64(V * l) <= 5e-299) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+287) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= 5e-299)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 1e+287)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], 5e-299], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+287], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq 5 \cdot 10^{-299}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+287}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 4.99999999999999956e-299Initial program 65.8%
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
*-lowering-*.f64N/A
/-lowering-/.f6468.8
Applied egg-rr68.8%
if 4.99999999999999956e-299 < (*.f64 V l) < 1.0000000000000001e287Initial program 79.7%
*-commutativeN/A
sqrt-divN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f6496.8
Applied egg-rr96.8%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6496.8
Applied egg-rr96.8%
if 1.0000000000000001e287 < (*.f64 V l) Initial program 39.3%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.5
Applied egg-rr76.5%
Final simplification79.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 l) 5e-209)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 4e+33)
(* c0 (/ A (sqrt (* A (fma V l 0.0)))))
(* c0 (sqrt (/ (/ A V) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 5e-209) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 4e+33) {
tmp = c0 * (A / sqrt((A * fma(V, l, 0.0))));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 5e-209) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 4e+33) tmp = Float64(c0 * Float64(A / sqrt(Float64(A * fma(V, l, 0.0))))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return 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], 5e-209], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+33], N[(c0 * N[(A / N[Sqrt[N[(A * N[(V * l + 0.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq 5 \cdot 10^{-209}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+33}:\\
\;\;\;\;c0 \cdot \frac{A}{\sqrt{A \cdot \mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 5.0000000000000005e-209Initial program 67.5%
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
*-lowering-*.f64N/A
/-lowering-/.f6469.7
Applied egg-rr69.7%
if 5.0000000000000005e-209 < (*.f64 V l) < 3.9999999999999998e33Initial program 69.3%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6454.2
Applied egg-rr54.2%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6454.2
Applied egg-rr54.2%
Applied egg-rr88.9%
if 3.9999999999999998e33 < (*.f64 V l) Initial program 71.7%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6479.0
Applied egg-rr79.0%
Final simplification74.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 (<= (* V l) 5e-209)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* V l) 4e+33)
(* c0 (/ A (sqrt (* A (fma V l 0.0)))))
(* c0 (sqrt (/ (/ A V) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 5e-209) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((V * l) <= 4e+33) {
tmp = c0 * (A / sqrt((A * fma(V, l, 0.0))));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 5e-209) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(V * l) <= 4e+33) tmp = Float64(c0 * Float64(A / sqrt(Float64(A * fma(V, l, 0.0))))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return 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], 5e-209], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+33], N[(c0 * N[(A / N[Sqrt[N[(A * N[(V * l + 0.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq 5 \cdot 10^{-209}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+33}:\\
\;\;\;\;c0 \cdot \frac{A}{\sqrt{A \cdot \mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 5.0000000000000005e-209Initial program 67.5%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6469.5
Applied egg-rr69.5%
if 5.0000000000000005e-209 < (*.f64 V l) < 3.9999999999999998e33Initial program 69.3%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6454.2
Applied egg-rr54.2%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6454.2
Applied egg-rr54.2%
Applied egg-rr88.9%
if 3.9999999999999998e33 < (*.f64 V l) Initial program 71.7%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6479.0
Applied egg-rr79.0%
Final simplification74.5%
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 68.7%
herbie shell --seed 2024197
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))