(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (pow (cbrt A) 2.0)) (t_1 (cbrt t_0)) (t_2 (sqrt (/ A V))))
(if (<= (* V l) (- INFINITY))
(/ (* c0 t_2) (sqrt l))
(if (<= (* V l) -5.434208759382676e-103)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(* c0 (/ t_2 (sqrt l)))
(if (<= (* V l) 3.406287716144191e+305)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(*
c0
(/
(sqrt (* (* (cbrt (/ t_0 V)) (/ (cbrt A) l)) (* t_1 t_1)))
(fabs (cbrt V))))))))))double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
double code(double c0, double A, double V, double l) {
double t_0 = pow(cbrt(A), 2.0);
double t_1 = cbrt(t_0);
double t_2 = sqrt((A / V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0 * t_2) / sqrt(l);
} else if ((V * l) <= -5.434208759382676e-103) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_2 / sqrt(l));
} else if ((V * l) <= 3.406287716144191e+305) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * (sqrt(((cbrt((t_0 / V)) * (cbrt(A) / l)) * (t_1 * t_1))) / fabs(cbrt(V)));
}
return tmp;
}
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.pow(Math.cbrt(A), 2.0);
double t_1 = Math.cbrt(t_0);
double t_2 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 * t_2) / Math.sqrt(l);
} else if ((V * l) <= -5.434208759382676e-103) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_2 / Math.sqrt(l));
} else if ((V * l) <= 3.406287716144191e+305) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * (Math.sqrt(((Math.cbrt((t_0 / V)) * (Math.cbrt(A) / l)) * (t_1 * t_1))) / Math.abs(Math.cbrt(V)));
}
return tmp;
}
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function code(c0, A, V, l) t_0 = cbrt(A) ^ 2.0 t_1 = cbrt(t_0) t_2 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0 * t_2) / sqrt(l)); elseif (Float64(V * l) <= -5.434208759382676e-103) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(t_2 / sqrt(l))); elseif (Float64(V * l) <= 3.406287716144191e+305) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * Float64(sqrt(Float64(Float64(cbrt(Float64(t_0 / V)) * Float64(cbrt(A) / l)) * Float64(t_1 * t_1))) / abs(cbrt(V)))); end return tmp end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Power[N[Power[A, 1/3], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 1/3], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 * t$95$2), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5.434208759382676e-103], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(t$95$2 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 3.406287716144191e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(N[(N[Power[N[(t$95$0 / V), $MachinePrecision], 1/3], $MachinePrecision] * N[(N[Power[A, 1/3], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Abs[N[Power[V, 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
t_0 := {\left(\sqrt[3]{A}\right)}^{2}\\
t_1 := \sqrt[3]{t_0}\\
t_2 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0 \cdot t_2}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5.434208759382676 \cdot 10^{-103}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{t_2}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 3.406287716144191 \cdot 10^{+305}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\left(\sqrt[3]{\frac{t_0}{V}} \cdot \frac{\sqrt[3]{A}}{\ell}\right) \cdot \left(t_1 \cdot t_1\right)}}{\left|\sqrt[3]{V}\right|}\\
\end{array}



Bits error versus c0



Bits error versus A



Bits error versus V



Bits error versus l
Results
if (*.f64 V l) < -inf.0Initial program 42.1
Applied add-cube-cbrt_binary6442.1
Applied times-frac_binary6422.5
Applied associate-*r/_binary6422.5
Applied sqrt-div_binary6411.0
Applied associate-*r/_binary6411.5
Simplified11.3
if -inf.0 < (*.f64 V l) < -5.4342087593826757e-103Initial program 7.2
Applied add-cube-cbrt_binary647.7
Applied times-frac_binary6413.3
Taylor expanded in c0 around 0 7.2
if -5.4342087593826757e-103 < (*.f64 V l) < -0.0Initial program 38.6
Applied add-cube-cbrt_binary6438.9
Applied times-frac_binary6427.8
Applied associate-*r/_binary6428.3
Applied sqrt-div_binary6420.0
Simplified19.6
if -0.0 < (*.f64 V l) < 3.4062877161441909e305Initial program 10.9
Applied sqrt-div_binary640.7
if 3.4062877161441909e305 < (*.f64 V l) Initial program 41.1
Applied add-cube-cbrt_binary6441.1
Applied times-frac_binary6423.5
Applied add-cube-cbrt_binary6423.6
Applied associate-*l*_binary6423.6
Applied cbrt-div_binary6423.5
Applied associate-*l/_binary6423.5
Applied cbrt-div_binary6423.6
Applied associate-*l/_binary6423.6
Applied frac-times_binary6423.6
Applied sqrt-div_binary6414.6
Simplified15.0
Simplified15.0
Final simplification7.9
herbie shell --seed 2022131
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))