Average Error: 18.6 → 1.0
Time: 8.2s
Precision: binary64
\[[V, l]=\mathsf{sort}([V, l])\]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 4.8328305849675 \cdot 10^{-311} \lor \neg \left(t_0 \leq 2.437639631441024 \cdot 10^{+295}\right):\\ \;\;\;\;\frac{c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right| \cdot \sqrt{\frac{\frac{\sqrt[3]{A}}{\sqrt[3]{\ell}}}{\sqrt[3]{V}}}\right)}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 4.8328305849675 \cdot 10^{-311} \lor \neg \left(t_0 \leq 2.437639631441024 \cdot 10^{+295}\right):\\
\;\;\;\;\frac{c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right| \cdot \sqrt{\frac{\frac{\sqrt[3]{A}}{\sqrt[3]{\ell}}}{\sqrt[3]{V}}}\right)}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\


\end{array}
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (or (<= t_0 4.8328305849675e-311) (not (<= t_0 2.437639631441024e+295)))
     (/
      (*
       c0
       (*
        (fabs (/ (cbrt A) (cbrt V)))
        (sqrt (/ (/ (cbrt A) (cbrt l)) (cbrt V)))))
      (sqrt (* (cbrt l) (cbrt l))))
     (* c0 (sqrt t_0)))))
double code(double c0, double A, double V, double l) {
	return c0 * sqrt(A / (V * l));
}
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 4.8328305849675e-311) || !(t_0 <= 2.437639631441024e+295)) {
		tmp = (c0 * (fabs(cbrt(A) / cbrt(V)) * sqrt((cbrt(A) / cbrt(l)) / cbrt(V)))) / sqrt(cbrt(l) * cbrt(l));
	} else {
		tmp = c0 * sqrt(t_0);
	}
	return tmp;
}

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 2 regimes
  2. if (/.f64 A (*.f64 V l)) < 4.83283058496745e-311 or 2.4376396314410239e295 < (/.f64 A (*.f64 V l))

    1. Initial program 48.1

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied *-un-lft-identity_binary6448.1

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}} \]
    4. Applied add-cube-cbrt_binary6437.0

      \[\leadsto c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\color{blue}{\left(\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}\right) \cdot \sqrt[3]{\ell}}}} \]
    5. Applied *-un-lft-identity_binary6437.0

      \[\leadsto c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{\color{blue}{1 \cdot A}}{\left(\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}\right) \cdot \sqrt[3]{\ell}}} \]
    6. Applied times-frac_binary6437.0

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{c0 \cdot \sqrt{\frac{\frac{A}{\sqrt[3]{\ell}}}{V}}}}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}} \]
    13. Applied add-cube-cbrt_binary6425.2

      \[\leadsto \frac{c0 \cdot \sqrt{\frac{\frac{A}{\sqrt[3]{\ell}}}{\color{blue}{\left(\sqrt[3]{V} \cdot \sqrt[3]{V}\right) \cdot \sqrt[3]{V}}}}}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}} \]
    14. Applied *-un-lft-identity_binary6425.2

      \[\leadsto \frac{c0 \cdot \sqrt{\frac{\frac{A}{\sqrt[3]{\color{blue}{1 \cdot \ell}}}}{\left(\sqrt[3]{V} \cdot \sqrt[3]{V}\right) \cdot \sqrt[3]{V}}}}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}} \]
    15. Applied cbrt-prod_binary6425.2

      \[\leadsto \frac{c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{\sqrt[3]{1} \cdot \sqrt[3]{\ell}}}}{\left(\sqrt[3]{V} \cdot \sqrt[3]{V}\right) \cdot \sqrt[3]{V}}}}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}} \]
    16. Applied add-cube-cbrt_binary6425.3

      \[\leadsto \frac{c0 \cdot \sqrt{\frac{\frac{\color{blue}{\left(\sqrt[3]{A} \cdot \sqrt[3]{A}\right) \cdot \sqrt[3]{A}}}{\sqrt[3]{1} \cdot \sqrt[3]{\ell}}}{\left(\sqrt[3]{V} \cdot \sqrt[3]{V}\right) \cdot \sqrt[3]{V}}}}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}} \]
    17. Applied times-frac_binary6425.3

      \[\leadsto \frac{c0 \cdot \sqrt{\frac{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{\sqrt[3]{1}} \cdot \frac{\sqrt[3]{A}}{\sqrt[3]{\ell}}}}{\left(\sqrt[3]{V} \cdot \sqrt[3]{V}\right) \cdot \sqrt[3]{V}}}}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}} \]
    18. Applied times-frac_binary6422.7

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

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

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

    if 4.83283058496745e-311 < (/.f64 A (*.f64 V l)) < 2.4376396314410239e295

    1. Initial program 0.6

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied *-un-lft-identity_binary640.6

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}} \]
    4. Applied *-un-lft-identity_binary647.9

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \leq 4.8328305849675 \cdot 10^{-311} \lor \neg \left(\frac{A}{V \cdot \ell} \leq 2.437639631441024 \cdot 10^{+295}\right):\\ \;\;\;\;\frac{c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right| \cdot \sqrt{\frac{\frac{\sqrt[3]{A}}{\sqrt[3]{\ell}}}{\sqrt[3]{V}}}\right)}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \end{array} \]

Reproduce

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