Average Error: 16.6 → 1.0
Time: 11.1s
Precision: binary64
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
\[\begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -8.641113133281987 \cdot 10^{+34} \lor \neg \left(\pi \cdot \ell \leq 3952334.5931660286\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F}}{F}\\ \end{array}\]
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -8.641113133281987 \cdot 10^{+34} \lor \neg \left(\pi \cdot \ell \leq 3952334.5931660286\right):\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F}}{F}\\

\end{array}
(FPCore (F l)
 :precision binary64
 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
(FPCore (F l)
 :precision binary64
 (if (or (<= (* PI l) -8.641113133281987e+34)
         (not (<= (* PI l) 3952334.5931660286)))
   (* PI l)
   (- (* PI l) (/ (* (tan (* PI l)) (/ 1.0 F)) 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) {
	double tmp;
	if (((((double) M_PI) * l) <= -8.641113133281987e+34) || !((((double) M_PI) * l) <= 3952334.5931660286)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) - ((tan(((double) M_PI) * l) * (1.0 / F)) / F);
	}
	return tmp;
}

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. Split input into 2 regimes
  2. if (*.f64 PI.f64 l) < -8.64111313328198651e34 or 3952334.59316602862 < (*.f64 PI.f64 l)

    1. Initial program 23.7

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

      \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}}\]
    3. Taylor expanded around 0 0.6

      \[\leadsto \pi \cdot \ell - \color{blue}{0}\]

    if -8.64111313328198651e34 < (*.f64 PI.f64 l) < 3952334.59316602862

    1. Initial program 9.8

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

      \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}}\]
    3. Using strategy rm
    4. Applied associate-/r*_binary641.3

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}}\]
    5. Using strategy rm
    6. Applied div-inv_binary641.3

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F}}}{F}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -8.641113133281987 \cdot 10^{+34} \lor \neg \left(\pi \cdot \ell \leq 3952334.5931660286\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F}}{F}\\ \end{array}\]

Reproduce

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