
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) (- INFINITY))
(/ c0 (/ (sqrt l) t_0))
(if (<= (* V l) -1e-314)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-319)
(* t_0 (/ c0 (sqrt l)))
(if (<= (* V l) 1e+306)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* 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 t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 / (sqrt(l) / t_0);
} else if ((V * l) <= -1e-314) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-319) {
tmp = t_0 * (c0 / sqrt(l));
} else if ((V * l) <= 1e+306) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt((1.0 / (l * (V / A))));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 / (Math.sqrt(l) / t_0);
} else if ((V * l) <= -1e-314) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-319) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if ((V * l) <= 1e+306) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -math.inf: tmp = c0 / (math.sqrt(l) / t_0) elif (V * l) <= -1e-314: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-319: tmp = t_0 * (c0 / math.sqrt(l)) elif (V * l) <= 1e+306: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 / Float64(sqrt(l) / t_0)); elseif (Float64(V * l) <= -1e-314) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-319) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= 1e+306) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(1.0 / 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 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 / (sqrt(l) / t_0);
elseif ((V * l) <= -1e-314)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-319)
tmp = t_0 * (c0 / sqrt(l));
elseif ((V * l) <= 1e+306)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-314], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-319], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+306], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(1.0 / 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 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{t\_0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-319}:\\
\;\;\;\;t\_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 33.7%
associate-/r*70.2%
sqrt-div38.3%
associate-*r/38.3%
Applied egg-rr38.3%
associate-/l*38.3%
Simplified38.3%
if -inf.0 < (*.f64 V l) < -9.9999999996e-315Initial program 83.0%
frac-2neg83.0%
sqrt-div98.9%
distribute-rgt-neg-in98.9%
Applied egg-rr98.9%
distribute-rgt-neg-out98.9%
*-commutative98.9%
distribute-rgt-neg-in98.9%
Simplified98.9%
if -9.9999999996e-315 < (*.f64 V l) < 1.99998e-319Initial program 46.5%
add-sqr-sqrt32.1%
sqrt-unprod32.2%
*-commutative32.2%
*-commutative32.2%
swap-sqr31.8%
add-sqr-sqrt31.8%
pow231.8%
Applied egg-rr31.8%
sqrt-prod31.8%
unpow231.8%
sqrt-prod32.1%
add-sqr-sqrt46.5%
sqrt-div18.6%
associate-*l/18.5%
sqrt-prod34.6%
times-frac38.1%
sqrt-div50.4%
Applied egg-rr50.4%
if 1.99998e-319 < (*.f64 V l) < 1.00000000000000002e306Initial program 87.9%
sqrt-div99.5%
associate-*r/98.2%
Applied egg-rr98.2%
*-commutative98.2%
associate-/l*92.0%
associate-/r/99.5%
Simplified99.5%
if 1.00000000000000002e306 < (*.f64 V l) Initial program 40.8%
associate-/r*61.3%
div-inv61.3%
Applied egg-rr61.3%
clear-num61.3%
frac-times61.3%
metadata-eval61.3%
Applied egg-rr61.3%
Final simplification87.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 0.0)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= t_0 2e+252) t_0 (* c0 (pow (* V (/ l A)) -0.5))))))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) {
tmp = c0 / sqrt((V / (A / l)));
} else if (t_0 <= 2e+252) {
tmp = t_0;
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((v / (a / l)))
else if (t_0 <= 2d+252) then
tmp = t_0
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if (t_0 <= 2e+252) {
tmp = t_0;
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
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: tmp = c0 / math.sqrt((V / (A / l))) elif t_0 <= 2e+252: tmp = t_0 else: tmp = c0 * math.pow((V * (l / A)), -0.5) 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) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (t_0 <= 2e+252) tmp = t_0; else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((V / (A / l)));
elseif (t_0 <= 2e+252)
tmp = t_0;
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+252], t$95$0, N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+252}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.8%
associate-/r*71.9%
div-inv71.9%
Applied egg-rr71.9%
*-commutative71.9%
un-div-inv71.9%
associate-/r*69.8%
add-sqr-sqrt10.7%
sqrt-prod19.4%
unpow219.4%
sqrt-prod19.4%
expm1-log1p-u19.4%
expm1-udef19.6%
Applied egg-rr22.4%
expm1-def46.9%
expm1-log1p74.0%
Simplified74.0%
Taylor expanded in V around 0 69.4%
associate-/l*74.1%
Simplified74.1%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000002e252Initial program 98.7%
if 2.0000000000000002e252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 53.5%
associate-/r*63.9%
div-inv63.8%
Applied egg-rr63.8%
clear-num63.9%
frac-times63.9%
metadata-eval63.9%
Applied egg-rr63.9%
inv-pow63.9%
sqrt-pow163.9%
associate-/r/63.9%
div-inv63.9%
clear-num63.9%
metadata-eval63.9%
Applied egg-rr63.9%
Final simplification78.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 1e+242)))
(* 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 <= 1e+242)) {
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 <= 1d+242))) 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 <= 1e+242)) {
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 <= 1e+242): 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 <= 1e+242)) 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 <= 1e+242)))
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, 1e+242]], $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 10^{+242}\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 1.00000000000000005e242 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.9%
*-commutative66.9%
associate-/l/70.6%
Simplified70.6%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000005e242Initial program 98.7%
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 (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+252)))
(* c0 (sqrt (/ (/ A l) V)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+252)) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 2d+252))) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+252)) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 2e+252): tmp = c0 * math.sqrt(((A / l) / V)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 2e+252)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 2e+252)))
tmp = c0 * sqrt(((A / l) / V));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2e+252]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 2 \cdot 10^{+252}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 2.0000000000000002e252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.8%
associate-/r*70.4%
div-inv70.4%
Applied egg-rr70.4%
associate-*l/72.2%
div-inv72.2%
Applied egg-rr72.2%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000002e252Initial program 98.7%
Final simplification78.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 0.0)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= t_0 2e+252) t_0 (* c0 (sqrt (/ (/ A l) V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((V / (A / l)));
} else if (t_0 <= 2e+252) {
tmp = t_0;
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((v / (a / l)))
else if (t_0 <= 2d+252) then
tmp = t_0
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if (t_0 <= 2e+252) {
tmp = t_0;
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((V / (A / l))) elif t_0 <= 2e+252: tmp = t_0 else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (t_0 <= 2e+252) tmp = t_0; else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((V / (A / l)));
elseif (t_0 <= 2e+252)
tmp = t_0;
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+252], t$95$0, N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $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 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+252}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.8%
associate-/r*71.9%
div-inv71.9%
Applied egg-rr71.9%
*-commutative71.9%
un-div-inv71.9%
associate-/r*69.8%
add-sqr-sqrt10.7%
sqrt-prod19.4%
unpow219.4%
sqrt-prod19.4%
expm1-log1p-u19.4%
expm1-udef19.6%
Applied egg-rr22.4%
expm1-def46.9%
expm1-log1p74.0%
Simplified74.0%
Taylor expanded in V around 0 69.4%
associate-/l*74.1%
Simplified74.1%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000002e252Initial program 98.7%
if 2.0000000000000002e252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 53.5%
associate-/r*63.9%
div-inv63.8%
Applied egg-rr63.8%
associate-*l/63.9%
div-inv64.0%
Applied egg-rr64.0%
Final simplification78.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (- V))))
(if (<= V -2.4e-61)
(* c0 (/ (sqrt (- (/ A l))) t_0))
(if (<= V -1e-310)
(/ (* c0 (/ (sqrt (- A)) t_0)) (sqrt l))
(/ (* c0 (sqrt A)) (* (sqrt l) (sqrt V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt(-V);
double tmp;
if (V <= -2.4e-61) {
tmp = c0 * (sqrt(-(A / l)) / t_0);
} else if (V <= -1e-310) {
tmp = (c0 * (sqrt(-A) / t_0)) / sqrt(l);
} else {
tmp = (c0 * sqrt(A)) / (sqrt(l) * sqrt(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 = sqrt(-v)
if (v <= (-2.4d-61)) then
tmp = c0 * (sqrt(-(a / l)) / t_0)
else if (v <= (-1d-310)) then
tmp = (c0 * (sqrt(-a) / t_0)) / sqrt(l)
else
tmp = (c0 * sqrt(a)) / (sqrt(l) * sqrt(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 = Math.sqrt(-V);
double tmp;
if (V <= -2.4e-61) {
tmp = c0 * (Math.sqrt(-(A / l)) / t_0);
} else if (V <= -1e-310) {
tmp = (c0 * (Math.sqrt(-A) / t_0)) / Math.sqrt(l);
} else {
tmp = (c0 * Math.sqrt(A)) / (Math.sqrt(l) * Math.sqrt(V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt(-V) tmp = 0 if V <= -2.4e-61: tmp = c0 * (math.sqrt(-(A / l)) / t_0) elif V <= -1e-310: tmp = (c0 * (math.sqrt(-A) / t_0)) / math.sqrt(l) else: tmp = (c0 * math.sqrt(A)) / (math.sqrt(l) * math.sqrt(V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(-V)) tmp = 0.0 if (V <= -2.4e-61) tmp = Float64(c0 * Float64(sqrt(Float64(-Float64(A / l))) / t_0)); elseif (V <= -1e-310) tmp = Float64(Float64(c0 * Float64(sqrt(Float64(-A)) / t_0)) / sqrt(l)); else tmp = Float64(Float64(c0 * sqrt(A)) / Float64(sqrt(l) * sqrt(V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt(-V);
tmp = 0.0;
if (V <= -2.4e-61)
tmp = c0 * (sqrt(-(A / l)) / t_0);
elseif (V <= -1e-310)
tmp = (c0 * (sqrt(-A) / t_0)) / sqrt(l);
else
tmp = (c0 * sqrt(A)) / (sqrt(l) * sqrt(V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[(-V)], $MachinePrecision]}, If[LessEqual[V, -2.4e-61], N[(c0 * N[(N[Sqrt[(-N[(A / l), $MachinePrecision])], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[V, -1e-310], N[(N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{-V}\\
\mathbf{if}\;V \leq -2.4 \cdot 10^{-61}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-\frac{A}{\ell}}}{t\_0}\\
\mathbf{elif}\;V \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0 \cdot \frac{\sqrt{-A}}{t\_0}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}\\
\end{array}
\end{array}
if V < -2.4000000000000001e-61Initial program 71.7%
associate-/r*71.5%
div-inv71.6%
Applied egg-rr71.6%
clear-num70.3%
frac-times70.4%
metadata-eval70.4%
Applied egg-rr70.4%
associate-*l/71.7%
clear-num71.7%
associate-/l/71.7%
frac-2neg71.7%
sqrt-div78.8%
distribute-neg-frac78.8%
Applied egg-rr78.8%
if -2.4000000000000001e-61 < V < -9.999999999999969e-311Initial program 79.2%
*-commutative79.2%
associate-/r*75.3%
sqrt-div53.9%
associate-*l/54.0%
Applied egg-rr54.0%
frac-2neg54.0%
sqrt-div64.9%
Applied egg-rr64.9%
if -9.999999999999969e-311 < V Initial program 73.6%
associate-/r*73.2%
div-inv73.1%
Applied egg-rr73.1%
*-commutative73.1%
un-div-inv73.2%
associate-/r*73.6%
sqrt-div47.8%
associate-*l/46.9%
sqrt-prod57.3%
associate-/r*54.1%
*-commutative54.1%
Applied egg-rr54.1%
associate-/r*57.3%
Simplified57.3%
Final simplification64.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (* c0 (/ (/ (sqrt A) (sqrt (- l))) (sqrt (- V)))) (/ c0 (/ (sqrt l) (sqrt (/ A V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * ((sqrt(A) / sqrt(-l)) / sqrt(-V));
} else {
tmp = c0 / (sqrt(l) / sqrt((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) :: tmp
if (l <= (-5d-310)) then
tmp = c0 * ((sqrt(a) / sqrt(-l)) / sqrt(-v))
else
tmp = c0 / (sqrt(l) / sqrt((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 tmp;
if (l <= -5e-310) {
tmp = c0 * ((Math.sqrt(A) / Math.sqrt(-l)) / Math.sqrt(-V));
} else {
tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * ((math.sqrt(A) / math.sqrt(-l)) / math.sqrt(-V)) else: tmp = c0 / (math.sqrt(l) / math.sqrt((A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(Float64(sqrt(A) / sqrt(Float64(-l))) / sqrt(Float64(-V)))); else tmp = Float64(c0 / Float64(sqrt(l) / sqrt(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)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 * ((sqrt(A) / sqrt(-l)) / sqrt(-V));
else
tmp = c0 / (sqrt(l) / sqrt((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_] := If[LessEqual[l, -5e-310], N[(c0 * N[(N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{A}}{\sqrt{-\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 73.0%
associate-/r*75.1%
div-inv75.1%
Applied egg-rr75.1%
clear-num74.8%
frac-times74.3%
metadata-eval74.3%
Applied egg-rr74.3%
associate-*l/72.2%
clear-num73.0%
associate-/l/76.3%
frac-2neg76.3%
sqrt-div37.1%
distribute-neg-frac37.1%
Applied egg-rr37.1%
frac-2neg37.1%
sqrt-div48.1%
remove-double-neg48.1%
Applied egg-rr48.1%
if -4.999999999999985e-310 < l Initial program 74.8%
associate-/r*71.5%
sqrt-div82.6%
associate-*r/79.4%
Applied egg-rr79.4%
associate-/l*82.6%
Simplified82.6%
Final simplification67.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 (<= l -5e-310) (* c0 (/ (sqrt A) (sqrt (* V l)))) (/ c0 (/ (sqrt l) (sqrt (/ A V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / (sqrt(l) / sqrt((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) :: tmp
if (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 / (sqrt(l) / sqrt((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 tmp;
if (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / (math.sqrt(l) / math.sqrt((A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 / Float64(sqrt(l) / sqrt(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)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 / (sqrt(l) / sqrt((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_] := If[LessEqual[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 73.0%
sqrt-div40.9%
associate-*r/40.9%
Applied egg-rr40.9%
*-commutative40.9%
associate-/l*37.6%
associate-/r/40.9%
Simplified40.9%
if -4.999999999999985e-310 < l Initial program 74.8%
associate-/r*71.5%
sqrt-div82.6%
associate-*r/79.4%
Applied egg-rr79.4%
associate-/l*82.6%
Simplified82.6%
Final simplification64.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 5e-317) (not (<= t_0 1e+271)))
(sqrt (* (/ c0 (/ l A)) (/ c0 V)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 5e-317) || !(t_0 <= 1e+271)) {
tmp = sqrt(((c0 / (l / A)) * (c0 / V)));
} else {
tmp = c0 * sqrt(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 = a / (v * l)
if ((t_0 <= 5d-317) .or. (.not. (t_0 <= 1d+271))) then
tmp = sqrt(((c0 / (l / a)) * (c0 / v)))
else
tmp = c0 * sqrt(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 = A / (V * l);
double tmp;
if ((t_0 <= 5e-317) || !(t_0 <= 1e+271)) {
tmp = Math.sqrt(((c0 / (l / A)) * (c0 / V)));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 5e-317) or not (t_0 <= 1e+271): tmp = math.sqrt(((c0 / (l / A)) * (c0 / V))) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 5e-317) || !(t_0 <= 1e+271)) tmp = sqrt(Float64(Float64(c0 / Float64(l / A)) * Float64(c0 / V))); else tmp = Float64(c0 * sqrt(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 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 5e-317) || ~((t_0 <= 1e+271)))
tmp = sqrt(((c0 / (l / A)) * (c0 / V)));
else
tmp = c0 * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 5e-317], N[Not[LessEqual[t$95$0, 1e+271]], $MachinePrecision]], N[Sqrt[N[(N[(c0 / N[(l / A), $MachinePrecision]), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-317} \lor \neg \left(t\_0 \leq 10^{+271}\right):\\
\;\;\;\;\sqrt{\frac{c0}{\frac{\ell}{A}} \cdot \frac{c0}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5.00000017e-317 or 9.99999999999999953e270 < (/.f64 A (*.f64 V l)) Initial program 43.8%
associate-/r*56.9%
div-inv56.9%
Applied egg-rr56.9%
add-sqr-sqrt33.8%
sqrt-prod40.1%
unpow240.1%
pow1/240.1%
associate-*l/40.1%
div-inv40.1%
*-un-lft-identity40.1%
associate-*l/40.1%
pow1/240.1%
unpow-prod-down38.5%
frac-times35.8%
associate-/l*35.8%
un-div-inv35.8%
*-un-lft-identity35.8%
times-frac38.5%
/-rgt-identity38.5%
Applied egg-rr38.5%
unpow1/238.5%
associate-/r*45.5%
Simplified45.5%
associate-/l/38.5%
unpow238.5%
times-frac52.1%
Applied egg-rr52.1%
if 5.00000017e-317 < (/.f64 A (*.f64 V l)) < 9.99999999999999953e270Initial program 99.1%
Final simplification77.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 74.0%
Final simplification74.0%
herbie shell --seed 2024031
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))