Average Error: 13.8 → 10.0
Time: 1.1m
Precision: 64
Internal Precision: 576
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
\[\begin{array}{l} \mathbf{if}\;\frac{h}{\ell} \le -1.775245375421158 \cdot 10^{+308} \lor \neg \left(\frac{h}{\ell} \le -7.24625914193812 \cdot 10^{-213}\right):\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{(\left(\frac{-h}{\ell}\right) \cdot \left(\left(\sqrt[3]{\frac{M \cdot D}{d \cdot 2}} \cdot \left(\sqrt[3]{\frac{M \cdot D}{d \cdot 2}} \cdot \sqrt[3]{\frac{M \cdot D}{d \cdot 2}}\right)\right) \cdot \frac{M \cdot D}{d \cdot 2}\right) + 1)_*} \cdot w0\\ \end{array}\]

Error

Bits error versus w0

Bits error versus M

Bits error versus D

Bits error versus h

Bits error versus l

Bits error versus d

Derivation

  1. Split input into 2 regimes
  2. if (/ h l) < -1.775245375421158e+308 or -7.24625914193812e-213 < (/ h l)

    1. Initial program 14.0

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
    2. Initial simplification14.0

      \[\leadsto \sqrt{(\left(-\frac{h}{\ell}\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) + 1)_*} \cdot w0\]
    3. Taylor expanded around 0 7.5

      \[\leadsto \color{blue}{1} \cdot w0\]

    if -1.775245375421158e+308 < (/ h l) < -7.24625914193812e-213

    1. Initial program 13.6

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
    2. Initial simplification13.6

      \[\leadsto \sqrt{(\left(-\frac{h}{\ell}\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) + 1)_*} \cdot w0\]
    3. Using strategy rm
    4. Applied add-cube-cbrt13.7

      \[\leadsto \sqrt{(\left(-\frac{h}{\ell}\right) \cdot \left(\color{blue}{\left(\left(\sqrt[3]{\frac{M \cdot D}{2 \cdot d}} \cdot \sqrt[3]{\frac{M \cdot D}{2 \cdot d}}\right) \cdot \sqrt[3]{\frac{M \cdot D}{2 \cdot d}}\right)} \cdot \frac{M \cdot D}{2 \cdot d}\right) + 1)_*} \cdot w0\]
  3. Recombined 2 regimes into one program.
  4. Final simplification10.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{h}{\ell} \le -1.775245375421158 \cdot 10^{+308} \lor \neg \left(\frac{h}{\ell} \le -7.24625914193812 \cdot 10^{-213}\right):\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{(\left(\frac{-h}{\ell}\right) \cdot \left(\left(\sqrt[3]{\frac{M \cdot D}{d \cdot 2}} \cdot \left(\sqrt[3]{\frac{M \cdot D}{d \cdot 2}} \cdot \sqrt[3]{\frac{M \cdot D}{d \cdot 2}}\right)\right) \cdot \frac{M \cdot D}{d \cdot 2}\right) + 1)_*} \cdot w0\\ \end{array}\]

Runtime

Time bar (total: 1.1m)Debug logProfile

herbie shell --seed 2018225 +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))))))