
(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 11 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
(if (<= (* V l) -1e+248)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-284)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(* c0 (* (sqrt A) (pow (* V l) -0.5)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+248) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-284) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
}
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+248)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-1d-284)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
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+248) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-284) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+248: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-284: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) else: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+248) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-284) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); else tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); 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+248)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-284)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
else
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
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+248], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-284], 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[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $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^{+248}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-284}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000005e248Initial program 46.1%
associate-/r*75.2%
sqrt-div39.4%
Applied egg-rr39.4%
if -1.00000000000000005e248 < (*.f64 V l) < -1.00000000000000004e-284Initial program 87.2%
frac-2neg87.2%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -1.00000000000000004e-284 < (*.f64 V l) < 0.0Initial program 42.5%
pow1/242.5%
clear-num42.5%
inv-pow42.5%
pow-pow42.5%
associate-/l*52.3%
metadata-eval52.3%
Applied egg-rr52.3%
associate-/l*42.5%
Simplified42.5%
add-sqr-sqrt42.5%
sqrt-unprod42.5%
pow-prod-up42.5%
metadata-eval42.5%
inv-pow42.5%
clear-num42.5%
associate-/r*52.3%
Applied egg-rr52.3%
associate-/l/42.5%
associate-/r*52.3%
frac-2neg52.3%
sqrt-div44.0%
Applied egg-rr44.0%
distribute-neg-frac44.0%
Simplified44.0%
if 0.0 < (*.f64 V l) Initial program 82.4%
div-inv81.6%
sqrt-prod92.0%
pow1/292.0%
inv-pow92.0%
pow-pow92.8%
metadata-eval92.8%
Applied egg-rr92.8%
Final simplification84.8%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-309) (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l))) (* c0 (* (sqrt A) (pow (* V l) -0.5)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
}
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 (a <= (-1d-309)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-309: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-309) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-309)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
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[A, -1e-309], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 77.1%
associate-/r*74.8%
sqrt-div40.1%
Applied egg-rr40.1%
frac-2neg40.1%
sqrt-div47.2%
Applied egg-rr47.2%
if -1.000000000000002e-309 < A Initial program 75.4%
div-inv74.7%
sqrt-prod83.8%
pow1/283.8%
inv-pow83.8%
pow-pow84.5%
metadata-eval84.5%
Applied egg-rr84.5%
Final simplification65.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+248)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-287)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-283)
(/ 1.0 (/ (sqrt (* V (/ l A))) c0))
(* c0 (* (sqrt A) (pow (* V l) -0.5)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+248) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-287) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-283) {
tmp = 1.0 / (sqrt((V * (l / A))) / c0);
} else {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
}
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+248)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-287)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 5d-283) then
tmp = 1.0d0 / (sqrt((v * (l / a))) / c0)
else
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
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+248) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-287) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-283) {
tmp = 1.0 / (Math.sqrt((V * (l / A))) / c0);
} else {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+248: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-287: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-283: tmp = 1.0 / (math.sqrt((V * (l / A))) / c0) else: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+248) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-287) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-283) tmp = Float64(1.0 / Float64(sqrt(Float64(V * Float64(l / A))) / c0)); else tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); 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+248)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-287)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-283)
tmp = 1.0 / (sqrt((V * (l / A))) / c0);
else
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
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+248], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-287], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-283], N[(1.0 / N[(N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $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^{+248}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-287}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-283}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{V \cdot \frac{\ell}{A}}}{c0}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000005e248Initial program 46.1%
associate-/r*75.2%
sqrt-div39.4%
Applied egg-rr39.4%
if -1.00000000000000005e248 < (*.f64 V l) < -5.00000000000000025e-287Initial program 86.3%
frac-2neg86.3%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -5.00000000000000025e-287 < (*.f64 V l) < 5.0000000000000001e-283Initial program 50.4%
pow1/250.4%
clear-num50.4%
inv-pow50.4%
pow-pow50.4%
associate-/l*59.6%
metadata-eval59.6%
Applied egg-rr59.6%
associate-/l*50.4%
Simplified50.4%
add-sqr-sqrt50.4%
sqrt-unprod50.4%
pow-prod-up50.4%
metadata-eval50.4%
inv-pow50.4%
clear-num50.4%
associate-/r*59.6%
Applied egg-rr59.6%
associate-/l/50.4%
associate-/r*59.6%
frac-2neg59.6%
sqrt-div49.1%
Applied egg-rr49.1%
distribute-neg-frac49.1%
Simplified49.1%
clear-num49.1%
div-inv49.1%
add-sqr-sqrt49.1%
sqrt-unprod26.0%
sqr-neg26.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
metadata-eval0.0%
add-sqr-sqrt0.0%
sqrt-unprod6.9%
sqr-neg6.9%
sqrt-unprod9.5%
add-sqr-sqrt24.7%
sqrt-div24.7%
clear-num24.7%
sqrt-prod59.5%
Applied egg-rr59.6%
if 5.0000000000000001e-283 < (*.f64 V l) Initial program 81.8%
div-inv81.8%
sqrt-prod92.7%
pow1/292.7%
inv-pow92.7%
pow-pow92.7%
metadata-eval92.7%
Applied egg-rr92.7%
Final simplification86.2%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= (/ A (* V l)) 1e-319) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (pow (/ (* V l) A) -0.5))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 1e-319) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * pow(((V * l) / A), -0.5);
}
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 ((a / (v * l)) <= 1d-319) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (((v * l) / a) ** (-0.5d0))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 1e-319) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (A / (V * l)) <= 1e-319: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * math.pow(((V * l) / A), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(A / Float64(V * l)) <= 1e-319) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((A / (V * l)) <= 1e-319)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (((V * l) / A) ^ -0.5);
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], 1e-319], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{A}{V \cdot \ell} \leq 10^{-319}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.99989e-320Initial program 32.0%
associate-/r*53.6%
sqrt-div46.7%
Applied egg-rr46.7%
if 9.99989e-320 < (/.f64 A (*.f64 V l)) Initial program 84.9%
pow1/284.9%
clear-num84.5%
inv-pow84.5%
pow-pow85.0%
associate-/l*77.6%
metadata-eval77.6%
Applied egg-rr77.6%
associate-/l*85.0%
Simplified85.0%
Final simplification78.7%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-309) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (* (sqrt A) (pow (* V l) -0.5)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
}
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 (a <= (-1d-309)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-309: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-309) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-309)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
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[A, -1e-309], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 77.1%
associate-/r*74.8%
sqrt-div40.1%
Applied egg-rr40.1%
if -1.000000000000002e-309 < A Initial program 75.4%
div-inv74.7%
sqrt-prod83.8%
pow1/283.8%
inv-pow83.8%
pow-pow84.5%
metadata-eval84.5%
Applied egg-rr84.5%
Final simplification61.4%
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) (* (sqrt A) (/ c0 (sqrt (* V l)))) (* 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 = sqrt(A) * (c0 / sqrt((V * l)));
} 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 = sqrt(a) * (c0 / sqrt((v * l)))
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 = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} 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 = math.sqrt(A) * (c0 / math.sqrt((V * l))) 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(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); 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 = sqrt(A) * (c0 / sqrt((V * l)));
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[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $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}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 77.4%
sqrt-div43.2%
associate-*r/41.9%
Applied egg-rr41.9%
associate-*l/42.7%
Simplified42.7%
if -4.999999999999985e-310 < l Initial program 75.0%
associate-/r*73.6%
sqrt-div84.7%
Applied egg-rr84.7%
Final simplification62.3%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-309) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(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) :: tmp
if (a <= (-1d-309)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-309: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) 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 (A <= -1e-309) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-309)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 / (sqrt((V * l)) / sqrt(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_] := If[LessEqual[A, -1e-309], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $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}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 77.1%
associate-/r*74.8%
sqrt-div40.1%
Applied egg-rr40.1%
if -1.000000000000002e-309 < A Initial program 75.4%
sqrt-div84.4%
associate-*r/80.8%
Applied egg-rr80.8%
associate-/l*84.4%
Simplified84.4%
Final simplification61.4%
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 V) l)))
(if (<= t_0 2e+280) (* 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 / V) / l));
} else if (t_0 <= 2e+280) {
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 / v) / l))
else if (t_0 <= 2d+280) 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 / V) / l));
} else if (t_0 <= 2e+280) {
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 / V) / l)) elif t_0 <= 2e+280: 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 / V) / l))); elseif (t_0 <= 2e+280) 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 / V) / l));
elseif (t_0 <= 2e+280)
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 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+280], 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}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+280}:\\
\;\;\;\;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.7%
pow1/231.7%
clear-num31.7%
inv-pow31.7%
pow-pow31.7%
associate-/l*55.4%
metadata-eval55.4%
Applied egg-rr55.4%
associate-/l*31.7%
Simplified31.7%
add-sqr-sqrt31.7%
sqrt-unprod31.7%
pow-prod-up31.7%
metadata-eval31.7%
inv-pow31.7%
clear-num31.7%
associate-/r*55.5%
Applied egg-rr55.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e280Initial program 98.7%
if 2.0000000000000001e280 < (/.f64 A (*.f64 V l)) Initial program 47.6%
sqrt-div35.9%
associate-*r/35.9%
Applied egg-rr35.9%
associate-*l/35.9%
Simplified35.9%
associate-*l/35.9%
associate-/l*35.9%
sqrt-div49.5%
associate-*r/52.4%
Applied egg-rr52.4%
Final simplification81.1%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= (/ A (* V l)) 5e-309) (* c0 (sqrt (/ (/ A V) l))) (* c0 (pow (/ (* V l) A) -0.5))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 5e-309) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * pow(((V * l) / A), -0.5);
}
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 ((a / (v * l)) <= 5d-309) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * (((v * l) / a) ** (-0.5d0))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 5e-309) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (A / (V * l)) <= 5e-309: tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.pow(((V * l) / A), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(A / Float64(V * l)) <= 5e-309) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((A / (V * l)) <= 5e-309)
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * (((V * l) / A) ^ -0.5);
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], 5e-309], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{A}{V \cdot \ell} \leq 5 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.9999999999999995e-309Initial program 33.6%
pow1/233.6%
clear-num29.9%
inv-pow29.9%
pow-pow29.9%
associate-/l*51.9%
metadata-eval51.9%
Applied egg-rr51.9%
associate-/l*29.9%
Simplified29.9%
add-sqr-sqrt29.9%
sqrt-unprod29.9%
pow-prod-up29.9%
metadata-eval29.9%
inv-pow29.9%
clear-num33.6%
associate-/r*54.6%
Applied egg-rr54.6%
if 4.9999999999999995e-309 < (/.f64 A (*.f64 V l)) Initial program 84.9%
pow1/284.9%
clear-num84.8%
inv-pow84.8%
pow-pow85.4%
associate-/l*77.9%
metadata-eval77.9%
Applied egg-rr77.9%
associate-/l*85.4%
Simplified85.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 (let* ((t_0 (/ A (* V l)))) (if (<= t_0 0.0) (* 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) {
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) 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) {
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: 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) 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)
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[LessEqual[t$95$0, 0.0], 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:\\
\;\;\;\;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.0Initial program 31.7%
pow1/231.7%
clear-num31.7%
inv-pow31.7%
pow-pow31.7%
associate-/l*55.4%
metadata-eval55.4%
Applied egg-rr55.4%
associate-/l*31.7%
Simplified31.7%
add-sqr-sqrt31.7%
sqrt-unprod31.7%
pow-prod-up31.7%
metadata-eval31.7%
inv-pow31.7%
clear-num31.7%
associate-/r*55.5%
Applied egg-rr55.5%
if 0.0 < (/.f64 A (*.f64 V l)) Initial program 84.5%
Final simplification80.0%
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 76.3%
Final simplification76.3%
herbie shell --seed 2023207
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))