Average Error: 18.6 → 12.9
Time: 26.5s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -1.3123647273443226 \cdot 10^{+301}:\\ \;\;\;\;\frac{\sqrt{\frac{A}{\ell}} \cdot c0}{\sqrt{V}}\\ \mathbf{elif}\;V \cdot \ell \le -1.1340018144888945 \cdot 10^{-73}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \le 5.344587270006659 \cdot 10^{-304}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array}\]
double f(double c0, double A, double V, double l) {
        double r12965867 = c0;
        double r12965868 = A;
        double r12965869 = V;
        double r12965870 = l;
        double r12965871 = r12965869 * r12965870;
        double r12965872 = r12965868 / r12965871;
        double r12965873 = sqrt(r12965872);
        double r12965874 = r12965867 * r12965873;
        return r12965874;
}

double f(double c0, double A, double V, double l) {
        double r12965875 = V;
        double r12965876 = l;
        double r12965877 = r12965875 * r12965876;
        double r12965878 = -1.3123647273443226e+301;
        bool r12965879 = r12965877 <= r12965878;
        double r12965880 = A;
        double r12965881 = r12965880 / r12965876;
        double r12965882 = sqrt(r12965881);
        double r12965883 = c0;
        double r12965884 = r12965882 * r12965883;
        double r12965885 = sqrt(r12965875);
        double r12965886 = r12965884 / r12965885;
        double r12965887 = -1.1340018144888945e-73;
        bool r12965888 = r12965877 <= r12965887;
        double r12965889 = r12965880 / r12965877;
        double r12965890 = sqrt(r12965889);
        double r12965891 = r12965883 * r12965890;
        double r12965892 = 5.344587270006659e-304;
        bool r12965893 = r12965877 <= r12965892;
        double r12965894 = 1.0;
        double r12965895 = r12965894 / r12965875;
        double r12965896 = r12965881 * r12965895;
        double r12965897 = sqrt(r12965896);
        double r12965898 = r12965883 * r12965897;
        double r12965899 = sqrt(r12965880);
        double r12965900 = sqrt(r12965877);
        double r12965901 = r12965899 / r12965900;
        double r12965902 = r12965883 * r12965901;
        double r12965903 = r12965893 ? r12965898 : r12965902;
        double r12965904 = r12965888 ? r12965891 : r12965903;
        double r12965905 = r12965879 ? r12965886 : r12965904;
        return r12965905;
}

c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \le -1.3123647273443226 \cdot 10^{+301}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{\ell}} \cdot c0}{\sqrt{V}}\\

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

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

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

\end{array}

Error

Bits error versus c0

Bits error versus A

Bits error versus V

Bits error versus l

Derivation

  1. Split input into 4 regimes
  2. if (* V l) < -1.3123647273443226e+301

    1. Initial program 41.4

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0}\]
    7. Using strategy rm
    8. Applied associate-*l/23.4

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

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

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

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

    if -1.3123647273443226e+301 < (* V l) < -1.1340018144888945e-73

    1. Initial program 8.1

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0}\]
    7. Taylor expanded around -inf 8.1

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

    if -1.1340018144888945e-73 < (* V l) < 5.344587270006659e-304

    1. Initial program 33.1

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

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

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

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

    if 5.344587270006659e-304 < (* V l)

    1. Initial program 14.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -1.3123647273443226 \cdot 10^{+301}:\\ \;\;\;\;\frac{\sqrt{\frac{A}{\ell}} \cdot c0}{\sqrt{V}}\\ \mathbf{elif}\;V \cdot \ell \le -1.1340018144888945 \cdot 10^{-73}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \le 5.344587270006659 \cdot 10^{-304}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array}\]

Reproduce

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