
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -4e-306)
(* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l)))
(if (<= (* l V) 2e-315)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* l V) 1e+277)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(* c0 (sqrt (/ (/ 1.0 l) (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -4e-306) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else if ((l * V) <= 2e-315) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((l * V) <= 1e+277) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((l * v) <= (-4d-306)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else if ((l * v) <= 2d-315) then
tmp = c0 * sqrt(((a / v) / l))
else if ((l * v) <= 1d+277) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * sqrt(((1.0d0 / l) / (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -4e-306) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else if ((l * V) <= 2e-315) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((l * V) <= 1e+277) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -4e-306: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) elif (l * V) <= 2e-315: tmp = c0 * math.sqrt(((A / V) / l)) elif (l * V) <= 1e+277: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * math.sqrt(((1.0 / l) / (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -4e-306) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); elseif (Float64(l * V) <= 2e-315) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(l * V) <= 1e+277) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) / Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -4e-306)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
elseif ((l * V) <= 2e-315)
tmp = c0 * sqrt(((A / V) / l));
elseif ((l * V) <= 1e+277)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], -4e-306], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e-315], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e+277], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -4 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{+277}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.00000000000000011e-306Initial program 69.9%
associate-/r*70.5%
sqrt-div49.5%
div-inv49.4%
Applied egg-rr49.4%
associate-*r/49.5%
*-rgt-identity49.5%
Simplified49.5%
frac-2neg49.5%
sqrt-div53.9%
Applied egg-rr53.9%
if -4.00000000000000011e-306 < (*.f64 V l) < 2.0000000019e-315Initial program 43.6%
associate-/r*66.6%
Simplified66.6%
if 2.0000000019e-315 < (*.f64 V l) < 1e277Initial program 86.4%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1e277 < (*.f64 V l) Initial program 42.1%
*-un-lft-identity42.1%
times-frac73.1%
Applied egg-rr73.1%
frac-times42.1%
*-commutative42.1%
frac-times73.1%
clear-num73.1%
associate-*l/73.1%
*-un-lft-identity73.1%
Applied egg-rr73.1%
Final simplification73.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (or (<= t_0 1e-286) (not (<= t_0 2e+299)))
(* 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 / (l * V)));
double tmp;
if ((t_0 <= 1e-286) || !(t_0 <= 2e+299)) {
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 / (l * v)))
if ((t_0 <= 1d-286) .or. (.not. (t_0 <= 2d+299))) 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 / (l * V)));
double tmp;
if ((t_0 <= 1e-286) || !(t_0 <= 2e+299)) {
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 / (l * V))) tmp = 0 if (t_0 <= 1e-286) or not (t_0 <= 2e+299): 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(l * V)))) tmp = 0.0 if ((t_0 <= 1e-286) || !(t_0 <= 2e+299)) 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 / (l * V)));
tmp = 0.0;
if ((t_0 <= 1e-286) || ~((t_0 <= 2e+299)))
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 1e-286], N[Not[LessEqual[t$95$0, 2e+299]], $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}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 10^{-286} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+299}\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)))) < 1.00000000000000005e-286 or 2.0000000000000001e299 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 60.8%
associate-/r*70.1%
Simplified70.1%
if 1.00000000000000005e-286 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e299Initial program 98.5%
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
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 0.0)
(* c0 (sqrt (* (/ 1.0 V) (/ A l))))
(if (<= t_0 5e+255) 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 / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
} else if (t_0 <= 5e+255) {
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 / (l * v)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((1.0d0 / v) * (a / l)))
else if (t_0 <= 5d+255) 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 / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((1.0 / V) * (A / l)));
} else if (t_0 <= 5e+255) {
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 / (l * V))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((1.0 / V) * (A / l))) elif t_0 <= 5e+255: 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(l * V)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / V) * Float64(A / l)))); elseif (t_0 <= 5e+255) 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 / (l * V)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
elseif (t_0 <= 5e+255)
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+255], 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}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+255}:\\
\;\;\;\;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)))) < 0.0Initial program 61.1%
*-un-lft-identity61.1%
times-frac67.3%
Applied egg-rr67.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e255Initial program 98.4%
if 5.0000000000000002e255 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 62.9%
associate-/r*63.0%
clear-num63.0%
sqrt-div63.9%
metadata-eval63.9%
div-inv63.9%
clear-num65.2%
Applied egg-rr65.2%
associate-*r/65.1%
sqrt-prod53.5%
times-frac50.7%
metadata-eval50.7%
sqrt-div49.4%
clear-num49.4%
associate-/r/52.1%
sqrt-undiv63.8%
Applied egg-rr63.8%
associate-/r/66.5%
*-commutative66.5%
Simplified66.5%
Final simplification74.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 1e-286)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+255) 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 / (l * V)));
double tmp;
if (t_0 <= 1e-286) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+255) {
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 / (l * v)))
if (t_0 <= 1d-286) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+255) 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 / (l * V)));
double tmp;
if (t_0 <= 1e-286) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+255) {
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 / (l * V))) tmp = 0 if t_0 <= 1e-286: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+255: 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(l * V)))) tmp = 0.0 if (t_0 <= 1e-286) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+255) 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 / (l * V)));
tmp = 0.0;
if (t_0 <= 1e-286)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+255)
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-286], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+255], 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}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 10^{-286}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+255}:\\
\;\;\;\;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)))) < 1.00000000000000005e-286Initial program 61.1%
associate-/r*71.5%
Simplified71.5%
if 1.00000000000000005e-286 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e255Initial program 98.4%
if 5.0000000000000002e255 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 62.9%
associate-/r*63.0%
clear-num63.0%
sqrt-div63.9%
metadata-eval63.9%
div-inv63.9%
clear-num65.2%
Applied egg-rr65.2%
associate-*r/65.1%
sqrt-prod53.5%
times-frac50.7%
metadata-eval50.7%
sqrt-div49.4%
clear-num49.4%
associate-/r/52.1%
sqrt-undiv63.8%
Applied egg-rr63.8%
associate-/r/66.5%
*-commutative66.5%
Simplified66.5%
Final simplification76.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -2e-310) (* c0 (/ (sqrt (/ -1.0 l)) (/ (sqrt (- V)) (sqrt A)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -2e-310) {
tmp = c0 * (sqrt((-1.0 / l)) / (sqrt(-V) / sqrt(A)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-2d-310)) then
tmp = c0 * (sqrt(((-1.0d0) / l)) / (sqrt(-v) / sqrt(a)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -2e-310) {
tmp = c0 * (Math.sqrt((-1.0 / l)) / (Math.sqrt(-V) / Math.sqrt(A)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -2e-310: tmp = c0 * (math.sqrt((-1.0 / l)) / (math.sqrt(-V) / math.sqrt(A))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -2e-310) tmp = Float64(c0 * Float64(sqrt(Float64(-1.0 / l)) / Float64(sqrt(Float64(-V)) / sqrt(A)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -2e-310)
tmp = c0 * (sqrt((-1.0 / l)) / (sqrt(-V) / sqrt(A)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -2e-310], N[(c0 * N[(N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-1}{\ell}}}{\frac{\sqrt{-V}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 68.2%
*-un-lft-identity68.2%
times-frac69.6%
Applied egg-rr69.6%
frac-times68.2%
*-commutative68.2%
frac-times66.8%
clear-num66.5%
associate-*l/66.5%
*-un-lft-identity66.5%
Applied egg-rr66.5%
frac-2neg66.5%
sqrt-div79.2%
distribute-neg-frac79.2%
metadata-eval79.2%
distribute-neg-frac279.2%
Applied egg-rr79.2%
frac-2neg79.2%
sqrt-div55.2%
remove-double-neg55.2%
Applied egg-rr55.2%
if -1.999999999999994e-310 < l Initial program 71.3%
associate-/r*75.3%
sqrt-div90.3%
div-inv90.2%
Applied egg-rr90.2%
associate-*r/90.3%
*-rgt-identity90.3%
Simplified90.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -7.5e+264)
(/ (sqrt (/ A V)) (/ (sqrt l) c0))
(if (<= (* l V) -4e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 2e-315)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* l V) 1e+277)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(* c0 (sqrt (/ (/ 1.0 l) (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -7.5e+264) {
tmp = sqrt((A / V)) / (sqrt(l) / c0);
} else if ((l * V) <= -4e-306) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 2e-315) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((l * V) <= 1e+277) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((l * v) <= (-7.5d+264)) then
tmp = sqrt((a / v)) / (sqrt(l) / c0)
else if ((l * v) <= (-4d-306)) then
tmp = c0 * (sqrt(-a) / sqrt((l * -v)))
else if ((l * v) <= 2d-315) then
tmp = c0 * sqrt(((a / v) / l))
else if ((l * v) <= 1d+277) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * sqrt(((1.0d0 / l) / (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -7.5e+264) {
tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
} else if ((l * V) <= -4e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 2e-315) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((l * V) <= 1e+277) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -7.5e+264: tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0) elif (l * V) <= -4e-306: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 2e-315: tmp = c0 * math.sqrt(((A / V) / l)) elif (l * V) <= 1e+277: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * math.sqrt(((1.0 / l) / (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -7.5e+264) tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0)); elseif (Float64(l * V) <= -4e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 2e-315) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(l * V) <= 1e+277) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) / Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -7.5e+264)
tmp = sqrt((A / V)) / (sqrt(l) / c0);
elseif ((l * V) <= -4e-306)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 2e-315)
tmp = c0 * sqrt(((A / V) / l));
elseif ((l * V) <= 1e+277)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], -7.5e+264], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -4e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e-315], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e+277], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -7.5 \cdot 10^{+264}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;\ell \cdot V \leq -4 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{+277}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -7.50000000000000005e264Initial program 41.6%
*-un-lft-identity41.6%
times-frac63.9%
Applied egg-rr63.9%
frac-times41.6%
*-commutative41.6%
frac-times65.5%
clear-num65.5%
associate-*l/65.5%
*-un-lft-identity65.5%
Applied egg-rr65.5%
div-inv65.5%
clear-num65.5%
sqrt-prod57.2%
inv-pow57.2%
sqrt-pow157.3%
metadata-eval57.3%
associate-*l*57.3%
*-commutative57.3%
metadata-eval57.3%
pow-flip57.3%
pow1/257.3%
associate-/r/57.4%
associate-*l/57.5%
*-un-lft-identity57.5%
Applied egg-rr57.5%
if -7.50000000000000005e264 < (*.f64 V l) < -4.00000000000000011e-306Initial program 79.3%
frac-2neg79.3%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -4.00000000000000011e-306 < (*.f64 V l) < 2.0000000019e-315Initial program 43.6%
associate-/r*66.6%
Simplified66.6%
if 2.0000000019e-315 < (*.f64 V l) < 1e277Initial program 86.4%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1e277 < (*.f64 V l) Initial program 42.1%
*-un-lft-identity42.1%
times-frac73.1%
Applied egg-rr73.1%
frac-times42.1%
*-commutative42.1%
frac-times73.1%
clear-num73.1%
associate-*l/73.1%
*-un-lft-identity73.1%
Applied egg-rr73.1%
Final simplification88.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 (<= (* l V) -5e+304)
(* c0 (pow (* V (/ l A)) -0.5))
(if (<= (* l V) -5e-128)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* l V) 2e-315)
(/ c0 (sqrt (/ l (/ A V))))
(if (<= (* l V) 1e+277)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(* c0 (sqrt (/ (/ 1.0 l) (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -5e+304) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else if ((l * V) <= -5e-128) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else if ((l * V) <= 2e-315) {
tmp = c0 / sqrt((l / (A / V)));
} else if ((l * V) <= 1e+277) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((l * v) <= (-5d+304)) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else if ((l * v) <= (-5d-128)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else if ((l * v) <= 2d-315) then
tmp = c0 / sqrt((l / (a / v)))
else if ((l * v) <= 1d+277) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * sqrt(((1.0d0 / l) / (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -5e+304) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else if ((l * V) <= -5e-128) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((l * V) <= 2e-315) {
tmp = c0 / Math.sqrt((l / (A / V)));
} else if ((l * V) <= 1e+277) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -5e+304: tmp = c0 * math.pow((V * (l / A)), -0.5) elif (l * V) <= -5e-128: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) elif (l * V) <= 2e-315: tmp = c0 / math.sqrt((l / (A / V))) elif (l * V) <= 1e+277: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * math.sqrt(((1.0 / l) / (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -5e+304) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); elseif (Float64(l * V) <= -5e-128) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(l * V) <= 2e-315) tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); elseif (Float64(l * V) <= 1e+277) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) / Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -5e+304)
tmp = c0 * ((V * (l / A)) ^ -0.5);
elseif ((l * V) <= -5e-128)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
elseif ((l * V) <= 2e-315)
tmp = c0 / sqrt((l / (A / V)));
elseif ((l * V) <= 1e+277)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], -5e+304], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -5e-128], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e-315], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e+277], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -5 \cdot 10^{+304}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;\ell \cdot V \leq -5 \cdot 10^{-128}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{-315}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{+277}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999997e304Initial program 33.3%
associate-/r*61.5%
clear-num61.5%
sqrt-div61.5%
metadata-eval61.5%
div-inv61.5%
clear-num61.5%
Applied egg-rr61.5%
inv-pow61.5%
sqrt-prod54.1%
unpow-prod-down54.1%
clear-num54.3%
sqrt-div54.1%
metadata-eval54.1%
unpow-prod-down54.1%
div-inv54.3%
sqrt-undiv61.5%
sqrt-pow261.5%
metadata-eval61.5%
Applied egg-rr61.5%
associate-/r/61.7%
*-commutative61.7%
Simplified61.7%
if -4.9999999999999997e304 < (*.f64 V l) < -5.0000000000000001e-128Initial program 83.1%
clear-num80.9%
associate-/r/83.1%
associate-/r*83.2%
Applied egg-rr83.2%
if -5.0000000000000001e-128 < (*.f64 V l) < 2.0000000019e-315Initial program 50.8%
associate-/r*66.6%
clear-num66.6%
sqrt-div67.1%
metadata-eval67.1%
div-inv67.1%
clear-num67.1%
Applied egg-rr67.1%
associate-*r/67.2%
sqrt-prod42.7%
times-frac39.2%
metadata-eval39.2%
sqrt-div39.2%
clear-num39.3%
associate-/r/42.6%
sqrt-undiv67.1%
Applied egg-rr67.1%
if 2.0000000019e-315 < (*.f64 V l) < 1e277Initial program 86.4%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1e277 < (*.f64 V l) Initial program 42.1%
*-un-lft-identity42.1%
times-frac73.1%
Applied egg-rr73.1%
frac-times42.1%
*-commutative42.1%
frac-times73.1%
clear-num73.1%
associate-*l/73.1%
*-un-lft-identity73.1%
Applied egg-rr73.1%
Final simplification82.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= l -1.7e-163)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(if (<= l -2e-310)
(* c0 (/ (sqrt (/ -1.0 l)) (sqrt (/ V (- A)))))
(* c0 (/ (sqrt (/ A V)) (sqrt l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -1.7e-163) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else if (l <= -2e-310) {
tmp = c0 * (sqrt((-1.0 / l)) / sqrt((V / -A)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-1.7d-163)) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else if (l <= (-2d-310)) then
tmp = c0 * (sqrt(((-1.0d0) / l)) / sqrt((v / -a)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -1.7e-163) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else if (l <= -2e-310) {
tmp = c0 * (Math.sqrt((-1.0 / l)) / Math.sqrt((V / -A)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -1.7e-163: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) elif l <= -2e-310: tmp = c0 * (math.sqrt((-1.0 / l)) / math.sqrt((V / -A))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -1.7e-163) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); elseif (l <= -2e-310) tmp = Float64(c0 * Float64(sqrt(Float64(-1.0 / l)) / sqrt(Float64(V / Float64(-A))))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -1.7e-163)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
elseif (l <= -2e-310)
tmp = c0 * (sqrt((-1.0 / l)) / sqrt((V / -A)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -1.7e-163], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(c0 * N[(N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(V / (-A)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{-163}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-1}{\ell}}}{\sqrt{\frac{V}{-A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.70000000000000007e-163Initial program 71.1%
*-un-lft-identity71.1%
times-frac73.2%
Applied egg-rr73.2%
frac-times71.1%
*-commutative71.1%
frac-times67.8%
clear-num67.5%
associate-*l/67.5%
*-un-lft-identity67.5%
Applied egg-rr67.5%
associate-/l/65.9%
sqrt-div66.1%
associate-/r/72.7%
sqrt-div72.5%
clear-num73.2%
frac-2neg73.2%
sqrt-div51.9%
distribute-neg-frac251.9%
Applied egg-rr51.9%
distribute-frac-neg251.9%
distribute-neg-frac51.9%
Simplified51.9%
if -1.70000000000000007e-163 < l < -1.999999999999994e-310Initial program 58.4%
*-un-lft-identity58.4%
times-frac57.4%
Applied egg-rr57.4%
frac-times58.4%
*-commutative58.4%
frac-times63.4%
clear-num63.4%
associate-*l/63.4%
*-un-lft-identity63.4%
Applied egg-rr63.4%
frac-2neg63.4%
sqrt-div84.7%
distribute-neg-frac84.7%
metadata-eval84.7%
distribute-neg-frac284.7%
Applied egg-rr84.7%
if -1.999999999999994e-310 < l Initial program 71.3%
associate-/r*75.3%
sqrt-div90.3%
div-inv90.2%
Applied egg-rr90.2%
associate-*r/90.3%
*-rgt-identity90.3%
Simplified90.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= l -1.4e-162)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(if (<= l -2e-310)
(* c0 (/ (sqrt (/ A (- V))) (sqrt (- l))))
(* c0 (/ (sqrt (/ A V)) (sqrt l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -1.4e-162) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else if (l <= -2e-310) {
tmp = c0 * (sqrt((A / -V)) / sqrt(-l));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-1.4d-162)) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else if (l <= (-2d-310)) then
tmp = c0 * (sqrt((a / -v)) / sqrt(-l))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -1.4e-162) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else if (l <= -2e-310) {
tmp = c0 * (Math.sqrt((A / -V)) / Math.sqrt(-l));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -1.4e-162: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) elif l <= -2e-310: tmp = c0 * (math.sqrt((A / -V)) / math.sqrt(-l)) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -1.4e-162) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); elseif (l <= -2e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-V))) / sqrt(Float64(-l)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -1.4e-162)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
elseif (l <= -2e-310)
tmp = c0 * (sqrt((A / -V)) / sqrt(-l));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -1.4e-162], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(c0 * N[(N[Sqrt[N[(A / (-V)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{-162}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-V}}}{\sqrt{-\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.40000000000000011e-162Initial program 71.1%
*-un-lft-identity71.1%
times-frac73.2%
Applied egg-rr73.2%
frac-times71.1%
*-commutative71.1%
frac-times67.8%
clear-num67.5%
associate-*l/67.5%
*-un-lft-identity67.5%
Applied egg-rr67.5%
associate-/l/65.9%
sqrt-div66.1%
associate-/r/72.7%
sqrt-div72.5%
clear-num73.2%
frac-2neg73.2%
sqrt-div51.9%
distribute-neg-frac251.9%
Applied egg-rr51.9%
distribute-frac-neg251.9%
distribute-neg-frac51.9%
Simplified51.9%
if -1.40000000000000011e-162 < l < -1.999999999999994e-310Initial program 58.4%
associate-/r*63.3%
frac-2neg63.3%
sqrt-div84.5%
distribute-neg-frac284.5%
Applied egg-rr84.5%
if -1.999999999999994e-310 < l Initial program 71.3%
associate-/r*75.3%
sqrt-div90.3%
div-inv90.2%
Applied egg-rr90.2%
associate-*r/90.3%
*-rgt-identity90.3%
Simplified90.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -2e-310) (* c0 (/ (sqrt A) (sqrt (* l V)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -2e-310) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-2d-310)) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -2e-310) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -2e-310: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -2e-310) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -2e-310)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -2e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 68.2%
sqrt-div43.9%
div-inv43.9%
Applied egg-rr43.9%
associate-*r/43.9%
*-rgt-identity43.9%
Simplified43.9%
if -1.999999999999994e-310 < l Initial program 71.3%
associate-/r*75.3%
sqrt-div90.3%
div-inv90.2%
Applied egg-rr90.2%
associate-*r/90.3%
*-rgt-identity90.3%
Simplified90.3%
Final simplification65.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 (/ A (* l V))))
(if (or (<= t_0 2e-323) (not (<= t_0 2e+212)))
(* c0 (sqrt (/ (/ 1.0 l) (/ V A))))
(* c0 (sqrt (* A (/ (/ 1.0 V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if ((t_0 <= 2e-323) || !(t_0 <= 2e+212)) {
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
} else {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (l * v)
if ((t_0 <= 2d-323) .or. (.not. (t_0 <= 2d+212))) then
tmp = c0 * sqrt(((1.0d0 / l) / (v / a)))
else
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if ((t_0 <= 2e-323) || !(t_0 <= 2e+212)) {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
} else {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if (t_0 <= 2e-323) or not (t_0 <= 2e+212): tmp = c0 * math.sqrt(((1.0 / l) / (V / A))) else: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if ((t_0 <= 2e-323) || !(t_0 <= 2e+212)) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) / Float64(V / A)))); else tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if ((t_0 <= 2e-323) || ~((t_0 <= 2e+212)))
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
else
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-323], N[Not[LessEqual[t$95$0, 2e+212]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-323} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+212}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.97626e-323 or 1.9999999999999998e212 < (/.f64 A (*.f64 V l)) Initial program 41.2%
*-un-lft-identity41.2%
times-frac56.9%
Applied egg-rr56.9%
frac-times41.2%
*-commutative41.2%
frac-times55.6%
clear-num55.6%
associate-*l/56.1%
*-un-lft-identity56.1%
Applied egg-rr56.1%
if 1.97626e-323 < (/.f64 A (*.f64 V l)) < 1.9999999999999998e212Initial program 99.1%
clear-num98.0%
associate-/r/99.1%
associate-/r*99.2%
Applied egg-rr99.2%
Final simplification77.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 2e-323)
(* c0 (sqrt (/ (/ 1.0 l) (/ V A))))
(if (<= t_0 2e+212)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(* c0 (/ 1.0 (sqrt (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 2e-323) {
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
} else if (t_0 <= 2e+212) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (l * v)
if (t_0 <= 2d-323) then
tmp = c0 * sqrt(((1.0d0 / l) / (v / a)))
else if (t_0 <= 2d+212) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else
tmp = c0 * (1.0d0 / sqrt((l * (v / a))))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 2e-323) {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
} else if (t_0 <= 2e+212) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 2e-323: tmp = c0 * math.sqrt(((1.0 / l) / (V / A))) elif t_0 <= 2e+212: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) else: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 2e-323) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) / Float64(V / A)))); elseif (t_0 <= 2e+212) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 2e-323)
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
elseif (t_0 <= 2e+212)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
else
tmp = c0 * (1.0 / sqrt((l * (V / A))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-323], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+212], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-323}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+212}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.97626e-323Initial program 35.0%
*-un-lft-identity35.0%
times-frac55.2%
Applied egg-rr55.2%
frac-times35.0%
*-commutative35.0%
frac-times55.4%
clear-num55.4%
associate-*l/55.4%
*-un-lft-identity55.4%
Applied egg-rr55.4%
if 1.97626e-323 < (/.f64 A (*.f64 V l)) < 1.9999999999999998e212Initial program 99.1%
clear-num98.0%
associate-/r/99.1%
associate-/r*99.2%
Applied egg-rr99.2%
if 1.9999999999999998e212 < (/.f64 A (*.f64 V l)) Initial program 47.1%
associate-/r*55.7%
clear-num55.7%
sqrt-div56.5%
metadata-eval56.5%
div-inv56.5%
clear-num57.6%
Applied egg-rr57.6%
Final simplification77.5%
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 (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (* (/ 1.0 V) (/ A l))))
(if (<= t_0 2e+212)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(/ 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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
} else if (t_0 <= 2e+212) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} 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 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((1.0d0 / v) * (a / l)))
else if (t_0 <= 2d+212) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((1.0 / V) * (A / l)));
} else if (t_0 <= 2e+212) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} 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 / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((1.0 / V) * (A / l))) elif t_0 <= 2e+212: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) 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(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / V) * Float64(A / l)))); elseif (t_0 <= 2e+212) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); 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 / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
elseif (t_0 <= 2e+212)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+212], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $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}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+212}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 35.2%
*-un-lft-identity35.2%
times-frac55.9%
Applied egg-rr55.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.9999999999999998e212Initial program 98.5%
clear-num97.3%
associate-/r/98.5%
associate-/r*98.6%
Applied egg-rr98.6%
if 1.9999999999999998e212 < (/.f64 A (*.f64 V l)) Initial program 47.1%
associate-/r*55.7%
clear-num55.7%
sqrt-div56.5%
metadata-eval56.5%
div-inv56.5%
clear-num57.6%
Applied egg-rr57.6%
associate-*r/57.7%
sqrt-prod39.3%
times-frac39.2%
metadata-eval39.2%
sqrt-div38.2%
clear-num38.2%
associate-/r/38.2%
sqrt-undiv56.5%
Applied egg-rr56.5%
Final simplification77.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (l * v)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 69.7%
Final simplification69.7%
herbie shell --seed 2024110
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))