Average Error: 13.7 → 8.9
Time: 39.3s
Precision: 64
Internal Precision: 128
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
\[\begin{array}{l} \mathbf{if}\;h \le -2.2498668262508357 \cdot 10^{+184} \lor \neg \left(h \le 1.5451301861912833 \cdot 10^{+40}\right):\\ \;\;\;\;\sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot h} \cdot w0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{\frac{\ell}{h}}{\frac{M \cdot D}{2 \cdot d}}}} \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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if h < -2.2498668262508357e+184 or 1.5451301861912833e+40 < h

    1. Initial program 21.8

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

      \[\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 associate-/r/10.3

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

    if -2.2498668262508357e+184 < h < 1.5451301861912833e+40

    1. Initial program 10.7

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
    2. Initial simplification10.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 associate-/l*8.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \le -2.2498668262508357 \cdot 10^{+184} \lor \neg \left(h \le 1.5451301861912833 \cdot 10^{+40}\right):\\ \;\;\;\;\sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot h} \cdot w0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{\frac{\ell}{h}}{\frac{M \cdot D}{2 \cdot d}}}} \cdot w0\\ \end{array}\]

Runtime

Time bar (total: 39.3s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes8.78.97.01.7-15.5%
herbie shell --seed 2018353 
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  (* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))))