Average Error: 19.2 → 12.0
Time: 4.4s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell = -\infty:\\ \;\;\;\;c0 \cdot \sqrt{1 \cdot \frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;V \cdot \ell \le -1.372795207365171957618020462669794258377 \cdot 10^{-130}:\\ \;\;\;\;{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}^{1}\\ \mathbf{elif}\;V \cdot \ell \le 1.891642626224512109719484957582604470818 \cdot 10^{-316}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le 7.417466762286140589654100306077537827697 \cdot 10^{212}:\\ \;\;\;\;\left(c0 \cdot \sqrt{A}\right) \cdot \sqrt{\frac{1}{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{1 \cdot \frac{\frac{A}{\ell}}{V}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell = -\infty:\\
\;\;\;\;c0 \cdot \sqrt{1 \cdot \frac{\frac{A}{\ell}}{V}}\\

\mathbf{elif}\;V \cdot \ell \le -1.372795207365171957618020462669794258377 \cdot 10^{-130}:\\
\;\;\;\;{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}^{1}\\

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

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

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

\end{array}
double f(double c0, double A, double V, double l) {
        double r167925 = c0;
        double r167926 = A;
        double r167927 = V;
        double r167928 = l;
        double r167929 = r167927 * r167928;
        double r167930 = r167926 / r167929;
        double r167931 = sqrt(r167930);
        double r167932 = r167925 * r167931;
        return r167932;
}

double f(double c0, double A, double V, double l) {
        double r167933 = V;
        double r167934 = l;
        double r167935 = r167933 * r167934;
        double r167936 = -inf.0;
        bool r167937 = r167935 <= r167936;
        double r167938 = c0;
        double r167939 = 1.0;
        double r167940 = A;
        double r167941 = r167940 / r167934;
        double r167942 = r167941 / r167933;
        double r167943 = r167939 * r167942;
        double r167944 = sqrt(r167943);
        double r167945 = r167938 * r167944;
        double r167946 = -1.372795207365172e-130;
        bool r167947 = r167935 <= r167946;
        double r167948 = r167940 / r167935;
        double r167949 = sqrt(r167948);
        double r167950 = r167938 * r167949;
        double r167951 = pow(r167950, r167939);
        double r167952 = 1.8916426262245e-316;
        bool r167953 = r167935 <= r167952;
        double r167954 = r167940 / r167933;
        double r167955 = r167954 / r167934;
        double r167956 = sqrt(r167955);
        double r167957 = r167938 * r167956;
        double r167958 = 7.41746676228614e+212;
        bool r167959 = r167935 <= r167958;
        double r167960 = sqrt(r167940);
        double r167961 = r167938 * r167960;
        double r167962 = r167939 / r167935;
        double r167963 = sqrt(r167962);
        double r167964 = r167961 * r167963;
        double r167965 = r167959 ? r167964 : r167945;
        double r167966 = r167953 ? r167957 : r167965;
        double r167967 = r167947 ? r167951 : r167966;
        double r167968 = r167937 ? r167945 : r167967;
        return r167968;
}

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) < -inf.0 or 7.41746676228614e+212 < (* V l)

    1. Initial program 33.0

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

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

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

      \[\leadsto c0 \cdot \sqrt{\frac{1}{\color{blue}{1 \cdot V}} \cdot \frac{A}{\ell}}\]
    7. Applied *-un-lft-identity20.3

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

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

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

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

    if -inf.0 < (* V l) < -1.372795207365172e-130

    1. Initial program 8.9

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt{\frac{A}{V \cdot \ell}}\right)}^{1}}\]
    4. Applied pow18.9

      \[\leadsto \color{blue}{{c0}^{1}} \cdot {\left(\sqrt{\frac{A}{V \cdot \ell}}\right)}^{1}\]
    5. Applied pow-prod-down8.9

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

    if -1.372795207365172e-130 < (* V l) < 1.8916426262245e-316

    1. Initial program 40.2

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

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

    if 1.8916426262245e-316 < (* V l) < 7.41746676228614e+212

    1. Initial program 10.1

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

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

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \sqrt{\frac{1}{V \cdot \ell}}\right)}\]
    5. Applied associate-*r*2.4

      \[\leadsto \color{blue}{\left(c0 \cdot \sqrt{A}\right) \cdot \sqrt{\frac{1}{V \cdot \ell}}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification12.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell = -\infty:\\ \;\;\;\;c0 \cdot \sqrt{1 \cdot \frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;V \cdot \ell \le -1.372795207365171957618020462669794258377 \cdot 10^{-130}:\\ \;\;\;\;{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}^{1}\\ \mathbf{elif}\;V \cdot \ell \le 1.891642626224512109719484957582604470818 \cdot 10^{-316}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \le 7.417466762286140589654100306077537827697 \cdot 10^{212}:\\ \;\;\;\;\left(c0 \cdot \sqrt{A}\right) \cdot \sqrt{\frac{1}{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{1 \cdot \frac{\frac{A}{\ell}}{V}}\\ \end{array}\]

Reproduce

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