Average Error: 19.1 → 7.3
Time: 12.2s
Precision: binary64
\[[V, l]=\mathsf{sort}([V, l])\]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} t_0 := c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\ell}{\sqrt[3]{A}}}}\right)\\ \mathbf{if}\;V \cdot \ell \leq -3.6588971574741957 \cdot 10^{+204}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -2.4449299542679964 \cdot 10^{-232}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{\sqrt[3]{A}}{V \cdot \ell}}\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{1}{\sqrt[3]{A}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5.1518 \cdot 10^{-319}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array} \]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
t_0 := c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\ell}{\sqrt[3]{A}}}}\right)\\
\mathbf{if}\;V \cdot \ell \leq -3.6588971574741957 \cdot 10^{+204}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;V \cdot \ell \leq -2.4449299542679964 \cdot 10^{-232}:\\
\;\;\;\;\left(c0 \cdot \sqrt{\frac{\sqrt[3]{A}}{V \cdot \ell}}\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{1}{\sqrt[3]{A}}}}\\

\mathbf{elif}\;V \cdot \ell \leq 5.1518 \cdot 10^{-319}:\\
\;\;\;\;t_0\\

\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
 (let* ((t_0
         (* c0 (* (sqrt (/ (cbrt A) V)) (sqrt (/ (cbrt A) (/ l (cbrt A))))))))
   (if (<= (* V l) -3.6588971574741957e+204)
     t_0
     (if (<= (* V l) -2.4449299542679964e-232)
       (*
        (* c0 (sqrt (/ (cbrt A) (* V l))))
        (sqrt (/ (cbrt A) (/ 1.0 (cbrt A)))))
       (if (<= (* V l) 5.1518e-319) t_0 (* 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 t_0 = c0 * (sqrt(cbrt(A) / V) * sqrt(cbrt(A) / (l / cbrt(A))));
	double tmp;
	if ((V * l) <= -3.6588971574741957e+204) {
		tmp = t_0;
	} else if ((V * l) <= -2.4449299542679964e-232) {
		tmp = (c0 * sqrt(cbrt(A) / (V * l))) * sqrt(cbrt(A) / (1.0 / cbrt(A)));
	} else if ((V * l) <= 5.1518e-319) {
		tmp = t_0;
	} 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) < -3.65889715747419566e204 or -2.44492995426799638e-232 < (*.f64 V l) < 5.15182e-319

    1. Initial program 40.7

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

      \[\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 associate-/l*_binary6440.9

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{\frac{V \cdot \ell}{\sqrt[3]{A}}}}} \]
    4. Applied *-un-lft-identity_binary6440.9

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

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

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

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

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

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

    if -3.65889715747419566e204 < (*.f64 V l) < -2.44492995426799638e-232

    1. Initial program 8.1

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

      \[\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 associate-/l*_binary648.6

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

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

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

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

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

    if 5.15182e-319 < (*.f64 V l)

    1. Initial program 14.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -3.6588971574741957 \cdot 10^{+204}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\ell}{\sqrt[3]{A}}}}\right)\\ \mathbf{elif}\;V \cdot \ell \leq -2.4449299542679964 \cdot 10^{-232}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{\sqrt[3]{A}}{V \cdot \ell}}\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{1}{\sqrt[3]{A}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5.1518 \cdot 10^{-319}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\ell}{\sqrt[3]{A}}}}\right)\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array} \]

Reproduce

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