Average Error: 18.6 → 13.1
Time: 21.5s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -4.496077677986746 \cdot 10^{+255}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{\ell}} \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}}\right)\\ \mathbf{elif}\;V \cdot \ell \le -3.998925438315843 \cdot 10^{-275}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \le 1.1946566067922436 \cdot 10^{-302}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{\ell}} \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}}\right)\\ \mathbf{elif}\;V \cdot \ell \le 4.2360797360047584 \cdot 10^{+307}:\\ \;\;\;\;\frac{\sqrt{A} \cdot c0}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \le -4.496077677986746 \cdot 10^{+255}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{\ell}} \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}}\right)\\

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

\mathbf{elif}\;V \cdot \ell \le 1.1946566067922436 \cdot 10^{-302}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{\ell}} \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}}\right)\\

\mathbf{elif}\;V \cdot \ell \le 4.2360797360047584 \cdot 10^{+307}:\\
\;\;\;\;\frac{\sqrt{A} \cdot c0}{\sqrt{V \cdot \ell}}\\

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

\end{array}
double f(double c0, double A, double V, double l) {
        double r2982852 = c0;
        double r2982853 = A;
        double r2982854 = V;
        double r2982855 = l;
        double r2982856 = r2982854 * r2982855;
        double r2982857 = r2982853 / r2982856;
        double r2982858 = sqrt(r2982857);
        double r2982859 = r2982852 * r2982858;
        return r2982859;
}

double f(double c0, double A, double V, double l) {
        double r2982860 = V;
        double r2982861 = l;
        double r2982862 = r2982860 * r2982861;
        double r2982863 = -4.496077677986746e+255;
        bool r2982864 = r2982862 <= r2982863;
        double r2982865 = c0;
        double r2982866 = A;
        double r2982867 = cbrt(r2982866);
        double r2982868 = r2982867 / r2982861;
        double r2982869 = sqrt(r2982868);
        double r2982870 = r2982867 * r2982867;
        double r2982871 = r2982870 / r2982860;
        double r2982872 = sqrt(r2982871);
        double r2982873 = r2982869 * r2982872;
        double r2982874 = r2982865 * r2982873;
        double r2982875 = -3.998925438315843e-275;
        bool r2982876 = r2982862 <= r2982875;
        double r2982877 = r2982866 / r2982862;
        double r2982878 = sqrt(r2982877);
        double r2982879 = r2982865 * r2982878;
        double r2982880 = 1.1946566067922436e-302;
        bool r2982881 = r2982862 <= r2982880;
        double r2982882 = 4.2360797360047584e+307;
        bool r2982883 = r2982862 <= r2982882;
        double r2982884 = sqrt(r2982866);
        double r2982885 = r2982884 * r2982865;
        double r2982886 = sqrt(r2982862);
        double r2982887 = r2982885 / r2982886;
        double r2982888 = r2982866 / r2982861;
        double r2982889 = 1.0;
        double r2982890 = r2982889 / r2982860;
        double r2982891 = r2982888 * r2982890;
        double r2982892 = sqrt(r2982891);
        double r2982893 = r2982865 * r2982892;
        double r2982894 = r2982883 ? r2982887 : r2982893;
        double r2982895 = r2982881 ? r2982874 : r2982894;
        double r2982896 = r2982876 ? r2982879 : r2982895;
        double r2982897 = r2982864 ? r2982874 : r2982896;
        return r2982897;
}

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 4 regimes
  2. if (* V l) < -4.496077677986746e+255 or -3.998925438315843e-275 < (* V l) < 1.1946566067922436e-302

    1. Initial program 44.3

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt44.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-frac29.2

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \frac{\sqrt[3]{A}}{\ell}}}\]
    5. Applied sqrt-prod36.5

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

    if -4.496077677986746e+255 < (* V l) < -3.998925438315843e-275

    1. Initial program 8.4

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

    if 1.1946566067922436e-302 < (* V l) < 4.2360797360047584e+307

    1. Initial program 9.9

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{1 \cdot A}}{\sqrt{V \cdot \ell}}}\]
    8. Applied associate-*r/2.7

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

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

    if 4.2360797360047584e+307 < (* V l)

    1. Initial program 42.9

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -4.496077677986746 \cdot 10^{+255}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{\ell}} \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}}\right)\\ \mathbf{elif}\;V \cdot \ell \le -3.998925438315843 \cdot 10^{-275}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \le 1.1946566067922436 \cdot 10^{-302}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{\ell}} \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}}\right)\\ \mathbf{elif}\;V \cdot \ell \le 4.2360797360047584 \cdot 10^{+307}:\\ \;\;\;\;\frac{\sqrt{A} \cdot c0}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\ \end{array}\]

Reproduce

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