
(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 10 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 (/ l (/ A V)))))
(if (<= (* l V) -2e+302)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* l V) -2e-313)
(* c0 (/ (sqrt (- 0.0 A)) (sqrt (* l (- 0.0 V)))))
(if (<= (* l V) 0.0)
(/ 1.0 (/ t_0 c0))
(if (<= (* l V) 5e+279)
(* c0 (/ (sqrt A) (pow (* l V) 0.5)))
(/ c0 t_0)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((l / (A / V)));
double tmp;
if ((l * V) <= -2e+302) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((l * V) <= -2e-313) {
tmp = c0 * (sqrt((0.0 - A)) / sqrt((l * (0.0 - V))));
} else if ((l * V) <= 0.0) {
tmp = 1.0 / (t_0 / c0);
} else if ((l * V) <= 5e+279) {
tmp = c0 * (sqrt(A) / pow((l * V), 0.5));
} else {
tmp = c0 / 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 = sqrt((l / (a / v)))
if ((l * v) <= (-2d+302)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((l * v) <= (-2d-313)) then
tmp = c0 * (sqrt((0.0d0 - a)) / sqrt((l * (0.0d0 - v))))
else if ((l * v) <= 0.0d0) then
tmp = 1.0d0 / (t_0 / c0)
else if ((l * v) <= 5d+279) then
tmp = c0 * (sqrt(a) / ((l * v) ** 0.5d0))
else
tmp = c0 / 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 = Math.sqrt((l / (A / V)));
double tmp;
if ((l * V) <= -2e+302) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((l * V) <= -2e-313) {
tmp = c0 * (Math.sqrt((0.0 - A)) / Math.sqrt((l * (0.0 - V))));
} else if ((l * V) <= 0.0) {
tmp = 1.0 / (t_0 / c0);
} else if ((l * V) <= 5e+279) {
tmp = c0 * (Math.sqrt(A) / Math.pow((l * V), 0.5));
} else {
tmp = c0 / t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((l / (A / V))) tmp = 0 if (l * V) <= -2e+302: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (l * V) <= -2e-313: tmp = c0 * (math.sqrt((0.0 - A)) / math.sqrt((l * (0.0 - V)))) elif (l * V) <= 0.0: tmp = 1.0 / (t_0 / c0) elif (l * V) <= 5e+279: tmp = c0 * (math.sqrt(A) / math.pow((l * V), 0.5)) else: tmp = c0 / t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(l / Float64(A / V))) tmp = 0.0 if (Float64(l * V) <= -2e+302) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(l * V) <= -2e-313) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - A)) / sqrt(Float64(l * Float64(0.0 - V))))); elseif (Float64(l * V) <= 0.0) tmp = Float64(1.0 / Float64(t_0 / c0)); elseif (Float64(l * V) <= 5e+279) tmp = Float64(c0 * Float64(sqrt(A) / (Float64(l * V) ^ 0.5))); else tmp = Float64(c0 / 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 = sqrt((l / (A / V)));
tmp = 0.0;
if ((l * V) <= -2e+302)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((l * V) <= -2e-313)
tmp = c0 * (sqrt((0.0 - A)) / sqrt((l * (0.0 - V))));
elseif ((l * V) <= 0.0)
tmp = 1.0 / (t_0 / c0);
elseif ((l * V) <= 5e+279)
tmp = c0 * (sqrt(A) / ((l * V) ^ 0.5));
else
tmp = c0 / 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[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], -2e+302], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -2e-313], N[(c0 * N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * N[(0.0 - V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(1.0 / N[(t$95$0 / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e+279], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Power[N[(l * V), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{\ell}{\frac{A}{V}}}\\
\mathbf{if}\;\ell \cdot V \leq -2 \cdot 10^{+302}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq -2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - A}}{\sqrt{\ell \cdot \left(0 - V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{1}{\frac{t\_0}{c0}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{+279}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{{\left(\ell \cdot V\right)}^{0.5}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{t\_0}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000002e302Initial program 25.0%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.3%
Applied egg-rr44.3%
if -2.0000000000000002e302 < (*.f64 V l) < -1.99999999998e-313Initial program 82.9%
sqrt-lowering-sqrt.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.2%
Applied egg-rr74.2%
div-invN/A
frac-2negN/A
frac-timesN/A
sqrt-divN/A
*-rgt-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-lft-neg-inN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6499.2%
Applied egg-rr99.2%
if -1.99999999998e-313 < (*.f64 V l) < -0.0Initial program 38.3%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval72.8%
Applied egg-rr72.8%
Applied egg-rr72.9%
if -0.0 < (*.f64 V l) < 5.0000000000000002e279Initial program 80.9%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
*-lowering-*.f6498.3%
Applied egg-rr98.3%
if 5.0000000000000002e279 < (*.f64 V l) Initial program 34.6%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval65.2%
Applied egg-rr65.2%
/-lowering-/.f64N/A
associate-/l/N/A
associate-/r*N/A
clear-numN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
div-invN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6465.3%
Applied egg-rr65.3%
Final simplification89.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 (/ l (/ A V))))))
(if (<= t_0 0.0)
t_1
(if (<= t_0 2e+157) (* c0 (sqrt (/ A (/ l (/ 1.0 V))))) 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((l / (A / V)));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+157) {
tmp = c0 * sqrt((A / (l / (1.0 / V))));
} 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((l / (a / v)))
if (t_0 <= 0.0d0) then
tmp = t_1
else if (t_0 <= 2d+157) then
tmp = c0 * sqrt((a / (l / (1.0d0 / v))))
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((l / (A / V)));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+157) {
tmp = c0 * Math.sqrt((A / (l / (1.0 / V))));
} 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((l / (A / V))) tmp = 0 if t_0 <= 0.0: tmp = t_1 elif t_0 <= 2e+157: tmp = c0 * math.sqrt((A / (l / (1.0 / V)))) 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(l / Float64(A / V)))) tmp = 0.0 if (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 2e+157) tmp = Float64(c0 * sqrt(Float64(A / Float64(l / Float64(1.0 / V))))); 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((l / (A / V)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = t_1;
elseif (t_0 <= 2e+157)
tmp = c0 * sqrt((A / (l / (1.0 / V))));
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[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 2e+157], N[(c0 * N[Sqrt[N[(A / N[(l / N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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 := \frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+157}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\frac{1}{V}}}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 1.99999999999999997e157 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 60.7%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval69.5%
Applied egg-rr69.5%
/-lowering-/.f64N/A
associate-/l/N/A
associate-/r*N/A
clear-numN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
div-invN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.9%
Applied egg-rr68.9%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999997e157Initial program 99.5%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.6%
Applied egg-rr99.6%
Final simplification75.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (* c0 (sqrt (/ A (* l V))))) (t_1 (/ c0 (sqrt (/ l (/ A V)))))) (if (<= t_0 0.0) t_1 (if (<= t_0 2e+157) 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((l / (A / V)));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+157) {
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((l / (a / v)))
if (t_0 <= 0.0d0) then
tmp = t_1
else if (t_0 <= 2d+157) 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((l / (A / V)));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+157) {
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((l / (A / V))) tmp = 0 if t_0 <= 0.0: tmp = t_1 elif t_0 <= 2e+157: 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(l / Float64(A / V)))) tmp = 0.0 if (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 2e+157) 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((l / (A / V)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = t_1;
elseif (t_0 <= 2e+157)
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[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 2e+157], 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 := \frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+157}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 1.99999999999999997e157 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 60.7%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval69.5%
Applied egg-rr69.5%
/-lowering-/.f64N/A
associate-/l/N/A
associate-/r*N/A
clear-numN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
div-invN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.9%
Applied egg-rr68.9%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999997e157Initial program 99.5%
Final simplification75.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (* c0 (sqrt (/ A (* l V))))) (t_1 (/ c0 (sqrt (* l (/ V A)))))) (if (<= t_0 1e-298) t_1 (if (<= t_0 4e+226) 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((l * (V / A)));
double tmp;
if (t_0 <= 1e-298) {
tmp = t_1;
} else if (t_0 <= 4e+226) {
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((l * (v / a)))
if (t_0 <= 1d-298) then
tmp = t_1
else if (t_0 <= 4d+226) 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((l * (V / A)));
double tmp;
if (t_0 <= 1e-298) {
tmp = t_1;
} else if (t_0 <= 4e+226) {
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((l * (V / A))) tmp = 0 if t_0 <= 1e-298: tmp = t_1 elif t_0 <= 4e+226: 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(l * Float64(V / A)))) tmp = 0.0 if (t_0 <= 1e-298) tmp = t_1; elseif (t_0 <= 4e+226) 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((l * (V / A)));
tmp = 0.0;
if (t_0 <= 1e-298)
tmp = t_1;
elseif (t_0 <= 4e+226)
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[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-298], t$95$1, If[LessEqual[t$95$0, 4e+226], 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 := \frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{if}\;t\_0 \leq 10^{-298}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+226}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999912e-299 or 3.99999999999999985e226 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 59.3%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval68.5%
Applied egg-rr68.5%
/-lowering-/.f64N/A
associate-/l/N/A
associate-/r*N/A
clear-numN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
div-invN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6467.8%
Applied egg-rr67.8%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f6467.8%
Applied egg-rr67.8%
if 9.99999999999999912e-299 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e226Initial program 99.6%
Final simplification75.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (* c0 (sqrt (/ A (* l V))))) (t_1 (* c0 (sqrt (/ (/ A V) l))))) (if (<= t_0 0.0) t_1 (if (<= t_0 2e+157) 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+157) {
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+157) 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+157) {
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+157: 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+157) 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+157)
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+157], 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^{+157}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 1.99999999999999997e157 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 60.7%
sqrt-lowering-sqrt.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6469.5%
Applied egg-rr69.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999997e157Initial program 99.5%
Final simplification75.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 (<= A -2e-310) (* c0 (/ (sqrt (- 0.0 A)) (* (sqrt l) (sqrt (- 0.0 V))))) (* c0 (/ (sqrt A) (pow (* l V) 0.5)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-310) {
tmp = c0 * (sqrt((0.0 - A)) / (sqrt(l) * sqrt((0.0 - V))));
} else {
tmp = c0 * (sqrt(A) / pow((l * V), 0.5));
}
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 <= (-2d-310)) then
tmp = c0 * (sqrt((0.0d0 - a)) / (sqrt(l) * sqrt((0.0d0 - v))))
else
tmp = c0 * (sqrt(a) / ((l * v) ** 0.5d0))
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 <= -2e-310) {
tmp = c0 * (Math.sqrt((0.0 - A)) / (Math.sqrt(l) * Math.sqrt((0.0 - V))));
} else {
tmp = c0 * (Math.sqrt(A) / Math.pow((l * V), 0.5));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -2e-310: tmp = c0 * (math.sqrt((0.0 - A)) / (math.sqrt(l) * math.sqrt((0.0 - V)))) else: tmp = c0 * (math.sqrt(A) / math.pow((l * V), 0.5)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -2e-310) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - A)) / Float64(sqrt(l) * sqrt(Float64(0.0 - V))))); else tmp = Float64(c0 * Float64(sqrt(A) / (Float64(l * V) ^ 0.5))); 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 <= -2e-310)
tmp = c0 * (sqrt((0.0 - A)) / (sqrt(l) * sqrt((0.0 - V))));
else
tmp = c0 * (sqrt(A) / ((l * V) ^ 0.5));
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, -2e-310], N[(c0 * N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Power[N[(l * V), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - A}}{\sqrt{\ell} \cdot \sqrt{0 - V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{{\left(\ell \cdot V\right)}^{0.5}}\\
\end{array}
\end{array}
if A < -1.999999999999994e-310Initial program 68.8%
sqrt-lowering-sqrt.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6473.3%
Applied egg-rr73.3%
sqrt-divN/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
associate-/l/N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6437.7%
Applied egg-rr37.7%
if -1.999999999999994e-310 < A Initial program 68.2%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
*-lowering-*.f6480.0%
Applied egg-rr80.0%
Final simplification56.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 (<= l -5e-310) (* c0 (/ (pow (- 0.0 (/ A V)) 0.5) (sqrt (- 0.0 l)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (pow((0.0 - (A / V)), 0.5) / sqrt((0.0 - l)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(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 <= (-5d-310)) then
tmp = c0 * (((0.0d0 - (a / v)) ** 0.5d0) / sqrt((0.0d0 - l)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(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 <= -5e-310) {
tmp = c0 * (Math.pow((0.0 - (A / V)), 0.5) / Math.sqrt((0.0 - l)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * (math.pow((0.0 - (A / V)), 0.5) / math.sqrt((0.0 - l))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64((Float64(0.0 - Float64(A / V)) ^ 0.5) / sqrt(Float64(0.0 - l)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 <= -5e-310)
tmp = c0 * (((0.0 - (A / V)) ^ 0.5) / sqrt((0.0 - l)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(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[l, -5e-310], N[(c0 * N[(N[Power[N[(0.0 - N[(A / V), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[Sqrt[N[(0.0 - l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{{\left(0 - \frac{A}{V}\right)}^{0.5}}{\sqrt{0 - \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 67.8%
sqrt-lowering-sqrt.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6469.9%
Applied egg-rr69.9%
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
distribute-neg-frac2N/A
div-invN/A
*-lowering-*.f64N/A
distribute-frac-neg2N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6483.4%
Applied egg-rr83.4%
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
neg-mul-1N/A
neg-lowering-neg.f64N/A
/-lowering-/.f6483.3%
Applied egg-rr83.3%
sub0-negN/A
neg-lowering-neg.f6483.3%
Applied egg-rr83.3%
if -4.999999999999985e-310 < l Initial program 69.6%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6487.8%
Applied egg-rr87.8%
Final simplification85.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 (<= l -5e-310) (/ c0 (/ (sqrt (* l V)) (sqrt A))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(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 <= (-5d-310)) then
tmp = c0 / (sqrt((l * v)) / sqrt(a))
else
tmp = c0 * (sqrt((a / v)) / sqrt(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 <= -5e-310) {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 <= -5e-310)
tmp = c0 / (sqrt((l * V)) / sqrt(A));
else
tmp = c0 * (sqrt((A / V)) / sqrt(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[l, -5e-310], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 67.8%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval69.9%
Applied egg-rr69.9%
associate-/l/N/A
associate-/r*N/A
clear-numN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
pow1/2N/A
associate-/r/N/A
associate-*l/N/A
sqrt-divN/A
unpow1/2N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f6430.3%
Applied egg-rr30.3%
if -4.999999999999985e-310 < l Initial program 69.6%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6487.8%
Applied egg-rr87.8%
Final simplification54.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 -5e-310) (/ c0 (pow (/ (/ A V) l) -0.5)) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 / pow(((A / V) / l), -0.5);
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(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 <= (-5d-310)) then
tmp = c0 / (((a / v) / l) ** (-0.5d0))
else
tmp = c0 * (sqrt((a / v)) / sqrt(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 <= -5e-310) {
tmp = c0 / Math.pow(((A / V) / l), -0.5);
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 / math.pow(((A / V) / l), -0.5) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 / (Float64(Float64(A / V) / l) ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 <= -5e-310)
tmp = c0 / (((A / V) / l) ^ -0.5);
else
tmp = c0 * (sqrt((A / V)) / sqrt(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[l, -5e-310], N[(c0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 67.8%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval69.9%
Applied egg-rr69.9%
if -4.999999999999985e-310 < l Initial program 69.6%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6487.8%
Applied egg-rr87.8%
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 68.6%
Final simplification68.6%
herbie shell --seed 2024192
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))