Average Error: 18.6 → 12.9
Time: 26.7s
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 r11830041 = c0;
        double r11830042 = A;
        double r11830043 = V;
        double r11830044 = l;
        double r11830045 = r11830043 * r11830044;
        double r11830046 = r11830042 / r11830045;
        double r11830047 = sqrt(r11830046);
        double r11830048 = r11830041 * r11830047;
        return r11830048;
}

double f(double c0, double A, double V, double l) {
        double r11830049 = V;
        double r11830050 = l;
        double r11830051 = r11830049 * r11830050;
        double r11830052 = -1.3123647273443226e+301;
        bool r11830053 = r11830051 <= r11830052;
        double r11830054 = A;
        double r11830055 = r11830054 / r11830050;
        double r11830056 = sqrt(r11830055);
        double r11830057 = c0;
        double r11830058 = r11830056 * r11830057;
        double r11830059 = sqrt(r11830049);
        double r11830060 = r11830058 / r11830059;
        double r11830061 = -1.1340018144888945e-73;
        bool r11830062 = r11830051 <= r11830061;
        double r11830063 = r11830054 / r11830051;
        double r11830064 = sqrt(r11830063);
        double r11830065 = r11830057 * r11830064;
        double r11830066 = 5.344587270006659e-304;
        bool r11830067 = r11830051 <= r11830066;
        double r11830068 = 1.0;
        double r11830069 = r11830068 / r11830049;
        double r11830070 = r11830055 * r11830069;
        double r11830071 = sqrt(r11830070);
        double r11830072 = r11830057 * r11830071;
        double r11830073 = sqrt(r11830054);
        double r11830074 = sqrt(r11830051);
        double r11830075 = r11830073 / r11830074;
        double r11830076 = r11830057 * r11830075;
        double r11830077 = r11830067 ? r11830072 : r11830076;
        double r11830078 = r11830062 ? r11830065 : r11830077;
        double r11830079 = r11830053 ? r11830060 : r11830078;
        return r11830079;
}

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 0 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 *-un-lft-identity14.2

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0}\]
    7. Using strategy rm
    8. Applied frac-times14.2

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \cdot c0\]
  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 +o rules:numerics
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  (* c0 (sqrt (/ A (* V l)))))