Average Error: 19.5 → 12.2
Time: 4.8s
Precision: binary64
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -6.6560613513075085 \cdot 10^{-183}:\\ \;\;\;\;\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{\frac{V}{\frac{\sqrt[3]{A}}{\ell}}}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \leq 2.23 \cdot 10^{-321}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 1.0135061622844712 \cdot 10^{+304}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\ \end{array} \]
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -6.6560613513075085e-183)
   (* (sqrt (/ (* (cbrt A) (cbrt A)) (/ V (/ (cbrt A) l)))) c0)
   (if (<= (* V l) 2.23e-321)
     (* c0 (sqrt (/ 1.0 (/ V (/ A l)))))
     (if (<= (* V l) 1.0135061622844712e+304)
       (* c0 (/ (sqrt A) (sqrt (* V l))))
       (* c0 (sqrt (* (/ A l) (/ 1.0 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 tmp;
	if ((V * l) <= -6.6560613513075085e-183) {
		tmp = sqrt(((cbrt(A) * cbrt(A)) / (V / (cbrt(A) / l)))) * c0;
	} else if ((V * l) <= 2.23e-321) {
		tmp = c0 * sqrt((1.0 / (V / (A / l))));
	} else if ((V * l) <= 1.0135061622844712e+304) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * sqrt(((A / l) * (1.0 / V)));
	}
	return tmp;
}
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (V * l)));
}
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -6.6560613513075085e-183) {
		tmp = Math.sqrt(((Math.cbrt(A) * Math.cbrt(A)) / (V / (Math.cbrt(A) / l)))) * c0;
	} else if ((V * l) <= 2.23e-321) {
		tmp = c0 * Math.sqrt((1.0 / (V / (A / l))));
	} else if ((V * l) <= 1.0135061622844712e+304) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * Math.sqrt(((A / l) * (1.0 / V)));
	}
	return tmp;
}
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -6.6560613513075085e-183)
		tmp = Float64(sqrt(Float64(Float64(cbrt(A) * cbrt(A)) / Float64(V / Float64(cbrt(A) / l)))) * c0);
	elseif (Float64(V * l) <= 2.23e-321)
		tmp = Float64(c0 * sqrt(Float64(1.0 / Float64(V / Float64(A / l)))));
	elseif (Float64(V * l) <= 1.0135061622844712e+304)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / l) * Float64(1.0 / V))));
	end
	return tmp
end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -6.6560613513075085e-183], N[(N[Sqrt[N[(N[(N[Power[A, 1/3], $MachinePrecision] * N[Power[A, 1/3], $MachinePrecision]), $MachinePrecision] / N[(V / N[(N[Power[A, 1/3], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * c0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2.23e-321], N[(c0 * N[Sqrt[N[(1.0 / N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1.0135061622844712e+304], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -6.6560613513075085 \cdot 10^{-183}:\\
\;\;\;\;\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{\frac{V}{\frac{\sqrt[3]{A}}{\ell}}}} \cdot c0\\

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

\mathbf{elif}\;V \cdot \ell \leq 1.0135061622844712 \cdot 10^{+304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

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


\end{array}

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 4 regimes
  2. if (*.f64 V l) < -6.6560613513075085e-183

    1. Initial program 14.9

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

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

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

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

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

      \[\leadsto \left(\color{blue}{{c0}^{1}} \cdot {\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1}\right) \cdot {\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1} \]
    7. Applied pow-prod-down_binary6415.1

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

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

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

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

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

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

    if -6.6560613513075085e-183 < (*.f64 V l) < 2.22824e-321

    1. Initial program 46.7

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied add-sqr-sqrt_binary6446.8

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

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

      \[\leadsto \left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right) \cdot \color{blue}{{\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1}} \]
    5. Applied pow1_binary6446.8

      \[\leadsto \left(c0 \cdot \color{blue}{{\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1}}\right) \cdot {\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1} \]
    6. Applied pow1_binary6446.8

      \[\leadsto \left(\color{blue}{{c0}^{1}} \cdot {\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1}\right) \cdot {\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1} \]
    7. Applied pow-prod-down_binary6446.8

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

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

      \[\leadsto {\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}}^{1} \]
    10. Applied clear-num_binary6446.7

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

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

    if 2.22824e-321 < (*.f64 V l) < 1.01350616228447121e304

    1. Initial program 10.1

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied sqrt-div_binary640.5

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

    if 1.01350616228447121e304 < (*.f64 V l)

    1. Initial program 41.6

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

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

      \[\leadsto \color{blue}{\left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right) \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}} \]
    4. Applied pow1_binary6441.6

      \[\leadsto \left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right) \cdot \color{blue}{{\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1}} \]
    5. Applied pow1_binary6441.6

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

      \[\leadsto \left(\color{blue}{{c0}^{1}} \cdot {\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1}\right) \cdot {\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1} \]
    7. Applied pow-prod-down_binary6441.6

      \[\leadsto \color{blue}{{\left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1}} \cdot {\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^{1} \]
    8. Applied pow-prod-down_binary6441.6

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

      \[\leadsto {\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}}^{1} \]
    10. Applied *-un-lft-identity_binary6441.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -6.6560613513075085 \cdot 10^{-183}:\\ \;\;\;\;\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{\frac{V}{\frac{\sqrt[3]{A}}{\ell}}}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \leq 2.23 \cdot 10^{-321}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 1.0135061622844712 \cdot 10^{+304}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\ \end{array} \]

Reproduce

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