Average Error: 16.3 → 1.8
Time: 15.7s
Precision: binary64
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
\[\pi \cdot \ell - \frac{1}{\frac{F}{\frac{1}{\frac{F}{\pi \cdot \ell} - \left(0.3333333333333333 \cdot \left(\pi \cdot \left(\ell \cdot F\right)\right) + \left(0.0021164021164021165 \cdot \left({\pi}^{5} \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(F \cdot {\ell}^{5}\right)\right)\right) + 0.022222222222222223 \cdot \left({\pi}^{3} \cdot \left(F \cdot {\ell}^{3}\right)\right)\right)\right)}}} \]
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\pi \cdot \ell - \frac{1}{\frac{F}{\frac{1}{\frac{F}{\pi \cdot \ell} - \left(0.3333333333333333 \cdot \left(\pi \cdot \left(\ell \cdot F\right)\right) + \left(0.0021164021164021165 \cdot \left({\pi}^{5} \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(F \cdot {\ell}^{5}\right)\right)\right) + 0.022222222222222223 \cdot \left({\pi}^{3} \cdot \left(F \cdot {\ell}^{3}\right)\right)\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
    (/
     1.0
     (-
      (/ F (* PI l))
      (+
       (* 0.3333333333333333 (* PI (* l F)))
       (+
        (*
         0.0021164021164021165
         (* (pow PI 5.0) (log1p (expm1 (* F (pow l 5.0))))))
        (* 0.022222222222222223 (* (pow PI 3.0) (* F (pow l 3.0))))))))))))
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 / ((F / (((double) M_PI) * l)) - ((0.3333333333333333 * (((double) M_PI) * (l * F))) + ((0.0021164021164021165 * (pow(((double) M_PI), 5.0) * log1p(expm1(F * pow(l, 5.0))))) + (0.022222222222222223 * (pow(((double) M_PI), 3.0) * (F * pow(l, 3.0))))))))));
}

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. Initial program 16.3

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

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

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

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

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

    \[\leadsto \pi \cdot \ell - \frac{1}{\frac{F}{\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)}}}} \]
  7. Applied log1p-expm1-u_binary641.8

    \[\leadsto \pi \cdot \ell - \frac{1}{\frac{F}{\frac{1}{\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 \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left({\ell}^{5} \cdot F\right)\right)}\right) + 0.022222222222222223 \cdot \left({\pi}^{3} \cdot \left({\ell}^{3} \cdot F\right)\right)\right)\right)}}} \]
  8. Final simplification1.8

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

Reproduce

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