Average Error: 19.3 → 13.2
Time: 4.2s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -6.56599507614637624 \cdot 10^{190}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -1.15484042545716117 \cdot 10^{-143}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \le 1.21046 \cdot 10^{-320}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(c0 \cdot \sqrt{A}\right) \cdot \sqrt{\frac{1}{V \cdot \ell}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \le -6.56599507614637624 \cdot 10^{190}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;V \cdot \ell \le -1.15484042545716117 \cdot 10^{-143}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \le 1.21046 \cdot 10^{-320}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\left(c0 \cdot \sqrt{A}\right) \cdot \sqrt{\frac{1}{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)) <= -6.565995076146376e+190)) {
		VAR = ((double) (c0 * ((double) sqrt(((double) (((double) (A / V)) / l))))));
	} else {
		double VAR_1;
		if ((((double) (V * l)) <= -1.1548404254571612e-143)) {
			VAR_1 = ((double) (c0 * ((double) sqrt(((double) (A / ((double) (V * l))))))));
		} else {
			double VAR_2;
			if ((((double) (V * l)) <= 1.2104608323111e-320)) {
				VAR_2 = ((double) (c0 * ((double) sqrt(((double) (((double) (A / V)) / l))))));
			} else {
				VAR_2 = ((double) (((double) (c0 * ((double) sqrt(A)))) * ((double) sqrt(((double) (1.0 / ((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) < -6.565995076146376e+190 or -1.1548404254571612e-143 < (* V l) < 1.2104608323111e-320

    1. Initial program 36.0

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

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

    if -6.565995076146376e+190 < (* V l) < -1.1548404254571612e-143

    1. Initial program 6.1

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

    if 1.2104608323111e-320 < (* V l)

    1. Initial program 15.4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -6.56599507614637624 \cdot 10^{190}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -1.15484042545716117 \cdot 10^{-143}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \le 1.21046 \cdot 10^{-320}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(c0 \cdot \sqrt{A}\right) \cdot \sqrt{\frac{1}{V \cdot \ell}}\\ \end{array}\]

Reproduce

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