Average Error: 16.5 → 2.3
Time: 10.9s
Precision: binary64
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
\[\pi \cdot \ell - \frac{1}{F \cdot \left(\frac{1}{\pi \cdot \ell} - \mathsf{fma}\left(0.022222222222222223, {\left(\pi \cdot \ell\right)}^{3}, \mathsf{fma}\left(\ell, \pi \cdot 0.3333333333333333, 0.0021164021164021165 \cdot \left({\pi}^{5} \cdot {\ell}^{5}\right)\right)\right)\right)} \cdot \frac{1}{F} \]
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\pi \cdot \ell - \frac{1}{F \cdot \left(\frac{1}{\pi \cdot \ell} - \mathsf{fma}\left(0.022222222222222223, {\left(\pi \cdot \ell\right)}^{3}, \mathsf{fma}\left(\ell, \pi \cdot 0.3333333333333333, 0.0021164021164021165 \cdot \left({\pi}^{5} \cdot {\ell}^{5}\right)\right)\right)\right)} \cdot \frac{1}{F}
(FPCore (F l)
 :precision binary64
 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
(FPCore (F l)
 :precision binary64
 (-
  (* PI l)
  (*
   (/
    1.0
    (*
     F
     (-
      (/ 1.0 (* PI l))
      (fma
       0.022222222222222223
       (pow (* PI l) 3.0)
       (fma
        l
        (* PI 0.3333333333333333)
        (* 0.0021164021164021165 (* (pow PI 5.0) (pow l 5.0))))))))
   (/ 1.0 F))))
double code(double F, double l) {
	return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan(((double) M_PI) * l));
}
double code(double F, double l) {
	return (((double) M_PI) * l) - ((1.0 / (F * ((1.0 / (((double) M_PI) * l)) - fma(0.022222222222222223, pow((((double) M_PI) * l), 3.0), fma(l, (((double) M_PI) * 0.3333333333333333), (0.0021164021164021165 * (pow(((double) M_PI), 5.0) * pow(l, 5.0)))))))) * (1.0 / F));
}

Error

Bits error versus F

Bits error versus l

Derivation

  1. Initial program 16.5

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

    \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
  3. Applied clear-num_binary6416.2

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

    \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}} \]
  5. Applied associate-/r/_binary6412.3

    \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\frac{F}{\tan \left(\pi \cdot \ell\right)} \cdot F}} \]
  6. Applied *-un-lft-identity_binary6412.3

    \[\leadsto \pi \cdot \ell - \frac{\color{blue}{1 \cdot 1}}{\frac{F}{\tan \left(\pi \cdot \ell\right)} \cdot F} \]
  7. Applied times-frac_binary6412.3

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

    \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\frac{F}{\pi \cdot \ell} - \left(0.3333333333333333 \cdot \left(\pi \cdot \left(F \cdot \ell\right)\right) + \left(0.0021164021164021165 \cdot \left({\pi}^{5} \cdot \left({\ell}^{5} \cdot F\right)\right) + 0.022222222222222223 \cdot \left({\pi}^{3} \cdot \left({\ell}^{3} \cdot F\right)\right)\right)\right)}} \cdot \frac{1}{F} \]
  9. Simplified2.3

    \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\frac{F}{\pi \cdot \ell} - \mathsf{fma}\left(\pi, \left(\ell \cdot F\right) \cdot 0.3333333333333333, F \cdot \mathsf{fma}\left(0.022222222222222223, {\pi}^{3} \cdot {\ell}^{3}, 0.0021164021164021165 \cdot \left({\pi}^{5} \cdot {\ell}^{5}\right)\right)\right)}} \cdot \frac{1}{F} \]
  10. Taylor expanded in F around 0 2.3

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F \cdot \left(\frac{1}{\pi \cdot \ell} - \left(0.3333333333333333 \cdot \left(\pi \cdot \ell\right) + \left(0.022222222222222223 \cdot \left({\pi}^{3} \cdot {\ell}^{3}\right) + 0.0021164021164021165 \cdot \left({\pi}^{5} \cdot {\ell}^{5}\right)\right)\right)\right)}} \cdot \frac{1}{F} \]
  11. Simplified2.3

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F \cdot \left(\frac{1}{\pi \cdot \ell} - \mathsf{fma}\left(0.022222222222222223, {\left(\pi \cdot \ell\right)}^{3}, \mathsf{fma}\left(\ell, \pi \cdot 0.3333333333333333, 0.0021164021164021165 \cdot \left({\pi}^{5} \cdot {\ell}^{5}\right)\right)\right)\right)}} \cdot \frac{1}{F} \]
  12. Final simplification2.3

    \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot \left(\frac{1}{\pi \cdot \ell} - \mathsf{fma}\left(0.022222222222222223, {\left(\pi \cdot \ell\right)}^{3}, \mathsf{fma}\left(\ell, \pi \cdot 0.3333333333333333, 0.0021164021164021165 \cdot \left({\pi}^{5} \cdot {\ell}^{5}\right)\right)\right)\right)} \cdot \frac{1}{F} \]

Reproduce

herbie shell --seed 2022004 
(FPCore (F l)
  :name "VandenBroeck and Keller, Equation (6)"
  :precision binary64
  (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))