Average Error: 14.5 → 6.6
Time: 1.8m
Precision: 64
Internal Precision: 2432
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
\[\begin{array}{l} \mathbf{if}\;\ell \le -3.0570141152696557 \cdot 10^{+22}:\\ \;\;\;\;\ell \cdot \pi - \frac{\frac{\frac{\sin \left(\frac{\pi}{\ell}\right)}{\cos \left(\frac{\pi}{\ell}\right)}}{F}}{F}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \pi - \frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}\\ \end{array}\]

Error

Bits error versus F

Bits error versus l

Derivation

  1. Split input into 2 regimes
  2. if l < -3.0570141152696557e+22

    1. Initial program 17.5

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
    2. Applied simplify17.5

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

      \[\leadsto \ell \cdot \pi - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}}\]
    5. Taylor expanded around inf 0.3

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

    if -3.0570141152696557e+22 < l

    1. Initial program 13.6

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

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

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

Runtime

Time bar (total: 1.8m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (F l)
  :name "VandenBroeck and Keller, Equation (6)"
  (- (* PI l) (* (/ 1 (* F F)) (tan (* PI l)))))