Average Error: 32.7 → 27.1
Time: 56.7s
Precision: 64
Internal precision: 384
\[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{{\ell}^2}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)}\]
\[\begin{array}{l} \mathbf{if}\;n \le 4.5602004537906414 \cdot 10^{-307}:\\ \;\;\;\;{\left(\sqrt[3]{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t - 2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)\right)}}\right)}^3\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(\left(t - 2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)}\\ \end{array}\]

Error

Bits error versus n

Bits error versus U

Bits error versus t

Bits error versus l

Bits error versus Om

Bits error versus U*

Derivation

  1. Split input into 2 regimes.
  2. if n < 4.5602004537906414e-307

    1. Initial program 32.9

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{{\ell}^2}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)}\]
    2. Using strategy rm
    3. Applied square-mult 32.9

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)}\]
    4. Applied associate-/l* 30.4

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\frac{\ell}{\frac{Om}{\ell}}}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)}\]
    5. Using strategy rm
    6. Applied associate-*l* 30.5

      \[\leadsto \sqrt{\color{blue}{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t - 2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)\right)}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt 31.0

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t - 2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)\right)}}\right)}^3}\]

    if 4.5602004537906414e-307 < n

    1. Initial program 32.4

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{{\ell}^2}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)}\]
    2. Using strategy rm
    3. Applied square-mult 32.4

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)}\]
    4. Applied associate-/l* 30.0

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\frac{\ell}{\frac{Om}{\ell}}}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)}\]
    5. Using strategy rm
    6. Applied associate-*l* 29.6

      \[\leadsto \sqrt{\color{blue}{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t - 2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)\right)}}\]
    7. Using strategy rm
    8. Applied sqrt-prod 23.1

      \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(\left(t - 2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^2\right) \cdot \left(U - U*\right)\right)}}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 56.7s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064524629 4159152179 2999149171 575749698 4006532819 692958815)'
(FPCore (n U t l Om U*)
  :name "Toniolo and Linder, Equation (13)"
  (sqrt (* (* (* 2 n) U) (- (- t (* 2 (/ (sqr l) Om))) (* (* n (sqr (/ l Om))) (- U U*))))))