Average Error: 18.9 → 9.3
Time: 4.1s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -2.7289556725804634 \cdot 10^{-280} \lor \neg \left(V \cdot \ell \leq 5.727760610342335 \cdot 10^{-290}\right):\\ \;\;\;\;c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}\right| \cdot \sqrt{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{V}}\right) \cdot \sqrt{\frac{A}{\ell}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq -2.7289556725804634 \cdot 10^{-280} \lor \neg \left(V \cdot \ell \leq 5.727760610342335 \cdot 10^{-290}\right):\\
\;\;\;\;c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}\right| \cdot \sqrt{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{V}}\right) \cdot \sqrt{\frac{A}{\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) (- INFINITY))
   (* c0 (sqrt (/ (/ A V) l)))
   (if (or (<= (* V l) -2.7289556725804634e-280)
           (not (<= (* V l) 5.727760610342335e-290)))
     (*
      c0
      (*
       (fabs (/ (cbrt A) (cbrt (* V l))))
       (sqrt (* (cbrt A) (cbrt (/ 1.0 (* V l)))))))
     (* (* c0 (sqrt (/ 1.0 V))) (sqrt (/ 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 tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = c0 * sqrt((A / V) / l);
	} else if (((V * l) <= -2.7289556725804634e-280) || !((V * l) <= 5.727760610342335e-290)) {
		tmp = c0 * (fabs(cbrt(A) / cbrt(V * l)) * sqrt(cbrt(A) * cbrt(1.0 / (V * l))));
	} else {
		tmp = (c0 * sqrt(1.0 / V)) * sqrt(A / 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 3 regimes
  2. if (*.f64 V l) < -inf.0

    1. Initial program 40.5

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied associate-/r*_binary64_70723.9

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

    if -inf.0 < (*.f64 V l) < -2.7289556725804634e-280 or 5.727760610342335e-290 < (*.f64 V l)

    1. Initial program 12.4

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

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

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

      \[\leadsto c0 \cdot \left(\color{blue}{\left|\sqrt[3]{\frac{A}{V \cdot \ell}}\right|} \cdot \sqrt{\sqrt[3]{\frac{A}{V \cdot \ell}}}\right)\]
    6. Using strategy rm
    7. Applied cbrt-div_binary64_79512.8

      \[\leadsto c0 \cdot \left(\left|\color{blue}{\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}}\right| \cdot \sqrt{\sqrt[3]{\frac{A}{V \cdot \ell}}}\right)\]
    8. Using strategy rm
    9. Applied div-inv_binary64_76012.8

      \[\leadsto c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}\right| \cdot \sqrt{\sqrt[3]{\color{blue}{A \cdot \frac{1}{V \cdot \ell}}}}\right)\]
    10. Applied cbrt-prod_binary64_7944.2

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

    if -2.7289556725804634e-280 < (*.f64 V l) < 5.727760610342335e-290

    1. Initial program 56.3

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

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

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

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{1}{V}} \cdot \sqrt{\frac{A}{\ell}}\right)}\]
    6. Applied associate-*r*_binary64_70339.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -2.7289556725804634 \cdot 10^{-280} \lor \neg \left(V \cdot \ell \leq 5.727760610342335 \cdot 10^{-290}\right):\\ \;\;\;\;c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}\right| \cdot \sqrt{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{V}}\right) \cdot \sqrt{\frac{A}{\ell}}\\ \end{array}\]

Reproduce

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