Average Error: 19.0 → 12.7
Time: 8.6s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -1.72676546762110236 \cdot 10^{247}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -4.39859015128601336 \cdot 10^{-148}:\\ \;\;\;\;\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 4.64665628960562929 \cdot 10^{-242}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\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.72676546762110236 \cdot 10^{247}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;V \cdot \ell \le -4.39859015128601336 \cdot 10^{-148}:\\
\;\;\;\;\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 4.64665628960562929 \cdot 10^{-242}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\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.7267654676211024e+247)) {
		VAR = ((double) (c0 * ((double) sqrt(((double) (((double) (A / V)) / l))))));
	} else {
		double VAR_1;
		if ((((double) (V * l)) <= -4.3985901512860134e-148)) {
			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)) <= 4.646656289605629e-242)) {
				VAR_2 = ((double) (c0 * ((double) sqrt(((double) (((double) (A / V)) / 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 3 regimes
  2. if (* V l) < -1.72676546762110236e247 or -4.39859015128601336e-148 < (* V l) < 4.64665628960562929e-242

    1. Initial program 38.3

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

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

    if -1.72676546762110236e247 < (* V l) < -4.39859015128601336e-148

    1. Initial program 6.3

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

      \[\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-prod6.8

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

      \[\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. Simplified6.8

      \[\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 4.64665628960562929e-242 < (* V l)

    1. Initial program 14.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -1.72676546762110236 \cdot 10^{247}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -4.39859015128601336 \cdot 10^{-148}:\\ \;\;\;\;\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 4.64665628960562929 \cdot 10^{-242}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array}\]

Reproduce

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