Average Error: 19.7 → 9.0
Time: 8.6s
Precision: binary64
\[[V, l] = \mathsf{sort}([V, l]) \\]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} t_0 := c0 \cdot \frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}\\ \mathbf{if}\;V \cdot \ell \leq -1.4355172731589321 \cdot 10^{+190}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -1.8242966002800545 \cdot 10^{-93}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 9.73622505 \cdot 10^{-315}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq 8.463646756495044 \cdot 10^{+306}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right)\\ \end{array} \]
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (* c0 (/ (sqrt (* (/ 1.0 V) A)) (sqrt l)))))
   (if (<= (* V l) -1.4355172731589321e+190)
     t_0
     (if (<= (* V l) -1.8242966002800545e-93)
       (* c0 (sqrt (/ A (* V l))))
       (if (<= (* V l) 9.73622505e-315)
         t_0
         (if (<= (* V l) 8.463646756495044e+306)
           (* c0 (/ (sqrt A) (sqrt (* V l))))
           (*
            c0
            (* (sqrt (/ (* (cbrt A) (cbrt A)) V)) (sqrt (/ (cbrt A) l))))))))))
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 = c0 * (sqrt(((1.0 / V) * A)) / sqrt(l));
	double tmp;
	if ((V * l) <= -1.4355172731589321e+190) {
		tmp = t_0;
	} else if ((V * l) <= -1.8242966002800545e-93) {
		tmp = c0 * sqrt((A / (V * l)));
	} else if ((V * l) <= 9.73622505e-315) {
		tmp = t_0;
	} else if ((V * l) <= 8.463646756495044e+306) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * (sqrt(((cbrt(A) * cbrt(A)) / V)) * sqrt((cbrt(A) / l)));
	}
	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 = c0 * (Math.sqrt(((1.0 / V) * A)) / Math.sqrt(l));
	double tmp;
	if ((V * l) <= -1.4355172731589321e+190) {
		tmp = t_0;
	} else if ((V * l) <= -1.8242966002800545e-93) {
		tmp = c0 * Math.sqrt((A / (V * l)));
	} else if ((V * l) <= 9.73622505e-315) {
		tmp = t_0;
	} else if ((V * l) <= 8.463646756495044e+306) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * (Math.sqrt(((Math.cbrt(A) * Math.cbrt(A)) / V)) * Math.sqrt((Math.cbrt(A) / l)));
	}
	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 = Float64(c0 * Float64(sqrt(Float64(Float64(1.0 / V) * A)) / sqrt(l)))
	tmp = 0.0
	if (Float64(V * l) <= -1.4355172731589321e+190)
		tmp = t_0;
	elseif (Float64(V * l) <= -1.8242966002800545e-93)
		tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l))));
	elseif (Float64(V * l) <= 9.73622505e-315)
		tmp = t_0;
	elseif (Float64(V * l) <= 8.463646756495044e+306)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * Float64(sqrt(Float64(Float64(cbrt(A) * cbrt(A)) / V)) * sqrt(Float64(cbrt(A) / l))));
	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[(c0 * N[(N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] * A), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1.4355172731589321e+190], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1.8242966002800545e-93], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 9.73622505e-315], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 8.463646756495044e+306], 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[A, 1/3], $MachinePrecision] * N[Power[A, 1/3], $MachinePrecision]), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[Power[A, 1/3], $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -1.4355172731589321 \cdot 10^{+190}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;V \cdot \ell \leq -1.8242966002800545 \cdot 10^{-93}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 9.73622505 \cdot 10^{-315}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;V \cdot \ell \leq 8.463646756495044 \cdot 10^{+306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right)\\


\end{array}

Error

Bits error versus c0

Bits error versus A

Bits error versus V

Bits error versus l

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if (*.f64 V l) < -1.4355172731589321e190 or -1.82429660028005452e-93 < (*.f64 V l) < 9.7362250509e-315

    1. Initial program 34.1

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied *-un-lft-identity_binary6434.1

      \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{1 \cdot A}}{V \cdot \ell}} \]
    3. Applied times-frac_binary6424.5

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}} \]
    4. Applied associate-*r/_binary6424.3

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
    5. Applied sqrt-div_binary6415.6

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}} \]

    if -1.4355172731589321e190 < (*.f64 V l) < -1.82429660028005452e-93

    1. Initial program 4.7

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]

    if 9.7362250509e-315 < (*.f64 V l) < 8.4636467564950444e306

    1. Initial program 10.7

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied sqrt-div_binary640.4

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 8.4636467564950444e306 < (*.f64 V l)

    1. Initial program 42.3

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied add-cube-cbrt_binary6442.3

      \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\left(\sqrt[3]{A} \cdot \sqrt[3]{A}\right) \cdot \sqrt[3]{A}}}{V \cdot \ell}} \]
    3. Applied times-frac_binary6424.5

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \frac{\sqrt[3]{A}}{\ell}}} \]
    4. Applied sqrt-prod_binary6437.0

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification9.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1.4355172731589321 \cdot 10^{+190}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1.8242966002800545 \cdot 10^{-93}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 9.73622505 \cdot 10^{-315}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 8.463646756495044 \cdot 10^{+306}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right)\\ \end{array} \]

Reproduce

herbie shell --seed 2022129 
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  :precision binary64
  (* c0 (sqrt (/ A (* V l)))))