Average Error: 19.3 → 13.0
Time: 5.0s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -5.1348332136836345 \cdot 10^{+293}:\\ \;\;\;\;\left(\sqrt{\sqrt[3]{A} \cdot \frac{\sqrt[3]{A}}{V}} \cdot c0\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5.72665889875855 \cdot 10^{-186}:\\ \;\;\;\;c0 \cdot \sqrt{A \cdot \frac{1}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -0:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{V}}\right) \cdot \sqrt{\frac{1}{\frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 6.635835769926885 \cdot 10^{+294}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5.1348332136836345 \cdot 10^{+293}:\\
\;\;\;\;\left(\sqrt{\sqrt[3]{A} \cdot \frac{\sqrt[3]{A}}{V}} \cdot c0\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq -5.72665889875855 \cdot 10^{-186}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{1}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq -0:\\
\;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{V}}\right) \cdot \sqrt{\frac{1}{\frac{\ell}{A}}}\\

\mathbf{elif}\;V \cdot \ell \leq 6.635835769926885 \cdot 10^{+294}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\

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

\end{array}
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -5.1348332136836345e+293)
   (* (* (sqrt (* (cbrt A) (/ (cbrt A) V))) c0) (sqrt (/ (cbrt A) l)))
   (if (<= (* V l) -5.72665889875855e-186)
     (* c0 (sqrt (* A (/ 1.0 (* V l)))))
     (if (<= (* V l) -0.0)
       (* (* c0 (sqrt (/ 1.0 V))) (sqrt (/ 1.0 (/ l A))))
       (if (<= (* V l) 6.635835769926885e+294)
         (/ c0 (/ (sqrt (* V l)) (sqrt A)))
         (* c0 (pow (* V (/ l A)) -0.5)))))))
double code(double c0, double A, double V, double l) {
	return ((double) (c0 * ((double) sqrt((A / ((double) (V * l)))))));
}
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((((double) (V * l)) <= -5.1348332136836345e+293)) {
		tmp = ((double) (((double) (((double) sqrt(((double) (((double) cbrt(A)) * (((double) cbrt(A)) / V))))) * c0)) * ((double) sqrt((((double) cbrt(A)) / l)))));
	} else {
		double tmp_1;
		if ((((double) (V * l)) <= -5.72665889875855e-186)) {
			tmp_1 = ((double) (c0 * ((double) sqrt(((double) (A * (1.0 / ((double) (V * l)))))))));
		} else {
			double tmp_2;
			if ((((double) (V * l)) <= -0.0)) {
				tmp_2 = ((double) (((double) (c0 * ((double) sqrt((1.0 / V))))) * ((double) sqrt((1.0 / (l / A))))));
			} else {
				double tmp_3;
				if ((((double) (V * l)) <= 6.635835769926885e+294)) {
					tmp_3 = (c0 / (((double) sqrt(((double) (V * l)))) / ((double) sqrt(A))));
				} else {
					tmp_3 = ((double) (c0 * ((double) pow(((double) (V * (l / A))), -0.5))));
				}
				tmp_2 = tmp_3;
			}
			tmp_1 = tmp_2;
		}
		tmp = tmp_1;
	}
	return tmp;
}

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) < -5.1348332136836345e293

    1. Initial program Error: 40.2 bits

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied add-cube-cbrtError: 40.2 bits

      \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\left(\sqrt[3]{A} \cdot \sqrt[3]{A}\right) \cdot \sqrt[3]{A}}}{V \cdot \ell}}\]
    4. Applied times-fracError: 24.4 bits

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \frac{\sqrt[3]{A}}{\ell}}}\]
    5. Applied sqrt-prodError: 36.5 bits

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\right)}\]
    6. Applied associate-*r*Error: 36.8 bits

      \[\leadsto \color{blue}{\left(c0 \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}}\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}}\]
    7. SimplifiedError: 36.8 bits

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

    if -5.1348332136836345e293 < (* V l) < -5.72665889875855e-186

    1. Initial program Error: 8.4 bits

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

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

    if -5.72665889875855e-186 < (* V l) < -0.0

    1. Initial program Error: 48.3 bits

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied clear-numError: 48.3 bits

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}}\]
    4. SimplifiedError: 33.4 bits

      \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{V \cdot \frac{\ell}{A}}}}\]
    5. Using strategy rm
    6. Applied *-un-lft-identityError: 33.4 bits

      \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{V \cdot \frac{\ell}{A}}}\]
    7. Applied times-fracError: 33.6 bits

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{1}{\frac{\ell}{A}}}}\]
    8. Applied sqrt-prodError: 39.7 bits

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{1}{V}} \cdot \sqrt{\frac{1}{\frac{\ell}{A}}}\right)}\]
    9. Applied associate-*r*Error: 40.3 bits

      \[\leadsto \color{blue}{\left(c0 \cdot \sqrt{\frac{1}{V}}\right) \cdot \sqrt{\frac{1}{\frac{\ell}{A}}}}\]
    10. SimplifiedError: 40.3 bits

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

    if -0.0 < (* V l) < 6.6358357699268845e294

    1. Initial program Error: 9.9 bits

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied clear-numError: 10.3 bits

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}}\]
    4. SimplifiedError: 16.4 bits

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

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{V \cdot \frac{\ell}{A}}}}\]
    7. Applied associate-*r/Error: 16.1 bits

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{1}}{\sqrt{V \cdot \frac{\ell}{A}}}}\]
    8. SimplifiedError: 16.1 bits

      \[\leadsto \frac{\color{blue}{c0}}{\sqrt{V \cdot \frac{\ell}{A}}}\]
    9. Using strategy rm
    10. Applied associate-*r/Error: 9.8 bits

      \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}}\]
    11. Applied sqrt-divError: 0.8 bits

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

    if 6.6358357699268845e294 < (* V l)

    1. Initial program Error: 41.9 bits

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied clear-numError: 42.0 bits

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}}\]
    4. SimplifiedError: 23.2 bits

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{\left(\frac{-1}{2}\right)}}\]
    8. SimplifiedError: 23.2 bits

      \[\leadsto c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{\color{blue}{-0.5}}\]
  3. Recombined 5 regimes into one program.
  4. Final simplificationError: 13.0 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -5.1348332136836345 \cdot 10^{+293}:\\ \;\;\;\;\left(\sqrt{\sqrt[3]{A} \cdot \frac{\sqrt[3]{A}}{V}} \cdot c0\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5.72665889875855 \cdot 10^{-186}:\\ \;\;\;\;c0 \cdot \sqrt{A \cdot \frac{1}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -0:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{V}}\right) \cdot \sqrt{\frac{1}{\frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 6.635835769926885 \cdot 10^{+294}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\ \end{array}\]

Reproduce

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