Average Error: 19.1 → 13.2
Time: 12.0s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le 0.0 \lor \neg \left(V \cdot \ell \le 1.891469986160729535580472992607288030419 \cdot 10^{305}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \le 0.0 \lor \neg \left(V \cdot \ell \le 1.891469986160729535580472992607288030419 \cdot 10^{305}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\

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

\end{array}
double f(double c0, double A, double V, double l) {
        double r135586 = c0;
        double r135587 = A;
        double r135588 = V;
        double r135589 = l;
        double r135590 = r135588 * r135589;
        double r135591 = r135587 / r135590;
        double r135592 = sqrt(r135591);
        double r135593 = r135586 * r135592;
        return r135593;
}

double f(double c0, double A, double V, double l) {
        double r135594 = V;
        double r135595 = l;
        double r135596 = r135594 * r135595;
        double r135597 = 0.0;
        bool r135598 = r135596 <= r135597;
        double r135599 = 1.8914699861607295e+305;
        bool r135600 = r135596 <= r135599;
        double r135601 = !r135600;
        bool r135602 = r135598 || r135601;
        double r135603 = c0;
        double r135604 = 1.0;
        double r135605 = r135604 / r135594;
        double r135606 = A;
        double r135607 = r135606 / r135595;
        double r135608 = r135605 * r135607;
        double r135609 = sqrt(r135608);
        double r135610 = r135603 * r135609;
        double r135611 = sqrt(r135606);
        double r135612 = sqrt(r135596);
        double r135613 = r135611 / r135612;
        double r135614 = r135603 * r135613;
        double r135615 = r135602 ? r135610 : r135614;
        return r135615;
}

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) < 0.0

    1. Initial program 19.0

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

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

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

    if 0.0 < (* V l) < 1.8914699861607295e+305

    1. Initial program 15.9

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

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

    if 1.8914699861607295e+305 < (* V l)

    1. Initial program 40.7

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification13.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le 0.0 \lor \neg \left(V \cdot \ell \le 1.891469986160729535580472992607288030419 \cdot 10^{305}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array}\]

Reproduce

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