Average Error: 19.4 → 12.7
Time: 5.9s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -3.6922872727633901 \cdot 10^{210}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -3.433196738714222 \cdot 10^{-143}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \le 3.1672678118888 \cdot 10^{-312}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le 1.115918443196442 \cdot 10^{238}:\\ \;\;\;\;\left(c0 \cdot \sqrt{A}\right) \cdot \sqrt{\frac{1}{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \le -3.6922872727633901 \cdot 10^{210}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\

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

\mathbf{elif}\;V \cdot \ell \le 3.1672678118888 \cdot 10^{-312}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\

\mathbf{elif}\;V \cdot \ell \le 1.115918443196442 \cdot 10^{238}:\\
\;\;\;\;\left(c0 \cdot \sqrt{A}\right) \cdot \sqrt{\frac{1}{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\

\end{array}
double f(double c0, double A, double V, double l) {
        double r136276 = c0;
        double r136277 = A;
        double r136278 = V;
        double r136279 = l;
        double r136280 = r136278 * r136279;
        double r136281 = r136277 / r136280;
        double r136282 = sqrt(r136281);
        double r136283 = r136276 * r136282;
        return r136283;
}

double f(double c0, double A, double V, double l) {
        double r136284 = V;
        double r136285 = l;
        double r136286 = r136284 * r136285;
        double r136287 = -3.69228727276339e+210;
        bool r136288 = r136286 <= r136287;
        double r136289 = c0;
        double r136290 = A;
        double r136291 = r136290 / r136284;
        double r136292 = 1.0;
        double r136293 = r136292 / r136285;
        double r136294 = r136291 * r136293;
        double r136295 = sqrt(r136294);
        double r136296 = r136289 * r136295;
        double r136297 = -3.433196738714222e-143;
        bool r136298 = r136286 <= r136297;
        double r136299 = r136290 / r136286;
        double r136300 = sqrt(r136299);
        double r136301 = r136289 * r136300;
        double r136302 = 3.1672678118888e-312;
        bool r136303 = r136286 <= r136302;
        double r136304 = 1.115918443196442e+238;
        bool r136305 = r136286 <= r136304;
        double r136306 = sqrt(r136290);
        double r136307 = r136289 * r136306;
        double r136308 = r136292 / r136286;
        double r136309 = sqrt(r136308);
        double r136310 = r136307 * r136309;
        double r136311 = r136305 ? r136310 : r136296;
        double r136312 = r136303 ? r136296 : r136311;
        double r136313 = r136298 ? r136301 : r136312;
        double r136314 = r136288 ? r136296 : r136313;
        return r136314;
}

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) < -3.69228727276339e+210 or -3.433196738714222e-143 < (* V l) < 3.1672678118888e-312 or 1.115918443196442e+238 < (* V l)

    1. Initial program 37.2

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

      \[\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-frac25.3

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

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

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

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

    if -3.69228727276339e+210 < (* V l) < -3.433196738714222e-143

    1. Initial program 6.6

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

    if 3.1672678118888e-312 < (* V l) < 1.115918443196442e+238

    1. Initial program 8.9

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

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

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

      \[\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 simplification12.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -3.6922872727633901 \cdot 10^{210}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le -3.433196738714222 \cdot 10^{-143}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \le 3.1672678118888 \cdot 10^{-312}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le 1.115918443196442 \cdot 10^{238}:\\ \;\;\;\;\left(c0 \cdot \sqrt{A}\right) \cdot \sqrt{\frac{1}{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \end{array}\]

Reproduce

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