Average Error: 19.0 → 4.3
Time: 14.7s
Precision: binary64
\[[V, l]=\mathsf{sort}([V, l])\]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;\ell \leq 2.9757661883394 \cdot 10^{-311}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V} \cdot \sqrt[3]{V}}{\frac{\sqrt[3]{\sqrt[3]{A} \cdot \sqrt[3]{A}}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V}}{\frac{\sqrt[3]{\sqrt[3]{A}}}{\sqrt[3]{\ell}}}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{\sqrt[3]{V}}} \cdot \left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right|\right)}{\sqrt{\ell}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.9757661883394 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V} \cdot \sqrt[3]{V}}{\frac{\sqrt[3]{\sqrt[3]{A} \cdot \sqrt[3]{A}}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V}}{\frac{\sqrt[3]{\sqrt[3]{A}}}{\sqrt[3]{\ell}}}}}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \left(\sqrt{\frac{\sqrt[3]{A}}{\sqrt[3]{V}}} \cdot \left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right|\right)}{\sqrt{\ell}}\\

\end{array}
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (if (<= l 2.9757661883394e-311)
   (*
    c0
    (*
     (sqrt
      (/
       (cbrt A)
       (/
        (* (cbrt V) (cbrt V))
        (/ (cbrt (* (cbrt A) (cbrt A))) (* (cbrt l) (cbrt l))))))
     (sqrt (/ (cbrt A) (/ (cbrt V) (/ (cbrt (cbrt A)) (cbrt l)))))))
   (/
    (* c0 (* (sqrt (/ (cbrt A) (cbrt V))) (fabs (/ (cbrt A) (cbrt V)))))
    (sqrt l))))
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 tmp;
	if (l <= 2.9757661883394e-311) {
		tmp = c0 * (sqrt(cbrt(A) / ((cbrt(V) * cbrt(V)) / (cbrt(cbrt(A) * cbrt(A)) / (cbrt(l) * cbrt(l))))) * sqrt(cbrt(A) / (cbrt(V) / (cbrt(cbrt(A)) / cbrt(l)))));
	} else {
		tmp = (c0 * (sqrt(cbrt(A) / cbrt(V)) * fabs(cbrt(A) / cbrt(V)))) / sqrt(l);
	}
	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 l < 2.97576618833939e-311

    1. Initial program 19.2

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt_binary64_113619.6

      \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\left(\sqrt[3]{A} \cdot \sqrt[3]{A}\right) \cdot \sqrt[3]{A}}}{V \cdot \ell}}\]
    4. Applied associate-/l*_binary64_104619.6

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{\frac{V \cdot \ell}{\sqrt[3]{A}}}}}\]
    5. Simplified18.9

      \[\leadsto c0 \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{\color{blue}{\frac{V}{\frac{\sqrt[3]{A}}{\ell}}}}}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt_binary64_113619.1

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

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

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

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

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V} \cdot \sqrt[3]{V}}{\frac{\sqrt[3]{\sqrt[3]{A} \cdot \sqrt[3]{A}}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}} \cdot \frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V}}{\frac{\sqrt[3]{\sqrt[3]{A}}}{\sqrt[3]{\ell}}}}}}\]
    14. Applied sqrt-prod_binary64_11175.6

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

    if 2.97576618833939e-311 < l

    1. Initial program 18.9

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

      \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\left(\sqrt[3]{A} \cdot \sqrt[3]{A}\right) \cdot \sqrt[3]{A}}}{V \cdot \ell}}\]
    4. Applied associate-/l*_binary64_104619.2

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

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right| \cdot \color{blue}{\sqrt{\frac{\sqrt[3]{A}}{\sqrt[3]{V} \cdot \ell}}}\right)\]
    14. Using strategy rm
    15. Applied add-cube-cbrt_binary64_11366.5

      \[\leadsto c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right| \cdot \sqrt{\frac{\color{blue}{\left(\sqrt[3]{\sqrt[3]{A}} \cdot \sqrt[3]{\sqrt[3]{A}}\right) \cdot \sqrt[3]{\sqrt[3]{A}}}}{\sqrt[3]{V} \cdot \ell}}\right)\]
    16. Applied times-frac_binary64_11075.2

      \[\leadsto c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right| \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{\sqrt[3]{A}} \cdot \sqrt[3]{\sqrt[3]{A}}}{\sqrt[3]{V}} \cdot \frac{\sqrt[3]{\sqrt[3]{A}}}{\ell}}}\right)\]
    17. Using strategy rm
    18. Applied associate-*r/_binary64_10434.9

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

      \[\leadsto c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right| \cdot \color{blue}{\frac{\sqrt{\frac{\sqrt[3]{\sqrt[3]{A}} \cdot \sqrt[3]{\sqrt[3]{A}}}{\sqrt[3]{V}} \cdot \sqrt[3]{\sqrt[3]{A}}}}{\sqrt{\ell}}}\right)\]
    20. Applied associate-*r/_binary64_10432.3

      \[\leadsto c0 \cdot \color{blue}{\frac{\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right| \cdot \sqrt{\frac{\sqrt[3]{\sqrt[3]{A}} \cdot \sqrt[3]{\sqrt[3]{A}}}{\sqrt[3]{V}} \cdot \sqrt[3]{\sqrt[3]{A}}}}{\sqrt{\ell}}}\]
    21. Applied associate-*r/_binary64_10434.1

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

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

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

Reproduce

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