Average Error: 19.0 → 8.4
Time: 6.2s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{if}\;V \cdot \ell \leq -7.412885324817908 \cdot 10^{+253}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -1.3754201150893268 \cdot 10^{-288}:\\ \;\;\;\;c0 \cdot \frac{\left|\sqrt[3]{A}\right|}{\sqrt{\left(V \cdot \ell\right) \cdot \sqrt[3]{\frac{1}{A}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 1.7736509609331736 \cdot 10^{-308} \lor \neg \left(V \cdot \ell \leq 6.1070541913147315 \cdot 10^{+259}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array} \]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -7.412885324817908 \cdot 10^{+253}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;V \cdot \ell \leq -1.3754201150893268 \cdot 10^{-288}:\\
\;\;\;\;c0 \cdot \frac{\left|\sqrt[3]{A}\right|}{\sqrt{\left(V \cdot \ell\right) \cdot \sqrt[3]{\frac{1}{A}}}}\\

\mathbf{elif}\;V \cdot \ell \leq 1.7736509609331736 \cdot 10^{-308} \lor \neg \left(V \cdot \ell \leq 6.1070541913147315 \cdot 10^{+259}\right):\\
\;\;\;\;t_0\\

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


\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 (/ (/ A l) V)))))
   (if (<= (* V l) -7.412885324817908e+253)
     t_0
     (if (<= (* V l) -1.3754201150893268e-288)
       (* c0 (/ (fabs (cbrt A)) (sqrt (* (* V l) (cbrt (/ 1.0 A))))))
       (if (or (<= (* V l) 1.7736509609331736e-308)
               (not (<= (* V l) 6.1070541913147315e+259)))
         t_0
         (* c0 (/ (sqrt A) (sqrt (* V 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 t_0 = c0 * sqrt((A / l) / V);
	double tmp;
	if ((V * l) <= -7.412885324817908e+253) {
		tmp = t_0;
	} else if ((V * l) <= -1.3754201150893268e-288) {
		tmp = c0 * (fabs(cbrt(A)) / sqrt((V * l) * cbrt(1.0 / A)));
	} else if (((V * l) <= 1.7736509609331736e-308) || !((V * l) <= 6.1070541913147315e+259)) {
		tmp = t_0;
	} else {
		tmp = c0 * (sqrt(A) / sqrt(V * 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 3 regimes
  2. if (*.f64 V l) < -7.41288532481790781e253 or -1.37542011508932678e-288 < (*.f64 V l) < 1.7736509609331736e-308 or 6.1070541913147315e259 < (*.f64 V l)

    1. Initial program 44.0

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

      \[\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 times-frac_binary6427.0

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \frac{\sqrt[3]{A}}{\ell}}} \]
    5. Applied associate-*l/_binary6427.0

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

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

    if -7.41288532481790781e253 < (*.f64 V l) < -1.37542011508932678e-288

    1. Initial program 8.4

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

      \[\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*_binary648.8

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

      \[\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 sqrt-div_binary644.4

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\sqrt[3]{A} \cdot \sqrt[3]{A}}}{\sqrt{\frac{V}{\frac{\sqrt[3]{A}}{\ell}}}}} \]
    8. Simplified4.4

      \[\leadsto c0 \cdot \frac{\color{blue}{\left|\sqrt[3]{A}\right|}}{\sqrt{\frac{V}{\frac{\sqrt[3]{A}}{\ell}}}} \]
    9. Taylor expanded around 0 64.0

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

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

    if 1.7736509609331736e-308 < (*.f64 V l) < 6.1070541913147315e259

    1. Initial program 9.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -7.412885324817908 \cdot 10^{+253}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1.3754201150893268 \cdot 10^{-288}:\\ \;\;\;\;c0 \cdot \frac{\left|\sqrt[3]{A}\right|}{\sqrt{\left(V \cdot \ell\right) \cdot \sqrt[3]{\frac{1}{A}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 1.7736509609331736 \cdot 10^{-308} \lor \neg \left(V \cdot \ell \leq 6.1070541913147315 \cdot 10^{+259}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array} \]

Reproduce

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