Average Error: 19.7 → 8.8
Time: 11.2s
Precision: binary64
\[[V, l]=\mathsf{sort}([V, l])\]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1.0708771622682368 \cdot 10^{-235}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\sqrt[3]{1} \cdot \left(A \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}\right)\right)}}{\sqrt{\sqrt[3]{V \cdot \ell} \cdot \sqrt[3]{V \cdot \ell}}}\\ \mathbf{elif}\;V \cdot \ell \leq 2.393827005791 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq 1.4277681989284532 \cdot 10^{+252}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array}\]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 2.393827005791 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq 1.4277681989284532 \cdot 10^{+252}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\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
 (if (<= (* V l) (- INFINITY))
   (* c0 (sqrt (/ (/ A V) l)))
   (if (<= (* V l) -1.0708771622682368e-235)
     (*
      c0
      (/
       (sqrt (* (cbrt 1.0) (* A (* (cbrt 1.0) (cbrt (/ 1.0 (* V l)))))))
       (sqrt (* (cbrt (* V l)) (cbrt (* V l))))))
     (if (or (<= (* V l) 2.393827005791e-316)
             (not (<= (* V l) 1.4277681989284532e+252)))
       (* c0 (sqrt (/ (/ A V) l)))
       (* 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 tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = c0 * sqrt((A / V) / l);
	} else if ((V * l) <= -1.0708771622682368e-235) {
		tmp = c0 * (sqrt(cbrt(1.0) * (A * (cbrt(1.0) * cbrt(1.0 / (V * l))))) / sqrt(cbrt(V * l) * cbrt(V * l)));
	} else if (((V * l) <= 2.393827005791e-316) || !((V * l) <= 1.4277681989284532e+252)) {
		tmp = c0 * sqrt((A / V) / l);
	} 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) < -inf.0 or -1.07087716226823684e-235 < (*.f64 V l) < 2.393827006e-316 or 1.42776819892845322e252 < (*.f64 V l)

    1. Initial program 43.6

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied associate-/r*_binary64_104526.0

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

    if -inf.0 < (*.f64 V l) < -1.07087716226823684e-235

    1. Initial program 9.2

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

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\left(A \cdot \left(\sqrt[3]{\frac{1}{V \cdot \ell}} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}\right)\right) \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}}\]
    7. Using strategy rm
    8. Applied cbrt-div_binary64_11339.5

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

      \[\leadsto c0 \cdot \sqrt{\left(A \cdot \left(\color{blue}{\frac{\sqrt[3]{1}}{\sqrt[3]{V \cdot \ell}}} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}\right)\right) \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{V \cdot \ell}}}\]
    10. Applied associate-*l/_binary64_10449.5

      \[\leadsto c0 \cdot \sqrt{\left(A \cdot \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}}{\sqrt[3]{V \cdot \ell}}}\right) \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{V \cdot \ell}}}\]
    11. Applied associate-*r/_binary64_10439.5

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

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

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

    if 2.393827006e-316 < (*.f64 V l) < 1.42776819892845322e252

    1. Initial program 10.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1.0708771622682368 \cdot 10^{-235}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\sqrt[3]{1} \cdot \left(A \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{\frac{1}{V \cdot \ell}}\right)\right)}}{\sqrt{\sqrt[3]{V \cdot \ell} \cdot \sqrt[3]{V \cdot \ell}}}\\ \mathbf{elif}\;V \cdot \ell \leq 2.393827005791 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq 1.4277681989284532 \cdot 10^{+252}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array}\]

Reproduce

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