Average Error: 18.3 → 12.4
Time: 13.5s
Precision: 64
Internal Precision: 576
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;V \cdot \ell = -\infty:\\ \;\;\;\;\sqrt{\frac{1}{\frac{\frac{\ell}{A}}{\frac{1}{V}}}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le -3.0782050555432137 \cdot 10^{-226}:\\ \;\;\;\;\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 8.00156415082717 \cdot 10^{-309}:\\ \;\;\;\;\sqrt{\frac{\frac{A}{\ell}}{V}} \cdot c0\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{A} \cdot c0}{\sqrt{V \cdot \ell}}\\ \end{array}\]

Error

Bits error versus c0

Bits error versus A

Bits error versus V

Bits error versus l

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if (* V l) < -inf.0

    1. Initial program 40.8

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Initial simplification21.9

      \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\]
    3. Using strategy rm
    4. Applied *-commutative21.9

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0}\]
    5. Using strategy rm
    6. Applied clear-num22.9

      \[\leadsto \sqrt{\color{blue}{\frac{1}{\frac{\ell}{\frac{A}{V}}}}} \cdot c0\]
    7. Using strategy rm
    8. Applied div-inv22.9

      \[\leadsto \sqrt{\frac{1}{\frac{\ell}{\color{blue}{A \cdot \frac{1}{V}}}}} \cdot c0\]
    9. Applied associate-/r*22.9

      \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{\frac{\ell}{A}}{\frac{1}{V}}}}} \cdot c0\]

    if -inf.0 < (* V l) < -3.0782050555432137e-226

    1. Initial program 7.8

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Initial simplification14.1

      \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\]
    3. Taylor expanded around 0 7.8

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{\ell \cdot V}}}\]

    if -3.0782050555432137e-226 < (* V l) < 8.00156415082717e-309

    1. Initial program 50.0

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Initial simplification31.0

      \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\]
    3. Using strategy rm
    4. Applied div-inv31.0

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V} \cdot \frac{1}{\ell}}}\]
    5. Using strategy rm
    6. Applied associate-*l/30.8

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{1}{\ell}}{V}}}\]
    7. Simplified30.8

      \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{\ell}}}{V}}\]

    if 8.00156415082717e-309 < (* V l)

    1. Initial program 14.2

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Initial simplification15.8

      \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\]
    3. Using strategy rm
    4. Applied div-inv15.8

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V} \cdot \frac{1}{\ell}}}\]
    5. Using strategy rm
    6. Applied frac-times14.2

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot 1}{V \cdot \ell}}}\]
    7. Applied sqrt-div7.1

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A \cdot 1}}{\sqrt{V \cdot \ell}}}\]
    8. Applied associate-*r/9.4

      \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{A \cdot 1}}{\sqrt{V \cdot \ell}}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification12.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell = -\infty:\\ \;\;\;\;\sqrt{\frac{1}{\frac{\frac{\ell}{A}}{\frac{1}{V}}}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le -3.0782050555432137 \cdot 10^{-226}:\\ \;\;\;\;\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\\ \mathbf{elif}\;V \cdot \ell \le 8.00156415082717 \cdot 10^{-309}:\\ \;\;\;\;\sqrt{\frac{\frac{A}{\ell}}{V}} \cdot c0\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{A} \cdot c0}{\sqrt{V \cdot \ell}}\\ \end{array}\]

Runtime

Time bar (total: 13.5s)Debug logProfile

herbie shell --seed 2018251 +o rules:numerics
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  (* c0 (sqrt (/ A (* V l)))))