Average Error: 19.3 → 11.0
Time: 4.5s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -8.3845321407732062 \cdot 10^{186}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -2.6496509911402419 \cdot 10^{-254}:\\ \;\;\;\;\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 6.8556055 \cdot 10^{-319}:\\ \;\;\;\;\left(\left|\frac{\sqrt[3]{A}}{{V}^{\frac{1}{2}}}\right| \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right) \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 1.09163379013158326 \cdot 10^{285}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}}\right) \cdot \sqrt{\sqrt{\left(\sqrt[3]{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot \sqrt[3]{\frac{1}{V} \cdot \frac{A}{\ell}}\right) \cdot \sqrt[3]{\frac{1}{V} \cdot \frac{A}{\ell}}}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \le -8.3845321407732062 \cdot 10^{186}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\

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

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

\mathbf{elif}\;V \cdot \ell \le 1.09163379013158326 \cdot 10^{285}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}}\right) \cdot \sqrt{\sqrt{\left(\sqrt[3]{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot \sqrt[3]{\frac{1}{V} \cdot \frac{A}{\ell}}\right) \cdot \sqrt[3]{\frac{1}{V} \cdot \frac{A}{\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 temp;
	if (((V * l) <= -8.384532140773206e+186)) {
		temp = (c0 * sqrt(((1.0 / V) * (A / l))));
	} else {
		double temp_1;
		if (((V * l) <= -2.649650991140242e-254)) {
			temp_1 = (sqrt((A / (V * l))) * c0);
		} else {
			double temp_2;
			if (((V * l) <= 6.8556054951286e-319)) {
				temp_2 = ((fabs((cbrt(A) / pow(V, 0.5))) * sqrt((cbrt(A) / l))) * c0);
			} else {
				double temp_3;
				if (((V * l) <= 1.0916337901315833e+285)) {
					temp_3 = (c0 * (sqrt(A) / sqrt((V * l))));
				} else {
					temp_3 = ((c0 * sqrt(sqrt(((1.0 / V) * (A / l))))) * sqrt(sqrt(((cbrt(((1.0 / V) * (A / l))) * cbrt(((1.0 / V) * (A / l)))) * cbrt(((1.0 / V) * (A / l)))))));
				}
				temp_2 = temp_3;
			}
			temp_1 = temp_2;
		}
		temp = temp_1;
	}
	return temp;
}

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 5 regimes
  2. if (* V l) < -8.384532140773206e+186

    1. Initial program 28.2

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

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

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

    if -8.384532140773206e+186 < (* V l) < -2.649650991140242e-254

    1. Initial program 7.9

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

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

    if -2.649650991140242e-254 < (* V l) < 6.8556054951286e-319

    1. Initial program 56.1

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

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell}} \cdot c0}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt56.2

      \[\leadsto \sqrt{\frac{\color{blue}{\left(\sqrt[3]{A} \cdot \sqrt[3]{A}\right) \cdot \sqrt[3]{A}}}{V \cdot \ell}} \cdot c0\]
    6. Applied times-frac35.8

      \[\leadsto \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \frac{\sqrt[3]{A}}{\ell}}} \cdot c0\]
    7. Applied sqrt-prod39.3

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right)} \cdot c0\]
    8. Simplified35.9

      \[\leadsto \left(\color{blue}{\left|\frac{\sqrt[3]{A}}{{V}^{\frac{1}{2}}}\right|} \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right) \cdot c0\]

    if 6.8556054951286e-319 < (* V l) < 1.0916337901315833e+285

    1. Initial program 9.5

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

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

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

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

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

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

    if 1.0916337901315833e+285 < (* V l)

    1. Initial program 39.8

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}}\]
    5. Using strategy rm
    6. Applied add-sqr-sqrt22.1

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

      \[\leadsto \color{blue}{\left(c0 \cdot \sqrt{\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}}\right) \cdot \sqrt{\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}}}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt22.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -8.3845321407732062 \cdot 10^{186}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -2.6496509911402419 \cdot 10^{-254}:\\ \;\;\;\;\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 6.8556055 \cdot 10^{-319}:\\ \;\;\;\;\left(\left|\frac{\sqrt[3]{A}}{{V}^{\frac{1}{2}}}\right| \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right) \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 1.09163379013158326 \cdot 10^{285}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}}\right) \cdot \sqrt{\sqrt{\left(\sqrt[3]{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot \sqrt[3]{\frac{1}{V} \cdot \frac{A}{\ell}}\right) \cdot \sqrt[3]{\frac{1}{V} \cdot \frac{A}{\ell}}}}\\ \end{array}\]

Reproduce

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