Average Error: 19.4 → 8.9
Time: 7.4s
Precision: binary64
\[[V, l]=\mathsf{sort}([V, l])\]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} t_0 := \sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}\\ t_1 := \frac{A}{V \cdot \ell}\\ t_2 := \frac{1}{\sqrt[3]{\ell}}\\ \mathbf{if}\;t_1 \leq 2.5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V} \cdot t_2}}{t_0}\\ \mathbf{elif}\;t_1 \leq 3.020884093980358 \cdot 10^{+304}:\\ \;\;\;\;c0 \cdot \sqrt{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{t_2 \cdot \left(A \cdot \frac{1}{V}\right)}}{t_0}\\ \end{array} \]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
t_0 := \sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}\\
t_1 := \frac{A}{V \cdot \ell}\\
t_2 := \frac{1}{\sqrt[3]{\ell}}\\
\mathbf{if}\;t_1 \leq 2.5 \cdot 10^{-323}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V} \cdot t_2}}{t_0}\\

\mathbf{elif}\;t_1 \leq 3.020884093980358 \cdot 10^{+304}:\\
\;\;\;\;c0 \cdot \sqrt{t_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{t_2 \cdot \left(A \cdot \frac{1}{V}\right)}}{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 (sqrt (* (cbrt l) (cbrt l))))
        (t_1 (/ A (* V l)))
        (t_2 (/ 1.0 (cbrt l))))
   (if (<= t_1 2.5e-323)
     (/ (* c0 (sqrt (* (/ A V) t_2))) t_0)
     (if (<= t_1 3.020884093980358e+304)
       (* c0 (sqrt t_1))
       (/ (* c0 (sqrt (* t_2 (* A (/ 1.0 V))))) 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 = sqrt(cbrt(l) * cbrt(l));
	double t_1 = A / (V * l);
	double t_2 = 1.0 / cbrt(l);
	double tmp;
	if (t_1 <= 2.5e-323) {
		tmp = (c0 * sqrt((A / V) * t_2)) / t_0;
	} else if (t_1 <= 3.020884093980358e+304) {
		tmp = c0 * sqrt(t_1);
	} else {
		tmp = (c0 * sqrt(t_2 * (A * (1.0 / V)))) / 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 3 regimes
  2. if (/.f64 A (*.f64 V l)) < 2.47033e-323

    1. Initial program 42.0

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

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

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

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

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

      \[\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*_binary6435.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. Applied un-div-inv_binary6435.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/_binary6429.8

      \[\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_binary6419.6

      \[\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/_binary6419.7

      \[\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. Applied div-inv_binary6419.7

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

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

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

    if 2.47033e-323 < (/.f64 A (*.f64 V l)) < 3.02088409398035799e304

    1. Initial program 0.8

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

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

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

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

    if 3.02088409398035799e304 < (/.f64 A (*.f64 V l))

    1. Initial program 63.4

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

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

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

      \[\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_binary6447.9

      \[\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_binary6447.9

      \[\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*_binary6457.9

      \[\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. Applied un-div-inv_binary6457.9

      \[\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/_binary6448.2

      \[\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_binary6431.9

      \[\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/_binary6431.9

      \[\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. Applied div-inv_binary6431.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \leq 2.5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\sqrt[3]{\ell}}}}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}\\ \mathbf{elif}\;\frac{A}{V \cdot \ell} \leq 3.020884093980358 \cdot 10^{+304}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{\frac{1}{\sqrt[3]{\ell}} \cdot \left(A \cdot \frac{1}{V}\right)}}{\sqrt{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}\\ \end{array} \]

Reproduce

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