Average Error: 19.4 → 8.8
Time: 9.0s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2.8438821766728927 \cdot 10^{-298}:\\ \;\;\;\;\left(c0 \cdot \left|\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}\right|\right) \cdot \sqrt{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}\\ \mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 3.237153052078643 \cdot 10^{+258}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2.8438821766728927 \cdot 10^{-298}:\\
\;\;\;\;\left(c0 \cdot \left|\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}\right|\right) \cdot \sqrt{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}\\

\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 3.237153052078643 \cdot 10^{+258}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \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.8438821766728927e-298)
   (*
    (* c0 (fabs (/ (cbrt A) (cbrt (* V l)))))
    (sqrt (* (cbrt A) (cbrt (/ 1.0 (* V l))))))
   (if (or (<= (* V l) 0.0) (not (<= (* V l) 3.237153052078643e+258)))
     (* c0 (sqrt (/ (/ A V) l)))
     (* c0 (/ (sqrt A) (sqrt (* 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.8438821766728927e-298) {
		tmp = (c0 * fabs(cbrt(A) / cbrt(V * l))) * sqrt(cbrt(A) * cbrt(1.0 / (V * l)));
	} else if (((V * l) <= 0.0) || !((V * l) <= 3.237153052078643e+258)) {
		tmp = c0 * sqrt((A / V) / l);
	} else {
		tmp = c0 * (sqrt(A) / sqrt(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 3 regimes
  2. if (*.f64 V l) < -2.84388217667289267e-298

    1. Initial program 15.1

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

      \[\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_111715.5

      \[\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. Applied associate-*r*_binary64_104115.5

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

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

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

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

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

    if -2.84388217667289267e-298 < (*.f64 V l) < -0.0 or 3.2371530520786429e258 < (*.f64 V l)

    1. Initial program 48.1

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

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

    if -0.0 < (*.f64 V l) < 3.2371530520786429e258

    1. Initial program 10.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2.8438821766728927 \cdot 10^{-298}:\\ \;\;\;\;\left(c0 \cdot \left|\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}\right|\right) \cdot \sqrt{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}\\ \mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 3.237153052078643 \cdot 10^{+258}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array}\]

Reproduce

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