
(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: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (pow (/ (* (cbrt A) (cbrt (/ 1.0 V))) (cbrt l)) 1.5)))
assert(V < l);
double code(double c0, double A, double V, double l) {
return c0 * pow(((cbrt(A) * cbrt((1.0 / V))) / cbrt(l)), 1.5);
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.pow(((Math.cbrt(A) * Math.cbrt((1.0 / V))) / Math.cbrt(l)), 1.5);
}
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * (Float64(Float64(cbrt(A) * cbrt(Float64(1.0 / V))) / cbrt(l)) ^ 1.5)) end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Power[N[(N[(N[Power[A, 1/3], $MachinePrecision] * N[Power[N[(1.0 / V), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot {\left(\frac{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}
\end{array}
Initial program 71.1%
pow1/271.1%
add-cube-cbrt70.5%
pow370.5%
pow-pow70.5%
metadata-eval70.5%
Applied egg-rr70.5%
associate-/r*73.8%
un-div-inv73.7%
*-commutative73.7%
cbrt-prod82.7%
cbrt-div82.5%
metadata-eval82.5%
Applied egg-rr82.5%
associate-*l/82.6%
*-lft-identity82.6%
Simplified82.6%
div-inv82.6%
cbrt-prod97.1%
Applied egg-rr97.1%
Final simplification97.1%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (pow (/ (/ (cbrt A) (cbrt V)) (cbrt l)) 1.5)))
assert(V < l);
double code(double c0, double A, double V, double l) {
return c0 * pow(((cbrt(A) / cbrt(V)) / cbrt(l)), 1.5);
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.pow(((Math.cbrt(A) / Math.cbrt(V)) / Math.cbrt(l)), 1.5);
}
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * (Float64(Float64(cbrt(A) / cbrt(V)) / cbrt(l)) ^ 1.5)) end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Power[N[(N[(N[Power[A, 1/3], $MachinePrecision] / N[Power[V, 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot {\left(\frac{\frac{\sqrt[3]{A}}{\sqrt[3]{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}
\end{array}
Initial program 71.1%
pow1/271.1%
add-cube-cbrt70.5%
pow370.5%
pow-pow70.5%
metadata-eval70.5%
Applied egg-rr70.5%
associate-/r*73.8%
un-div-inv73.7%
*-commutative73.7%
cbrt-prod82.7%
cbrt-div82.5%
metadata-eval82.5%
Applied egg-rr82.5%
associate-*l/82.6%
*-lft-identity82.6%
Simplified82.6%
cbrt-div97.2%
Applied egg-rr97.2%
Final simplification97.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+269)
(/ 1.0 (/ (* (sqrt (/ V A)) (sqrt l)) c0))
(if (<= (* V l) -4e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 2e-316) (not (<= (* V l) 4e+278)))
(* c0 (pow (/ (cbrt (/ A V)) (cbrt l)) 1.5))
(* c0 (* (pow (* V l) -0.5) (pow (/ 1.0 A) -0.5)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+269) {
tmp = 1.0 / ((sqrt((V / A)) * sqrt(l)) / c0);
} else if ((V * l) <= -4e-306) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 2e-316) || !((V * l) <= 4e+278)) {
tmp = c0 * pow((cbrt((A / V)) / cbrt(l)), 1.5);
} else {
tmp = c0 * (pow((V * l), -0.5) * pow((1.0 / A), -0.5));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+269) {
tmp = 1.0 / ((Math.sqrt((V / A)) * Math.sqrt(l)) / c0);
} else if ((V * l) <= -4e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 2e-316) || !((V * l) <= 4e+278)) {
tmp = c0 * Math.pow((Math.cbrt((A / V)) / Math.cbrt(l)), 1.5);
} else {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.pow((1.0 / A), -0.5));
}
return tmp;
}
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+269) tmp = Float64(1.0 / Float64(Float64(sqrt(Float64(V / A)) * sqrt(l)) / c0)); elseif (Float64(V * l) <= -4e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 2e-316) || !(Float64(V * l) <= 4e+278)) tmp = Float64(c0 * (Float64(cbrt(Float64(A / V)) / cbrt(l)) ^ 1.5)); else tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * (Float64(1.0 / A) ^ -0.5))); end return tmp end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+269], N[(1.0 / N[(N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 2e-316], N[Not[LessEqual[N[(V * l), $MachinePrecision], 4e+278]], $MachinePrecision]], N[(c0 * N[Power[N[(N[Power[N[(A / V), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Power[N[(1.0 / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+269}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq 4 \cdot 10^{+278}\right):\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot {\left(\frac{1}{A}\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -1e269Initial program 59.4%
associate-/r*80.8%
div-inv80.9%
Applied egg-rr80.9%
un-div-inv80.8%
associate-/r*59.4%
sqrt-undiv0.0%
clear-num0.0%
sqrt-div56.9%
un-div-inv56.9%
clear-num57.1%
div-inv57.1%
*-commutative57.1%
associate-*l*78.5%
div-inv78.5%
Applied egg-rr78.5%
*-commutative78.5%
sqrt-prod38.7%
Applied egg-rr38.7%
if -1e269 < (*.f64 V l) < -4.00000000000000011e-306Initial program 82.7%
frac-2neg82.7%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -4.00000000000000011e-306 < (*.f64 V l) < 2.000000017e-316 or 3.99999999999999985e278 < (*.f64 V l) Initial program 32.7%
pow1/232.7%
add-cube-cbrt32.7%
pow332.7%
pow-pow32.7%
metadata-eval32.7%
Applied egg-rr32.7%
associate-/r*70.8%
un-div-inv70.8%
*-commutative70.8%
cbrt-prod85.6%
cbrt-div85.4%
metadata-eval85.4%
Applied egg-rr85.4%
associate-*l/85.5%
*-lft-identity85.5%
Simplified85.5%
if 2.000000017e-316 < (*.f64 V l) < 3.99999999999999985e278Initial program 85.9%
associate-/r*77.4%
div-inv77.4%
Applied egg-rr77.4%
un-div-inv77.4%
associate-/r*85.9%
clear-num84.8%
sqrt-div86.3%
metadata-eval86.3%
pow1/286.3%
pow-flip86.5%
div-inv86.5%
metadata-eval86.5%
unpow-prod-down99.5%
Applied egg-rr99.5%
Final simplification92.1%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+269)
(/ 1.0 (/ (* (sqrt (/ V A)) (sqrt l)) c0))
(if (<= (* V l) -4e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-316)
(* c0 (pow (/ (cbrt (/ A V)) (cbrt l)) 1.5))
(if (<= (* V l) 4e+278)
(* c0 (* (pow (* V l) -0.5) (pow (/ 1.0 A) -0.5)))
(* c0 (pow (/ (cbrt (/ A l)) (cbrt V)) 1.5)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+269) {
tmp = 1.0 / ((sqrt((V / A)) * sqrt(l)) / c0);
} else if ((V * l) <= -4e-306) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-316) {
tmp = c0 * pow((cbrt((A / V)) / cbrt(l)), 1.5);
} else if ((V * l) <= 4e+278) {
tmp = c0 * (pow((V * l), -0.5) * pow((1.0 / A), -0.5));
} else {
tmp = c0 * pow((cbrt((A / l)) / cbrt(V)), 1.5);
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+269) {
tmp = 1.0 / ((Math.sqrt((V / A)) * Math.sqrt(l)) / c0);
} else if ((V * l) <= -4e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-316) {
tmp = c0 * Math.pow((Math.cbrt((A / V)) / Math.cbrt(l)), 1.5);
} else if ((V * l) <= 4e+278) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.pow((1.0 / A), -0.5));
} else {
tmp = c0 * Math.pow((Math.cbrt((A / l)) / Math.cbrt(V)), 1.5);
}
return tmp;
}
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+269) tmp = Float64(1.0 / Float64(Float64(sqrt(Float64(V / A)) * sqrt(l)) / c0)); elseif (Float64(V * l) <= -4e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-316) tmp = Float64(c0 * (Float64(cbrt(Float64(A / V)) / cbrt(l)) ^ 1.5)); elseif (Float64(V * l) <= 4e+278) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * (Float64(1.0 / A) ^ -0.5))); else tmp = Float64(c0 * (Float64(cbrt(Float64(A / l)) / cbrt(V)) ^ 1.5)); end return tmp end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+269], N[(1.0 / N[(N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-316], N[(c0 * N[Power[N[(N[Power[N[(A / V), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+278], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Power[N[(1.0 / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(N[Power[N[(A / l), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[V, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+269}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot {\left(\frac{1}{A}\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e269Initial program 59.4%
associate-/r*80.8%
div-inv80.9%
Applied egg-rr80.9%
un-div-inv80.8%
associate-/r*59.4%
sqrt-undiv0.0%
clear-num0.0%
sqrt-div56.9%
un-div-inv56.9%
clear-num57.1%
div-inv57.1%
*-commutative57.1%
associate-*l*78.5%
div-inv78.5%
Applied egg-rr78.5%
*-commutative78.5%
sqrt-prod38.7%
Applied egg-rr38.7%
if -1e269 < (*.f64 V l) < -4.00000000000000011e-306Initial program 82.7%
frac-2neg82.7%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -4.00000000000000011e-306 < (*.f64 V l) < 2.000000017e-316Initial program 38.1%
pow1/238.1%
add-cube-cbrt38.1%
pow338.1%
pow-pow38.1%
metadata-eval38.1%
Applied egg-rr38.1%
associate-/r*79.5%
un-div-inv79.5%
*-commutative79.5%
cbrt-prod93.5%
cbrt-div93.2%
metadata-eval93.2%
Applied egg-rr93.2%
associate-*l/93.2%
*-lft-identity93.2%
Simplified93.2%
if 2.000000017e-316 < (*.f64 V l) < 3.99999999999999985e278Initial program 85.9%
associate-/r*77.4%
div-inv77.4%
Applied egg-rr77.4%
un-div-inv77.4%
associate-/r*85.9%
clear-num84.8%
sqrt-div86.3%
metadata-eval86.3%
pow1/286.3%
pow-flip86.5%
div-inv86.5%
metadata-eval86.5%
unpow-prod-down99.5%
Applied egg-rr99.5%
if 3.99999999999999985e278 < (*.f64 V l) Initial program 24.8%
pow1/224.8%
add-cube-cbrt24.8%
pow324.8%
pow-pow24.8%
metadata-eval24.8%
Applied egg-rr24.8%
associate-/r*57.9%
un-div-inv57.9%
associate-*l/57.9%
cbrt-div74.0%
div-inv74.0%
Applied egg-rr74.0%
Final simplification92.1%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+269)
(/ 1.0 (/ (* (sqrt (/ V A)) (sqrt l)) c0))
(if (<= (* V l) -4e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-316)
(* c0 (pow (* V (/ l A)) -0.5))
(if (<= (* V l) 4e+278)
(* c0 (* (pow (* V l) -0.5) (pow (/ 1.0 A) -0.5)))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+269) {
tmp = 1.0 / ((sqrt((V / A)) * sqrt(l)) / c0);
} else if ((V * l) <= -4e-306) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-316) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else if ((V * l) <= 4e+278) {
tmp = c0 * (pow((V * l), -0.5) * pow((1.0 / A), -0.5));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-1d+269)) then
tmp = 1.0d0 / ((sqrt((v / a)) * sqrt(l)) / c0)
else if ((v * l) <= (-4d-306)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 2d-316) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else if ((v * l) <= 4d+278) then
tmp = c0 * (((v * l) ** (-0.5d0)) * ((1.0d0 / a) ** (-0.5d0)))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+269) {
tmp = 1.0 / ((Math.sqrt((V / A)) * Math.sqrt(l)) / c0);
} else if ((V * l) <= -4e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-316) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else if ((V * l) <= 4e+278) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.pow((1.0 / A), -0.5));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+269: tmp = 1.0 / ((math.sqrt((V / A)) * math.sqrt(l)) / c0) elif (V * l) <= -4e-306: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-316: tmp = c0 * math.pow((V * (l / A)), -0.5) elif (V * l) <= 4e+278: tmp = c0 * (math.pow((V * l), -0.5) * math.pow((1.0 / A), -0.5)) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+269) tmp = Float64(1.0 / Float64(Float64(sqrt(Float64(V / A)) * sqrt(l)) / c0)); elseif (Float64(V * l) <= -4e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-316) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); elseif (Float64(V * l) <= 4e+278) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * (Float64(1.0 / A) ^ -0.5))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e+269)
tmp = 1.0 / ((sqrt((V / A)) * sqrt(l)) / c0);
elseif ((V * l) <= -4e-306)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-316)
tmp = c0 * ((V * (l / A)) ^ -0.5);
elseif ((V * l) <= 4e+278)
tmp = c0 * (((V * l) ^ -0.5) * ((1.0 / A) ^ -0.5));
else
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+269], N[(1.0 / N[(N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-316], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+278], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Power[N[(1.0 / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+269}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot {\left(\frac{1}{A}\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e269Initial program 59.4%
associate-/r*80.8%
div-inv80.9%
Applied egg-rr80.9%
un-div-inv80.8%
associate-/r*59.4%
sqrt-undiv0.0%
clear-num0.0%
sqrt-div56.9%
un-div-inv56.9%
clear-num57.1%
div-inv57.1%
*-commutative57.1%
associate-*l*78.5%
div-inv78.5%
Applied egg-rr78.5%
*-commutative78.5%
sqrt-prod38.7%
Applied egg-rr38.7%
if -1e269 < (*.f64 V l) < -4.00000000000000011e-306Initial program 82.7%
frac-2neg82.7%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -4.00000000000000011e-306 < (*.f64 V l) < 2.000000017e-316Initial program 38.1%
pow1/238.1%
clear-num38.1%
inv-pow38.1%
pow-pow38.1%
associate-/l*79.9%
metadata-eval79.9%
Applied egg-rr79.9%
associate-/l*38.1%
*-lft-identity38.1%
times-frac79.9%
/-rgt-identity79.9%
Simplified79.9%
if 2.000000017e-316 < (*.f64 V l) < 3.99999999999999985e278Initial program 85.9%
associate-/r*77.4%
div-inv77.4%
Applied egg-rr77.4%
un-div-inv77.4%
associate-/r*85.9%
clear-num84.8%
sqrt-div86.3%
metadata-eval86.3%
pow1/286.3%
pow-flip86.5%
div-inv86.5%
metadata-eval86.5%
unpow-prod-down99.5%
Applied egg-rr99.5%
if 3.99999999999999985e278 < (*.f64 V l) Initial program 24.8%
associate-/r*58.2%
div-inv58.2%
Applied egg-rr58.2%
Final simplification88.9%
NOTE: 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)) (sqrt l)))))
(if (<= (* V l) -2e+252)
t_0
(if (<= (* V l) -2e-143)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 4e+278)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (sqrt (* (/ A V) (/ 1.0 l))))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -2e+252) {
tmp = t_0;
} else if ((V * l) <= -2e-143) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+278) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
NOTE: 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)) / sqrt(l))
if ((v * l) <= (-2d+252)) then
tmp = t_0
else if ((v * l) <= (-2d-143)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 4d+278) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+252) {
tmp = t_0;
} else if ((V * l) <= -2e-143) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+278) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+252: tmp = t_0 elif (V * l) <= -2e-143: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 4e+278: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+252) tmp = t_0; elseif (Float64(V * l) <= -2e-143) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 4e+278) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+252)
tmp = t_0;
elseif ((V * l) <= -2e-143)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 4e+278)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+252], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-143], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 4e+278], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+252}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-143}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000002e252 or -1.9999999999999999e-143 < (*.f64 V l) < -0.0Initial program 47.4%
associate-/r*70.8%
sqrt-div43.4%
Applied egg-rr43.4%
if -2.0000000000000002e252 < (*.f64 V l) < -1.9999999999999999e-143Initial program 93.7%
pow1/293.7%
clear-num93.6%
inv-pow93.6%
pow-pow95.0%
associate-/l*76.2%
metadata-eval76.2%
Applied egg-rr76.2%
associate-/l*95.0%
Simplified95.0%
if -0.0 < (*.f64 V l) < 3.99999999999999985e278Initial program 85.4%
sqrt-div98.6%
associate-*r/95.3%
Applied egg-rr95.3%
associate-*l/96.5%
Simplified96.5%
if 3.99999999999999985e278 < (*.f64 V l) Initial program 24.8%
associate-/r*58.2%
div-inv58.2%
Applied egg-rr58.2%
Final simplification77.3%
NOTE: 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)) (sqrt l)))))
(if (<= (* V l) -2e+252)
t_0
(if (<= (* V l) -2e-143)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 4e+278)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (* (/ A V) (/ 1.0 l))))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -2e+252) {
tmp = t_0;
} else if ((V * l) <= -2e-143) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+278) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
NOTE: 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)) / sqrt(l))
if ((v * l) <= (-2d+252)) then
tmp = t_0
else if ((v * l) <= (-2d-143)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 4d+278) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+252) {
tmp = t_0;
} else if ((V * l) <= -2e-143) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+278) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+252: tmp = t_0 elif (V * l) <= -2e-143: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 4e+278: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+252) tmp = t_0; elseif (Float64(V * l) <= -2e-143) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 4e+278) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+252)
tmp = t_0;
elseif ((V * l) <= -2e-143)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 4e+278)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+252], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-143], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 4e+278], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+252}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-143}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000002e252 or -1.9999999999999999e-143 < (*.f64 V l) < -0.0Initial program 47.4%
associate-/r*70.8%
sqrt-div43.4%
Applied egg-rr43.4%
if -2.0000000000000002e252 < (*.f64 V l) < -1.9999999999999999e-143Initial program 93.7%
pow1/293.7%
clear-num93.6%
inv-pow93.6%
pow-pow95.0%
associate-/l*76.2%
metadata-eval76.2%
Applied egg-rr76.2%
associate-/l*95.0%
Simplified95.0%
if -0.0 < (*.f64 V l) < 3.99999999999999985e278Initial program 85.4%
sqrt-div98.6%
associate-*r/95.3%
Applied egg-rr95.3%
*-commutative95.3%
associate-*l/98.6%
Simplified98.6%
if 3.99999999999999985e278 < (*.f64 V l) Initial program 24.8%
associate-/r*58.2%
div-inv58.2%
Applied egg-rr58.2%
Final simplification78.1%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (* (pow l -0.5) (sqrt (/ A V))))))
(if (<= (* V l) -2e+252)
t_0
(if (<= (* V l) -1e-226)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 4e+278)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (* (/ A V) (/ 1.0 l))))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (pow(l, -0.5) * sqrt((A / V)));
double tmp;
if ((V * l) <= -2e+252) {
tmp = t_0;
} else if ((V * l) <= -1e-226) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+278) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
NOTE: 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 * ((l ** (-0.5d0)) * sqrt((a / v)))
if ((v * l) <= (-2d+252)) then
tmp = t_0
else if ((v * l) <= (-1d-226)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 4d+278) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.pow(l, -0.5) * Math.sqrt((A / V)));
double tmp;
if ((V * l) <= -2e+252) {
tmp = t_0;
} else if ((V * l) <= -1e-226) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 4e+278) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.pow(l, -0.5) * math.sqrt((A / V))) tmp = 0 if (V * l) <= -2e+252: tmp = t_0 elif (V * l) <= -1e-226: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 4e+278: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))) tmp = 0.0 if (Float64(V * l) <= -2e+252) tmp = t_0; elseif (Float64(V * l) <= -1e-226) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 4e+278) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * ((l ^ -0.5) * sqrt((A / V)));
tmp = 0.0;
if ((V * l) <= -2e+252)
tmp = t_0;
elseif ((V * l) <= -1e-226)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 4e+278)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+252], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-226], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 4e+278], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+252}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-226}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000002e252 or -9.99999999999999921e-227 < (*.f64 V l) < -0.0Initial program 40.3%
associate-/r*68.1%
div-inv68.1%
Applied egg-rr68.1%
*-commutative68.1%
sqrt-prod43.7%
inv-pow43.7%
sqrt-pow143.8%
metadata-eval43.8%
Applied egg-rr43.8%
if -2.0000000000000002e252 < (*.f64 V l) < -9.99999999999999921e-227Initial program 92.2%
pow1/292.2%
clear-num92.2%
inv-pow92.2%
pow-pow93.4%
associate-/l*77.4%
metadata-eval77.4%
Applied egg-rr77.4%
associate-/l*93.4%
Simplified93.4%
if -0.0 < (*.f64 V l) < 3.99999999999999985e278Initial program 85.4%
sqrt-div98.6%
associate-*r/95.3%
Applied egg-rr95.3%
*-commutative95.3%
associate-*l/98.6%
Simplified98.6%
if 3.99999999999999985e278 < (*.f64 V l) Initial program 24.8%
associate-/r*58.2%
div-inv58.2%
Applied egg-rr58.2%
Final simplification80.1%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e+296)
(* c0 (* (pow l -0.5) (sqrt (/ A V))))
(if (<= (* V l) -4e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-316)
(* c0 (pow (* V (/ l A)) -0.5))
(if (<= (* V l) 4e+278)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+296) {
tmp = c0 * (pow(l, -0.5) * sqrt((A / V)));
} else if ((V * l) <= -4e-306) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-316) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else if ((V * l) <= 4e+278) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d+296)) then
tmp = c0 * ((l ** (-0.5d0)) * sqrt((a / v)))
else if ((v * l) <= (-4d-306)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 2d-316) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else if ((v * l) <= 4d+278) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+296) {
tmp = c0 * (Math.pow(l, -0.5) * Math.sqrt((A / V)));
} else if ((V * l) <= -4e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-316) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else if ((V * l) <= 4e+278) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+296: tmp = c0 * (math.pow(l, -0.5) * math.sqrt((A / V))) elif (V * l) <= -4e-306: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-316: tmp = c0 * math.pow((V * (l / A)), -0.5) elif (V * l) <= 4e+278: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+296) tmp = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -4e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-316) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); elseif (Float64(V * l) <= 4e+278) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e+296)
tmp = c0 * ((l ^ -0.5) * sqrt((A / V)));
elseif ((V * l) <= -4e-306)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-316)
tmp = c0 * ((V * (l / A)) ^ -0.5);
elseif ((V * l) <= 4e+278)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+296], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-316], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+278], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+296}:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000001e296Initial program 51.8%
associate-/r*79.2%
div-inv79.2%
Applied egg-rr79.2%
*-commutative79.2%
sqrt-prod28.3%
inv-pow28.3%
sqrt-pow128.5%
metadata-eval28.5%
Applied egg-rr28.5%
if -5.0000000000000001e296 < (*.f64 V l) < -4.00000000000000011e-306Initial program 82.9%
frac-2neg82.9%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -4.00000000000000011e-306 < (*.f64 V l) < 2.000000017e-316Initial program 38.1%
pow1/238.1%
clear-num38.1%
inv-pow38.1%
pow-pow38.1%
associate-/l*79.9%
metadata-eval79.9%
Applied egg-rr79.9%
associate-/l*38.1%
*-lft-identity38.1%
times-frac79.9%
/-rgt-identity79.9%
Simplified79.9%
if 2.000000017e-316 < (*.f64 V l) < 3.99999999999999985e278Initial program 85.9%
sqrt-div99.4%
associate-*r/96.1%
Applied egg-rr96.1%
*-commutative96.1%
associate-*l/99.4%
Simplified99.4%
if 3.99999999999999985e278 < (*.f64 V l) Initial program 24.8%
associate-/r*58.2%
div-inv58.2%
Applied egg-rr58.2%
Final simplification89.3%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+269)
(/ 1.0 (/ (* (sqrt (/ V A)) (sqrt l)) c0))
(if (<= (* V l) -4e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-316)
(* c0 (pow (* V (/ l A)) -0.5))
(if (<= (* V l) 4e+278)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+269) {
tmp = 1.0 / ((sqrt((V / A)) * sqrt(l)) / c0);
} else if ((V * l) <= -4e-306) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-316) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else if ((V * l) <= 4e+278) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-1d+269)) then
tmp = 1.0d0 / ((sqrt((v / a)) * sqrt(l)) / c0)
else if ((v * l) <= (-4d-306)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 2d-316) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else if ((v * l) <= 4d+278) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+269) {
tmp = 1.0 / ((Math.sqrt((V / A)) * Math.sqrt(l)) / c0);
} else if ((V * l) <= -4e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-316) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else if ((V * l) <= 4e+278) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+269: tmp = 1.0 / ((math.sqrt((V / A)) * math.sqrt(l)) / c0) elif (V * l) <= -4e-306: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-316: tmp = c0 * math.pow((V * (l / A)), -0.5) elif (V * l) <= 4e+278: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+269) tmp = Float64(1.0 / Float64(Float64(sqrt(Float64(V / A)) * sqrt(l)) / c0)); elseif (Float64(V * l) <= -4e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-316) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); elseif (Float64(V * l) <= 4e+278) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e+269)
tmp = 1.0 / ((sqrt((V / A)) * sqrt(l)) / c0);
elseif ((V * l) <= -4e-306)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-316)
tmp = c0 * ((V * (l / A)) ^ -0.5);
elseif ((V * l) <= 4e+278)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+269], N[(1.0 / N[(N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-316], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+278], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+269}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e269Initial program 59.4%
associate-/r*80.8%
div-inv80.9%
Applied egg-rr80.9%
un-div-inv80.8%
associate-/r*59.4%
sqrt-undiv0.0%
clear-num0.0%
sqrt-div56.9%
un-div-inv56.9%
clear-num57.1%
div-inv57.1%
*-commutative57.1%
associate-*l*78.5%
div-inv78.5%
Applied egg-rr78.5%
*-commutative78.5%
sqrt-prod38.7%
Applied egg-rr38.7%
if -1e269 < (*.f64 V l) < -4.00000000000000011e-306Initial program 82.7%
frac-2neg82.7%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -4.00000000000000011e-306 < (*.f64 V l) < 2.000000017e-316Initial program 38.1%
pow1/238.1%
clear-num38.1%
inv-pow38.1%
pow-pow38.1%
associate-/l*79.9%
metadata-eval79.9%
Applied egg-rr79.9%
associate-/l*38.1%
*-lft-identity38.1%
times-frac79.9%
/-rgt-identity79.9%
Simplified79.9%
if 2.000000017e-316 < (*.f64 V l) < 3.99999999999999985e278Initial program 85.9%
sqrt-div99.4%
associate-*r/96.1%
Applied egg-rr96.1%
*-commutative96.1%
associate-*l/99.4%
Simplified99.4%
if 3.99999999999999985e278 < (*.f64 V l) Initial program 24.8%
associate-/r*58.2%
div-inv58.2%
Applied egg-rr58.2%
Final simplification88.9%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (/ c0 (sqrt (* l (/ V A)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 / sqrt((l * (V / A)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-5d-310)) then
tmp = c0 / sqrt((l * (v / a)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 / math.sqrt((l * (V / A))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 / sqrt((l * (V / A)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: 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[Sqrt[N[(l * 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}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 71.1%
associate-/r*72.3%
div-inv72.3%
Applied egg-rr72.3%
un-div-inv72.3%
associate-/r*71.1%
sqrt-undiv42.4%
clear-num42.3%
sqrt-div71.7%
un-div-inv71.8%
div-inv71.7%
*-commutative71.7%
associate-*l*72.6%
div-inv72.7%
Applied egg-rr72.7%
if -4.999999999999985e-310 < l Initial program 71.1%
associate-/r*76.7%
sqrt-div84.5%
Applied egg-rr84.5%
Final simplification78.1%
NOTE: 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-319) (not (<= t_0 5e+303)))
(* c0 (sqrt (/ (/ A l) V)))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 5e-319) || !(t_0 <= 5e+303)) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: 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-319) .or. (.not. (t_0 <= 5d+303))) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert 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-319) || !(t_0 <= 5e+303)) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 5e-319) or not (t_0 <= 5e+303): tmp = c0 * math.sqrt(((A / l) / V)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 5e-319) || !(t_0 <= 5e+303)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 5e-319) || ~((t_0 <= 5e+303)))
tmp = c0 * sqrt(((A / l) / V));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: 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-319], N[Not[LessEqual[t$95$0, 5e+303]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-319} \lor \neg \left(t_0 \leq 5 \cdot 10^{+303}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.9999937e-319 or 4.9999999999999997e303 < (/.f64 A (*.f64 V l)) Initial program 33.4%
associate-/r*56.2%
div-inv56.2%
Applied egg-rr56.2%
associate-*l/56.1%
div-inv56.2%
Applied egg-rr56.2%
if 4.9999937e-319 < (/.f64 A (*.f64 V l)) < 4.9999999999999997e303Initial program 99.1%
Final simplification80.8%
NOTE: 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 (<= t_0 5e-319)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+304) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-319) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+304) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: 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-319) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+304) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert 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-319) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+304) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-319: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+304: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-319) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+304) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-319)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+304)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: 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[LessEqual[t$95$0, 5e-319], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+304], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-319}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.9999937e-319Initial program 39.8%
associate-/r*61.1%
div-inv61.1%
Applied egg-rr61.1%
associate-*l/61.1%
div-inv61.1%
Applied egg-rr61.1%
if 4.9999937e-319 < (/.f64 A (*.f64 V l)) < 1.9999999999999999e304Initial program 99.1%
if 1.9999999999999999e304 < (/.f64 A (*.f64 V l)) Initial program 25.7%
associate-/r*50.5%
div-inv50.4%
Applied egg-rr50.4%
un-div-inv50.5%
associate-/r*25.7%
sqrt-undiv24.8%
clear-num24.8%
sqrt-div30.1%
un-div-inv30.1%
div-inv30.1%
*-commutative30.1%
associate-*l*53.2%
div-inv53.3%
Applied egg-rr53.3%
Final simplification81.4%
NOTE: 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(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: 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 V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: 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}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 71.1%
Final simplification71.1%
herbie shell --seed 2023238
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))