Average Error: 19.1 → 9.6
Time: 6.1s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -1.1138505052891914 \cdot 10^{289}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;V \cdot \ell \le -4.1616449878 \cdot 10^{-315}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\left(A \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}\right)\right) \cdot \sqrt[3]{1}}}{\left|\sqrt[3]{V \cdot \ell}\right|}\\ \mathbf{elif}\;V \cdot \ell \le 8.6598838 \cdot 10^{-319}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\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 \le -1.1138505052891914 \cdot 10^{289}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\

\mathbf{elif}\;V \cdot \ell \le -4.1616449878 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\left(A \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}\right)\right) \cdot \sqrt[3]{1}}}{\left|\sqrt[3]{V \cdot \ell}\right|}\\

\mathbf{elif}\;V \cdot \ell \le 8.6598838 \cdot 10^{-319}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\

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

\end{array}
double code(double c0, double A, double V, double l) {
	return ((double) (c0 * ((double) sqrt(((double) (A / ((double) (V * l))))))));
}
double code(double c0, double A, double V, double l) {
	double VAR;
	if ((((double) (V * l)) <= -1.1138505052891914e+289)) {
		VAR = ((double) (c0 * ((double) sqrt(((double) (((double) (A / l)) / V))))));
	} else {
		double VAR_1;
		if ((((double) (V * l)) <= -4.1616449878208e-315)) {
			VAR_1 = ((double) (c0 * ((double) (((double) sqrt(((double) (((double) (A * ((double) (((double) cbrt(1.0)) * ((double) cbrt(((double) (1.0 / ((double) (V * l)))))))))) * ((double) cbrt(1.0)))))) / ((double) fabs(((double) cbrt(((double) (V * l))))))))));
		} else {
			double VAR_2;
			if ((((double) (V * l)) <= 8.6598838271762e-319)) {
				VAR_2 = ((double) (c0 * ((double) sqrt(((double) (((double) (A / V)) * ((double) (1.0 / l))))))));
			} else {
				VAR_2 = ((double) (c0 * ((double) (((double) sqrt(A)) / ((double) sqrt(((double) (V * l))))))));
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	return VAR;
}

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 4 regimes
  2. if (* V l) < -1.1138505052891914e289

    1. Initial program 40.2

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{A \cdot \frac{1}{V \cdot \ell}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity40.2

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

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V}} \cdot \frac{1}{\ell}}\]
    9. Using strategy rm
    10. Applied associate-*l/22.5

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{1}{\ell}}{V}}}\]
    11. Simplified22.5

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

    if -1.1138505052891914e289 < (* V l) < -4.1616449878e-315

    1. Initial program 9.7

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{A \cdot \frac{1}{V \cdot \ell}}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt10.3

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

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

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

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

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

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

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

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

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

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

    if -4.1616449878e-315 < (* V l) < 8.6598838e-319

    1. Initial program 63.1

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{A \cdot \frac{1}{V \cdot \ell}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity64.0

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

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

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

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

    if 8.6598838e-319 < (* V l)

    1. Initial program 15.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -1.1138505052891914 \cdot 10^{289}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;V \cdot \ell \le -4.1616449878 \cdot 10^{-315}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\left(A \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}\right)\right) \cdot \sqrt[3]{1}}}{\left|\sqrt[3]{V \cdot \ell}\right|}\\ \mathbf{elif}\;V \cdot \ell \le 8.6598838 \cdot 10^{-319}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array}\]

Reproduce

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