Average Error: 19.1 → 11.6
Time: 4.3s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -1.45709572748422905 \cdot 10^{260}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -9.22308155473384938 \cdot 10^{-181}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right) \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\\ \mathbf{elif}\;V \cdot \ell \le -0.0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le 3.48894052778647116 \cdot 10^{286}:\\ \;\;\;\;\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 -1.45709572748422905 \cdot 10^{260}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

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

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

\mathbf{elif}\;V \cdot \ell \le 3.48894052778647116 \cdot 10^{286}:\\
\;\;\;\;\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 (c0 * sqrt((A / (V * l))));
}
double code(double c0, double A, double V, double l) {
	double VAR;
	if (((V * l) <= -1.457095727484229e+260)) {
		VAR = (c0 * sqrt(((A / V) / l)));
	} else {
		double VAR_1;
		if (((V * l) <= -9.223081554733849e-181)) {
			VAR_1 = ((c0 * sqrt(sqrt((A / (V * l))))) * sqrt(sqrt((A / (V * l)))));
		} else {
			double VAR_2;
			if (((V * l) <= -0.0)) {
				VAR_2 = (c0 * sqrt(((A / V) / l)));
			} else {
				double VAR_3;
				if (((V * l) <= 3.488940527786471e+286)) {
					VAR_3 = ((c0 * sqrt(A)) / sqrt((V * l)));
				} else {
					VAR_3 = (c0 * sqrt(((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 3 regimes
  2. if (* V l) < -1.457095727484229e+260 or -9.223081554733849e-181 < (* V l) < -0.0 or 3.488940527786471e+286 < (* V l)

    1. Initial program 41.3

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

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

    if -1.457095727484229e+260 < (* V l) < -9.223081554733849e-181

    1. Initial program 7.6

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

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

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

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

    if -0.0 < (* V l) < 3.488940527786471e+286

    1. Initial program 10.1

      \[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}}}\]
    4. Applied associate-*r/2.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -1.45709572748422905 \cdot 10^{260}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -9.22308155473384938 \cdot 10^{-181}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right) \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\\ \mathbf{elif}\;V \cdot \ell \le -0.0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le 3.48894052778647116 \cdot 10^{286}:\\ \;\;\;\;\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 2020091 
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  :precision binary64
  (* c0 (sqrt (/ A (* V l)))))