Average Error: 13.5 → 9.6
Time: 3.2m
Precision: 64
Internal Precision: 320
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
↓
\[\begin{array}{l}
\mathbf{if}\;\sqrt{1 - {\left(\frac{M}{\frac{2 \cdot d}{D}}\right)}^{2} \cdot \frac{h}{\ell}} \le +\infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - {\left(\frac{M}{\frac{2 \cdot d}{D}}\right)}^{2} \cdot \frac{h}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}\]
Derivation
- Split input into 2 regimes
if (sqrt (- 1 (* (pow (/ M (/ (* 2 d) D)) 2) (/ h l)))) < +inf.0
Initial program 9.1
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
- Using strategy
rm Applied associate-/l*8.9
\[\leadsto w0 \cdot \sqrt{1 - {\color{blue}{\left(\frac{M}{\frac{2 \cdot d}{D}}\right)}}^{2} \cdot \frac{h}{\ell}}\]
if +inf.0 < (sqrt (- 1 (* (pow (/ M (/ (* 2 d) D)) 2) (/ h l))))
Initial program 61.1
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
Taylor expanded around 0 17.5
\[\leadsto \color{blue}{w0}\]
- Recombined 2 regimes into one program.
Runtime
herbie shell --seed '#(1071246582 2318319007 2683472949 3810440501 3233274817 2724848749)' +o rules:numerics
(FPCore (w0 M D h l d)
:name "Henrywood and Agarwal, Equation (9a)"
(* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))))