Average Error: 19.0 → 9.6
Time: 4.5s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -9.8813129168249 \cdot 10^{-324} \lor \neg \left(V \cdot \ell \leq 0\right) \land V \cdot \ell \leq 2.4879261280073773 \cdot 10^{+223}:\\ \;\;\;\;\left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}\right| \cdot c0\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -9.8813129168249 \cdot 10^{-324} \lor \neg \left(V \cdot \ell \leq 0\right) \land V \cdot \ell \leq 2.4879261280073773 \cdot 10^{+223}:\\
\;\;\;\;\left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}\right| \cdot c0\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\frac{V}{\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 (or (<= (* V l) -9.8813129168249e-324)
         (and (not (<= (* V l) 0.0)) (<= (* V l) 2.4879261280073773e+223)))
   (*
    (* (fabs (/ (cbrt A) (cbrt (* V l)))) c0)
    (sqrt (/ (cbrt A) (cbrt (* V l)))))
   (* c0 (sqrt (/ 1.0 (/ V (/ A l)))))))
double code(double c0, double A, double V, double l) {
	return ((double) (c0 * ((double) sqrt((A / ((double) (V * l)))))));
}
double code(double c0, double A, double V, double l) {
	double tmp;
	if (((((double) (V * l)) <= -9.8813129168249e-324) || (!(((double) (V * l)) <= 0.0) && (((double) (V * l)) <= 2.4879261280073773e+223)))) {
		tmp = ((double) (((double) (((double) fabs((((double) cbrt(A)) / ((double) cbrt(((double) (V * l))))))) * c0)) * ((double) sqrt((((double) cbrt(A)) / ((double) cbrt(((double) (V * l)))))))));
	} else {
		tmp = ((double) (c0 * ((double) sqrt((1.0 / (V / (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 2 regimes
  2. if (*.f64 V l) < -9.88131e-324 or 0.0 < (*.f64 V l) < 2.4879261280073773e223

    1. Initial program 12.6

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

      \[\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_binary6413.0

      \[\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*_binary6413.0

      \[\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. Simplified13.0

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

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

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

    if -9.88131e-324 < (*.f64 V l) < 0.0 or 2.4879261280073773e223 < (*.f64 V l)

    1. Initial program 44.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -9.8813129168249 \cdot 10^{-324} \lor \neg \left(V \cdot \ell \leq 0\right) \land V \cdot \ell \leq 2.4879261280073773 \cdot 10^{+223}:\\ \;\;\;\;\left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}\right| \cdot c0\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\sqrt[3]{V \cdot \ell}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}}\\ \end{array}\]

Reproduce

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