Average Error: 14.1 → 9.1
Time: 53.5s
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}\;d \le -1.5279638605749536 \cdot 10^{-113} \lor \neg \left(d \le 3.4015828758501012 \cdot 10^{-149}\right):\\ \;\;\;\;\sqrt{1 - \frac{\frac{M}{\frac{2 \cdot d}{D}}}{\ell} \cdot \frac{\frac{M}{d} \cdot D}{\frac{2}{h}}} \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{D \cdot M}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}}} \cdot \frac{\frac{D \cdot M}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}} \cdot \sqrt[3]{\frac{\ell}{h}}}}\\ \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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if d < -1.5279638605749536e-113 or 3.4015828758501012e-149 < d

    1. Initial program 11.8

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

      \[\leadsto \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}} \cdot w0\]
    3. Using strategy rm
    4. Applied div-inv11.3

      \[\leadsto \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \cdot w0\]
    5. Applied times-frac6.4

      \[\leadsto \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \cdot w0\]
    6. Simplified9.7

      \[\leadsto \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{D}{\frac{2}{h}}\right)}} \cdot w0\]
    7. Using strategy rm
    8. Applied associate-/l*9.3

      \[\leadsto \sqrt{1 - \frac{\color{blue}{\frac{M}{\frac{2 \cdot d}{D}}}}{\ell} \cdot \left(\frac{M}{d} \cdot \frac{D}{\frac{2}{h}}\right)} \cdot w0\]
    9. Using strategy rm
    10. Applied associate-*r/6.5

      \[\leadsto \sqrt{1 - \frac{\frac{M}{\frac{2 \cdot d}{D}}}{\ell} \cdot \color{blue}{\frac{\frac{M}{d} \cdot D}{\frac{2}{h}}}} \cdot w0\]

    if -1.5279638605749536e-113 < d < 3.4015828758501012e-149

    1. Initial program 23.9

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

      \[\leadsto \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}} \cdot w0\]
    3. Using strategy rm
    4. Applied add-cube-cbrt23.9

      \[\leadsto \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\left(\sqrt[3]{\frac{\ell}{h}} \cdot \sqrt[3]{\frac{\ell}{h}}\right) \cdot \sqrt[3]{\frac{\ell}{h}}}}} \cdot w0\]
    5. Applied times-frac20.7

      \[\leadsto \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}} \cdot \sqrt[3]{\frac{\ell}{h}}} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}}}}} \cdot w0\]
  3. Recombined 2 regimes into one program.
  4. Final simplification9.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \le -1.5279638605749536 \cdot 10^{-113} \lor \neg \left(d \le 3.4015828758501012 \cdot 10^{-149}\right):\\ \;\;\;\;\sqrt{1 - \frac{\frac{M}{\frac{2 \cdot d}{D}}}{\ell} \cdot \frac{\frac{M}{d} \cdot D}{\frac{2}{h}}} \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{D \cdot M}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}}} \cdot \frac{\frac{D \cdot M}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}} \cdot \sqrt[3]{\frac{\ell}{h}}}}\\ \end{array}\]

Runtime

Time bar (total: 53.5s)Debug logProfile

herbie shell --seed 2018230 
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  (* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))))