Average Error: 19.6 → 7.9
Time: 9.3s
Precision: binary64
\[[V, l] = \mathsf{sort}([V, l]) \\]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} t_0 := {\left(\sqrt[3]{A}\right)}^{2}\\ t_1 := \sqrt[3]{t_0}\\ t_2 := \sqrt{\frac{A}{V}}\\ \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0 \cdot t_2}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5.434208759382676 \cdot 10^{-103}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{t_2}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 3.406287716144191 \cdot 10^{+305}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\left(\sqrt[3]{\frac{t_0}{V}} \cdot \frac{\sqrt[3]{A}}{\ell}\right) \cdot \left(t_1 \cdot t_1\right)}}{\left|\sqrt[3]{V}\right|}\\ \end{array} \]
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (pow (cbrt A) 2.0)) (t_1 (cbrt t_0)) (t_2 (sqrt (/ A V))))
   (if (<= (* V l) (- INFINITY))
     (/ (* c0 t_2) (sqrt l))
     (if (<= (* V l) -5.434208759382676e-103)
       (* c0 (sqrt (/ A (* V l))))
       (if (<= (* V l) 0.0)
         (* c0 (/ t_2 (sqrt l)))
         (if (<= (* V l) 3.406287716144191e+305)
           (* c0 (/ (sqrt A) (sqrt (* V l))))
           (*
            c0
            (/
             (sqrt (* (* (cbrt (/ t_0 V)) (/ (cbrt A) l)) (* t_1 t_1)))
             (fabs (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 = pow(cbrt(A), 2.0);
	double t_1 = cbrt(t_0);
	double t_2 = sqrt((A / V));
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (c0 * t_2) / sqrt(l);
	} else if ((V * l) <= -5.434208759382676e-103) {
		tmp = c0 * sqrt((A / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0 * (t_2 / sqrt(l));
	} else if ((V * l) <= 3.406287716144191e+305) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 * (sqrt(((cbrt((t_0 / V)) * (cbrt(A) / l)) * (t_1 * t_1))) / fabs(cbrt(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 t_0 = Math.pow(Math.cbrt(A), 2.0);
	double t_1 = Math.cbrt(t_0);
	double t_2 = Math.sqrt((A / V));
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (c0 * t_2) / Math.sqrt(l);
	} else if ((V * l) <= -5.434208759382676e-103) {
		tmp = c0 * Math.sqrt((A / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0 * (t_2 / Math.sqrt(l));
	} else if ((V * l) <= 3.406287716144191e+305) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 * (Math.sqrt(((Math.cbrt((t_0 / V)) * (Math.cbrt(A) / l)) * (t_1 * t_1))) / Math.abs(Math.cbrt(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)
	t_0 = cbrt(A) ^ 2.0
	t_1 = cbrt(t_0)
	t_2 = sqrt(Float64(A / V))
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(c0 * t_2) / sqrt(l));
	elseif (Float64(V * l) <= -5.434208759382676e-103)
		tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(c0 * Float64(t_2 / sqrt(l)));
	elseif (Float64(V * l) <= 3.406287716144191e+305)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * Float64(sqrt(Float64(Float64(cbrt(Float64(t_0 / V)) * Float64(cbrt(A) / l)) * Float64(t_1 * t_1))) / abs(cbrt(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_] := Block[{t$95$0 = N[Power[N[Power[A, 1/3], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 1/3], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 * t$95$2), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5.434208759382676e-103], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(t$95$2 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 3.406287716144191e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(N[(N[Power[N[(t$95$0 / V), $MachinePrecision], 1/3], $MachinePrecision] * N[(N[Power[A, 1/3], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Abs[N[Power[V, 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
t_0 := {\left(\sqrt[3]{A}\right)}^{2}\\
t_1 := \sqrt[3]{t_0}\\
t_2 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0 \cdot t_2}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq -5.434208759382676 \cdot 10^{-103}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{t_2}{\sqrt{\ell}}\\

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

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


\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 5 regimes
  2. if (*.f64 V l) < -inf.0

    1. Initial program 42.1

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied add-cube-cbrt_binary6442.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_binary6422.5

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \frac{\sqrt[3]{A}}{\ell}}} \]
    4. Applied associate-*r/_binary6422.5

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \sqrt[3]{A}}{\ell}}} \]
    5. Applied sqrt-div_binary6411.0

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \sqrt[3]{A}}}{\sqrt{\ell}}} \]
    6. Applied associate-*r/_binary6411.5

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

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

    if -inf.0 < (*.f64 V l) < -5.4342087593826757e-103

    1. Initial program 7.2

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

      \[\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_binary6413.3

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \frac{\sqrt[3]{A}}{\ell}}} \]
    4. Taylor expanded in c0 around 0 7.2

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

    if -5.4342087593826757e-103 < (*.f64 V l) < -0.0

    1. Initial program 38.6

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

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V} \cdot \sqrt[3]{A}}{\ell}}} \]
    5. Applied sqrt-div_binary6420.0

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

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

    if -0.0 < (*.f64 V l) < 3.4062877161441909e305

    1. Initial program 10.9

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

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

    if 3.4062877161441909e305 < (*.f64 V l)

    1. Initial program 41.1

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied add-cube-cbrt_binary6441.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.5

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

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

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

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

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{\sqrt[3]{A} \cdot \sqrt[3]{A}} \cdot \sqrt[3]{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}}}{\sqrt[3]{V}}} \cdot \frac{\sqrt[3]{\sqrt[3]{A} \cdot \sqrt[3]{A}} \cdot \frac{\sqrt[3]{A}}{\ell}}{\sqrt[3]{V}}} \]
    10. Applied frac-times_binary6423.6

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5.434208759382676 \cdot 10^{-103}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 3.406287716144191 \cdot 10^{+305}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\left(\sqrt[3]{\frac{{\left(\sqrt[3]{A}\right)}^{2}}{V}} \cdot \frac{\sqrt[3]{A}}{\ell}\right) \cdot \left(\sqrt[3]{{\left(\sqrt[3]{A}\right)}^{2}} \cdot \sqrt[3]{{\left(\sqrt[3]{A}\right)}^{2}}\right)}}{\left|\sqrt[3]{V}\right|}\\ \end{array} \]

Reproduce

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