Average Error: 19.5 → 12.0
Time: 6.9s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2.807710229850412 \cdot 10^{+282}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -3.3853497944081804 \cdot 10^{-198}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right)\\ \mathbf{elif}\;V \cdot \ell \leq 6.168225696975944 \cdot 10^{+297}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2.807710229850412 \cdot 10^{+282}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\

\end{array}
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -2.807710229850412e+282)
   (* c0 (sqrt (/ (/ A l) V)))
   (if (<= (* V l) -3.3853497944081804e-198)
     (* c0 (sqrt (/ A (* V l))))
     (if (<= (* V l) 0.0)
       (* c0 (* (sqrt (/ (* (cbrt A) (cbrt A)) V)) (sqrt (/ (cbrt A) l))))
       (if (<= (* V l) 6.168225696975944e+297)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (* c0 (sqrt (/ (* A (/ 1.0 V)) 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 tmp;
	if ((V * l) <= -2.807710229850412e+282) {
		tmp = c0 * sqrt((A / l) / V);
	} else if ((V * l) <= -3.3853497944081804e-198) {
		tmp = c0 * sqrt(A / (V * l));
	} else if ((V * l) <= 0.0) {
		tmp = c0 * (sqrt((cbrt(A) * cbrt(A)) / V) * sqrt(cbrt(A) / l));
	} else if ((V * l) <= 6.168225696975944e+297) {
		tmp = c0 * (sqrt(A) / sqrt(V * l));
	} else {
		tmp = c0 * sqrt((A * (1.0 / V)) / l);
	}
	return tmp;
}

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 5 regimes
  2. if (*.f64 V l) < -2.807710229850412e282

    1. Initial program 39.5

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt_binary64_113639.6

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \frac{\sqrt[3]{A}}{\ell}}}\]
    5. Using strategy rm
    6. Applied associate-*l/_binary64_104422.5

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\left(\sqrt[3]{A} \cdot \sqrt[3]{A}\right) \cdot \frac{\sqrt[3]{A}}{\ell}}{V}}}\]
    7. Simplified22.4

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

    if -2.807710229850412e282 < (*.f64 V l) < -3.38534979440818e-198

    1. Initial program 8.4

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

    if -3.38534979440818e-198 < (*.f64 V l) < 0.0

    1. Initial program 47.3

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt_binary64_113647.5

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

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

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right)}\]

    if 0.0 < (*.f64 V l) < 6.1682256969759444e297

    1. Initial program 10.6

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied sqrt-div_binary64_11180.6

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

    if 6.1682256969759444e297 < (*.f64 V l)

    1. Initial program 40.0

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity_binary64_110140.0

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}}\]
    5. Using strategy rm
    6. Applied associate-*r/_binary64_104322.5

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}}\]
  3. Recombined 5 regimes into one program.
  4. Final simplification12.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2.807710229850412 \cdot 10^{+282}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -3.3853497944081804 \cdot 10^{-198}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right)\\ \mathbf{elif}\;V \cdot \ell \leq 6.168225696975944 \cdot 10^{+297}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\ \end{array}\]

Reproduce

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