Average Error: 19.0 → 12.7
Time: 20.9s
Precision: 64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \le -4.409349952943876663367877224423395046501 \cdot 10^{225}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\ \mathbf{elif}\;V \cdot \ell \le -3.924693719743890677810332879329743375618 \cdot 10^{-189}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{V \cdot \ell} \cdot A}\\ \mathbf{elif}\;V \cdot \ell \le 7.375757807070217284048742538091816401626 \cdot 10^{-319}:\\ \;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 2.336051817442314793904355180504260870482 \cdot 10^{285}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{A}}{\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.409349952943876663367877224423395046501 \cdot 10^{225}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\

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

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

\mathbf{elif}\;V \cdot \ell \le 2.336051817442314793904355180504260870482 \cdot 10^{285}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\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 r7701269 = c0;
        double r7701270 = A;
        double r7701271 = V;
        double r7701272 = l;
        double r7701273 = r7701271 * r7701272;
        double r7701274 = r7701270 / r7701273;
        double r7701275 = sqrt(r7701274);
        double r7701276 = r7701269 * r7701275;
        return r7701276;
}

double f(double c0, double A, double V, double l) {
        double r7701277 = V;
        double r7701278 = l;
        double r7701279 = r7701277 * r7701278;
        double r7701280 = -4.4093499529438767e+225;
        bool r7701281 = r7701279 <= r7701280;
        double r7701282 = c0;
        double r7701283 = A;
        double r7701284 = r7701283 / r7701278;
        double r7701285 = 1.0;
        double r7701286 = r7701285 / r7701277;
        double r7701287 = r7701284 * r7701286;
        double r7701288 = sqrt(r7701287);
        double r7701289 = r7701282 * r7701288;
        double r7701290 = -3.924693719743891e-189;
        bool r7701291 = r7701279 <= r7701290;
        double r7701292 = r7701285 / r7701279;
        double r7701293 = r7701292 * r7701283;
        double r7701294 = sqrt(r7701293);
        double r7701295 = r7701282 * r7701294;
        double r7701296 = 7.3757578070702e-319;
        bool r7701297 = r7701279 <= r7701296;
        double r7701298 = r7701283 / r7701277;
        double r7701299 = sqrt(r7701298);
        double r7701300 = sqrt(r7701278);
        double r7701301 = r7701299 / r7701300;
        double r7701302 = r7701301 * r7701282;
        double r7701303 = 2.3360518174423148e+285;
        bool r7701304 = r7701279 <= r7701303;
        double r7701305 = sqrt(r7701283);
        double r7701306 = r7701282 * r7701305;
        double r7701307 = sqrt(r7701279);
        double r7701308 = r7701306 / r7701307;
        double r7701309 = r7701304 ? r7701308 : r7701289;
        double r7701310 = r7701297 ? r7701302 : r7701309;
        double r7701311 = r7701291 ? r7701295 : r7701310;
        double r7701312 = r7701281 ? r7701289 : r7701311;
        return r7701312;
}

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.4093499529438767e+225 or 2.3360518174423148e+285 < (* V l)

    1. Initial program 35.7

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

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

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

    if -4.4093499529438767e+225 < (* V l) < -3.924693719743891e-189

    1. Initial program 6.9

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

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

    if -3.924693719743891e-189 < (* V l) < 7.3757578070702e-319

    1. Initial program 47.4

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

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

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

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

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

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

    if 7.3757578070702e-319 < (* V l) < 2.3360518174423148e+285

    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.5

      \[\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.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \le -4.409349952943876663367877224423395046501 \cdot 10^{225}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\ \mathbf{elif}\;V \cdot \ell \le -3.924693719743890677810332879329743375618 \cdot 10^{-189}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{V \cdot \ell} \cdot A}\\ \mathbf{elif}\;V \cdot \ell \le 7.375757807070217284048742538091816401626 \cdot 10^{-319}:\\ \;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 2.336051817442314793904355180504260870482 \cdot 10^{285}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\ \end{array}\]

Reproduce

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