Average Error: 18.5 → 10.4
Time: 4.3s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -9.6542839962778116 \cdot 10^{232}:\\ \;\;\;\;\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le -5.0345604282613683 \cdot 10^{-262}:\\ \;\;\;\;\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 9.88131 \cdot 10^{-324}:\\ \;\;\;\;\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 1.72830285559158499 \cdot 10^{303}:\\ \;\;\;\;\frac{\sqrt{A}}{\sqrt{V \cdot \ell}} \cdot c0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \le -9.6542839962778116 \cdot 10^{232}:\\
\;\;\;\;\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0\\

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

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

\mathbf{elif}\;V \cdot \ell \le 1.72830285559158499 \cdot 10^{303}:\\
\;\;\;\;\frac{\sqrt{A}}{\sqrt{V \cdot \ell}} \cdot c0\\

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

\end{array}
double f(double c0, double A, double V, double l) {
        double r251108 = c0;
        double r251109 = A;
        double r251110 = V;
        double r251111 = l;
        double r251112 = r251110 * r251111;
        double r251113 = r251109 / r251112;
        double r251114 = sqrt(r251113);
        double r251115 = r251108 * r251114;
        return r251115;
}

double f(double c0, double A, double V, double l) {
        double r251116 = V;
        double r251117 = l;
        double r251118 = r251116 * r251117;
        double r251119 = -9.654283996277812e+232;
        bool r251120 = r251118 <= r251119;
        double r251121 = 1.0;
        double r251122 = r251121 / r251116;
        double r251123 = A;
        double r251124 = r251123 / r251117;
        double r251125 = r251122 * r251124;
        double r251126 = sqrt(r251125);
        double r251127 = c0;
        double r251128 = r251126 * r251127;
        double r251129 = -5.0345604282613683e-262;
        bool r251130 = r251118 <= r251129;
        double r251131 = r251123 / r251118;
        double r251132 = sqrt(r251131);
        double r251133 = r251132 * r251127;
        double r251134 = 9.8813129168249e-324;
        bool r251135 = r251118 <= r251134;
        double r251136 = 1.728302855591585e+303;
        bool r251137 = r251118 <= r251136;
        double r251138 = sqrt(r251123);
        double r251139 = sqrt(r251118);
        double r251140 = r251138 / r251139;
        double r251141 = r251140 * r251127;
        double r251142 = r251137 ? r251141 : r251128;
        double r251143 = r251135 ? r251128 : r251142;
        double r251144 = r251130 ? r251133 : r251143;
        double r251145 = r251120 ? r251128 : r251144;
        return r251145;
}

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) < -9.654283996277812e+232 or -5.0345604282613683e-262 < (* V l) < 9.8813129168249e-324 or 1.728302855591585e+303 < (* V l)

    1. Initial program 42.6

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

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell}} \cdot c0}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity42.6

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

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

    if -9.654283996277812e+232 < (* V l) < -5.0345604282613683e-262

    1. Initial program 8.3

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

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

    if 9.8813129168249e-324 < (* V l) < 1.728302855591585e+303

    1. Initial program 9.9

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -9.6542839962778116 \cdot 10^{232}:\\ \;\;\;\;\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le -5.0345604282613683 \cdot 10^{-262}:\\ \;\;\;\;\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 9.88131 \cdot 10^{-324}:\\ \;\;\;\;\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 1.72830285559158499 \cdot 10^{303}:\\ \;\;\;\;\frac{\sqrt{A}}{\sqrt{V \cdot \ell}} \cdot c0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0\\ \end{array}\]

Reproduce

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