Average Error: 16.6 → 2.4
Time: 8.2s
Precision: binary64
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
\[\pi \cdot \ell + \frac{\frac{-1}{F}}{\frac{F}{\pi \cdot \ell} + \mathsf{fma}\left(F, \mathsf{fma}\left(\pi \cdot \ell, -0.3333333333333333, {\pi}^{3} \cdot \left({\ell}^{3} \cdot -0.022222222222222223\right)\right), {\pi}^{5} \cdot \left(\left(F \cdot {\ell}^{5}\right) \cdot -0.0021164021164021165\right)\right)} \]
(FPCore (F l)
 :precision binary64
 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
(FPCore (F l)
 :precision binary64
 (+
  (* PI l)
  (/
   (/ -1.0 F)
   (+
    (/ F (* PI l))
    (fma
     F
     (fma
      (* PI l)
      -0.3333333333333333
      (* (pow PI 3.0) (* (pow l 3.0) -0.022222222222222223)))
     (* (pow PI 5.0) (* (* F (pow l 5.0)) -0.0021164021164021165)))))))
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) / ((F / (((double) M_PI) * l)) + fma(F, fma((((double) M_PI) * l), -0.3333333333333333, (pow(((double) M_PI), 3.0) * (pow(l, 3.0) * -0.022222222222222223))), (pow(((double) M_PI), 5.0) * ((F * pow(l, 5.0)) * -0.0021164021164021165)))));
}
function code(F, l)
	return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l))))
end
function code(F, l)
	return Float64(Float64(pi * l) + Float64(Float64(-1.0 / F) / Float64(Float64(F / Float64(pi * l)) + fma(F, fma(Float64(pi * l), -0.3333333333333333, Float64((pi ^ 3.0) * Float64((l ^ 3.0) * -0.022222222222222223))), Float64((pi ^ 5.0) * Float64(Float64(F * (l ^ 5.0)) * -0.0021164021164021165))))))
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] + N[(N[(-1.0 / F), $MachinePrecision] / N[(N[(F / N[(Pi * l), $MachinePrecision]), $MachinePrecision] + N[(F * N[(N[(Pi * l), $MachinePrecision] * -0.3333333333333333 + N[(N[Power[Pi, 3.0], $MachinePrecision] * N[(N[Power[l, 3.0], $MachinePrecision] * -0.022222222222222223), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[Pi, 5.0], $MachinePrecision] * N[(N[(F * N[Power[l, 5.0], $MachinePrecision]), $MachinePrecision] * -0.0021164021164021165), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\pi \cdot \ell + \frac{\frac{-1}{F}}{\frac{F}{\pi \cdot \ell} + \mathsf{fma}\left(F, \mathsf{fma}\left(\pi \cdot \ell, -0.3333333333333333, {\pi}^{3} \cdot \left({\ell}^{3} \cdot -0.022222222222222223\right)\right), {\pi}^{5} \cdot \left(\left(F \cdot {\ell}^{5}\right) \cdot -0.0021164021164021165\right)\right)}

Error

Bits error versus F

Bits error versus l

Derivation

  1. Initial program 16.6

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

    \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
  3. Applied egg-rr12.5

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{1}{F}} \]
  4. Applied egg-rr12.5

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

    \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\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)}} \]
  6. Simplified2.4

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

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

Reproduce

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