Average Error: 19.4 → 12.7
Time: 6.1s
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 r191342 = c0;
        double r191343 = A;
        double r191344 = V;
        double r191345 = l;
        double r191346 = r191344 * r191345;
        double r191347 = r191343 / r191346;
        double r191348 = sqrt(r191347);
        double r191349 = r191342 * r191348;
        return r191349;
}

double f(double c0, double A, double V, double l) {
        double r191350 = V;
        double r191351 = l;
        double r191352 = r191350 * r191351;
        double r191353 = -3.69228727276339e+210;
        bool r191354 = r191352 <= r191353;
        double r191355 = c0;
        double r191356 = A;
        double r191357 = r191356 / r191350;
        double r191358 = 1.0;
        double r191359 = r191358 / r191351;
        double r191360 = r191357 * r191359;
        double r191361 = sqrt(r191360);
        double r191362 = r191355 * r191361;
        double r191363 = -3.433196738714222e-143;
        bool r191364 = r191352 <= r191363;
        double r191365 = r191356 / r191352;
        double r191366 = sqrt(r191365);
        double r191367 = r191355 * r191366;
        double r191368 = 3.1672678118888e-312;
        bool r191369 = r191352 <= r191368;
        double r191370 = 1.115918443196442e+238;
        bool r191371 = r191352 <= r191370;
        double r191372 = sqrt(r191356);
        double r191373 = r191355 * r191372;
        double r191374 = r191358 / r191352;
        double r191375 = sqrt(r191374);
        double r191376 = r191373 * r191375;
        double r191377 = r191371 ? r191376 : r191362;
        double r191378 = r191369 ? r191362 : r191377;
        double r191379 = r191364 ? r191367 : r191378;
        double r191380 = r191354 ? r191362 : r191379;
        return r191380;
}

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 +o rules:numerics
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  :precision binary64
  (* c0 (sqrt (/ A (* V l)))))