Average Error: 16.4 → 12.5
Time: 8.4s
Precision: 64
\[\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}{F} \cdot \tan \left(\sqrt{\pi} \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot \ell\right)\right)\right)\]
\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}{F} \cdot \tan \left(\sqrt{\pi} \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot \ell\right)\right)\right)
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) * tan((sqrt(((double) M_PI)) * (expm1(log1p((sqrt(sqrt(((double) M_PI))) * sqrt(sqrt(((double) M_PI)))))) * l))))));
}

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.4

    \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
  2. Using strategy rm
  3. Applied *-un-lft-identity16.4

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

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

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F} \cdot \left(\frac{1}{F} \cdot \tan \left(\pi \cdot \ell\right)\right)}\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt12.6

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

    \[\leadsto \pi \cdot \ell - \frac{1}{F} \cdot \left(\frac{1}{F} \cdot \tan \color{blue}{\left(\sqrt{\pi} \cdot \left(\sqrt{\pi} \cdot \ell\right)\right)}\right)\]
  9. Using strategy rm
  10. Applied expm1-log1p-u12.7

    \[\leadsto \pi \cdot \ell - \frac{1}{F} \cdot \left(\frac{1}{F} \cdot \tan \left(\sqrt{\pi} \cdot \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\pi}\right)\right)} \cdot \ell\right)\right)\right)\]
  11. Using strategy rm
  12. Applied add-sqr-sqrt12.7

    \[\leadsto \pi \cdot \ell - \frac{1}{F} \cdot \left(\frac{1}{F} \cdot \tan \left(\sqrt{\pi} \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\color{blue}{\sqrt{\pi} \cdot \sqrt{\pi}}}\right)\right) \cdot \ell\right)\right)\right)\]
  13. Applied sqrt-prod12.5

    \[\leadsto \pi \cdot \ell - \frac{1}{F} \cdot \left(\frac{1}{F} \cdot \tan \left(\sqrt{\pi} \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\sqrt{\sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}}\right)\right) \cdot \ell\right)\right)\right)\]
  14. Final simplification12.5

    \[\leadsto \pi \cdot \ell - \frac{1}{F} \cdot \left(\frac{1}{F} \cdot \tan \left(\sqrt{\pi} \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot \ell\right)\right)\right)\]

Reproduce

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