
(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 18 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 (/ -1.0 V))))
(if (<= (* V l) (- INFINITY))
(/ (* (* (pow (- 0.0 A) 0.5) c0) t_0) (sqrt l))
(if (<= (* V l) -5e-253)
(/ c0 (* (pow (- 0.0 (* V l)) 0.5) (sqrt (/ -1.0 A))))
(if (<= (* V l) 2e-313)
(* c0 (* t_0 (sqrt (- 0.0 (/ A l)))))
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* (/ (sqrt A) V) (* c0 (pow (/ V l) 0.5)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((-1.0 / V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = ((pow((0.0 - A), 0.5) * c0) * t_0) / sqrt(l);
} else if ((V * l) <= -5e-253) {
tmp = c0 / (pow((0.0 - (V * l)), 0.5) * sqrt((-1.0 / A)));
} else if ((V * l) <= 2e-313) {
tmp = c0 * (t_0 * sqrt((0.0 - (A / l))));
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = (sqrt(A) / V) * (c0 * pow((V / l), 0.5));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((-1.0 / V));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = ((Math.pow((0.0 - A), 0.5) * c0) * t_0) / Math.sqrt(l);
} else if ((V * l) <= -5e-253) {
tmp = c0 / (Math.pow((0.0 - (V * l)), 0.5) * Math.sqrt((-1.0 / A)));
} else if ((V * l) <= 2e-313) {
tmp = c0 * (t_0 * Math.sqrt((0.0 - (A / l))));
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = (Math.sqrt(A) / V) * (c0 * Math.pow((V / l), 0.5));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((-1.0 / V)) tmp = 0 if (V * l) <= -math.inf: tmp = ((math.pow((0.0 - A), 0.5) * c0) * t_0) / math.sqrt(l) elif (V * l) <= -5e-253: tmp = c0 / (math.pow((0.0 - (V * l)), 0.5) * math.sqrt((-1.0 / A))) elif (V * l) <= 2e-313: tmp = c0 * (t_0 * math.sqrt((0.0 - (A / l)))) elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = (math.sqrt(A) / V) * (c0 * math.pow((V / l), 0.5)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(-1.0 / V)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(Float64((Float64(0.0 - A) ^ 0.5) * c0) * t_0) / sqrt(l)); elseif (Float64(V * l) <= -5e-253) tmp = Float64(c0 / Float64((Float64(0.0 - Float64(V * l)) ^ 0.5) * sqrt(Float64(-1.0 / A)))); elseif (Float64(V * l) <= 2e-313) tmp = Float64(c0 * Float64(t_0 * sqrt(Float64(0.0 - Float64(A / l))))); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(Float64(sqrt(A) / V) * Float64(c0 * (Float64(V / l) ^ 0.5))); 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((-1.0 / V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = ((((0.0 - A) ^ 0.5) * c0) * t_0) / sqrt(l);
elseif ((V * l) <= -5e-253)
tmp = c0 / (((0.0 - (V * l)) ^ 0.5) * sqrt((-1.0 / A)));
elseif ((V * l) <= 2e-313)
tmp = c0 * (t_0 * sqrt((0.0 - (A / l))));
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = (sqrt(A) / V) * (c0 * ((V / l) ^ 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_] := Block[{t$95$0 = N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(N[(N[Power[N[(0.0 - A), $MachinePrecision], 0.5], $MachinePrecision] * c0), $MachinePrecision] * t$95$0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-253], N[(c0 / N[(N[Power[N[(0.0 - N[(V * l), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(-1.0 / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-313], N[(c0 * N[(t$95$0 * N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[A], $MachinePrecision] / V), $MachinePrecision] * N[(c0 * N[Power[N[(V / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{-1}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\left({\left(0 - A\right)}^{0.5} \cdot c0\right) \cdot t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-253}:\\
\;\;\;\;\frac{c0}{{\left(0 - V \cdot \ell\right)}^{0.5} \cdot \sqrt{\frac{-1}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \left(t\_0 \cdot \sqrt{0 - \frac{A}{\ell}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{A}}{V} \cdot \left(c0 \cdot {\left(\frac{V}{\ell}\right)}^{0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 34.7%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6434.7%
Applied egg-rr34.7%
Applied egg-rr62.9%
if -inf.0 < (*.f64 V l) < -4.99999999999999971e-253Initial program 86.4%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.4%
Applied egg-rr86.4%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval86.5%
Applied egg-rr86.5%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
frac-2negN/A
sub0-negN/A
div-invN/A
sqrt-prodN/A
*-lowering-*.f64N/A
Applied egg-rr99.4%
div-invN/A
*-commutativeN/A
frac-2negN/A
metadata-evalN/A
remove-double-divN/A
distribute-lft-neg-inN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Applied egg-rr99.4%
if -4.99999999999999971e-253 < (*.f64 V l) < 1.99999999998e-313Initial program 39.1%
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
remove-double-negN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6449.9%
Applied egg-rr49.9%
if 1.99999999998e-313 < (*.f64 V l) < +inf.0Initial program 78.2%
div-invN/A
sqrt-prodN/A
pow1/2N/A
*-commutativeN/A
*-lowering-*.f64N/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sqrt-lowering-sqrt.f6488.3%
Applied egg-rr88.3%
if +inf.0 < (*.f64 V l) Initial program 74.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval74.2%
Applied egg-rr74.2%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6472.9%
Applied egg-rr72.9%
sqrt-divN/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
*-rgt-identityN/A
metadata-evalN/A
*-inversesN/A
sqrt-prodN/A
times-fracN/A
associate-*l/N/A
associate-*l/N/A
sqrt-divN/A
pow1/2N/A
associate-/l*N/A
unpow-prod-downN/A
associate-*l*N/A
*-lowering-*.f64N/A
Applied egg-rr20.2%
Final simplification86.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 (/ A (* V l))) (t_1 (* c0 (sqrt t_0))))
(if (<= t_1 4e-305)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_1 2e+276) (/ c0 (pow t_0 -0.5)) (/ c0 (sqrt (/ l (/ A V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = c0 * sqrt(t_0);
double tmp;
if (t_1 <= 4e-305) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_1 <= 2e+276) {
tmp = c0 / pow(t_0, -0.5);
} else {
tmp = c0 / sqrt((l / (A / 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) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = c0 * sqrt(t_0)
if (t_1 <= 4d-305) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_1 <= 2d+276) then
tmp = c0 / (t_0 ** (-0.5d0))
else
tmp = c0 / sqrt((l / (a / 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 = A / (V * l);
double t_1 = c0 * Math.sqrt(t_0);
double tmp;
if (t_1 <= 4e-305) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_1 <= 2e+276) {
tmp = c0 / Math.pow(t_0, -0.5);
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) t_1 = c0 * math.sqrt(t_0) tmp = 0 if t_1 <= 4e-305: tmp = c0 / math.sqrt((V * (l / A))) elif t_1 <= 2e+276: tmp = c0 / math.pow(t_0, -0.5) else: tmp = c0 / math.sqrt((l / (A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) t_1 = Float64(c0 * sqrt(t_0)) tmp = 0.0 if (t_1 <= 4e-305) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_1 <= 2e+276) tmp = Float64(c0 / (t_0 ^ -0.5)); else tmp = Float64(c0 / sqrt(Float64(l / Float64(A / 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 = A / (V * l);
t_1 = c0 * sqrt(t_0);
tmp = 0.0;
if (t_1 <= 4e-305)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_1 <= 2e+276)
tmp = c0 / (t_0 ^ -0.5);
else
tmp = c0 / sqrt((l / (A / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e-305], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+276], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / N[(A / V), $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}\\
t_1 := c0 \cdot \sqrt{t\_0}\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{-305}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+276}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999999e-305Initial program 68.0%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.0%
Applied egg-rr68.0%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval68.0%
Applied egg-rr68.0%
Taylor expanded in A around 0
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6464.8%
Simplified64.8%
if 3.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e276Initial program 98.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6498.1%
Applied egg-rr98.1%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval98.2%
Applied egg-rr98.2%
if 2.0000000000000001e276 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 53.8%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6453.8%
Applied egg-rr53.8%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval53.8%
Applied egg-rr53.8%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6462.8%
Applied egg-rr62.8%
Final simplification73.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 (* V l))))))
(if (<= t_0 4e-305)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 2e+276) t_0 (/ c0 (sqrt (/ l (/ A V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 2e+276) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l / (A / 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 / (v * l)))
if (t_0 <= 4d-305) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 2d+276) then
tmp = t_0
else
tmp = c0 / sqrt((l / (a / 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 / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 2e+276) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 4e-305: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 2e+276: tmp = t_0 else: tmp = c0 / math.sqrt((l / (A / 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(V * l)))) tmp = 0.0 if (t_0 <= 4e-305) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 2e+276) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l / Float64(A / 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 / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-305)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 2e+276)
tmp = t_0;
else
tmp = c0 / sqrt((l / (A / 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[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-305], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+276], t$95$0, N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-305}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+276}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999999e-305Initial program 68.0%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.0%
Applied egg-rr68.0%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval68.0%
Applied egg-rr68.0%
Taylor expanded in A around 0
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6464.8%
Simplified64.8%
if 3.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e276Initial program 98.1%
if 2.0000000000000001e276 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 53.8%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6453.8%
Applied egg-rr53.8%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval53.8%
Applied egg-rr53.8%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6462.8%
Applied egg-rr62.8%
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))))
(if (<= (* V l) -5e-193)
(/ (/ (pow (- 0.0 A) 0.5) t_0) (/ (sqrt l) c0))
(if (<= (* V l) 2e-313)
(* c0 (/ (sqrt (- 0.0 (/ A l))) t_0))
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* (/ (sqrt A) V) (* c0 (pow (/ V l) 0.5))))))))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 tmp;
if ((V * l) <= -5e-193) {
tmp = (pow((0.0 - A), 0.5) / t_0) / (sqrt(l) / c0);
} else if ((V * l) <= 2e-313) {
tmp = c0 * (sqrt((0.0 - (A / l))) / t_0);
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = (sqrt(A) / V) * (c0 * pow((V / l), 0.5));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((0.0 - V));
double tmp;
if ((V * l) <= -5e-193) {
tmp = (Math.pow((0.0 - A), 0.5) / t_0) / (Math.sqrt(l) / c0);
} else if ((V * l) <= 2e-313) {
tmp = c0 * (Math.sqrt((0.0 - (A / l))) / t_0);
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = (Math.sqrt(A) / V) * (c0 * Math.pow((V / l), 0.5));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((0.0 - V)) tmp = 0 if (V * l) <= -5e-193: tmp = (math.pow((0.0 - A), 0.5) / t_0) / (math.sqrt(l) / c0) elif (V * l) <= 2e-313: tmp = c0 * (math.sqrt((0.0 - (A / l))) / t_0) elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = (math.sqrt(A) / V) * (c0 * math.pow((V / l), 0.5)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(0.0 - V)) tmp = 0.0 if (Float64(V * l) <= -5e-193) tmp = Float64(Float64((Float64(0.0 - A) ^ 0.5) / t_0) / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= 2e-313) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - Float64(A / l))) / t_0)); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(Float64(sqrt(A) / V) * Float64(c0 * (Float64(V / l) ^ 0.5))); 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((0.0 - V));
tmp = 0.0;
if ((V * l) <= -5e-193)
tmp = (((0.0 - A) ^ 0.5) / t_0) / (sqrt(l) / c0);
elseif ((V * l) <= 2e-313)
tmp = c0 * (sqrt((0.0 - (A / l))) / t_0);
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = (sqrt(A) / V) * (c0 * ((V / l) ^ 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_] := Block[{t$95$0 = N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e-193], N[(N[(N[Power[N[(0.0 - A), $MachinePrecision], 0.5], $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-313], 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], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[A], $MachinePrecision] / V), $MachinePrecision] * N[(c0 * N[Power[N[(V / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{0 - V}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-193}:\\
\;\;\;\;\frac{\frac{{\left(0 - A\right)}^{0.5}}{t\_0}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - \frac{A}{\ell}}}{t\_0}\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{A}}{V} \cdot \left(c0 \cdot {\left(\frac{V}{\ell}\right)}^{0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000005e-193Initial program 76.7%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.7%
Applied egg-rr76.7%
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
associate-/r/N/A
sqrt-prodN/A
/-rgt-identityN/A
times-fracN/A
pow1/2N/A
sqrt-divN/A
unpow1/2N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6445.9%
Applied egg-rr45.9%
frac-2negN/A
sub0-negN/A
sub0-negN/A
sqrt-divN/A
/-lowering-/.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f6454.6%
Applied egg-rr54.6%
if -5.0000000000000005e-193 < (*.f64 V l) < 1.99999999998e-313Initial program 47.1%
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
remove-double-negN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f6448.1%
Applied egg-rr48.1%
unpow1/2N/A
sub0-negN/A
sqrt-lowering-sqrt.f64N/A
sub0-negN/A
--lowering--.f6448.1%
Applied egg-rr48.1%
sub0-negN/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6448.1%
Applied egg-rr48.1%
if 1.99999999998e-313 < (*.f64 V l) < +inf.0Initial program 78.2%
div-invN/A
sqrt-prodN/A
pow1/2N/A
*-commutativeN/A
*-lowering-*.f64N/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sqrt-lowering-sqrt.f6488.3%
Applied egg-rr88.3%
if +inf.0 < (*.f64 V l) Initial program 74.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval74.2%
Applied egg-rr74.2%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6472.9%
Applied egg-rr72.9%
sqrt-divN/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
*-rgt-identityN/A
metadata-evalN/A
*-inversesN/A
sqrt-prodN/A
times-fracN/A
associate-*l/N/A
associate-*l/N/A
sqrt-divN/A
pow1/2N/A
associate-/l*N/A
unpow-prod-downN/A
associate-*l*N/A
*-lowering-*.f64N/A
Applied egg-rr20.2%
Final simplification71.8%
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 (- 0.0 (/ A l))))
(if (<= (* V l) (- INFINITY))
(/ (/ c0 (pow t_0 -0.5)) (sqrt (- 0.0 V)))
(if (<= (* V l) -5e-253)
(/ c0 (* (pow (- 0.0 (* V l)) 0.5) (sqrt (/ -1.0 A))))
(if (<= (* V l) 2e-313)
(* c0 (* (sqrt (/ -1.0 V)) (sqrt t_0)))
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* (/ (sqrt A) V) (* c0 (pow (/ V l) 0.5)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = 0.0 - (A / l);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0 / pow(t_0, -0.5)) / sqrt((0.0 - V));
} else if ((V * l) <= -5e-253) {
tmp = c0 / (pow((0.0 - (V * l)), 0.5) * sqrt((-1.0 / A)));
} else if ((V * l) <= 2e-313) {
tmp = c0 * (sqrt((-1.0 / V)) * sqrt(t_0));
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = (sqrt(A) / V) * (c0 * pow((V / l), 0.5));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = 0.0 - (A / l);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 / Math.pow(t_0, -0.5)) / Math.sqrt((0.0 - V));
} else if ((V * l) <= -5e-253) {
tmp = c0 / (Math.pow((0.0 - (V * l)), 0.5) * Math.sqrt((-1.0 / A)));
} else if ((V * l) <= 2e-313) {
tmp = c0 * (Math.sqrt((-1.0 / V)) * Math.sqrt(t_0));
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = (Math.sqrt(A) / V) * (c0 * Math.pow((V / l), 0.5));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = 0.0 - (A / l) tmp = 0 if (V * l) <= -math.inf: tmp = (c0 / math.pow(t_0, -0.5)) / math.sqrt((0.0 - V)) elif (V * l) <= -5e-253: tmp = c0 / (math.pow((0.0 - (V * l)), 0.5) * math.sqrt((-1.0 / A))) elif (V * l) <= 2e-313: tmp = c0 * (math.sqrt((-1.0 / V)) * math.sqrt(t_0)) elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = (math.sqrt(A) / V) * (c0 * math.pow((V / l), 0.5)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(0.0 - Float64(A / l)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0 / (t_0 ^ -0.5)) / sqrt(Float64(0.0 - V))); elseif (Float64(V * l) <= -5e-253) tmp = Float64(c0 / Float64((Float64(0.0 - Float64(V * l)) ^ 0.5) * sqrt(Float64(-1.0 / A)))); elseif (Float64(V * l) <= 2e-313) tmp = Float64(c0 * Float64(sqrt(Float64(-1.0 / V)) * sqrt(t_0))); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(Float64(sqrt(A) / V) * Float64(c0 * (Float64(V / l) ^ 0.5))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = 0.0 - (A / l);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0 / (t_0 ^ -0.5)) / sqrt((0.0 - V));
elseif ((V * l) <= -5e-253)
tmp = c0 / (((0.0 - (V * l)) ^ 0.5) * sqrt((-1.0 / A)));
elseif ((V * l) <= 2e-313)
tmp = c0 * (sqrt((-1.0 / V)) * sqrt(t_0));
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = (sqrt(A) / V) * (c0 * ((V / l) ^ 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_] := Block[{t$95$0 = N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-253], N[(c0 / N[(N[Power[N[(0.0 - N[(V * l), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(-1.0 / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-313], N[(c0 * N[(N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[A], $MachinePrecision] / V), $MachinePrecision] * N[(c0 * N[Power[N[(V / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := 0 - \frac{A}{\ell}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\frac{c0}{{t\_0}^{-0.5}}}{\sqrt{0 - V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-253}:\\
\;\;\;\;\frac{c0}{{\left(0 - V \cdot \ell\right)}^{0.5} \cdot \sqrt{\frac{-1}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{-1}{V}} \cdot \sqrt{t\_0}\right)\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{A}}{V} \cdot \left(c0 \cdot {\left(\frac{V}{\ell}\right)}^{0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 34.7%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6434.7%
Applied egg-rr34.7%
Applied egg-rr53.0%
if -inf.0 < (*.f64 V l) < -4.99999999999999971e-253Initial program 86.4%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.4%
Applied egg-rr86.4%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval86.5%
Applied egg-rr86.5%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
frac-2negN/A
sub0-negN/A
div-invN/A
sqrt-prodN/A
*-lowering-*.f64N/A
Applied egg-rr99.4%
div-invN/A
*-commutativeN/A
frac-2negN/A
metadata-evalN/A
remove-double-divN/A
distribute-lft-neg-inN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Applied egg-rr99.4%
if -4.99999999999999971e-253 < (*.f64 V l) < 1.99999999998e-313Initial program 39.1%
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
remove-double-negN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6449.9%
Applied egg-rr49.9%
if 1.99999999998e-313 < (*.f64 V l) < +inf.0Initial program 78.2%
div-invN/A
sqrt-prodN/A
pow1/2N/A
*-commutativeN/A
*-lowering-*.f64N/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sqrt-lowering-sqrt.f6488.3%
Applied egg-rr88.3%
if +inf.0 < (*.f64 V l) Initial program 74.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval74.2%
Applied egg-rr74.2%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6472.9%
Applied egg-rr72.9%
sqrt-divN/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
*-rgt-identityN/A
metadata-evalN/A
*-inversesN/A
sqrt-prodN/A
times-fracN/A
associate-*l/N/A
associate-*l/N/A
sqrt-divN/A
pow1/2N/A
associate-/l*N/A
unpow-prod-downN/A
associate-*l*N/A
*-lowering-*.f64N/A
Applied egg-rr20.2%
Final simplification85.8%
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 (/ A l)))))
(if (<= (* V l) -5e+266)
(* c0 (/ t_0 (sqrt (- 0.0 V))))
(if (<= (* V l) -5e-253)
(/ c0 (* (pow (- 0.0 (* V l)) 0.5) (sqrt (/ -1.0 A))))
(if (<= (* V l) 2e-313)
(* c0 (* (sqrt (/ -1.0 V)) t_0))
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* (/ (sqrt A) V) (* c0 (pow (/ V l) 0.5)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((0.0 - (A / l)));
double tmp;
if ((V * l) <= -5e+266) {
tmp = c0 * (t_0 / sqrt((0.0 - V)));
} else if ((V * l) <= -5e-253) {
tmp = c0 / (pow((0.0 - (V * l)), 0.5) * sqrt((-1.0 / A)));
} else if ((V * l) <= 2e-313) {
tmp = c0 * (sqrt((-1.0 / V)) * t_0);
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = (sqrt(A) / V) * (c0 * pow((V / l), 0.5));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((0.0 - (A / l)));
double tmp;
if ((V * l) <= -5e+266) {
tmp = c0 * (t_0 / Math.sqrt((0.0 - V)));
} else if ((V * l) <= -5e-253) {
tmp = c0 / (Math.pow((0.0 - (V * l)), 0.5) * Math.sqrt((-1.0 / A)));
} else if ((V * l) <= 2e-313) {
tmp = c0 * (Math.sqrt((-1.0 / V)) * t_0);
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = (Math.sqrt(A) / V) * (c0 * Math.pow((V / l), 0.5));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((0.0 - (A / l))) tmp = 0 if (V * l) <= -5e+266: tmp = c0 * (t_0 / math.sqrt((0.0 - V))) elif (V * l) <= -5e-253: tmp = c0 / (math.pow((0.0 - (V * l)), 0.5) * math.sqrt((-1.0 / A))) elif (V * l) <= 2e-313: tmp = c0 * (math.sqrt((-1.0 / V)) * t_0) elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = (math.sqrt(A) / V) * (c0 * math.pow((V / l), 0.5)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(0.0 - Float64(A / l))) tmp = 0.0 if (Float64(V * l) <= -5e+266) tmp = Float64(c0 * Float64(t_0 / sqrt(Float64(0.0 - V)))); elseif (Float64(V * l) <= -5e-253) tmp = Float64(c0 / Float64((Float64(0.0 - Float64(V * l)) ^ 0.5) * sqrt(Float64(-1.0 / A)))); elseif (Float64(V * l) <= 2e-313) tmp = Float64(c0 * Float64(sqrt(Float64(-1.0 / V)) * t_0)); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(Float64(sqrt(A) / V) * Float64(c0 * (Float64(V / l) ^ 0.5))); 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((0.0 - (A / l)));
tmp = 0.0;
if ((V * l) <= -5e+266)
tmp = c0 * (t_0 / sqrt((0.0 - V)));
elseif ((V * l) <= -5e-253)
tmp = c0 / (((0.0 - (V * l)) ^ 0.5) * sqrt((-1.0 / A)));
elseif ((V * l) <= 2e-313)
tmp = c0 * (sqrt((-1.0 / V)) * t_0);
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = (sqrt(A) / V) * (c0 * ((V / l) ^ 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_] := Block[{t$95$0 = N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+266], N[(c0 * N[(t$95$0 / N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-253], N[(c0 / N[(N[Power[N[(0.0 - N[(V * l), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(-1.0 / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-313], N[(c0 * N[(N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[A], $MachinePrecision] / V), $MachinePrecision] * N[(c0 * N[Power[N[(V / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{0 - \frac{A}{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+266}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{0 - V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-253}:\\
\;\;\;\;\frac{c0}{{\left(0 - V \cdot \ell\right)}^{0.5} \cdot \sqrt{\frac{-1}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{-1}{V}} \cdot t\_0\right)\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{A}}{V} \cdot \left(c0 \cdot {\left(\frac{V}{\ell}\right)}^{0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999999e266Initial program 38.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
remove-double-negN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f6450.0%
Applied egg-rr50.0%
unpow1/2N/A
sub0-negN/A
sqrt-lowering-sqrt.f64N/A
sub0-negN/A
--lowering--.f6450.0%
Applied egg-rr50.0%
sub0-negN/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6450.0%
Applied egg-rr50.0%
if -4.9999999999999999e266 < (*.f64 V l) < -4.99999999999999971e-253Initial program 86.2%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.3%
Applied egg-rr86.3%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval86.3%
Applied egg-rr86.3%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
frac-2negN/A
sub0-negN/A
div-invN/A
sqrt-prodN/A
*-lowering-*.f64N/A
Applied egg-rr99.4%
div-invN/A
*-commutativeN/A
frac-2negN/A
metadata-evalN/A
remove-double-divN/A
distribute-lft-neg-inN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Applied egg-rr99.4%
if -4.99999999999999971e-253 < (*.f64 V l) < 1.99999999998e-313Initial program 39.1%
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
remove-double-negN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6449.9%
Applied egg-rr49.9%
if 1.99999999998e-313 < (*.f64 V l) < +inf.0Initial program 78.2%
div-invN/A
sqrt-prodN/A
pow1/2N/A
*-commutativeN/A
*-lowering-*.f64N/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sqrt-lowering-sqrt.f6488.3%
Applied egg-rr88.3%
if +inf.0 < (*.f64 V l) Initial program 74.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval74.2%
Applied egg-rr74.2%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6472.9%
Applied egg-rr72.9%
sqrt-divN/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
*-rgt-identityN/A
metadata-evalN/A
*-inversesN/A
sqrt-prodN/A
times-fracN/A
associate-*l/N/A
associate-*l/N/A
sqrt-divN/A
pow1/2N/A
associate-/l*N/A
unpow-prod-downN/A
associate-*l*N/A
*-lowering-*.f64N/A
Applied egg-rr20.2%
Final simplification85.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) -2e+160)
(/ (sqrt (/ A V)) (/ (sqrt l) c0))
(if (<= (* V l) -1e-128)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ (/ c0 (sqrt (/ V A))) (sqrt l))
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* c0 (/ (sqrt (/ A (/ l V))) V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+160) {
tmp = sqrt((A / V)) / (sqrt(l) / c0);
} else if ((V * l) <= -1e-128) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = (c0 / sqrt((V / A))) / sqrt(l);
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = c0 * (sqrt((A / (l / V))) / V);
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+160) {
tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
} else if ((V * l) <= -1e-128) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = (c0 / Math.sqrt((V / A))) / Math.sqrt(l);
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = c0 * (Math.sqrt((A / (l / V))) / V);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+160: tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0) elif (V * l) <= -1e-128: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = (c0 / math.sqrt((V / A))) / math.sqrt(l) elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = c0 * (math.sqrt((A / (l / V))) / V) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+160) tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= -1e-128) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(Float64(c0 / sqrt(Float64(V / A))) / sqrt(l)); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(l / V))) / V)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+160)
tmp = sqrt((A / V)) / (sqrt(l) / c0);
elseif ((V * l) <= -1e-128)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = (c0 / sqrt((V / A))) / sqrt(l);
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = c0 * (sqrt((A / (l / V))) / V);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+160], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-128], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / N[(l / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+160}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-128}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{\frac{\ell}{V}}}}{V}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000001e160Initial program 50.5%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6450.5%
Applied egg-rr50.5%
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
associate-/r/N/A
sqrt-prodN/A
/-rgt-identityN/A
times-fracN/A
pow1/2N/A
sqrt-divN/A
unpow1/2N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.3%
Applied egg-rr44.3%
if -2.00000000000000001e160 < (*.f64 V l) < -1.00000000000000005e-128Initial program 92.5%
if -1.00000000000000005e-128 < (*.f64 V l) < 0.0Initial program 52.6%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6452.7%
Applied egg-rr52.7%
*-commutativeN/A
sqrt-divN/A
associate-/r/N/A
sqrt-prodN/A
/-rgt-identityN/A
sqrt-prodN/A
sqrt-divN/A
associate-/l/N/A
sqrt-divN/A
unpow1/2N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr30.8%
if 0.0 < (*.f64 V l) < +inf.0Initial program 78.2%
div-invN/A
sqrt-prodN/A
pow1/2N/A
*-commutativeN/A
*-lowering-*.f64N/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sqrt-lowering-sqrt.f6488.2%
Applied egg-rr88.2%
if +inf.0 < (*.f64 V l) Initial program 74.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
Taylor expanded in c0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.7%
Simplified68.7%
associate-/l/N/A
associate-/r*N/A
sqrt-undivN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.0%
Applied egg-rr44.0%
sqrt-undivN/A
div-invN/A
associate-/l*N/A
sqrt-prodN/A
*-inversesN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-*r/N/A
sqrt-prodN/A
associate-*l*N/A
div-invN/A
associate-*l/N/A
sqrt-divN/A
div-invN/A
associate-*r*N/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
Applied egg-rr35.5%
Final simplification75.7%
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) -2e+160)
(/ (sqrt (/ A V)) (/ (sqrt l) c0))
(if (<= (* V l) -1e-128)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ (/ c0 (sqrt (/ V A))) (sqrt l))
(if (<= (* V l) INFINITY)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (/ (sqrt (/ A (/ l V))) V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+160) {
tmp = sqrt((A / V)) / (sqrt(l) / c0);
} else if ((V * l) <= -1e-128) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = (c0 / sqrt((V / A))) / sqrt(l);
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * (sqrt((A / (l / V))) / V);
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+160) {
tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
} else if ((V * l) <= -1e-128) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = (c0 / Math.sqrt((V / A))) / Math.sqrt(l);
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * (Math.sqrt((A / (l / V))) / V);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+160: tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0) elif (V * l) <= -1e-128: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = (c0 / math.sqrt((V / A))) / math.sqrt(l) elif (V * l) <= math.inf: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * (math.sqrt((A / (l / V))) / V) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+160) tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= -1e-128) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(Float64(c0 / sqrt(Float64(V / A))) / sqrt(l)); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(l / V))) / V)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+160)
tmp = sqrt((A / V)) / (sqrt(l) / c0);
elseif ((V * l) <= -1e-128)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = (c0 / sqrt((V / A))) / sqrt(l);
elseif ((V * l) <= Inf)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * (sqrt((A / (l / V))) / V);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+160], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-128], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / N[(l / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+160}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-128}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{\frac{\ell}{V}}}}{V}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000001e160Initial program 50.5%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6450.5%
Applied egg-rr50.5%
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
associate-/r/N/A
sqrt-prodN/A
/-rgt-identityN/A
times-fracN/A
pow1/2N/A
sqrt-divN/A
unpow1/2N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.3%
Applied egg-rr44.3%
if -2.00000000000000001e160 < (*.f64 V l) < -1.00000000000000005e-128Initial program 92.5%
if -1.00000000000000005e-128 < (*.f64 V l) < 0.0Initial program 52.6%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6452.7%
Applied egg-rr52.7%
*-commutativeN/A
sqrt-divN/A
associate-/r/N/A
sqrt-prodN/A
/-rgt-identityN/A
sqrt-prodN/A
sqrt-divN/A
associate-/l/N/A
sqrt-divN/A
unpow1/2N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr30.8%
if 0.0 < (*.f64 V l) < +inf.0Initial program 78.2%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.2%
Applied egg-rr78.2%
Taylor expanded in c0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.3%
Simplified68.3%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6488.2%
Applied egg-rr88.2%
if +inf.0 < (*.f64 V l) Initial program 74.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
Taylor expanded in c0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.7%
Simplified68.7%
associate-/l/N/A
associate-/r*N/A
sqrt-undivN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.0%
Applied egg-rr44.0%
sqrt-undivN/A
div-invN/A
associate-/l*N/A
sqrt-prodN/A
*-inversesN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-*r/N/A
sqrt-prodN/A
associate-*l*N/A
div-invN/A
associate-*l/N/A
sqrt-divN/A
div-invN/A
associate-*r*N/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
Applied egg-rr35.5%
Final simplification75.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 (sqrt (/ A V))))
(if (<= (* V l) -2e+160)
(/ t_0 (/ (sqrt l) c0))
(if (<= (* V l) -1e-128)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(* t_0 (/ c0 (sqrt l)))
(if (<= (* V l) INFINITY)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (/ (sqrt (/ A (/ l V))) V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -2e+160) {
tmp = t_0 / (sqrt(l) / c0);
} else if ((V * l) <= -1e-128) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0 * (c0 / sqrt(l));
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * (sqrt((A / (l / V))) / V);
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -2e+160) {
tmp = t_0 / (Math.sqrt(l) / c0);
} else if ((V * l) <= -1e-128) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * (Math.sqrt((A / (l / V))) / V);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -2e+160: tmp = t_0 / (math.sqrt(l) / c0) elif (V * l) <= -1e-128: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 * (c0 / math.sqrt(l)) elif (V * l) <= math.inf: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * (math.sqrt((A / (l / V))) / V) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -2e+160) tmp = Float64(t_0 / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= -1e-128) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(l / V))) / V)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -2e+160)
tmp = t_0 / (sqrt(l) / c0);
elseif ((V * l) <= -1e-128)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0 * (c0 / sqrt(l));
elseif ((V * l) <= Inf)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * (sqrt((A / (l / V))) / V);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+160], N[(t$95$0 / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-128], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / N[(l / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+160}:\\
\;\;\;\;\frac{t\_0}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-128}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{\frac{\ell}{V}}}}{V}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000001e160Initial program 50.5%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6450.5%
Applied egg-rr50.5%
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
associate-/r/N/A
sqrt-prodN/A
/-rgt-identityN/A
times-fracN/A
pow1/2N/A
sqrt-divN/A
unpow1/2N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.3%
Applied egg-rr44.3%
if -2.00000000000000001e160 < (*.f64 V l) < -1.00000000000000005e-128Initial program 92.5%
if -1.00000000000000005e-128 < (*.f64 V l) < 0.0Initial program 52.6%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
*-commutativeN/A
*-lowering-*.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6430.7%
Applied egg-rr30.7%
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6430.7%
Applied egg-rr30.7%
if 0.0 < (*.f64 V l) < +inf.0Initial program 78.2%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.2%
Applied egg-rr78.2%
Taylor expanded in c0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.3%
Simplified68.3%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6488.2%
Applied egg-rr88.2%
if +inf.0 < (*.f64 V l) Initial program 74.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
Taylor expanded in c0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.7%
Simplified68.7%
associate-/l/N/A
associate-/r*N/A
sqrt-undivN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.0%
Applied egg-rr44.0%
sqrt-undivN/A
div-invN/A
associate-/l*N/A
sqrt-prodN/A
*-inversesN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-*r/N/A
sqrt-prodN/A
associate-*l*N/A
div-invN/A
associate-*l/N/A
sqrt-divN/A
div-invN/A
associate-*r*N/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
Applied egg-rr35.5%
Final simplification75.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 (* (sqrt (/ A V)) (/ c0 (sqrt l)))))
(if (<= (* V l) -2e+160)
t_0
(if (<= (* V l) -1e-128)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) INFINITY)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (/ (sqrt (/ A (/ l V))) V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V)) * (c0 / sqrt(l));
double tmp;
if ((V * l) <= -2e+160) {
tmp = t_0;
} else if ((V * l) <= -1e-128) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * (sqrt((A / (l / V))) / V);
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+160) {
tmp = t_0;
} else if ((V * l) <= -1e-128) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * (Math.sqrt((A / (l / V))) / V);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) * (c0 / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+160: tmp = t_0 elif (V * l) <= -1e-128: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= math.inf: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * (math.sqrt((A / (l / V))) / V) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+160) tmp = t_0; elseif (Float64(V * l) <= -1e-128) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(l / V))) / V)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V)) * (c0 / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+160)
tmp = t_0;
elseif ((V * l) <= -1e-128)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= Inf)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * (sqrt((A / (l / V))) / 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[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+160], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-128], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / N[(l / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+160}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-128}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{\frac{\ell}{V}}}}{V}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000001e160 or -1.00000000000000005e-128 < (*.f64 V l) < 0.0Initial program 51.7%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
*-commutativeN/A
*-lowering-*.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6437.0%
Applied egg-rr37.0%
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6437.0%
Applied egg-rr37.0%
if -2.00000000000000001e160 < (*.f64 V l) < -1.00000000000000005e-128Initial program 92.5%
if 0.0 < (*.f64 V l) < +inf.0Initial program 78.2%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.2%
Applied egg-rr78.2%
Taylor expanded in c0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.3%
Simplified68.3%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6488.2%
Applied egg-rr88.2%
if +inf.0 < (*.f64 V l) Initial program 74.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
Taylor expanded in c0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.7%
Simplified68.7%
associate-/l/N/A
associate-/r*N/A
sqrt-undivN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.0%
Applied egg-rr44.0%
sqrt-undivN/A
div-invN/A
associate-/l*N/A
sqrt-prodN/A
*-inversesN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-*r/N/A
sqrt-prodN/A
associate-*l*N/A
div-invN/A
associate-*l/N/A
sqrt-divN/A
div-invN/A
associate-*r*N/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
Applied egg-rr35.5%
Final simplification75.7%
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) 2e-313)
(* c0 (/ (sqrt (- 0.0 (/ A l))) (sqrt (- 0.0 V))))
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* (/ (sqrt A) V) (* c0 (pow (/ V l) 0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 2e-313) {
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = (sqrt(A) / V) * (c0 * pow((V / l), 0.5));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 2e-313) {
tmp = c0 * (Math.sqrt((0.0 - (A / l))) / Math.sqrt((0.0 - V)));
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = (Math.sqrt(A) / V) * (c0 * Math.pow((V / l), 0.5));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 2e-313: tmp = c0 * (math.sqrt((0.0 - (A / l))) / math.sqrt((0.0 - V))) elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = (math.sqrt(A) / V) * (c0 * math.pow((V / l), 0.5)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 2e-313) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - Float64(A / l))) / sqrt(Float64(0.0 - V)))); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(Float64(sqrt(A) / V) * Float64(c0 * (Float64(V / l) ^ 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 ((V * l) <= 2e-313)
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = (sqrt(A) / V) * (c0 * ((V / l) ^ 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[N[(V * l), $MachinePrecision], 2e-313], 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], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[A], $MachinePrecision] / V), $MachinePrecision] * N[(c0 * N[Power[N[(V / l), $MachinePrecision], 0.5], $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 2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - \frac{A}{\ell}}}{\sqrt{0 - V}}\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{A}}{V} \cdot \left(c0 \cdot {\left(\frac{V}{\ell}\right)}^{0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < 1.99999999998e-313Initial program 69.5%
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
remove-double-negN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f6447.6%
Applied egg-rr47.6%
unpow1/2N/A
sub0-negN/A
sqrt-lowering-sqrt.f64N/A
sub0-negN/A
--lowering--.f6447.6%
Applied egg-rr47.6%
sub0-negN/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6447.6%
Applied egg-rr47.6%
if 1.99999999998e-313 < (*.f64 V l) < +inf.0Initial program 78.2%
div-invN/A
sqrt-prodN/A
pow1/2N/A
*-commutativeN/A
*-lowering-*.f64N/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sqrt-lowering-sqrt.f6488.3%
Applied egg-rr88.3%
if +inf.0 < (*.f64 V l) Initial program 74.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval74.2%
Applied egg-rr74.2%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6472.9%
Applied egg-rr72.9%
sqrt-divN/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
*-rgt-identityN/A
metadata-evalN/A
*-inversesN/A
sqrt-prodN/A
times-fracN/A
associate-*l/N/A
associate-*l/N/A
sqrt-divN/A
pow1/2N/A
associate-/l*N/A
unpow-prod-downN/A
associate-*l*N/A
*-lowering-*.f64N/A
Applied egg-rr20.2%
Final simplification69.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) 2e-313)
(* c0 (/ (sqrt (- 0.0 (/ A l))) (sqrt (- 0.0 V))))
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* c0 (/ (sqrt (/ A (/ l V))) V)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 2e-313) {
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = c0 * (sqrt((A / (l / V))) / V);
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 2e-313) {
tmp = c0 * (Math.sqrt((0.0 - (A / l))) / Math.sqrt((0.0 - V)));
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = c0 * (Math.sqrt((A / (l / V))) / V);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 2e-313: tmp = c0 * (math.sqrt((0.0 - (A / l))) / math.sqrt((0.0 - V))) elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = c0 * (math.sqrt((A / (l / V))) / V) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 2e-313) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - Float64(A / l))) / sqrt(Float64(0.0 - V)))); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(l / V))) / V)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 2e-313)
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = c0 * (sqrt((A / (l / V))) / V);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 2e-313], 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], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / N[(l / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - \frac{A}{\ell}}}{\sqrt{0 - V}}\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{\frac{\ell}{V}}}}{V}\\
\end{array}
\end{array}
if (*.f64 V l) < 1.99999999998e-313Initial program 69.5%
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
remove-double-negN/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f6447.6%
Applied egg-rr47.6%
unpow1/2N/A
sub0-negN/A
sqrt-lowering-sqrt.f64N/A
sub0-negN/A
--lowering--.f6447.6%
Applied egg-rr47.6%
sub0-negN/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6447.6%
Applied egg-rr47.6%
if 1.99999999998e-313 < (*.f64 V l) < +inf.0Initial program 78.2%
div-invN/A
sqrt-prodN/A
pow1/2N/A
*-commutativeN/A
*-lowering-*.f64N/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sqrt-lowering-sqrt.f6488.3%
Applied egg-rr88.3%
if +inf.0 < (*.f64 V l) Initial program 74.1%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
Taylor expanded in c0 around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.7%
Simplified68.7%
associate-/l/N/A
associate-/r*N/A
sqrt-undivN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.0%
Applied egg-rr44.0%
sqrt-undivN/A
div-invN/A
associate-/l*N/A
sqrt-prodN/A
*-inversesN/A
associate-/r*N/A
div-invN/A
*-commutativeN/A
associate-*r/N/A
sqrt-prodN/A
associate-*l*N/A
div-invN/A
associate-*l/N/A
sqrt-divN/A
div-invN/A
associate-*r*N/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
Applied egg-rr35.5%
Final simplification69.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 (* V l)))))) (if (<= t_0 4e-305) (/ c0 (sqrt (* V (/ l A)))) 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 / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 / sqrt((V * (l / A)));
} 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 / (v * l)))
if (t_0 <= 4d-305) then
tmp = c0 / sqrt((v * (l / a)))
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 / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 / Math.sqrt((V * (l / A)));
} 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 / (V * l))) tmp = 0 if t_0 <= 4e-305: tmp = c0 / math.sqrt((V * (l / A))) 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(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-305) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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 / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-305)
tmp = c0 / sqrt((V * (l / A)));
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-305], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $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{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-305}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999999e-305Initial program 68.0%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.0%
Applied egg-rr68.0%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval68.0%
Applied egg-rr68.0%
Taylor expanded in A around 0
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6464.8%
Simplified64.8%
if 3.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 85.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 (* V l)))))) (if (<= t_0 4e-305) (* c0 (sqrt (/ (/ A l) V))) 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 / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 * sqrt(((A / l) / V));
} 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 / (v * l)))
if (t_0 <= 4d-305) then
tmp = c0 * sqrt(((a / l) / v))
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 / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 * Math.sqrt(((A / l) / V));
} 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 / (V * l))) tmp = 0 if t_0 <= 4e-305: tmp = c0 * math.sqrt(((A / l) / V)) 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(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-305) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); 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 / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-305)
tmp = c0 * sqrt(((A / l) / V));
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-305], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $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{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999999e-305Initial program 68.0%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6465.3%
Applied egg-rr65.3%
if 3.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 85.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 (* V l)))))) (if (<= t_0 4e-305) (* c0 (sqrt (/ (/ A V) l))) 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 / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 * sqrt(((A / V) / l));
} 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 / (v * l)))
if (t_0 <= 4d-305) then
tmp = c0 * sqrt(((a / v) / l))
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 / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 * Math.sqrt(((A / V) / l));
} 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 / (V * l))) tmp = 0 if t_0 <= 4e-305: tmp = c0 * math.sqrt(((A / V) / l)) 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(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-305) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); 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 / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-305)
tmp = c0 * sqrt(((A / V) / l));
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-305], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $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{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999999e-305Initial program 68.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6469.7%
Applied egg-rr69.7%
if 3.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 85.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 (<= (/ A (* V l)) 5e-309) (* (sqrt (/ A V)) (/ c0 (sqrt l))) (/ c0 (sqrt (* (/ -1.0 A) (/ l (/ -1.0 V)))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 5e-309) {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
} else {
tmp = c0 / sqrt(((-1.0 / A) * (l / (-1.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 ((a / (v * l)) <= 5d-309) then
tmp = sqrt((a / v)) * (c0 / sqrt(l))
else
tmp = c0 / sqrt((((-1.0d0) / a) * (l / ((-1.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 ((A / (V * l)) <= 5e-309) {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
} else {
tmp = c0 / Math.sqrt(((-1.0 / A) * (l / (-1.0 / V))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (A / (V * l)) <= 5e-309: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) else: tmp = c0 / math.sqrt(((-1.0 / A) * (l / (-1.0 / V)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(A / Float64(V * l)) <= 5e-309) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); else tmp = Float64(c0 / sqrt(Float64(Float64(-1.0 / A) * Float64(l / Float64(-1.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 ((A / (V * l)) <= 5e-309)
tmp = sqrt((A / V)) * (c0 / sqrt(l));
else
tmp = c0 / sqrt(((-1.0 / A) * (l / (-1.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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], 5e-309], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(N[(-1.0 / A), $MachinePrecision] * N[(l / N[(-1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{A}{V \cdot \ell} \leq 5 \cdot 10^{-309}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{-1}{A} \cdot \frac{\ell}{\frac{-1}{V}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.9999999999999995e-309Initial program 36.1%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
*-commutativeN/A
*-lowering-*.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6446.1%
Applied egg-rr46.1%
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6446.1%
Applied egg-rr46.1%
if 4.9999999999999995e-309 < (/.f64 A (*.f64 V l)) Initial program 85.5%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6485.5%
Applied egg-rr85.5%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval85.6%
Applied egg-rr85.6%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6480.2%
Applied egg-rr80.2%
frac-2negN/A
div-invN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
div-invN/A
neg-mul-1N/A
frac-timesN/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.0%
Applied egg-rr86.0%
Final simplification76.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 (<= (/ A (* V l)) 5e-309) (* c0 (sqrt (/ (/ 1.0 l) (/ V A)))) (/ c0 (sqrt (* (/ -1.0 A) (/ l (/ -1.0 V)))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 5e-309) {
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
} else {
tmp = c0 / sqrt(((-1.0 / A) * (l / (-1.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 ((a / (v * l)) <= 5d-309) then
tmp = c0 * sqrt(((1.0d0 / l) / (v / a)))
else
tmp = c0 / sqrt((((-1.0d0) / a) * (l / ((-1.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 ((A / (V * l)) <= 5e-309) {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
} else {
tmp = c0 / Math.sqrt(((-1.0 / A) * (l / (-1.0 / V))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (A / (V * l)) <= 5e-309: tmp = c0 * math.sqrt(((1.0 / l) / (V / A))) else: tmp = c0 / math.sqrt(((-1.0 / A) * (l / (-1.0 / V)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(A / Float64(V * l)) <= 5e-309) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) / Float64(V / A)))); else tmp = Float64(c0 / sqrt(Float64(Float64(-1.0 / A) * Float64(l / Float64(-1.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 ((A / (V * l)) <= 5e-309)
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
else
tmp = c0 / sqrt(((-1.0 / A) * (l / (-1.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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], 5e-309], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(N[(-1.0 / A), $MachinePrecision] * N[(l / N[(-1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{A}{V \cdot \ell} \leq 5 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{-1}{A} \cdot \frac{\ell}{\frac{-1}{V}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.9999999999999995e-309Initial program 36.1%
associate-/r*N/A
clear-numN/A
associate-/r*N/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6450.6%
Applied egg-rr50.6%
if 4.9999999999999995e-309 < (/.f64 A (*.f64 V l)) Initial program 85.5%
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6485.5%
Applied egg-rr85.5%
associate-/r/N/A
div-invN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
metadata-eval85.6%
Applied egg-rr85.6%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6480.2%
Applied egg-rr80.2%
frac-2negN/A
div-invN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
div-invN/A
neg-mul-1N/A
frac-timesN/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.0%
Applied egg-rr86.0%
Final simplification77.9%
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 74.1%
herbie shell --seed 2024163
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))