Average Error: 19.4 → 13.8
Time: 4.5s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le 2.290161057335081381418694401949687574784 \cdot 10^{-268} \lor \neg \left(V \cdot \ell \le 1.289537216867787660489854516707799548029 \cdot 10^{294}\right):\\ \;\;\;\;\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0\\ \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 2.290161057335081381418694401949687574784 \cdot 10^{-268} \lor \neg \left(V \cdot \ell \le 1.289537216867787660489854516707799548029 \cdot 10^{294}\right):\\
\;\;\;\;\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0\\

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

\end{array}
double f(double c0, double A, double V, double l) {
        double r181139 = c0;
        double r181140 = A;
        double r181141 = V;
        double r181142 = l;
        double r181143 = r181141 * r181142;
        double r181144 = r181140 / r181143;
        double r181145 = sqrt(r181144);
        double r181146 = r181139 * r181145;
        return r181146;
}

double f(double c0, double A, double V, double l) {
        double r181147 = V;
        double r181148 = l;
        double r181149 = r181147 * r181148;
        double r181150 = 2.2901610573350814e-268;
        bool r181151 = r181149 <= r181150;
        double r181152 = 1.2895372168677877e+294;
        bool r181153 = r181149 <= r181152;
        double r181154 = !r181153;
        bool r181155 = r181151 || r181154;
        double r181156 = 1.0;
        double r181157 = r181156 / r181147;
        double r181158 = A;
        double r181159 = r181158 / r181148;
        double r181160 = r181157 * r181159;
        double r181161 = sqrt(r181160);
        double r181162 = c0;
        double r181163 = r181161 * r181162;
        double r181164 = sqrt(r181158);
        double r181165 = sqrt(r181149);
        double r181166 = r181164 / r181165;
        double r181167 = r181162 * r181166;
        double r181168 = r181155 ? r181163 : r181167;
        return r181168;
}

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 2 regimes
  2. if (* V l) < 2.2901610573350814e-268 or 1.2895372168677877e+294 < (* V l)

    1. Initial program 25.0

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

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

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

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

    if 2.2901610573350814e-268 < (* V l) < 1.2895372168677877e+294

    1. Initial program 9.4

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

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

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

Reproduce

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