Average Error: 18.3 → 13.0
Time: 39.7s
Precision: 64
Internal Precision: 576
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;\frac{A}{V} \le -3.7407165418108477 \cdot 10^{-78}:\\ \;\;\;\;\left(\sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot c0\right) \cdot \sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}}\\ \mathbf{if}\;\frac{A}{V} \le 7.494159053559976 \cdot 10^{-306} \lor \neg \left(\frac{A}{V} \le +\infty\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\ \end{array}\]

Error

Bits error versus c0

Bits error versus A

Bits error versus V

Bits error versus l

Try it out

  1. Inputs

  2. Original Output:

    Herbie Output:

Derivation

  1. Split input into 3 regimes
  2. if (/ A V) < -3.7407165418108477e-78

    1. Initial program 20.0

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied associate-/r*17.5

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt17.5

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

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot \sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}}\right)}\]
    7. Applied associate-*r*17.7

      \[\leadsto \color{blue}{\left(c0 \cdot \sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}}\right) \cdot \sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}}}\]

    if -3.7407165418108477e-78 < (/ A V) < 7.494159053559976e-306 or +inf.0 < (/ A V)

    1. Initial program 18.0

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

    if 7.494159053559976e-306 < (/ A V) < +inf.0

    1. Initial program 17.3

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\]
    2. Using strategy rm
    3. Applied associate-/r*14.9

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}}\]
    4. Using strategy rm
    5. Applied div-inv14.9

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

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)}\]
  3. Recombined 3 regimes into one program.
  4. Applied simplify13.0

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;\frac{A}{V} \le -3.7407165418108477 \cdot 10^{-78}:\\ \;\;\;\;\left(\sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot c0\right) \cdot \sqrt{\sqrt{\frac{\frac{A}{V}}{\ell}}}\\ \mathbf{if}\;\frac{A}{V} \le 7.494159053559976 \cdot 10^{-306} \lor \neg \left(\frac{A}{V} \le +\infty\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\ \end{array}}\]

Runtime

Time bar (total: 39.7s)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' 
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  (* c0 (sqrt (/ A (* V l)))))