Average Error: 18.8 → 3.1
Time: 13.3s
Precision: binary64
\[[V, l] = \mathsf{sort}([V, l]) \\]
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
\[\begin{array}{l} \mathbf{if}\;\ell \leq 5.791585286599143 \cdot 10^{-309}:\\ \;\;\;\;\begin{array}{l} t_0 := \sqrt[3]{\sqrt{A}}\\ \left(c0 \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V} \cdot \sqrt[3]{V}}{\frac{t_0}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}}}\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V}}{\frac{t_0}{\sqrt[3]{\ell}}}}} \end{array}\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_1 := \frac{\sqrt[3]{A}}{\sqrt[3]{V}}\\ c0 \cdot \left(\left|t_1\right| \cdot \left(\sqrt{\frac{1}{\ell}} \cdot \sqrt{t_1}\right)\right) \end{array}\\ \end{array} \]
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.791585286599143 \cdot 10^{-309}:\\
\;\;\;\;\begin{array}{l}
t_0 := \sqrt[3]{\sqrt{A}}\\
\left(c0 \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V} \cdot \sqrt[3]{V}}{\frac{t_0}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}}}\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V}}{\frac{t_0}{\sqrt[3]{\ell}}}}}
\end{array}\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \frac{\sqrt[3]{A}}{\sqrt[3]{V}}\\
c0 \cdot \left(\left|t_1\right| \cdot \left(\sqrt{\frac{1}{\ell}} \cdot \sqrt{t_1}\right)\right)
\end{array}\\


\end{array}
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
 :precision binary64
 (if (<= l 5.791585286599143e-309)
   (let* ((t_0 (cbrt (sqrt A))))
     (*
      (*
       c0
       (sqrt
        (/ (cbrt A) (/ (* (cbrt V) (cbrt V)) (/ t_0 (* (cbrt l) (cbrt l)))))))
      (sqrt (/ (cbrt A) (/ (cbrt V) (/ t_0 (cbrt l)))))))
   (let* ((t_1 (/ (cbrt A) (cbrt V))))
     (* c0 (* (fabs t_1) (* (sqrt (/ 1.0 l)) (sqrt t_1)))))))
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 (l <= 5.791585286599143e-309) {
		double t_0_1 = cbrt(sqrt(A));
		tmp = (c0 * sqrt(cbrt(A) / ((cbrt(V) * cbrt(V)) / (t_0_1 / (cbrt(l) * cbrt(l)))))) * sqrt(cbrt(A) / (cbrt(V) / (t_0_1 / cbrt(l))));
	} else {
		double t_1 = cbrt(A) / cbrt(V);
		tmp = c0 * (fabs(t_1) * (sqrt(1.0 / l) * sqrt(t_1)));
	}
	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 2 regimes
  2. if l < 5.7915852865991435e-309

    1. Initial program 19.0

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

      \[\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 associate-/l*_binary6419.4

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

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

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

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

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

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

      \[\leadsto c0 \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{\frac{\color{blue}{\left(\sqrt[3]{V} \cdot \sqrt[3]{V}\right) \cdot \sqrt[3]{V}}}{\frac{\sqrt[3]{\sqrt{A}}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}} \cdot \frac{\sqrt[3]{\sqrt{A}}}{\sqrt[3]{\ell}}}}} \]
    10. Applied times-frac_binary6417.3

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V} \cdot \sqrt[3]{V}}{\frac{\sqrt[3]{\sqrt{A}}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}} \cdot \frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V}}{\frac{\sqrt[3]{\sqrt{A}}}{\sqrt[3]{\ell}}}}}} \]
    12. Applied sqrt-prod_binary645.4

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

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

    if 5.7915852865991435e-309 < l

    1. Initial program 18.8

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Applied add-cube-cbrt_binary6419.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 associate-/l*_binary6419.1

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

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

      \[\leadsto c0 \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{\frac{V}{\color{blue}{\sqrt[3]{A} \cdot \frac{1}{\ell}}}}} \]
    6. Applied add-cube-cbrt_binary6418.1

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

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

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

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

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

      \[\leadsto c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right| \cdot \color{blue}{\sqrt{\frac{\sqrt[3]{A}}{\ell \cdot \sqrt[3]{V}}}}\right) \]
    12. Applied *-un-lft-identity_binary646.4

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 5.791585286599143 \cdot 10^{-309}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V} \cdot \sqrt[3]{V}}{\frac{\sqrt[3]{\sqrt{A}}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}}}\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\frac{\sqrt[3]{V}}{\frac{\sqrt[3]{\sqrt{A}}}{\sqrt[3]{\ell}}}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\left|\frac{\sqrt[3]{A}}{\sqrt[3]{V}}\right| \cdot \left(\sqrt{\frac{1}{\ell}} \cdot \sqrt{\frac{\sqrt[3]{A}}{\sqrt[3]{V}}}\right)\right)\\ \end{array} \]

Reproduce

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