?

Average Error: 73.9% → 99.1%
Time: 18.9s
Precision: binary64
Cost: 45961.00

?

\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
\[\begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 2\right):\\ \;\;\;\;\pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{F}}{F \cdot \cos \left(\pi \cdot \ell\right)}\\ \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) -5e+16) (not (<= (* PI l) 2.0)))
   (+ (* PI l) (* (* PI l) 0.0))
   (- (* PI l) (/ (/ (sin (* PI l)) F) (* F (cos (* PI l)))))))
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) <= -5e+16) || !((((double) M_PI) * l) <= 2.0)) {
		tmp = (((double) M_PI) * l) + ((((double) M_PI) * l) * 0.0);
	} else {
		tmp = (((double) M_PI) * l) - ((sin((((double) M_PI) * l)) / F) / (F * cos((((double) M_PI) * l))));
	}
	return tmp;
}
public static double code(double F, double l) {
	return (Math.PI * l) - ((1.0 / (F * F)) * Math.tan((Math.PI * l)));
}
public static double code(double F, double l) {
	double tmp;
	if (((Math.PI * l) <= -5e+16) || !((Math.PI * l) <= 2.0)) {
		tmp = (Math.PI * l) + ((Math.PI * l) * 0.0);
	} else {
		tmp = (Math.PI * l) - ((Math.sin((Math.PI * l)) / F) / (F * Math.cos((Math.PI * l))));
	}
	return tmp;
}
def code(F, l):
	return (math.pi * l) - ((1.0 / (F * F)) * math.tan((math.pi * l)))
def code(F, l):
	tmp = 0
	if ((math.pi * l) <= -5e+16) or not ((math.pi * l) <= 2.0):
		tmp = (math.pi * l) + ((math.pi * l) * 0.0)
	else:
		tmp = (math.pi * l) - ((math.sin((math.pi * l)) / F) / (F * math.cos((math.pi * l))))
	return tmp
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)
	tmp = 0.0
	if ((Float64(pi * l) <= -5e+16) || !(Float64(pi * l) <= 2.0))
		tmp = Float64(Float64(pi * l) + Float64(Float64(pi * l) * 0.0));
	else
		tmp = Float64(Float64(pi * l) - Float64(Float64(sin(Float64(pi * l)) / F) / Float64(F * cos(Float64(pi * l)))));
	end
	return tmp
end
function tmp = code(F, l)
	tmp = (pi * l) - ((1.0 / (F * F)) * tan((pi * l)));
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if (((pi * l) <= -5e+16) || ~(((pi * l) <= 2.0)))
		tmp = (pi * l) + ((pi * l) * 0.0);
	else
		tmp = (pi * l) - ((sin((pi * l)) / F) / (F * cos((pi * l))));
	end
	tmp_2 = tmp;
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_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5e+16], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2.0]], $MachinePrecision]], N[(N[(Pi * l), $MachinePrecision] + N[(N[(Pi * l), $MachinePrecision] * 0.0), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Sin[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / N[(F * N[Cos[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 2\right):\\
\;\;\;\;\pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot 0\\

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


\end{array}

Error?

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) < -5e16 or 2 < (*.f64 (PI.f64) l)

    1. Initial program 63.4

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\left(e^{\mathsf{log1p}\left({F}^{-2}\right)} - 1\right)} \cdot \tan \left(\pi \cdot \ell\right) \]
    3. Taylor expanded in F around inf 99.0

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

      \[\leadsto \pi \cdot \ell - \left(1 - 1\right) \cdot \color{blue}{\left(\ell \cdot \pi\right)} \]

    if -5e16 < (*.f64 (PI.f64) l) < 2

    1. Initial program 85.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 2\right):\\ \;\;\;\;\pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{F}}{F \cdot \cos \left(\pi \cdot \ell\right)}\\ \end{array} \]

Alternatives

Alternative 1
Error99.1%
Cost33097.00
\[\begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 2\right):\\ \;\;\;\;\pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{\frac{F}{\tan \left(\pi \cdot \ell\right)}}\\ \end{array} \]
Alternative 2
Error99.1%
Cost32969.00
\[\begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 2\right):\\ \;\;\;\;\pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\ \end{array} \]
Alternative 3
Error98.8%
Cost26569.00
\[\begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 2\right):\\ \;\;\;\;\pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\ell}{F}}{\frac{F}{\pi}}\\ \end{array} \]
Alternative 4
Error98.8%
Cost13641.00
\[\begin{array}{l} \mathbf{if}\;\ell \leq -4.6 \cdot 10^{+14} \lor \neg \left(\ell \leq 0.5\right):\\ \;\;\;\;\pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F}\\ \end{array} \]
Alternative 5
Error98.8%
Cost13641.00
\[\begin{array}{l} \mathbf{if}\;\ell \leq -8 \cdot 10^{+14} \lor \neg \left(\ell \leq 0.5\right):\\ \;\;\;\;\pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\pi}{F \cdot \frac{F}{\ell}}\\ \end{array} \]
Alternative 6
Error78.8%
Cost13248.00
\[\pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot 0 \]

Error

Reproduce?

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