Average Error: 19.5 → 8.1
Time: 5.7s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le 1.97626 \cdot 10^{-322} \lor \neg \left(V \cdot \ell \le 9.99497490719426306 \cdot 10^{259}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{\frac{-1}{2}}\right)\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \le 1.97626 \cdot 10^{-322} \lor \neg \left(V \cdot \ell \le 9.99497490719426306 \cdot 10^{259}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{\frac{-1}{2}}\right)\\

\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.976262583365e-322) || !(((double) (V * l)) <= 9.994974907194263e+259))) {
		VAR = ((double) (c0 * ((double) sqrt(((double) (((double) (A / V)) / l))))));
	} else {
		VAR = ((double) (c0 * ((double) (((double) sqrt(A)) * ((double) pow(((double) (V * l)), -0.5))))));
	}
	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 2 regimes
  2. if (* V l) < 1.97626e-322 or 9.99497490719426306e259 < (* V l)

    1. Initial program 45.1

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

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

    if 1.97626e-322 < (* V l) < 9.99497490719426306e259

    1. Initial program 9.9

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

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

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \sqrt{\frac{1}{V \cdot \ell}}\right)}\]
    5. Using strategy rm
    6. Applied inv-pow1.2

      \[\leadsto c0 \cdot \left(\sqrt{A} \cdot \sqrt{\color{blue}{{\left(V \cdot \ell\right)}^{-1}}}\right)\]
    7. Applied sqrt-pow10.7

      \[\leadsto c0 \cdot \left(\sqrt{A} \cdot \color{blue}{{\left(V \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}}\right)\]
    8. Simplified0.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le 1.97626 \cdot 10^{-322} \lor \neg \left(V \cdot \ell \le 9.99497490719426306 \cdot 10^{259}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{\frac{-1}{2}}\right)\\ \end{array}\]

Reproduce

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