Average Error: 19.4 → 11.2
Time: 5.8s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -7.60685473970199791 \cdot 10^{189}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -9.38725 \cdot 10^{-323}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\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}}}}\right) \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\\ \mathbf{elif}\;V \cdot \ell \le 0.0:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{V}}\right) \cdot \sqrt{\frac{A}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le 5.91247365251381241 \cdot 10^{285}:\\ \;\;\;\;c0 \cdot \frac{\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.60685473970199791 \cdot 10^{189}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;V \cdot \ell \le -9.38725 \cdot 10^{-323}:\\
\;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\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}}}}\right) \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\\

\mathbf{elif}\;V \cdot \ell \le 0.0:\\
\;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{V}}\right) \cdot \sqrt{\frac{A}{\ell}}\\

\mathbf{elif}\;V \cdot \ell \le 5.91247365251381241 \cdot 10^{285}:\\
\;\;\;\;c0 \cdot \frac{\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.606854739701998e+189)) {
		VAR = ((double) (c0 * ((double) sqrt(((double) (((double) (A / V)) / l))))));
	} else {
		double VAR_1;
		if ((((double) (V * l)) <= -9.3872472709837e-323)) {
			VAR_1 = ((double) (((double) (c0 * ((double) sqrt(((double) sqrt(((double) (((double) (((double) cbrt(((double) (A / ((double) (V * l)))))) * ((double) cbrt(((double) (A / ((double) (V * l)))))))) * ((double) cbrt(((double) (A / ((double) (V * l)))))))))))))) * ((double) sqrt(((double) sqrt(((double) (A / ((double) (V * l))))))))));
		} else {
			double VAR_2;
			if ((((double) (V * l)) <= 0.0)) {
				VAR_2 = ((double) (((double) (c0 * ((double) sqrt(((double) (1.0 / V)))))) * ((double) sqrt(((double) (A / l))))));
			} else {
				double VAR_3;
				if ((((double) (V * l)) <= 5.912473652513812e+285)) {
					VAR_3 = ((double) (c0 * ((double) (((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 4 regimes
  2. if (* V l) < -7.60685473970199791e189 or 5.91247365251381241e285 < (* V l)

    1. Initial program 33.1

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

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

    if -7.60685473970199791e189 < (* V l) < -9.38725e-323

    1. Initial program 8.9

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

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

      \[\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.2

      \[\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.2

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

    if -9.38725e-323 < (* V l) < 0.0

    1. Initial program 64.0

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

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

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

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

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

    if 0.0 < (* V l) < 5.91247365251381241e285

    1. Initial program 10.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -7.60685473970199791 \cdot 10^{189}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -9.38725 \cdot 10^{-323}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\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}}}}\right) \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\\ \mathbf{elif}\;V \cdot \ell \le 0.0:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{V}}\right) \cdot \sqrt{\frac{A}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le 5.91247365251381241 \cdot 10^{285}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array}\]

Reproduce

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