Average Error: 19.3 → 5.7
Time: 8.6s
Precision: binary64
\[[V, l]=\mathsf{sort}([V, l])\]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} t_0 := \left(c0 \cdot \sqrt{\frac{1}{\ell}}\right) \cdot \frac{\sqrt{\frac{A}{\sqrt[3]{V}}}}{\left|\sqrt[3]{V}\right|}\\ \mathbf{if}\;V \cdot \ell \leq -3.9062903098446517 \cdot 10^{+201}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -1.23035359023557 \cdot 10^{-68}:\\ \;\;\;\;c0 \cdot \sqrt{A \cdot \frac{1}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\left|\frac{\sqrt{A}}{\sqrt[3]{V}}\right|}{\sqrt{\ell \cdot \sqrt[3]{V}}}\\ \end{array} \]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
t_0 := \left(c0 \cdot \sqrt{\frac{1}{\ell}}\right) \cdot \frac{\sqrt{\frac{A}{\sqrt[3]{V}}}}{\left|\sqrt[3]{V}\right|}\\
\mathbf{if}\;V \cdot \ell \leq -3.9062903098446517 \cdot 10^{+201}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;V \cdot \ell \leq -1.23035359023557 \cdot 10^{-68}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{1}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\

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


\end{array}
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0
         (*
          (* c0 (sqrt (/ 1.0 l)))
          (/ (sqrt (/ A (cbrt V))) (fabs (cbrt V))))))
   (if (<= (* V l) -3.9062903098446517e+201)
     t_0
     (if (<= (* V l) -1.23035359023557e-68)
       (* c0 (sqrt (* A (/ 1.0 (* V l)))))
       (if (<= (* V l) 0.0)
         t_0
         (* c0 (/ (fabs (/ (sqrt A) (cbrt V))) (sqrt (* l (cbrt V))))))))))
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 = (c0 * sqrt(1.0 / l)) * (sqrt(A / cbrt(V)) / fabs(cbrt(V)));
	double tmp;
	if ((V * l) <= -3.9062903098446517e+201) {
		tmp = t_0;
	} else if ((V * l) <= -1.23035359023557e-68) {
		tmp = c0 * sqrt(A * (1.0 / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = t_0;
	} else {
		tmp = c0 * (fabs(sqrt(A) / cbrt(V)) / sqrt(l * cbrt(V)));
	}
	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 3 regimes
  2. if (*.f64 V l) < -3.90629030984465169e201 or -1.2303535902355699e-68 < (*.f64 V l) < -0.0

    1. Initial program 32.9

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied add-cube-cbrt_binary6433.1

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \frac{\sqrt[3]{A}}{\ell}}} \]
    4. Applied add-cube-cbrt_binary6423.9

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

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

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

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

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

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

      \[\leadsto c0 \cdot \frac{\sqrt{\frac{A}{\ell \cdot \sqrt[3]{V}}}}{\color{blue}{\left|\sqrt[3]{V}\right|}} \]
    11. Applied *-un-lft-identity_binary6418.5

      \[\leadsto c0 \cdot \frac{\sqrt{\frac{A}{\ell \cdot \sqrt[3]{V}}}}{\left|\sqrt[3]{\color{blue}{1 \cdot V}}\right|} \]
    12. Applied cbrt-prod_binary6418.5

      \[\leadsto c0 \cdot \frac{\sqrt{\frac{A}{\ell \cdot \sqrt[3]{V}}}}{\left|\color{blue}{\sqrt[3]{1} \cdot \sqrt[3]{V}}\right|} \]
    13. Applied fabs-mul_binary6418.5

      \[\leadsto c0 \cdot \frac{\sqrt{\frac{A}{\ell \cdot \sqrt[3]{V}}}}{\color{blue}{\left|\sqrt[3]{1}\right| \cdot \left|\sqrt[3]{V}\right|}} \]
    14. Applied *-un-lft-identity_binary6418.5

      \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{1 \cdot A}}{\ell \cdot \sqrt[3]{V}}}}{\left|\sqrt[3]{1}\right| \cdot \left|\sqrt[3]{V}\right|} \]
    15. Applied times-frac_binary6415.4

      \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1}{\ell} \cdot \frac{A}{\sqrt[3]{V}}}}}{\left|\sqrt[3]{1}\right| \cdot \left|\sqrt[3]{V}\right|} \]
    16. Applied sqrt-prod_binary648.8

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

      \[\leadsto c0 \cdot \color{blue}{\left(\frac{\sqrt{\frac{1}{\ell}}}{\left|\sqrt[3]{1}\right|} \cdot \frac{\sqrt{\frac{A}{\sqrt[3]{V}}}}{\left|\sqrt[3]{V}\right|}\right)} \]
    18. Applied associate-*r*_binary649.0

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

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

    if -3.90629030984465169e201 < (*.f64 V l) < -1.2303535902355699e-68

    1. Initial program 5.7

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied div-inv_binary645.7

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

    if -0.0 < (*.f64 V l)

    1. Initial program 15.3

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied add-cube-cbrt_binary6415.6

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \frac{\sqrt[3]{A}}{\ell}}} \]
    4. Applied add-cube-cbrt_binary6416.7

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -3.9062903098446517 \cdot 10^{+201}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{\ell}}\right) \cdot \frac{\sqrt{\frac{A}{\sqrt[3]{V}}}}{\left|\sqrt[3]{V}\right|}\\ \mathbf{elif}\;V \cdot \ell \leq -1.23035359023557 \cdot 10^{-68}:\\ \;\;\;\;c0 \cdot \sqrt{A \cdot \frac{1}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{1}{\ell}}\right) \cdot \frac{\sqrt{\frac{A}{\sqrt[3]{V}}}}{\left|\sqrt[3]{V}\right|}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\left|\frac{\sqrt{A}}{\sqrt[3]{V}}\right|}{\sqrt{\ell \cdot \sqrt[3]{V}}}\\ \end{array} \]

Reproduce

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