Average Error: 18.8 → 14.9
Time: 15.9s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \le 1.4484281441300371 \cdot 10^{-295}:\\ \;\;\;\;\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0\\ \mathbf{elif}\;\frac{A}{V \cdot \ell} \le 9.7394205959520737 \cdot 10^{302}:\\ \;\;\;\;\sqrt{\sqrt{\frac{A}{V \cdot \ell}}} \cdot \left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}} \cdot c0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{A} \cdot c0}{\sqrt{V \cdot \ell}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;\frac{A}{V \cdot \ell} \le 1.4484281441300371 \cdot 10^{-295}:\\
\;\;\;\;\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0\\

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

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

\end{array}
double f(double c0, double A, double V, double l) {
        double r135233 = c0;
        double r135234 = A;
        double r135235 = V;
        double r135236 = l;
        double r135237 = r135235 * r135236;
        double r135238 = r135234 / r135237;
        double r135239 = sqrt(r135238);
        double r135240 = r135233 * r135239;
        return r135240;
}

double f(double c0, double A, double V, double l) {
        double r135241 = A;
        double r135242 = V;
        double r135243 = l;
        double r135244 = r135242 * r135243;
        double r135245 = r135241 / r135244;
        double r135246 = 1.4484281441300371e-295;
        bool r135247 = r135245 <= r135246;
        double r135248 = r135241 / r135242;
        double r135249 = r135248 / r135243;
        double r135250 = sqrt(r135249);
        double r135251 = c0;
        double r135252 = r135250 * r135251;
        double r135253 = 9.739420595952074e+302;
        bool r135254 = r135245 <= r135253;
        double r135255 = sqrt(r135245);
        double r135256 = sqrt(r135255);
        double r135257 = r135256 * r135251;
        double r135258 = r135256 * r135257;
        double r135259 = sqrt(r135241);
        double r135260 = r135259 * r135251;
        double r135261 = sqrt(r135244);
        double r135262 = r135260 / r135261;
        double r135263 = r135254 ? r135258 : r135262;
        double r135264 = r135247 ? r135252 : r135263;
        return r135264;
}

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 (/ A (* V l)) < 1.4484281441300371e-295

    1. Initial program 38.0

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

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell}} \cdot c0}\]
    4. Using strategy rm
    5. Applied associate-/r*28.9

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

    if 1.4484281441300371e-295 < (/ A (* V l)) < 9.739420595952074e+302

    1. Initial program 0.4

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

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell}} \cdot c0}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt0.4

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

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

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

    if 9.739420595952074e+302 < (/ A (* V l))

    1. Initial program 63.3

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

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell}} \cdot c0}\]
    4. Using strategy rm
    5. Applied sqrt-div50.5

      \[\leadsto \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \cdot c0\]
    6. Applied associate-*l/50.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \le 1.4484281441300371 \cdot 10^{-295}:\\ \;\;\;\;\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0\\ \mathbf{elif}\;\frac{A}{V \cdot \ell} \le 9.7394205959520737 \cdot 10^{302}:\\ \;\;\;\;\sqrt{\sqrt{\frac{A}{V \cdot \ell}}} \cdot \left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}} \cdot c0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{A} \cdot c0}{\sqrt{V \cdot \ell}}\\ \end{array}\]

Reproduce

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