Average Error: 19.1 → 15.1
Time: 20.9s
Precision: 64
Internal precision: 128
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;V \le 1.0800478838409164 \cdot 10^{-294}:\\
\;\;\;\;\sqrt{\frac{\frac{A}{\ell}}{V}} \cdot c0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{\ell}}}{\sqrt{V}} \cdot c0\\
\end{array}\]
Derivation
- Split input into 2 regimes.
-
if V < 1.0800478838409164e-294
Initial program 19.3
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
- Using strategy
rm
Applied add-sqr-sqrt 19.5
\[\leadsto c0 \cdot \color{blue}{{\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^2}\]
Applied taylor 19.5
\[\leadsto c0 \cdot {\left(\sqrt{\sqrt{\frac{A}{\ell \cdot V}}}\right)}^2\]
Taylor expanded around 0 19.5
\[\leadsto c0 \cdot {\left(\sqrt{\sqrt{\color{blue}{\frac{A}{\ell \cdot V}}}}\right)}^2\]
Applied simplify 19.1
\[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{\ell}}{V}} \cdot c0}\]
if 1.0800478838409164e-294 < V
Initial program 18.9
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
- Using strategy
rm
Applied add-sqr-sqrt 19.1
\[\leadsto c0 \cdot \color{blue}{{\left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)}^2}\]
Applied taylor 19.1
\[\leadsto c0 \cdot {\left(\sqrt{\sqrt{\frac{A}{\ell \cdot V}}}\right)}^2\]
Taylor expanded around 0 19.1
\[\leadsto c0 \cdot {\left(\sqrt{\sqrt{\color{blue}{\frac{A}{\ell \cdot V}}}}\right)}^2\]
Applied simplify 18.3
\[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{\ell}}{V}} \cdot c0}\]
- Using strategy
rm
Applied sqrt-div 10.9
\[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{\ell}}}{\sqrt{V}}} \cdot c0\]
- Recombined 2 regimes into one program.
- Removed slow pow expressions
Runtime
Please include this information when filing a bug report:
herbie --seed '#(2472078766 2254188213 3344067926 3806046757 1024838006 471693918)'
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
(* c0 (sqrt (/ A (* V l)))))