Average Error: 15.9 → 12.2
Time: 1.1m
Precision: 64
Internal Precision: 2624
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
\[\begin{array}{l} \mathbf{if}\;\ell \le -0.0001469723149592154:\\ \;\;\;\;\pi \cdot \ell - \sqrt{\frac{1}{F \cdot F}} \cdot \left(\frac{-1}{F} \cdot \tan \left(\pi \cdot \ell\right)\right)\\ \mathbf{elif}\;\ell \le 7.539158774635579 \cdot 10^{-30}:\\ \;\;\;\;\pi \cdot \ell - (\left(\frac{{\ell}^{3}}{F} \cdot \frac{{\pi}^{3}}{F}\right) \cdot \frac{1}{3} + \left(\frac{\ell}{F} \cdot \frac{\pi}{F}\right))_*\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \tan \left((e^{\log_* (1 + \pi \cdot \ell)} - 1)^*\right) \cdot \frac{1}{F \cdot F}\\ \end{array}\]

Error

Bits error versus F

Bits error versus l

Derivation

  1. Split input into 3 regimes
  2. if l < -0.0001469723149592154

    1. Initial program 23.4

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt23.4

      \[\leadsto \pi \cdot \ell - \color{blue}{\left(\sqrt{\frac{1}{F \cdot F}} \cdot \sqrt{\frac{1}{F \cdot F}}\right)} \cdot \tan \left(\pi \cdot \ell\right)\]
    4. Applied associate-*l*23.4

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

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

    if -0.0001469723149592154 < l < 7.539158774635579e-30

    1. Initial program 8.7

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
    2. Taylor expanded around 0 8.6

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

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

    if 7.539158774635579e-30 < l

    1. Initial program 20.5

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
    2. Using strategy rm
    3. Applied expm1-log1p-u20.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \le -0.0001469723149592154:\\ \;\;\;\;\pi \cdot \ell - \sqrt{\frac{1}{F \cdot F}} \cdot \left(\frac{-1}{F} \cdot \tan \left(\pi \cdot \ell\right)\right)\\ \mathbf{elif}\;\ell \le 7.539158774635579 \cdot 10^{-30}:\\ \;\;\;\;\pi \cdot \ell - (\left(\frac{{\ell}^{3}}{F} \cdot \frac{{\pi}^{3}}{F}\right) \cdot \frac{1}{3} + \left(\frac{\ell}{F} \cdot \frac{\pi}{F}\right))_*\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \tan \left((e^{\log_* (1 + \pi \cdot \ell)} - 1)^*\right) \cdot \frac{1}{F \cdot F}\\ \end{array}\]

Runtime

Time bar (total: 1.1m)Debug logProfile

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