Average Error: 15.9 → 10.2
Time: 4.5m
Precision: 64
Internal Precision: 4928
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
\[\begin{array}{l} \mathbf{if}\;F \le -1.4291531963084317 \cdot 10^{-19}:\\ \;\;\;\;\ell \cdot \pi - \frac{1}{\frac{F}{\frac{\tan \left(\ell \cdot \pi\right)}{F}}}\\ \mathbf{elif}\;F \le -7.626866928968471 \cdot 10^{-162} \lor \neg \left(F \le 4.236691078022539 \cdot 10^{-158} \lor \neg \left(F \le 2.0419088907347485 \cdot 10^{-53}\right)\right):\\ \;\;\;\;\ell \cdot \pi - \frac{1}{\frac{{F}^{2}}{\ell \cdot \pi} - \left(\left(\ell \cdot \pi\right) \cdot {F}^{2}\right) \cdot \frac{1}{3}}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \pi - \frac{\tan \left(\ell \cdot \pi\right) \cdot \frac{1}{F}}{F}\\ \end{array}\]

Error

Bits error versus F

Bits error versus l

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if F < -1.4291531963084317e-19

    1. Initial program 0.4

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
    2. Initial simplification0.4

      \[\leadsto \ell \cdot \pi - \frac{\tan \left(\ell \cdot \pi\right)}{F \cdot F}\]
    3. Using strategy rm
    4. Applied associate-/r*0.4

      \[\leadsto \ell \cdot \pi - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}}\]
    5. Using strategy rm
    6. Applied clear-num0.4

      \[\leadsto \ell \cdot \pi - \color{blue}{\frac{1}{\frac{F}{\frac{\tan \left(\ell \cdot \pi\right)}{F}}}}\]

    if -1.4291531963084317e-19 < F < -7.626866928968471e-162 or 4.236691078022539e-158 < F < 2.0419088907347485e-53

    1. Initial program 20.3

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
    2. Initial simplification19.3

      \[\leadsto \ell \cdot \pi - \frac{\tan \left(\ell \cdot \pi\right)}{F \cdot F}\]
    3. Using strategy rm
    4. Applied associate-/r*18.8

      \[\leadsto \ell \cdot \pi - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}}\]
    5. Using strategy rm
    6. Applied clear-num18.9

      \[\leadsto \ell \cdot \pi - \color{blue}{\frac{1}{\frac{F}{\frac{\tan \left(\ell \cdot \pi\right)}{F}}}}\]
    7. Taylor expanded around 0 10.9

      \[\leadsto \ell \cdot \pi - \frac{1}{\color{blue}{\frac{{F}^{2}}{\pi \cdot \ell} - \frac{1}{3} \cdot \left({F}^{2} \cdot \left(\pi \cdot \ell\right)\right)}}\]

    if -7.626866928968471e-162 < F < 4.236691078022539e-158 or 2.0419088907347485e-53 < F

    1. Initial program 22.8

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
    2. Initial simplification22.7

      \[\leadsto \ell \cdot \pi - \frac{\tan \left(\ell \cdot \pi\right)}{F \cdot F}\]
    3. Using strategy rm
    4. Applied associate-/r*15.5

      \[\leadsto \ell \cdot \pi - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}}\]
    5. Using strategy rm
    6. Applied div-inv15.5

      \[\leadsto \ell \cdot \pi - \frac{\color{blue}{\tan \left(\ell \cdot \pi\right) \cdot \frac{1}{F}}}{F}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification10.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.4291531963084317 \cdot 10^{-19}:\\ \;\;\;\;\ell \cdot \pi - \frac{1}{\frac{F}{\frac{\tan \left(\ell \cdot \pi\right)}{F}}}\\ \mathbf{elif}\;F \le -7.626866928968471 \cdot 10^{-162} \lor \neg \left(F \le 4.236691078022539 \cdot 10^{-158} \lor \neg \left(F \le 2.0419088907347485 \cdot 10^{-53}\right)\right):\\ \;\;\;\;\ell \cdot \pi - \frac{1}{\frac{{F}^{2}}{\ell \cdot \pi} - \left(\left(\ell \cdot \pi\right) \cdot {F}^{2}\right) \cdot \frac{1}{3}}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \pi - \frac{\tan \left(\ell \cdot \pi\right) \cdot \frac{1}{F}}{F}\\ \end{array}\]

Runtime

Time bar (total: 4.5m)Debug logProfile

herbie shell --seed 2018214 +o rules:numerics
(FPCore (F l)
  :name "VandenBroeck and Keller, Equation (6)"
  (- (* PI l) (* (/ 1 (* F F)) (tan (* PI l)))))