
(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 9 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 (/ c0 (/ (sqrt (- V)) (sqrt (/ A (- l)))))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -1e-294)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 4e-319)
t_0
(if (<= (* V l) 2e+281)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(-V) / sqrt((A / -l)));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -1e-294) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 4e-319) {
tmp = t_0;
} else if ((V * l) <= 2e+281) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
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(-V) / Math.sqrt((A / -l)));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -1e-294) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 4e-319) {
tmp = t_0;
} else if ((V * l) <= 2e+281) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(-V) / math.sqrt((A / -l))) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -1e-294: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 4e-319: tmp = t_0 elif (V * l) <= 2e+281: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(A / Float64(-l))))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -1e-294) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 4e-319) tmp = t_0; elseif (Float64(V * l) <= 2e+281) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 / (sqrt(-V) / sqrt((A / -l)));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -1e-294)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 4e-319)
tmp = t_0;
elseif ((V * l) <= 2e+281)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-294], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 2e+281], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{\sqrt{-V}}{\sqrt{\frac{A}{-\ell}}}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-294}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -1.00000000000000002e-294 < (*.f64 V l) < 4.0000049e-319Initial program 42.4%
clear-num42.4%
associate-/r/40.7%
associate-/r*40.7%
Applied egg-rr40.7%
*-commutative40.7%
associate-/l/40.7%
div-inv42.4%
frac-2neg42.4%
distribute-lft-neg-out42.4%
*-commutative42.4%
sqrt-undiv31.4%
clear-num31.4%
un-div-inv31.4%
sqrt-undiv42.4%
add-sqr-sqrt21.6%
sqrt-unprod21.7%
sqr-neg21.7%
sqrt-unprod0.1%
add-sqr-sqrt0.2%
add-sqr-sqrt0.1%
sqrt-unprod9.8%
sqr-neg9.8%
sqrt-unprod11.0%
add-sqr-sqrt42.4%
Applied egg-rr42.4%
associate-/l*72.5%
Simplified72.5%
clear-num72.5%
div-inv72.5%
frac-2neg72.5%
sqrt-div54.5%
distribute-neg-frac254.5%
Applied egg-rr54.5%
distribute-frac-neg254.5%
distribute-frac-neg54.5%
Simplified54.5%
if -inf.0 < (*.f64 V l) < -1.00000000000000002e-294Initial program 88.9%
frac-2neg88.9%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if 4.0000049e-319 < (*.f64 V l) < 2.0000000000000001e281Initial program 87.4%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 2.0000000000000001e281 < (*.f64 V l) Initial program 19.4%
associate-/r*67.4%
Simplified67.4%
Final simplification90.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+276)))
(/ 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 <= 0.0) || !(t_0 <= 4e+276)) {
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 <= 0.0d0) .or. (.not. (t_0 <= 4d+276))) 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 <= 0.0) || !(t_0 <= 4e+276)) {
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 <= 0.0) or not (t_0 <= 4e+276): 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 <= 0.0) || !(t_0 <= 4e+276)) 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 <= 0.0) || ~((t_0 <= 4e+276)))
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[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+276]], $MachinePrecision]], 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 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+276}\right):\\
\;\;\;\;\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)))) < 0.0 or 4.0000000000000002e276 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 67.2%
clear-num66.3%
associate-/r/66.7%
associate-/r*67.3%
Applied egg-rr67.3%
*-commutative67.3%
associate-/l/66.7%
div-inv67.2%
frac-2neg67.2%
distribute-lft-neg-out67.2%
*-commutative67.2%
sqrt-undiv41.2%
clear-num41.1%
un-div-inv41.2%
sqrt-undiv66.9%
add-sqr-sqrt33.7%
sqrt-unprod22.3%
sqr-neg22.3%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
add-sqr-sqrt0.0%
sqrt-unprod22.4%
sqr-neg22.4%
sqrt-unprod31.5%
add-sqr-sqrt66.9%
Applied egg-rr66.9%
associate-/l*72.5%
Simplified72.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e276Initial program 98.6%
Final simplification80.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+231)))
(* 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 <= 0.0) || !(t_0 <= 4e+231)) {
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 <= 0.0d0) .or. (.not. (t_0 <= 4d+231))) 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 <= 0.0) || !(t_0 <= 4e+231)) {
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 <= 0.0) or not (t_0 <= 4e+231): 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 <= 0.0) || !(t_0 <= 4e+231)) 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 <= 0.0) || ~((t_0 <= 4e+231)))
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[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+231]], $MachinePrecision]], 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 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+231}\right):\\
\;\;\;\;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)))) < 0.0 or 4.0000000000000002e231 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 67.9%
associate-/r*74.3%
Simplified74.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e231Initial program 98.5%
Final simplification81.4%
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-269)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 4e+276) t_0 (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-269) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 4e+276) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 4d-269) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 4d+276) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-269) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 4e+276) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 4e-269: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 4e+276: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-269) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 4e+276) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-269)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 4e+276)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-269], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+276], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-269}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+276}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.9999999999999998e-269Initial program 67.8%
clear-num66.8%
associate-/r/67.5%
associate-/r*68.1%
Applied egg-rr68.1%
*-commutative68.1%
associate-/l/67.5%
div-inv67.8%
frac-2neg67.8%
distribute-lft-neg-out67.8%
*-commutative67.8%
sqrt-undiv40.2%
clear-num40.2%
un-div-inv40.2%
sqrt-undiv67.5%
add-sqr-sqrt34.4%
sqrt-unprod20.8%
sqr-neg20.8%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod21.8%
sqr-neg21.8%
sqrt-unprod32.7%
add-sqr-sqrt67.5%
Applied egg-rr67.5%
associate-*l/71.6%
*-commutative71.6%
Simplified71.6%
if 3.9999999999999998e-269 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e276Initial program 98.5%
if 4.0000000000000002e276 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.9%
clear-num65.9%
associate-/r/64.7%
associate-/r*64.7%
Applied egg-rr64.7%
*-commutative64.7%
associate-/l/64.7%
div-inv65.9%
frac-2neg65.9%
distribute-lft-neg-out65.9%
*-commutative65.9%
sqrt-undiv47.9%
clear-num47.8%
un-div-inv48.0%
sqrt-undiv65.9%
add-sqr-sqrt30.1%
sqrt-unprod30.2%
sqr-neg30.2%
sqrt-unprod0.1%
add-sqr-sqrt0.1%
add-sqr-sqrt0.1%
sqrt-unprod25.6%
sqr-neg25.6%
sqrt-unprod25.5%
add-sqr-sqrt65.9%
Applied egg-rr65.9%
associate-/l*76.5%
Simplified76.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(/ c0 (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) -2e-270)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 4e-319)
(* c0 (sqrt (* (/ A V) (/ 1.0 l))))
(if (<= (* V l) 2e+281)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= -2e-270) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 4e-319) {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
} else if ((V * l) <= 2e+281) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= -2e-270) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 4e-319) {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
} else if ((V * l) <= 2e+281) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) elif (V * l) <= -2e-270: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 4e-319: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) elif (V * l) <= 2e+281: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= -2e-270) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 4e-319) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); elseif (Float64(V * l) <= 2e+281) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 / (sqrt((V / A)) * sqrt(l));
elseif ((V * l) <= -2e-270)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 4e-319)
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
elseif ((V * l) <= 2e+281)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-270], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+281], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-270}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 36.3%
clear-num36.3%
associate-/r/36.3%
associate-/r*36.3%
Applied egg-rr36.3%
*-commutative36.3%
associate-/l/36.3%
div-inv36.3%
frac-2neg36.3%
distribute-lft-neg-out36.3%
*-commutative36.3%
sqrt-undiv36.3%
clear-num36.3%
un-div-inv36.3%
sqrt-undiv36.3%
add-sqr-sqrt11.1%
sqrt-unprod11.1%
sqr-neg11.1%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt36.3%
Applied egg-rr36.3%
associate-/l*68.2%
Simplified68.2%
clear-num68.1%
div-inv68.0%
associate-/r/68.2%
sqrt-prod52.2%
Applied egg-rr52.2%
if -inf.0 < (*.f64 V l) < -2.0000000000000001e-270Initial program 88.7%
frac-2neg88.7%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -2.0000000000000001e-270 < (*.f64 V l) < 4.0000049e-319Initial program 52.8%
associate-/r*78.8%
div-inv78.8%
Applied egg-rr78.8%
if 4.0000049e-319 < (*.f64 V l) < 2.0000000000000001e281Initial program 87.4%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 2.0000000000000001e281 < (*.f64 V l) Initial program 19.4%
associate-/r*67.4%
Simplified67.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+143)
(/ c0 (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) -2e-164)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 4e-319)
(/ 1.0 (/ (sqrt (* l (/ V A))) c0))
(if (<= (* V l) 2e+281)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+143) {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= -2e-164) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 4e-319) {
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 2e+281) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-2d+143)) then
tmp = c0 / (sqrt((v / a)) * sqrt(l))
else if ((v * l) <= (-2d-164)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 4d-319) then
tmp = 1.0d0 / (sqrt((l * (v / a))) / c0)
else if ((v * l) <= 2d+281) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+143) {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= -2e-164) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 4e-319) {
tmp = 1.0 / (Math.sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 2e+281) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+143: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) elif (V * l) <= -2e-164: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 4e-319: tmp = 1.0 / (math.sqrt((l * (V / A))) / c0) elif (V * l) <= 2e+281: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+143) tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= -2e-164) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 4e-319) tmp = Float64(1.0 / Float64(sqrt(Float64(l * Float64(V / A))) / c0)); elseif (Float64(V * l) <= 2e+281) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+143)
tmp = c0 / (sqrt((V / A)) * sqrt(l));
elseif ((V * l) <= -2e-164)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 4e-319)
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
elseif ((V * l) <= 2e+281)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+143], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-164], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], N[(1.0 / N[(N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+281], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+143}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-164}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e143Initial program 62.9%
clear-num61.1%
associate-/r/62.9%
associate-/r*62.9%
Applied egg-rr62.9%
*-commutative62.9%
associate-/l/62.9%
div-inv62.9%
frac-2neg62.9%
distribute-lft-neg-out62.9%
*-commutative62.9%
sqrt-undiv74.0%
clear-num73.7%
un-div-inv73.8%
sqrt-undiv61.1%
add-sqr-sqrt23.7%
sqrt-unprod16.4%
sqr-neg16.4%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.1%
sqr-neg0.1%
sqrt-unprod0.0%
add-sqr-sqrt61.1%
Applied egg-rr61.1%
associate-/l*74.0%
Simplified74.0%
clear-num74.0%
div-inv73.9%
associate-/r/72.1%
sqrt-prod53.6%
Applied egg-rr53.6%
if -2e143 < (*.f64 V l) < -1.99999999999999992e-164Initial program 97.7%
if -1.99999999999999992e-164 < (*.f64 V l) < 4.0000049e-319Initial program 61.4%
clear-num61.5%
associate-/r/59.5%
associate-/r*59.5%
Applied egg-rr59.5%
clear-num59.5%
associate-/r/59.5%
Applied egg-rr59.5%
un-div-inv59.5%
Applied egg-rr59.5%
add-sqr-sqrt59.5%
associate-*r*59.5%
pow1/259.5%
sqrt-pow159.5%
*-commutative59.5%
associate-*r/59.2%
div-inv59.2%
clear-num59.3%
sqrt-pow159.3%
pow1/259.3%
pow1/259.3%
sqrt-pow159.3%
*-commutative59.3%
associate-*r/76.9%
div-inv76.9%
clear-num76.8%
sqrt-pow176.7%
Applied egg-rr77.3%
if 4.0000049e-319 < (*.f64 V l) < 2.0000000000000001e281Initial program 87.4%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 2.0000000000000001e281 < (*.f64 V l) Initial program 19.4%
associate-/r*67.4%
Simplified67.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+143)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-164)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 4e-319)
(/ 1.0 (/ (sqrt (* l (/ V A))) c0))
(if (<= (* V l) 2e+281)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+143) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-164) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 4e-319) {
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 2e+281) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-2d+143)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-2d-164)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 4d-319) then
tmp = 1.0d0 / (sqrt((l * (v / a))) / c0)
else if ((v * l) <= 2d+281) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+143) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-164) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 4e-319) {
tmp = 1.0 / (Math.sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 2e+281) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+143: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-164: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 4e-319: tmp = 1.0 / (math.sqrt((l * (V / A))) / c0) elif (V * l) <= 2e+281: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+143) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-164) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 4e-319) tmp = Float64(1.0 / Float64(sqrt(Float64(l * Float64(V / A))) / c0)); elseif (Float64(V * l) <= 2e+281) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+143)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-164)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 4e-319)
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
elseif ((V * l) <= 2e+281)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+143], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-164], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], N[(1.0 / N[(N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+281], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+143}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-164}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e143Initial program 62.9%
associate-/r*73.1%
sqrt-div53.6%
div-inv53.6%
Applied egg-rr53.6%
associate-*r/53.6%
*-rgt-identity53.6%
Simplified53.6%
if -2e143 < (*.f64 V l) < -1.99999999999999992e-164Initial program 97.7%
if -1.99999999999999992e-164 < (*.f64 V l) < 4.0000049e-319Initial program 61.4%
clear-num61.5%
associate-/r/59.5%
associate-/r*59.5%
Applied egg-rr59.5%
clear-num59.5%
associate-/r/59.5%
Applied egg-rr59.5%
un-div-inv59.5%
Applied egg-rr59.5%
add-sqr-sqrt59.5%
associate-*r*59.5%
pow1/259.5%
sqrt-pow159.5%
*-commutative59.5%
associate-*r/59.2%
div-inv59.2%
clear-num59.3%
sqrt-pow159.3%
pow1/259.3%
pow1/259.3%
sqrt-pow159.3%
*-commutative59.3%
associate-*r/76.9%
div-inv76.9%
clear-num76.8%
sqrt-pow176.7%
Applied egg-rr77.3%
if 4.0000049e-319 < (*.f64 V l) < 2.0000000000000001e281Initial program 87.4%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 2.0000000000000001e281 < (*.f64 V l) Initial program 19.4%
associate-/r*67.4%
Simplified67.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) (- INFINITY))
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) -2e-164)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 4e-319)
(/ 1.0 (/ (sqrt (* l (/ V A))) c0))
(if (<= (* V l) 2e+281)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= -2e-164) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 4e-319) {
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 2e+281) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= -2e-164) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 4e-319) {
tmp = 1.0 / (Math.sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 2e+281) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= -2e-164: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 4e-319: tmp = 1.0 / (math.sqrt((l * (V / A))) / c0) elif (V * l) <= 2e+281: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= -2e-164) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 4e-319) tmp = Float64(1.0 / Float64(sqrt(Float64(l * Float64(V / A))) / c0)); elseif (Float64(V * l) <= 2e+281) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= -2e-164)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 4e-319)
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
elseif ((V * l) <= 2e+281)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-164], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], N[(1.0 / N[(N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+281], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-164}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 36.3%
clear-num36.3%
associate-/r/36.3%
associate-/r*36.3%
Applied egg-rr36.3%
*-commutative36.3%
associate-/l/36.3%
div-inv36.3%
frac-2neg36.3%
distribute-lft-neg-out36.3%
*-commutative36.3%
sqrt-undiv36.3%
clear-num36.3%
un-div-inv36.3%
sqrt-undiv36.3%
add-sqr-sqrt11.1%
sqrt-unprod11.1%
sqr-neg11.1%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt36.3%
Applied egg-rr36.3%
associate-/l*68.2%
Simplified68.2%
if -inf.0 < (*.f64 V l) < -1.99999999999999992e-164Initial program 91.3%
if -1.99999999999999992e-164 < (*.f64 V l) < 4.0000049e-319Initial program 61.4%
clear-num61.5%
associate-/r/59.5%
associate-/r*59.5%
Applied egg-rr59.5%
clear-num59.5%
associate-/r/59.5%
Applied egg-rr59.5%
un-div-inv59.5%
Applied egg-rr59.5%
add-sqr-sqrt59.5%
associate-*r*59.5%
pow1/259.5%
sqrt-pow159.5%
*-commutative59.5%
associate-*r/59.2%
div-inv59.2%
clear-num59.3%
sqrt-pow159.3%
pow1/259.3%
pow1/259.3%
sqrt-pow159.3%
*-commutative59.3%
associate-*r/76.9%
div-inv76.9%
clear-num76.8%
sqrt-pow176.7%
Applied egg-rr77.3%
if 4.0000049e-319 < (*.f64 V l) < 2.0000000000000001e281Initial program 87.4%
sqrt-div99.5%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 2.0000000000000001e281 < (*.f64 V l) Initial program 19.4%
associate-/r*67.4%
Simplified67.4%
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 76.9%
herbie shell --seed 2024137
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))