
(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 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 72.5%
pow1/272.5%
add-cube-cbrt72.1%
pow372.1%
pow-pow72.2%
metadata-eval72.2%
Applied egg-rr72.2%
associate-/r*74.6%
cbrt-div83.3%
Applied egg-rr83.3%
cbrt-div96.0%
Applied egg-rr96.0%
Final simplification96.0%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+306)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -2e-322)
(/ c0 (/ (sqrt (* V (- l))) (sqrt (- A))))
(if (or (<= (* V l) 5e-302) (not (<= (* V l) 5e+222)))
(* c0 (pow (/ (cbrt (/ A V)) (cbrt l)) 1.5))
(/ c0 (/ (sqrt (* V l)) (sqrt A)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+306) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -2e-322) {
tmp = c0 / (sqrt((V * -l)) / sqrt(-A));
} else if (((V * l) <= 5e-302) || !((V * l) <= 5e+222)) {
tmp = c0 * pow((cbrt((A / V)) / cbrt(l)), 1.5);
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+306) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -2e-322) {
tmp = c0 / (Math.sqrt((V * -l)) / Math.sqrt(-A));
} else if (((V * l) <= 5e-302) || !((V * l) <= 5e+222)) {
tmp = c0 * Math.pow((Math.cbrt((A / V)) / Math.cbrt(l)), 1.5);
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+306) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -2e-322) tmp = Float64(c0 / Float64(sqrt(Float64(V * Float64(-l))) / sqrt(Float64(-A)))); elseif ((Float64(V * l) <= 5e-302) || !(Float64(V * l) <= 5e+222)) tmp = Float64(c0 * (Float64(cbrt(Float64(A / V)) / cbrt(l)) ^ 1.5)); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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], -2e+306], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-322], N[(c0 / N[(N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 5e-302], N[Not[LessEqual[N[(V * l), $MachinePrecision], 5e+222]], $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[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+306}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-322}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \left(-\ell\right)}}{\sqrt{-A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-302} \lor \neg \left(V \cdot \ell \leq 5 \cdot 10^{+222}\right):\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000003e306Initial program 31.7%
add-cube-cbrt31.7%
*-commutative31.7%
times-frac63.3%
pow263.3%
Applied egg-rr63.3%
frac-times31.7%
unpow231.7%
add-cube-cbrt31.7%
*-commutative31.7%
*-un-lft-identity31.7%
associate-*l/31.7%
add-sqr-sqrt30.1%
sqrt-unprod30.3%
*-commutative30.3%
*-commutative30.3%
swap-sqr29.9%
Applied egg-rr29.9%
*-commutative29.9%
rem-square-sqrt29.9%
swap-sqr30.3%
associate-*l*30.3%
*-commutative30.3%
associate-*l*30.3%
rem-square-sqrt30.3%
associate-*l/30.2%
*-commutative30.2%
Simplified30.2%
Taylor expanded in c0 around 0 29.5%
times-frac58.6%
unpow258.6%
Simplified58.6%
*-commutative58.6%
sqrt-prod50.4%
sqrt-div45.8%
sqrt-prod40.9%
add-sqr-sqrt59.2%
Applied egg-rr59.2%
if -2.00000000000000003e306 < (*.f64 V l) < -1.97626e-322Initial program 83.9%
frac-2neg83.9%
sqrt-div98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
Applied egg-rr98.4%
associate-*r/95.2%
Applied egg-rr95.2%
associate-/l*98.5%
Simplified98.5%
if -1.97626e-322 < (*.f64 V l) < 5.00000000000000033e-302 or 5.00000000000000023e222 < (*.f64 V l) Initial program 43.8%
pow1/243.8%
add-cube-cbrt43.8%
pow343.8%
pow-pow43.8%
metadata-eval43.8%
Applied egg-rr43.8%
associate-/r*72.5%
cbrt-div81.5%
Applied egg-rr81.5%
if 5.00000000000000033e-302 < (*.f64 V l) < 5.00000000000000023e222Initial program 87.8%
sqrt-div99.5%
associate-*r/96.5%
Applied egg-rr96.5%
associate-/l*99.4%
Simplified99.4%
Final simplification91.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+306)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -2e-322)
(/ c0 (/ (sqrt (* V (- l))) (sqrt (- A))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 2e+243)))
(* c0 (pow (/ (cbrt (/ A l)) (cbrt V)) 1.5))
(/ c0 (/ (sqrt (* V l)) (sqrt A)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+306) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -2e-322) {
tmp = c0 / (sqrt((V * -l)) / sqrt(-A));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+243)) {
tmp = c0 * pow((cbrt((A / l)) / cbrt(V)), 1.5);
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+306) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -2e-322) {
tmp = c0 / (Math.sqrt((V * -l)) / Math.sqrt(-A));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+243)) {
tmp = c0 * Math.pow((Math.cbrt((A / l)) / Math.cbrt(V)), 1.5);
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+306) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -2e-322) tmp = Float64(c0 / Float64(sqrt(Float64(V * Float64(-l))) / sqrt(Float64(-A)))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 2e+243)) tmp = Float64(c0 * (Float64(cbrt(Float64(A / l)) / cbrt(V)) ^ 1.5)); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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], -2e+306], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-322], N[(c0 / N[(N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+243]], $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], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+306}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-322}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \left(-\ell\right)}}{\sqrt{-A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+243}\right):\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000003e306Initial program 31.7%
add-cube-cbrt31.7%
*-commutative31.7%
times-frac63.3%
pow263.3%
Applied egg-rr63.3%
frac-times31.7%
unpow231.7%
add-cube-cbrt31.7%
*-commutative31.7%
*-un-lft-identity31.7%
associate-*l/31.7%
add-sqr-sqrt30.1%
sqrt-unprod30.3%
*-commutative30.3%
*-commutative30.3%
swap-sqr29.9%
Applied egg-rr29.9%
*-commutative29.9%
rem-square-sqrt29.9%
swap-sqr30.3%
associate-*l*30.3%
*-commutative30.3%
associate-*l*30.3%
rem-square-sqrt30.3%
associate-*l/30.2%
*-commutative30.2%
Simplified30.2%
Taylor expanded in c0 around 0 29.5%
times-frac58.6%
unpow258.6%
Simplified58.6%
*-commutative58.6%
sqrt-prod50.4%
sqrt-div45.8%
sqrt-prod40.9%
add-sqr-sqrt59.2%
Applied egg-rr59.2%
if -2.00000000000000003e306 < (*.f64 V l) < -1.97626e-322Initial program 83.9%
frac-2neg83.9%
sqrt-div98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
Applied egg-rr98.4%
associate-*r/95.2%
Applied egg-rr95.2%
associate-/l*98.5%
Simplified98.5%
if -1.97626e-322 < (*.f64 V l) < -0.0 or 2.0000000000000001e243 < (*.f64 V l) Initial program 41.2%
pow1/241.2%
add-cube-cbrt41.2%
pow341.2%
pow-pow41.2%
metadata-eval41.2%
Applied egg-rr41.2%
add-cube-cbrt41.2%
unpow241.2%
*-commutative41.2%
frac-times72.2%
associate-*r/72.2%
cbrt-div83.5%
Applied egg-rr83.5%
associate-*l/83.6%
unpow283.6%
rem-3cbrt-lft83.7%
Simplified83.7%
if -0.0 < (*.f64 V l) < 2.0000000000000001e243Initial program 87.3%
sqrt-div98.7%
associate-*r/95.9%
Applied egg-rr95.9%
associate-/l*98.6%
Simplified98.6%
Final simplification92.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) -2e-322)
(* c0 (/ (sqrt (- A)) (* (sqrt (- V)) (sqrt l))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 2e+243)))
(* c0 (pow (/ (cbrt (/ A l)) (cbrt V)) 1.5))
(/ c0 (/ (sqrt (* V l)) (sqrt A))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-322) {
tmp = c0 * (sqrt(-A) / (sqrt(-V) * sqrt(l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+243)) {
tmp = c0 * pow((cbrt((A / l)) / cbrt(V)), 1.5);
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-322) {
tmp = c0 * (Math.sqrt(-A) / (Math.sqrt(-V) * Math.sqrt(l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+243)) {
tmp = c0 * Math.pow((Math.cbrt((A / l)) / Math.cbrt(V)), 1.5);
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e-322) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / Float64(sqrt(Float64(-V)) * sqrt(l)))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 2e+243)) tmp = Float64(c0 * (Float64(cbrt(Float64(A / l)) / cbrt(V)) ^ 1.5)); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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], -2e-322], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[(N[Sqrt[(-V)], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+243]], $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], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{-322}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+243}\right):\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.97626e-322Initial program 73.7%
frac-2neg73.7%
sqrt-div85.9%
*-commutative85.9%
distribute-rgt-neg-in85.9%
Applied egg-rr85.9%
pow1/285.9%
*-commutative85.9%
unpow-prod-down54.1%
pow1/254.1%
pow1/254.1%
Applied egg-rr54.1%
if -1.97626e-322 < (*.f64 V l) < -0.0 or 2.0000000000000001e243 < (*.f64 V l) Initial program 41.2%
pow1/241.2%
add-cube-cbrt41.2%
pow341.2%
pow-pow41.2%
metadata-eval41.2%
Applied egg-rr41.2%
add-cube-cbrt41.2%
unpow241.2%
*-commutative41.2%
frac-times72.2%
associate-*r/72.2%
cbrt-div83.5%
Applied egg-rr83.5%
associate-*l/83.6%
unpow283.6%
rem-3cbrt-lft83.7%
Simplified83.7%
if -0.0 < (*.f64 V l) < 2.0000000000000001e243Initial program 87.3%
sqrt-div98.7%
associate-*r/95.9%
Applied egg-rr95.9%
associate-/l*98.6%
Simplified98.6%
Final simplification76.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) (- INFINITY))
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -2e-322)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 5e+222)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (/ (/ A l) V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -2e-322) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 5e+222) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -2e-322) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 5e+222) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -2e-322: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 5e+222: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -2e-322) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 5e+222) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -2e-322)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 5e+222)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((A / l) / V));
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], (-Infinity)], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-322], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+222], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-322}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+222}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 31.6%
add-cube-cbrt31.6%
*-commutative31.6%
times-frac64.7%
pow264.7%
Applied egg-rr64.7%
frac-times31.6%
unpow231.6%
add-cube-cbrt31.6%
*-commutative31.6%
*-un-lft-identity31.6%
associate-*l/31.6%
add-sqr-sqrt31.6%
sqrt-unprod31.6%
*-commutative31.6%
*-commutative31.6%
swap-sqr31.2%
Applied egg-rr31.2%
*-commutative31.2%
rem-square-sqrt31.2%
swap-sqr31.6%
associate-*l*31.6%
*-commutative31.6%
associate-*l*31.6%
rem-square-sqrt31.6%
associate-*l/31.5%
*-commutative31.5%
Simplified31.5%
Taylor expanded in c0 around 0 30.7%
times-frac61.2%
unpow261.2%
Simplified61.2%
*-commutative61.2%
sqrt-prod52.7%
sqrt-div47.9%
sqrt-prod42.8%
add-sqr-sqrt57.3%
Applied egg-rr57.3%
if -inf.0 < (*.f64 V l) < -1.97626e-322Initial program 83.4%
frac-2neg83.4%
sqrt-div98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
Applied egg-rr98.4%
if -1.97626e-322 < (*.f64 V l) < -0.0Initial program 41.3%
add-cube-cbrt41.3%
*-commutative41.3%
times-frac72.0%
pow272.0%
Applied egg-rr72.0%
frac-times41.3%
unpow241.3%
add-cube-cbrt41.3%
*-commutative41.3%
*-un-lft-identity41.3%
associate-*l/41.3%
sqrt-prod20.6%
associate-*r*20.6%
sqrt-div20.6%
metadata-eval20.6%
div-inv20.6%
associate-/r/20.6%
sqrt-undiv41.3%
associate-*r/72.4%
Applied egg-rr72.4%
associate-*r/41.3%
associate-*l/72.4%
Simplified72.4%
if -0.0 < (*.f64 V l) < 5.00000000000000023e222Initial program 87.2%
sqrt-div98.7%
associate-*r/95.8%
Applied egg-rr95.8%
associate-/l*98.6%
Simplified98.6%
if 5.00000000000000023e222 < (*.f64 V l) Initial program 44.1%
pow1/244.1%
add-cube-cbrt44.2%
pow344.2%
pow-pow44.1%
metadata-eval44.1%
Applied egg-rr44.1%
add-cube-cbrt43.9%
unpow243.9%
*-commutative43.9%
frac-times73.9%
cbrt-prod83.8%
Applied egg-rr83.8%
Taylor expanded in c0 around 0 44.1%
*-commutative44.1%
associate-/l/74.3%
Simplified74.3%
Final simplification90.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) -2e+306)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -2e-322)
(/ c0 (/ (sqrt (* V (- l))) (sqrt (- A))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 5e+222)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (/ (/ A l) V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+306) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -2e-322) {
tmp = c0 / (sqrt((V * -l)) / sqrt(-A));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 5e+222) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
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) <= (-2d+306)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((v * l) <= (-2d-322)) then
tmp = c0 / (sqrt((v * -l)) / sqrt(-a))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 5d+222) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * sqrt(((a / l) / v))
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) <= -2e+306) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -2e-322) {
tmp = c0 / (Math.sqrt((V * -l)) / Math.sqrt(-A));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 5e+222) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+306: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -2e-322: tmp = c0 / (math.sqrt((V * -l)) / math.sqrt(-A)) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 5e+222: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+306) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -2e-322) tmp = Float64(c0 / Float64(sqrt(Float64(V * Float64(-l))) / sqrt(Float64(-A)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 5e+222) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+306)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -2e-322)
tmp = c0 / (sqrt((V * -l)) / sqrt(-A));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 5e+222)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((A / l) / V));
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], -2e+306], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-322], N[(c0 / N[(N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+222], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+306}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-322}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \left(-\ell\right)}}{\sqrt{-A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+222}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000003e306Initial program 31.7%
add-cube-cbrt31.7%
*-commutative31.7%
times-frac63.3%
pow263.3%
Applied egg-rr63.3%
frac-times31.7%
unpow231.7%
add-cube-cbrt31.7%
*-commutative31.7%
*-un-lft-identity31.7%
associate-*l/31.7%
add-sqr-sqrt30.1%
sqrt-unprod30.3%
*-commutative30.3%
*-commutative30.3%
swap-sqr29.9%
Applied egg-rr29.9%
*-commutative29.9%
rem-square-sqrt29.9%
swap-sqr30.3%
associate-*l*30.3%
*-commutative30.3%
associate-*l*30.3%
rem-square-sqrt30.3%
associate-*l/30.2%
*-commutative30.2%
Simplified30.2%
Taylor expanded in c0 around 0 29.5%
times-frac58.6%
unpow258.6%
Simplified58.6%
*-commutative58.6%
sqrt-prod50.4%
sqrt-div45.8%
sqrt-prod40.9%
add-sqr-sqrt59.2%
Applied egg-rr59.2%
if -2.00000000000000003e306 < (*.f64 V l) < -1.97626e-322Initial program 83.9%
frac-2neg83.9%
sqrt-div98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
Applied egg-rr98.4%
associate-*r/95.2%
Applied egg-rr95.2%
associate-/l*98.5%
Simplified98.5%
if -1.97626e-322 < (*.f64 V l) < -0.0Initial program 41.3%
add-cube-cbrt41.3%
*-commutative41.3%
times-frac72.0%
pow272.0%
Applied egg-rr72.0%
frac-times41.3%
unpow241.3%
add-cube-cbrt41.3%
*-commutative41.3%
*-un-lft-identity41.3%
associate-*l/41.3%
sqrt-prod20.6%
associate-*r*20.6%
sqrt-div20.6%
metadata-eval20.6%
div-inv20.6%
associate-/r/20.6%
sqrt-undiv41.3%
associate-*r/72.4%
Applied egg-rr72.4%
associate-*r/41.3%
associate-*l/72.4%
Simplified72.4%
if -0.0 < (*.f64 V l) < 5.00000000000000023e222Initial program 87.2%
sqrt-div98.7%
associate-*r/95.8%
Applied egg-rr95.8%
associate-/l*98.6%
Simplified98.6%
if 5.00000000000000023e222 < (*.f64 V l) Initial program 44.1%
pow1/244.1%
add-cube-cbrt44.2%
pow344.2%
pow-pow44.1%
metadata-eval44.1%
Applied egg-rr44.1%
add-cube-cbrt43.9%
unpow243.9%
*-commutative43.9%
frac-times73.9%
cbrt-prod83.8%
Applied egg-rr83.8%
Taylor expanded in c0 around 0 44.1%
*-commutative44.1%
associate-/l/74.3%
Simplified74.3%
Final simplification90.2%
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 (/ (/ A l) V))) (* 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(((A / l) / V));
} 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(((a / l) / v))
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(((A / l) / V));
} 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(((A / l) / V)) 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(Float64(A / l) / V))); 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(((A / l) / V));
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[(N[(A / l), $MachinePrecision] / V), $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}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 72.9%
pow1/272.9%
add-cube-cbrt72.6%
pow372.6%
pow-pow72.6%
metadata-eval72.6%
Applied egg-rr72.6%
add-cube-cbrt72.4%
unpow272.4%
*-commutative72.4%
frac-times72.5%
cbrt-prod82.0%
Applied egg-rr82.0%
Taylor expanded in c0 around 0 72.9%
*-commutative72.9%
associate-/l/72.6%
Simplified72.6%
if -4.999999999999985e-310 < l Initial program 72.2%
associate-/r*76.5%
sqrt-div86.4%
Applied egg-rr86.4%
Final simplification80.2%
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 (* V l)) (sqrt 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((V * l)) / sqrt(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((v * l)) / sqrt(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((V * l)) / Math.sqrt(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((V * l)) / math.sqrt(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 / Float64(sqrt(Float64(V * l)) / sqrt(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((V * l)) / sqrt(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[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $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}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 72.9%
sqrt-div42.8%
associate-*r/42.7%
Applied egg-rr42.7%
associate-/l*42.8%
Simplified42.8%
if -4.999999999999985e-310 < l Initial program 72.2%
associate-/r*76.5%
sqrt-div86.4%
Applied egg-rr86.4%
Final simplification66.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 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+250)
(* c0 (sqrt t_0))
(* c0 (/ 1.0 (sqrt (* V (/ l 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 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+250) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * (1.0 / sqrt((V * (l / 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 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+250) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * (1.0d0 / sqrt((v * (l / 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 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+250) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * (1.0 / Math.sqrt((V * (l / A))));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+250: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * (1.0 / math.sqrt((V * (l / 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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+250) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(V * Float64(l / 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 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+250)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * (1.0 / sqrt((V * (l / 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, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+250], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+250}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 31.4%
pow1/231.4%
add-cube-cbrt31.4%
pow331.4%
pow-pow31.4%
metadata-eval31.4%
Applied egg-rr31.4%
add-cube-cbrt31.4%
unpow231.4%
*-commutative31.4%
frac-times57.1%
cbrt-prod82.9%
Applied egg-rr82.9%
Taylor expanded in c0 around 0 31.4%
*-commutative31.4%
associate-/l/57.4%
Simplified57.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.9999999999999998e250Initial program 98.4%
if 1.9999999999999998e250 < (/.f64 A (*.f64 V l)) Initial program 47.7%
clear-num47.7%
sqrt-div48.9%
metadata-eval48.9%
associate-/l*62.0%
Applied egg-rr62.0%
associate-/l*48.9%
*-lft-identity48.9%
times-frac62.0%
/-rgt-identity62.0%
Simplified62.0%
Final simplification81.2%
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 0.0) (not (<= t_0 5e+288)))
(* c0 (sqrt (/ (/ A V) l)))
(* 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 <= 0.0) || !(t_0 <= 5e+288)) {
tmp = c0 * sqrt(((A / V) / l));
} 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 <= 0.0d0) .or. (.not. (t_0 <= 5d+288))) then
tmp = c0 * sqrt(((a / v) / l))
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 <= 0.0) || !(t_0 <= 5e+288)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} 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 <= 0.0) or not (t_0 <= 5e+288): tmp = c0 * math.sqrt(((A / V) / l)) 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 <= 0.0) || !(t_0 <= 5e+288)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); 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 <= 0.0) || ~((t_0 <= 5e+288)))
tmp = c0 * sqrt(((A / V) / l));
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, 0.0], N[Not[LessEqual[t$95$0, 5e+288]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $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 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+288}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5.0000000000000003e288 < (/.f64 A (*.f64 V l)) Initial program 35.1%
add-cube-cbrt35.1%
*-commutative35.1%
times-frac56.3%
pow256.3%
Applied egg-rr56.3%
frac-times35.1%
unpow235.1%
add-cube-cbrt35.1%
*-commutative35.1%
associate-/r*56.4%
Applied egg-rr56.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000003e288Initial program 98.5%
Final simplification81.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 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+250)))
(* 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 <= 0.0) || !(t_0 <= 2e+250)) {
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 <= 0.0d0) .or. (.not. (t_0 <= 2d+250))) 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 <= 0.0) || !(t_0 <= 2e+250)) {
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 <= 0.0) or not (t_0 <= 2e+250): 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 <= 0.0) || !(t_0 <= 2e+250)) 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 <= 0.0) || ~((t_0 <= 2e+250)))
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, 0.0], N[Not[LessEqual[t$95$0, 2e+250]], $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 0 \lor \neg \left(t_0 \leq 2 \cdot 10^{+250}\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)) < 0.0 or 1.9999999999999998e250 < (/.f64 A (*.f64 V l)) Initial program 40.8%
pow1/240.8%
add-cube-cbrt40.7%
pow340.7%
pow-pow40.7%
metadata-eval40.7%
Applied egg-rr40.7%
add-cube-cbrt40.6%
unpow240.6%
*-commutative40.6%
frac-times58.3%
cbrt-prod79.8%
Applied egg-rr79.8%
Taylor expanded in c0 around 0 40.8%
*-commutative40.8%
associate-/l/59.3%
Simplified59.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.9999999999999998e250Initial program 98.4%
Final simplification80.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 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+275) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l 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 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+275) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / 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 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+275) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / 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 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+275) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+275: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / 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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+275) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / 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 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+275)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / 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, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+275], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / 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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+275}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 31.4%
pow1/231.4%
add-cube-cbrt31.4%
pow331.4%
pow-pow31.4%
metadata-eval31.4%
Applied egg-rr31.4%
add-cube-cbrt31.4%
unpow231.4%
*-commutative31.4%
frac-times57.1%
cbrt-prod82.9%
Applied egg-rr82.9%
Taylor expanded in c0 around 0 31.4%
*-commutative31.4%
associate-/l/57.4%
Simplified57.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.99999999999999992e275Initial program 98.5%
if 1.99999999999999992e275 < (/.f64 A (*.f64 V l)) Initial program 40.5%
add-cube-cbrt40.5%
*-commutative40.5%
times-frac55.2%
pow255.2%
Applied egg-rr55.2%
frac-times40.5%
unpow240.5%
add-cube-cbrt40.5%
*-commutative40.5%
*-un-lft-identity40.5%
associate-*l/40.5%
sqrt-prod31.6%
associate-*r*31.6%
sqrt-div32.0%
metadata-eval32.0%
div-inv32.0%
associate-/r/32.0%
sqrt-undiv41.8%
associate-*r/56.8%
Applied egg-rr56.8%
Final simplification81.2%
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 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+288) (* 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 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+288) {
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 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+288) 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 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+288) {
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 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+288: 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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+288) 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 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+288)
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, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+288], 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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;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)) < 0.0Initial program 31.4%
pow1/231.4%
add-cube-cbrt31.4%
pow331.4%
pow-pow31.4%
metadata-eval31.4%
Applied egg-rr31.4%
add-cube-cbrt31.4%
unpow231.4%
*-commutative31.4%
frac-times57.1%
cbrt-prod82.9%
Applied egg-rr82.9%
Taylor expanded in c0 around 0 31.4%
*-commutative31.4%
associate-/l/57.4%
Simplified57.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000003e288Initial program 98.5%
if 5.0000000000000003e288 < (/.f64 A (*.f64 V l)) Initial program 38.4%
add-cube-cbrt38.4%
*-commutative38.4%
times-frac55.3%
pow255.3%
Applied egg-rr55.3%
frac-times38.4%
unpow238.4%
add-cube-cbrt38.4%
*-commutative38.4%
*-un-lft-identity38.4%
associate-*l/38.4%
sqrt-prod32.8%
associate-*r*32.8%
sqrt-div33.1%
metadata-eval33.1%
div-inv33.2%
associate-/r/33.2%
sqrt-undiv39.8%
associate-*r/57.0%
Applied egg-rr57.0%
associate-*r/39.8%
associate-*l/57.0%
Simplified57.0%
Final simplification81.6%
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 72.5%
Final simplification72.5%
herbie shell --seed 2023174
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))