Average Error: 19.2 → 12.4
Time: 7.2s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -7.7234532439929487 \cdot 10^{181}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -5.98044972 \cdot 10^{-317}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right) \cdot \sqrt{\left|\sqrt[3]{\frac{A}{V \cdot \ell}}\right| \cdot \sqrt{\sqrt[3]{\frac{A}{V \cdot \ell}}}}\\ \mathbf{elif}\;V \cdot \ell \le 2.53428146831 \cdot 10^{-314}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{1}{V}} \cdot \sqrt{\frac{A}{\ell}}\right)\\ \mathbf{elif}\;V \cdot \ell \le 2.26623710288421461 \cdot 10^{266}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \le -7.7234532439929487 \cdot 10^{181}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\

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

\mathbf{elif}\;V \cdot \ell \le 2.53428146831 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{1}{V}} \cdot \sqrt{\frac{A}{\ell}}\right)\\

\mathbf{elif}\;V \cdot \ell \le 2.26623710288421461 \cdot 10^{266}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\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)) <= -7.723453243992949e+181)) {
		VAR = ((double) (c0 * ((double) sqrt(((double) (((double) (1.0 / V)) * ((double) (A / l))))))));
	} else {
		double VAR_1;
		if ((((double) (V * l)) <= -5.9804497243523e-317)) {
			VAR_1 = ((double) (((double) (c0 * ((double) sqrt(((double) sqrt(((double) (A / ((double) (V * l)))))))))) * ((double) sqrt(((double) (((double) fabs(((double) cbrt(((double) (A / ((double) (V * l)))))))) * ((double) sqrt(((double) cbrt(((double) (A / ((double) (V * l))))))))))))));
		} else {
			double VAR_2;
			if ((((double) (V * l)) <= 2.5342814683055e-314)) {
				VAR_2 = ((double) (c0 * ((double) (((double) sqrt(((double) (1.0 / V)))) * ((double) sqrt(((double) (A / l))))))));
			} else {
				double VAR_3;
				if ((((double) (V * l)) <= 2.2662371028842146e+266)) {
					VAR_3 = ((double) (((double) (c0 * ((double) sqrt(A)))) / ((double) sqrt(((double) (V * l))))));
				} else {
					VAR_3 = ((double) (c0 * ((double) sqrt(((double) (((double) (A / V)) / l))))));
				}
				VAR_2 = VAR_3;
			}
			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 5 regimes
  2. if (* V l) < -7.7234532439929487e181

    1. Initial program 28.7

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

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

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

    if -7.7234532439929487e181 < (* V l) < -5.98044972e-317

    1. Initial program 9.1

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt9.1

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

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

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

      \[\leadsto \left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right) \cdot \sqrt{\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}}}}}\]
    8. Applied sqrt-prod9.3

      \[\leadsto \left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right) \cdot \sqrt{\color{blue}{\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}}}}}\]
    9. Simplified9.3

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

    if -5.98044972e-317 < (* V l) < 2.53428146831e-314

    1. Initial program 62.7

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

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

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

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

    if 2.53428146831e-314 < (* V l) < 2.26623710288421461e266

    1. Initial program 9.6

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

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}}\]
    4. Applied associate-*r/2.5

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

    if 2.26623710288421461e266 < (* V l)

    1. Initial program 36.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -7.7234532439929487 \cdot 10^{181}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -5.98044972 \cdot 10^{-317}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right) \cdot \sqrt{\left|\sqrt[3]{\frac{A}{V \cdot \ell}}\right| \cdot \sqrt{\sqrt[3]{\frac{A}{V \cdot \ell}}}}\\ \mathbf{elif}\;V \cdot \ell \le 2.53428146831 \cdot 10^{-314}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{1}{V}} \cdot \sqrt{\frac{A}{\ell}}\right)\\ \mathbf{elif}\;V \cdot \ell \le 2.26623710288421461 \cdot 10^{266}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array}\]

Reproduce

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