Average Error: 19.4 → 11.8
Time: 6.7s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -1.6961802581639665 \cdot 10^{291}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -9.2989943 \cdot 10^{-317}:\\ \;\;\;\;\left(\left|\sqrt[3]{\frac{A}{V \cdot \ell}}\right| \cdot c0\right) \cdot \sqrt{\sqrt[3]{\frac{A}{V \cdot \ell}}}\\ \mathbf{elif}\;V \cdot \ell \le 0.0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le 4.2913315334292171 \cdot 10^{281}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{1}{V \cdot \ell}}\right)\\ \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 -1.6961802581639665 \cdot 10^{291}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

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

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

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

\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)) <= -1.6961802581639665e+291)) {
		VAR = ((double) (c0 * ((double) sqrt(((double) (((double) (A / V)) / l))))));
	} else {
		double VAR_1;
		if ((((double) (V * l)) <= -9.2989943009296e-317)) {
			VAR_1 = ((double) (((double) (((double) fabs(((double) cbrt(((double) (A / ((double) (V * l)))))))) * c0)) * ((double) sqrt(((double) cbrt(((double) (A / ((double) (V * l))))))))));
		} else {
			double VAR_2;
			if ((((double) (V * l)) <= 0.0)) {
				VAR_2 = ((double) (c0 * ((double) (((double) sqrt(((double) (((double) (1.0 / V)) * A)))) / ((double) sqrt(l))))));
			} else {
				double VAR_3;
				if ((((double) (V * l)) <= 4.291331533429217e+281)) {
					VAR_3 = ((double) (c0 * ((double) (((double) sqrt(A)) * ((double) sqrt(((double) (1.0 / ((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) < -1.6961802581639665e291 or 4.2913315334292171e281 < (* V l)

    1. Initial program 39.4

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

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

    if -1.6961802581639665e291 < (* V l) < -9.2989943e-317

    1. Initial program 9.9

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

      \[\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-prod10.4

      \[\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*10.4

      \[\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. Simplified10.4

      \[\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}}}\]

    if -9.2989943e-317 < (* V l) < 0.0

    1. Initial program 63.5

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}}\]
    5. Using strategy rm
    6. Applied associate-*r/34.3

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

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

    if 0.0 < (* V l) < 4.2913315334292171e281

    1. Initial program 10.1

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

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

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \sqrt{\frac{1}{V \cdot \ell}}\right)}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification11.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -1.6961802581639665 \cdot 10^{291}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -9.2989943 \cdot 10^{-317}:\\ \;\;\;\;\left(\left|\sqrt[3]{\frac{A}{V \cdot \ell}}\right| \cdot c0\right) \cdot \sqrt{\sqrt[3]{\frac{A}{V \cdot \ell}}}\\ \mathbf{elif}\;V \cdot \ell \le 0.0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le 4.2913315334292171 \cdot 10^{281}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{1}{V \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array}\]

Reproduce

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