
(FPCore (F l) :precision binary64 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
double code(double F, double l) {
return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan((((double) M_PI) * l)));
}
public static double code(double F, double l) {
return (Math.PI * l) - ((1.0 / (F * F)) * Math.tan((Math.PI * l)));
}
def code(F, l): return (math.pi * l) - ((1.0 / (F * F)) * math.tan((math.pi * l)))
function code(F, l) return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l)))) end
function tmp = code(F, l) tmp = (pi * l) - ((1.0 / (F * F)) * tan((pi * l))); 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]
\begin{array}{l}
\\
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F l) :precision binary64 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
double code(double F, double l) {
return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan((((double) M_PI) * l)));
}
public static double code(double F, double l) {
return (Math.PI * l) - ((1.0 / (F * F)) * Math.tan((Math.PI * l)));
}
def code(F, l): return (math.pi * l) - ((1.0 / (F * F)) * math.tan((math.pi * l)))
function code(F, l) return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l)))) end
function tmp = code(F, l) tmp = (pi * l) - ((1.0 / (F * F)) * tan((pi * l))); 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]
\begin{array}{l}
\\
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\end{array}
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+19) (not (<= (* PI l) 2000.0))) (* PI l) (+ (* PI l) (/ (/ -1.0 F) (/ F (tan (* PI l)))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+19) || !((((double) M_PI) * l) <= 2000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + ((-1.0 / F) / (F / tan((((double) M_PI) * l))));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -2e+19) || !((Math.PI * l) <= 2000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + ((-1.0 / F) / (F / Math.tan((Math.PI * l))));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -2e+19) or not ((math.pi * l) <= 2000.0): tmp = math.pi * l else: tmp = (math.pi * l) + ((-1.0 / F) / (F / math.tan((math.pi * l)))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -2e+19) || !(Float64(pi * l) <= 2000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(-1.0 / F) / Float64(F / tan(Float64(pi * l))))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2e+19) || ~(((pi * l) <= 2000.0))) tmp = pi * l; else tmp = (pi * l) + ((-1.0 / F) / (F / tan((pi * l)))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(-1.0 / F), $MachinePrecision] / N[(F / N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 2000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{\frac{F}{\tan \left(\pi \cdot \ell\right)}}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -2e19 or 2e3 < (*.f64 (PI.f64) l) Initial program 71.0%
associate-*l/71.0%
*-lft-identity71.0%
Simplified71.0%
Taylor expanded in l around 0 60.7%
unpow260.7%
Simplified60.7%
Taylor expanded in F around inf 99.6%
if -2e19 < (*.f64 (PI.f64) l) < 2e3Initial program 86.2%
associate-*l/86.2%
*-lft-identity86.2%
Simplified86.2%
associate-/r*99.2%
div-inv99.2%
Applied egg-rr99.2%
*-commutative99.2%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Final simplification99.4%
(FPCore (F l)
:precision binary64
(if (<= (* PI l) -5.0)
(* PI l)
(if (<= (* PI l) -5e-290)
(* (* PI l) (- 1.0 (pow F -2.0)))
(if (<= (* PI l) 2e-279)
(* (/ l F) (/ PI (- F)))
(if (<= (* PI l) 0.4) (- (* PI l) (* PI (/ l (* F F)))) (* PI l))))))
double code(double F, double l) {
double tmp;
if ((((double) M_PI) * l) <= -5.0) {
tmp = ((double) M_PI) * l;
} else if ((((double) M_PI) * l) <= -5e-290) {
tmp = (((double) M_PI) * l) * (1.0 - pow(F, -2.0));
} else if ((((double) M_PI) * l) <= 2e-279) {
tmp = (l / F) * (((double) M_PI) / -F);
} else if ((((double) M_PI) * l) <= 0.4) {
tmp = (((double) M_PI) * l) - (((double) M_PI) * (l / (F * F)));
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((Math.PI * l) <= -5.0) {
tmp = Math.PI * l;
} else if ((Math.PI * l) <= -5e-290) {
tmp = (Math.PI * l) * (1.0 - Math.pow(F, -2.0));
} else if ((Math.PI * l) <= 2e-279) {
tmp = (l / F) * (Math.PI / -F);
} else if ((Math.PI * l) <= 0.4) {
tmp = (Math.PI * l) - (Math.PI * (l / (F * F)));
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if (math.pi * l) <= -5.0: tmp = math.pi * l elif (math.pi * l) <= -5e-290: tmp = (math.pi * l) * (1.0 - math.pow(F, -2.0)) elif (math.pi * l) <= 2e-279: tmp = (l / F) * (math.pi / -F) elif (math.pi * l) <= 0.4: tmp = (math.pi * l) - (math.pi * (l / (F * F))) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if (Float64(pi * l) <= -5.0) tmp = Float64(pi * l); elseif (Float64(pi * l) <= -5e-290) tmp = Float64(Float64(pi * l) * Float64(1.0 - (F ^ -2.0))); elseif (Float64(pi * l) <= 2e-279) tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F))); elseif (Float64(pi * l) <= 0.4) tmp = Float64(Float64(pi * l) - Float64(pi * Float64(l / Float64(F * F)))); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((pi * l) <= -5.0) tmp = pi * l; elseif ((pi * l) <= -5e-290) tmp = (pi * l) * (1.0 - (F ^ -2.0)); elseif ((pi * l) <= 2e-279) tmp = (l / F) * (pi / -F); elseif ((pi * l) <= 0.4) tmp = (pi * l) - (pi * (l / (F * F))); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(Pi * l), $MachinePrecision], -5.0], N[(Pi * l), $MachinePrecision], If[LessEqual[N[(Pi * l), $MachinePrecision], -5e-290], N[(N[(Pi * l), $MachinePrecision] * N[(1.0 - N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(Pi * l), $MachinePrecision], 2e-279], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(Pi * l), $MachinePrecision], 0.4], N[(N[(Pi * l), $MachinePrecision] - N[(Pi * N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\pi \cdot \ell \leq -5 \cdot 10^{-290}:\\
\;\;\;\;\left(\pi \cdot \ell\right) \cdot \left(1 - {F}^{-2}\right)\\
\mathbf{elif}\;\pi \cdot \ell \leq 2 \cdot 10^{-279}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\
\mathbf{elif}\;\pi \cdot \ell \leq 0.4:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5 or 0.40000000000000002 < (*.f64 (PI.f64) l) Initial program 71.7%
associate-*l/71.7%
*-lft-identity71.7%
Simplified71.7%
Taylor expanded in l around 0 59.9%
unpow259.9%
Simplified59.9%
Taylor expanded in F around inf 97.3%
if -5 < (*.f64 (PI.f64) l) < -5.0000000000000001e-290Initial program 88.6%
associate-*l/88.5%
*-lft-identity88.5%
Simplified88.5%
Taylor expanded in l around 0 88.6%
unpow288.6%
Simplified88.6%
add-sqr-sqrt35.4%
pow235.4%
sub-neg35.4%
sub-neg35.4%
div-inv35.4%
pow235.4%
pow-flip35.4%
metadata-eval35.4%
Applied egg-rr35.4%
unpow235.4%
add-sqr-sqrt88.6%
*-commutative88.6%
*-commutative88.6%
*-un-lft-identity88.6%
distribute-rgt-out--88.6%
*-commutative88.6%
associate-*l*88.6%
Applied egg-rr88.6%
if -5.0000000000000001e-290 < (*.f64 (PI.f64) l) < 2.00000000000000011e-279Initial program 46.0%
associate-*l/46.0%
*-lft-identity46.0%
Simplified46.0%
Taylor expanded in l around 0 46.1%
unpow246.1%
Simplified46.1%
Taylor expanded in F around 0 26.9%
mul-1-neg26.9%
associate-/l*26.9%
unpow226.9%
associate-*r/27.1%
distribute-neg-frac27.1%
associate-*r/26.9%
Simplified26.9%
Taylor expanded in l around 0 26.9%
unpow226.9%
associate-*r/26.9%
*-commutative26.9%
associate-*l/26.9%
associate-*r*26.9%
associate-/r*27.0%
metadata-eval27.0%
associate-/r*27.0%
neg-mul-127.0%
associate-/r*26.9%
*-commutative26.9%
associate-/r/26.8%
associate-*l/26.9%
*-lft-identity26.9%
associate-/l*27.0%
associate-/r/80.4%
Simplified80.4%
if 2.00000000000000011e-279 < (*.f64 (PI.f64) l) < 0.40000000000000002Initial program 93.1%
Taylor expanded in l around 0 92.8%
associate-/l*92.8%
associate-/r/92.8%
unpow292.8%
Simplified92.8%
Final simplification93.3%
(FPCore (F l)
:precision binary64
(let* ((t_0 (- 1.0 (pow F -2.0))))
(if (<= (* PI l) -5.0)
(* PI l)
(if (<= (* PI l) -5e-290)
(* (* PI l) t_0)
(if (<= (* PI l) 2e-279)
(* (/ l F) (/ PI (- F)))
(if (<= (* PI l) 0.4) (* PI (* l t_0)) (* PI l)))))))
double code(double F, double l) {
double t_0 = 1.0 - pow(F, -2.0);
double tmp;
if ((((double) M_PI) * l) <= -5.0) {
tmp = ((double) M_PI) * l;
} else if ((((double) M_PI) * l) <= -5e-290) {
tmp = (((double) M_PI) * l) * t_0;
} else if ((((double) M_PI) * l) <= 2e-279) {
tmp = (l / F) * (((double) M_PI) / -F);
} else if ((((double) M_PI) * l) <= 0.4) {
tmp = ((double) M_PI) * (l * t_0);
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double t_0 = 1.0 - Math.pow(F, -2.0);
double tmp;
if ((Math.PI * l) <= -5.0) {
tmp = Math.PI * l;
} else if ((Math.PI * l) <= -5e-290) {
tmp = (Math.PI * l) * t_0;
} else if ((Math.PI * l) <= 2e-279) {
tmp = (l / F) * (Math.PI / -F);
} else if ((Math.PI * l) <= 0.4) {
tmp = Math.PI * (l * t_0);
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): t_0 = 1.0 - math.pow(F, -2.0) tmp = 0 if (math.pi * l) <= -5.0: tmp = math.pi * l elif (math.pi * l) <= -5e-290: tmp = (math.pi * l) * t_0 elif (math.pi * l) <= 2e-279: tmp = (l / F) * (math.pi / -F) elif (math.pi * l) <= 0.4: tmp = math.pi * (l * t_0) else: tmp = math.pi * l return tmp
function code(F, l) t_0 = Float64(1.0 - (F ^ -2.0)) tmp = 0.0 if (Float64(pi * l) <= -5.0) tmp = Float64(pi * l); elseif (Float64(pi * l) <= -5e-290) tmp = Float64(Float64(pi * l) * t_0); elseif (Float64(pi * l) <= 2e-279) tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F))); elseif (Float64(pi * l) <= 0.4) tmp = Float64(pi * Float64(l * t_0)); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) t_0 = 1.0 - (F ^ -2.0); tmp = 0.0; if ((pi * l) <= -5.0) tmp = pi * l; elseif ((pi * l) <= -5e-290) tmp = (pi * l) * t_0; elseif ((pi * l) <= 2e-279) tmp = (l / F) * (pi / -F); elseif ((pi * l) <= 0.4) tmp = pi * (l * t_0); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := Block[{t$95$0 = N[(1.0 - N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(Pi * l), $MachinePrecision], -5.0], N[(Pi * l), $MachinePrecision], If[LessEqual[N[(Pi * l), $MachinePrecision], -5e-290], N[(N[(Pi * l), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(Pi * l), $MachinePrecision], 2e-279], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(Pi * l), $MachinePrecision], 0.4], N[(Pi * N[(l * t$95$0), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {F}^{-2}\\
\mathbf{if}\;\pi \cdot \ell \leq -5:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\pi \cdot \ell \leq -5 \cdot 10^{-290}:\\
\;\;\;\;\left(\pi \cdot \ell\right) \cdot t_0\\
\mathbf{elif}\;\pi \cdot \ell \leq 2 \cdot 10^{-279}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\
\mathbf{elif}\;\pi \cdot \ell \leq 0.4:\\
\;\;\;\;\pi \cdot \left(\ell \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5 or 0.40000000000000002 < (*.f64 (PI.f64) l) Initial program 71.7%
associate-*l/71.7%
*-lft-identity71.7%
Simplified71.7%
Taylor expanded in l around 0 59.9%
unpow259.9%
Simplified59.9%
Taylor expanded in F around inf 97.3%
if -5 < (*.f64 (PI.f64) l) < -5.0000000000000001e-290Initial program 88.6%
associate-*l/88.5%
*-lft-identity88.5%
Simplified88.5%
Taylor expanded in l around 0 88.6%
unpow288.6%
Simplified88.6%
add-sqr-sqrt35.4%
pow235.4%
sub-neg35.4%
sub-neg35.4%
div-inv35.4%
pow235.4%
pow-flip35.4%
metadata-eval35.4%
Applied egg-rr35.4%
unpow235.4%
add-sqr-sqrt88.6%
*-commutative88.6%
*-commutative88.6%
*-un-lft-identity88.6%
distribute-rgt-out--88.6%
*-commutative88.6%
associate-*l*88.6%
Applied egg-rr88.6%
if -5.0000000000000001e-290 < (*.f64 (PI.f64) l) < 2.00000000000000011e-279Initial program 46.0%
associate-*l/46.0%
*-lft-identity46.0%
Simplified46.0%
Taylor expanded in l around 0 46.1%
unpow246.1%
Simplified46.1%
Taylor expanded in F around 0 26.9%
mul-1-neg26.9%
associate-/l*26.9%
unpow226.9%
associate-*r/27.1%
distribute-neg-frac27.1%
associate-*r/26.9%
Simplified26.9%
Taylor expanded in l around 0 26.9%
unpow226.9%
associate-*r/26.9%
*-commutative26.9%
associate-*l/26.9%
associate-*r*26.9%
associate-/r*27.0%
metadata-eval27.0%
associate-/r*27.0%
neg-mul-127.0%
associate-/r*26.9%
*-commutative26.9%
associate-/r/26.8%
associate-*l/26.9%
*-lft-identity26.9%
associate-/l*27.0%
associate-/r/80.4%
Simplified80.4%
if 2.00000000000000011e-279 < (*.f64 (PI.f64) l) < 0.40000000000000002Initial program 93.1%
associate-*l/93.2%
*-lft-identity93.2%
Simplified93.2%
Taylor expanded in l around 0 92.8%
unpow292.8%
Simplified92.8%
add-sqr-sqrt52.1%
pow252.1%
sub-neg52.1%
sub-neg52.1%
div-inv52.1%
pow252.1%
pow-flip52.1%
metadata-eval52.1%
Applied egg-rr52.1%
unpow252.1%
add-sqr-sqrt92.8%
*-commutative92.8%
*-un-lft-identity92.8%
distribute-rgt-out--92.7%
*-commutative92.7%
associate-*r*92.8%
Applied egg-rr92.8%
Final simplification93.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+19) (not (<= (* PI l) 2000.0))) (* PI l) (+ (* PI l) (* (/ (tan (* PI l)) F) (/ -1.0 F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+19) || !((((double) M_PI) * l) <= 2000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + ((tan((((double) M_PI) * l)) / F) * (-1.0 / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -2e+19) || !((Math.PI * l) <= 2000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + ((Math.tan((Math.PI * l)) / F) * (-1.0 / F));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -2e+19) or not ((math.pi * l) <= 2000.0): tmp = math.pi * l else: tmp = (math.pi * l) + ((math.tan((math.pi * l)) / F) * (-1.0 / F)) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -2e+19) || !(Float64(pi * l) <= 2000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(tan(Float64(pi * l)) / F) * Float64(-1.0 / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2e+19) || ~(((pi * l) <= 2000.0))) tmp = pi * l; else tmp = (pi * l) + ((tan((pi * l)) / F) * (-1.0 / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 2000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{-1}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -2e19 or 2e3 < (*.f64 (PI.f64) l) Initial program 71.0%
associate-*l/71.0%
*-lft-identity71.0%
Simplified71.0%
Taylor expanded in l around 0 60.7%
unpow260.7%
Simplified60.7%
Taylor expanded in F around inf 99.6%
if -2e19 < (*.f64 (PI.f64) l) < 2e3Initial program 86.2%
associate-*l/86.2%
*-lft-identity86.2%
Simplified86.2%
associate-/r*99.2%
div-inv99.2%
Applied egg-rr99.2%
Final simplification99.4%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+19) (not (<= (* PI l) 2000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+19) || !((((double) M_PI) * l) <= 2000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((tan((((double) M_PI) * l)) / F) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -2e+19) || !((Math.PI * l) <= 2000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.tan((Math.PI * l)) / F) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -2e+19) or not ((math.pi * l) <= 2000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.tan((math.pi * l)) / F) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -2e+19) || !(Float64(pi * l) <= 2000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(tan(Float64(pi * l)) / F) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2e+19) || ~(((pi * l) <= 2000.0))) tmp = pi * l; else tmp = (pi * l) - ((tan((pi * l)) / F) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 2000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -2e19 or 2e3 < (*.f64 (PI.f64) l) Initial program 71.0%
associate-*l/71.0%
*-lft-identity71.0%
Simplified71.0%
Taylor expanded in l around 0 60.7%
unpow260.7%
Simplified60.7%
Taylor expanded in F around inf 99.6%
if -2e19 < (*.f64 (PI.f64) l) < 2e3Initial program 86.2%
associate-*l/86.2%
*-un-lft-identity86.2%
associate-/r*99.2%
Applied egg-rr99.2%
Final simplification99.4%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5.0) (not (<= (* PI l) 0.4))) (* PI l) (+ (* PI l) (* (/ (* PI l) F) (/ -1.0 F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5.0) || !((((double) M_PI) * l) <= 0.4)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + (((((double) M_PI) * l) / F) * (-1.0 / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -5.0) || !((Math.PI * l) <= 0.4)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + (((Math.PI * l) / F) * (-1.0 / F));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -5.0) or not ((math.pi * l) <= 0.4): tmp = math.pi * l else: tmp = (math.pi * l) + (((math.pi * l) / F) * (-1.0 / F)) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5.0) || !(Float64(pi * l) <= 0.4)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(Float64(pi * l) / F) * Float64(-1.0 / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5.0) || ~(((pi * l) <= 0.4))) tmp = pi * l; else tmp = (pi * l) + (((pi * l) / F) * (-1.0 / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 0.4]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[(Pi * l), $MachinePrecision] / F), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \lor \neg \left(\pi \cdot \ell \leq 0.4\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\pi \cdot \ell}{F} \cdot \frac{-1}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5 or 0.40000000000000002 < (*.f64 (PI.f64) l) Initial program 71.7%
associate-*l/71.7%
*-lft-identity71.7%
Simplified71.7%
Taylor expanded in l around 0 59.9%
unpow259.9%
Simplified59.9%
Taylor expanded in F around inf 97.3%
if -5 < (*.f64 (PI.f64) l) < 0.40000000000000002Initial program 86.1%
associate-*l/86.1%
*-lft-identity86.1%
Simplified86.1%
associate-/r*99.5%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in l around 0 99.3%
Final simplification98.4%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5.0) (not (<= (* PI l) 0.4))) (* PI l) (+ (* PI l) (/ (/ -1.0 F) (/ F (* PI l))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5.0) || !((((double) M_PI) * l) <= 0.4)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + ((-1.0 / F) / (F / (((double) M_PI) * l)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -5.0) || !((Math.PI * l) <= 0.4)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + ((-1.0 / F) / (F / (Math.PI * l)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -5.0) or not ((math.pi * l) <= 0.4): tmp = math.pi * l else: tmp = (math.pi * l) + ((-1.0 / F) / (F / (math.pi * l))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5.0) || !(Float64(pi * l) <= 0.4)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(-1.0 / F) / Float64(F / Float64(pi * l)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5.0) || ~(((pi * l) <= 0.4))) tmp = pi * l; else tmp = (pi * l) + ((-1.0 / F) / (F / (pi * l))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 0.4]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(-1.0 / F), $MachinePrecision] / N[(F / N[(Pi * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \lor \neg \left(\pi \cdot \ell \leq 0.4\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{\frac{F}{\pi \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5 or 0.40000000000000002 < (*.f64 (PI.f64) l) Initial program 71.7%
associate-*l/71.7%
*-lft-identity71.7%
Simplified71.7%
Taylor expanded in l around 0 59.9%
unpow259.9%
Simplified59.9%
Taylor expanded in F around inf 97.3%
if -5 < (*.f64 (PI.f64) l) < 0.40000000000000002Initial program 86.1%
associate-*l/86.1%
*-lft-identity86.1%
Simplified86.1%
associate-/r*99.5%
div-inv99.5%
Applied egg-rr99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in l around 0 99.4%
Final simplification98.4%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5.0) (not (<= (* PI l) 0.4))) (* PI l) (- (* PI l) (/ (/ (* PI l) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5.0) || !((((double) M_PI) * l) <= 0.4)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - (((((double) M_PI) * l) / F) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -5.0) || !((Math.PI * l) <= 0.4)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (((Math.PI * l) / F) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -5.0) or not ((math.pi * l) <= 0.4): tmp = math.pi * l else: tmp = (math.pi * l) - (((math.pi * l) / F) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5.0) || !(Float64(pi * l) <= 0.4)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(Float64(pi * l) / F) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5.0) || ~(((pi * l) <= 0.4))) tmp = pi * l; else tmp = (pi * l) - (((pi * l) / F) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 0.4]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[(Pi * l), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \lor \neg \left(\pi \cdot \ell \leq 0.4\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\pi \cdot \ell}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5 or 0.40000000000000002 < (*.f64 (PI.f64) l) Initial program 71.7%
associate-*l/71.7%
*-lft-identity71.7%
Simplified71.7%
Taylor expanded in l around 0 59.9%
unpow259.9%
Simplified59.9%
Taylor expanded in F around inf 97.3%
if -5 < (*.f64 (PI.f64) l) < 0.40000000000000002Initial program 86.1%
associate-*l/86.1%
*-un-lft-identity86.1%
associate-/r*99.5%
Applied egg-rr99.5%
Taylor expanded in l around 0 99.3%
Final simplification98.4%
(FPCore (F l)
:precision binary64
(let* ((t_0 (* l (* PI (- 1.0 (pow F -2.0))))))
(if (<= l -1.5)
(* PI l)
(if (<= l -1.1e-293)
t_0
(if (<= l 5.6e-280)
(* (/ l F) (/ PI (- F)))
(if (<= l 0.5) t_0 (* PI l)))))))
double code(double F, double l) {
double t_0 = l * (((double) M_PI) * (1.0 - pow(F, -2.0)));
double tmp;
if (l <= -1.5) {
tmp = ((double) M_PI) * l;
} else if (l <= -1.1e-293) {
tmp = t_0;
} else if (l <= 5.6e-280) {
tmp = (l / F) * (((double) M_PI) / -F);
} else if (l <= 0.5) {
tmp = t_0;
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double t_0 = l * (Math.PI * (1.0 - Math.pow(F, -2.0)));
double tmp;
if (l <= -1.5) {
tmp = Math.PI * l;
} else if (l <= -1.1e-293) {
tmp = t_0;
} else if (l <= 5.6e-280) {
tmp = (l / F) * (Math.PI / -F);
} else if (l <= 0.5) {
tmp = t_0;
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): t_0 = l * (math.pi * (1.0 - math.pow(F, -2.0))) tmp = 0 if l <= -1.5: tmp = math.pi * l elif l <= -1.1e-293: tmp = t_0 elif l <= 5.6e-280: tmp = (l / F) * (math.pi / -F) elif l <= 0.5: tmp = t_0 else: tmp = math.pi * l return tmp
function code(F, l) t_0 = Float64(l * Float64(pi * Float64(1.0 - (F ^ -2.0)))) tmp = 0.0 if (l <= -1.5) tmp = Float64(pi * l); elseif (l <= -1.1e-293) tmp = t_0; elseif (l <= 5.6e-280) tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F))); elseif (l <= 0.5) tmp = t_0; else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) t_0 = l * (pi * (1.0 - (F ^ -2.0))); tmp = 0.0; if (l <= -1.5) tmp = pi * l; elseif (l <= -1.1e-293) tmp = t_0; elseif (l <= 5.6e-280) tmp = (l / F) * (pi / -F); elseif (l <= 0.5) tmp = t_0; else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := Block[{t$95$0 = N[(l * N[(Pi * N[(1.0 - N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.5], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -1.1e-293], t$95$0, If[LessEqual[l, 5.6e-280], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.5], t$95$0, N[(Pi * l), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\
\mathbf{if}\;\ell \leq -1.5:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq -1.1 \cdot 10^{-293}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 5.6 \cdot 10^{-280}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\
\mathbf{elif}\;\ell \leq 0.5:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if l < -1.5 or 0.5 < l Initial program 71.7%
associate-*l/71.7%
*-lft-identity71.7%
Simplified71.7%
Taylor expanded in l around 0 59.9%
unpow259.9%
Simplified59.9%
Taylor expanded in F around inf 97.3%
if -1.5 < l < -1.1e-293 or 5.60000000000000035e-280 < l < 0.5Initial program 90.8%
associate-*l/90.8%
*-lft-identity90.8%
Simplified90.8%
Taylor expanded in l around 0 90.7%
unpow290.7%
Simplified90.7%
Taylor expanded in l around 0 90.7%
unpow290.7%
*-lft-identity90.7%
times-frac90.7%
*-lft-identity90.7%
associate-*l/90.6%
associate-*l*90.6%
unpow-190.6%
unpow-190.6%
pow-sqr90.7%
metadata-eval90.7%
*-commutative90.7%
*-rgt-identity90.7%
distribute-lft-out--90.6%
Simplified90.6%
if -1.1e-293 < l < 5.60000000000000035e-280Initial program 46.0%
associate-*l/46.0%
*-lft-identity46.0%
Simplified46.0%
Taylor expanded in l around 0 46.1%
unpow246.1%
Simplified46.1%
Taylor expanded in F around 0 26.9%
mul-1-neg26.9%
associate-/l*26.9%
unpow226.9%
associate-*r/27.1%
distribute-neg-frac27.1%
associate-*r/26.9%
Simplified26.9%
Taylor expanded in l around 0 26.9%
unpow226.9%
associate-*r/26.9%
*-commutative26.9%
associate-*l/26.9%
associate-*r*26.9%
associate-/r*27.0%
metadata-eval27.0%
associate-/r*27.0%
neg-mul-127.0%
associate-/r*26.9%
*-commutative26.9%
associate-/r/26.8%
associate-*l/26.9%
*-lft-identity26.9%
associate-/l*27.0%
associate-/r/80.4%
Simplified80.4%
Final simplification93.3%
(FPCore (F l)
:precision binary64
(if (<= l -1.5)
(* PI l)
(if (<= l -1.05e-293)
(* l (* PI (- 1.0 (pow F -2.0))))
(if (<= l 5.6e-280)
(* (/ l F) (/ PI (- F)))
(if (<= l 0.5) (* l (- PI (/ PI (* F F)))) (* PI l))))))
double code(double F, double l) {
double tmp;
if (l <= -1.5) {
tmp = ((double) M_PI) * l;
} else if (l <= -1.05e-293) {
tmp = l * (((double) M_PI) * (1.0 - pow(F, -2.0)));
} else if (l <= 5.6e-280) {
tmp = (l / F) * (((double) M_PI) / -F);
} else if (l <= 0.5) {
tmp = l * (((double) M_PI) - (((double) M_PI) / (F * F)));
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (l <= -1.5) {
tmp = Math.PI * l;
} else if (l <= -1.05e-293) {
tmp = l * (Math.PI * (1.0 - Math.pow(F, -2.0)));
} else if (l <= 5.6e-280) {
tmp = (l / F) * (Math.PI / -F);
} else if (l <= 0.5) {
tmp = l * (Math.PI - (Math.PI / (F * F)));
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if l <= -1.5: tmp = math.pi * l elif l <= -1.05e-293: tmp = l * (math.pi * (1.0 - math.pow(F, -2.0))) elif l <= 5.6e-280: tmp = (l / F) * (math.pi / -F) elif l <= 0.5: tmp = l * (math.pi - (math.pi / (F * F))) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if (l <= -1.5) tmp = Float64(pi * l); elseif (l <= -1.05e-293) tmp = Float64(l * Float64(pi * Float64(1.0 - (F ^ -2.0)))); elseif (l <= 5.6e-280) tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F))); elseif (l <= 0.5) tmp = Float64(l * Float64(pi - Float64(pi / Float64(F * F)))); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (l <= -1.5) tmp = pi * l; elseif (l <= -1.05e-293) tmp = l * (pi * (1.0 - (F ^ -2.0))); elseif (l <= 5.6e-280) tmp = (l / F) * (pi / -F); elseif (l <= 0.5) tmp = l * (pi - (pi / (F * F))); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[l, -1.5], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -1.05e-293], N[(l * N[(Pi * N[(1.0 - N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.6e-280], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.5], N[(l * N[(Pi - N[(Pi / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.5:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq -1.05 \cdot 10^{-293}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\
\mathbf{elif}\;\ell \leq 5.6 \cdot 10^{-280}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\
\mathbf{elif}\;\ell \leq 0.5:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if l < -1.5 or 0.5 < l Initial program 71.7%
associate-*l/71.7%
*-lft-identity71.7%
Simplified71.7%
Taylor expanded in l around 0 59.9%
unpow259.9%
Simplified59.9%
Taylor expanded in F around inf 97.3%
if -1.5 < l < -1.05000000000000003e-293Initial program 88.6%
associate-*l/88.5%
*-lft-identity88.5%
Simplified88.5%
Taylor expanded in l around 0 88.6%
unpow288.6%
Simplified88.6%
Taylor expanded in l around 0 88.6%
unpow288.6%
*-lft-identity88.6%
times-frac88.6%
*-lft-identity88.6%
associate-*l/88.6%
associate-*l*88.5%
unpow-188.5%
unpow-188.5%
pow-sqr88.6%
metadata-eval88.6%
*-commutative88.6%
*-rgt-identity88.6%
distribute-lft-out--88.6%
Simplified88.6%
if -1.05000000000000003e-293 < l < 5.60000000000000035e-280Initial program 46.0%
associate-*l/46.0%
*-lft-identity46.0%
Simplified46.0%
Taylor expanded in l around 0 46.1%
unpow246.1%
Simplified46.1%
Taylor expanded in F around 0 26.9%
mul-1-neg26.9%
associate-/l*26.9%
unpow226.9%
associate-*r/27.1%
distribute-neg-frac27.1%
associate-*r/26.9%
Simplified26.9%
Taylor expanded in l around 0 26.9%
unpow226.9%
associate-*r/26.9%
*-commutative26.9%
associate-*l/26.9%
associate-*r*26.9%
associate-/r*27.0%
metadata-eval27.0%
associate-/r*27.0%
neg-mul-127.0%
associate-/r*26.9%
*-commutative26.9%
associate-/r/26.8%
associate-*l/26.9%
*-lft-identity26.9%
associate-/l*27.0%
associate-/r/80.4%
Simplified80.4%
if 5.60000000000000035e-280 < l < 0.5Initial program 93.1%
associate-*l/93.2%
*-lft-identity93.2%
Simplified93.2%
Taylor expanded in l around 0 92.8%
unpow292.8%
Simplified92.8%
Final simplification93.3%
(FPCore (F l)
:precision binary64
(let* ((t_0 (- 1.0 (pow F -2.0))))
(if (<= l -1.5)
(* PI l)
(if (<= l -1.05e-293)
(* l (* PI t_0))
(if (<= l 8.4e-280)
(* (/ l F) (/ PI (- F)))
(if (<= l 0.5) (* PI (* l t_0)) (* PI l)))))))
double code(double F, double l) {
double t_0 = 1.0 - pow(F, -2.0);
double tmp;
if (l <= -1.5) {
tmp = ((double) M_PI) * l;
} else if (l <= -1.05e-293) {
tmp = l * (((double) M_PI) * t_0);
} else if (l <= 8.4e-280) {
tmp = (l / F) * (((double) M_PI) / -F);
} else if (l <= 0.5) {
tmp = ((double) M_PI) * (l * t_0);
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double t_0 = 1.0 - Math.pow(F, -2.0);
double tmp;
if (l <= -1.5) {
tmp = Math.PI * l;
} else if (l <= -1.05e-293) {
tmp = l * (Math.PI * t_0);
} else if (l <= 8.4e-280) {
tmp = (l / F) * (Math.PI / -F);
} else if (l <= 0.5) {
tmp = Math.PI * (l * t_0);
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): t_0 = 1.0 - math.pow(F, -2.0) tmp = 0 if l <= -1.5: tmp = math.pi * l elif l <= -1.05e-293: tmp = l * (math.pi * t_0) elif l <= 8.4e-280: tmp = (l / F) * (math.pi / -F) elif l <= 0.5: tmp = math.pi * (l * t_0) else: tmp = math.pi * l return tmp
function code(F, l) t_0 = Float64(1.0 - (F ^ -2.0)) tmp = 0.0 if (l <= -1.5) tmp = Float64(pi * l); elseif (l <= -1.05e-293) tmp = Float64(l * Float64(pi * t_0)); elseif (l <= 8.4e-280) tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F))); elseif (l <= 0.5) tmp = Float64(pi * Float64(l * t_0)); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) t_0 = 1.0 - (F ^ -2.0); tmp = 0.0; if (l <= -1.5) tmp = pi * l; elseif (l <= -1.05e-293) tmp = l * (pi * t_0); elseif (l <= 8.4e-280) tmp = (l / F) * (pi / -F); elseif (l <= 0.5) tmp = pi * (l * t_0); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := Block[{t$95$0 = N[(1.0 - N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.5], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -1.05e-293], N[(l * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.4e-280], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.5], N[(Pi * N[(l * t$95$0), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {F}^{-2}\\
\mathbf{if}\;\ell \leq -1.5:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq -1.05 \cdot 10^{-293}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot t_0\right)\\
\mathbf{elif}\;\ell \leq 8.4 \cdot 10^{-280}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\
\mathbf{elif}\;\ell \leq 0.5:\\
\;\;\;\;\pi \cdot \left(\ell \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if l < -1.5 or 0.5 < l Initial program 71.7%
associate-*l/71.7%
*-lft-identity71.7%
Simplified71.7%
Taylor expanded in l around 0 59.9%
unpow259.9%
Simplified59.9%
Taylor expanded in F around inf 97.3%
if -1.5 < l < -1.05000000000000003e-293Initial program 88.6%
associate-*l/88.5%
*-lft-identity88.5%
Simplified88.5%
Taylor expanded in l around 0 88.6%
unpow288.6%
Simplified88.6%
Taylor expanded in l around 0 88.6%
unpow288.6%
*-lft-identity88.6%
times-frac88.6%
*-lft-identity88.6%
associate-*l/88.6%
associate-*l*88.5%
unpow-188.5%
unpow-188.5%
pow-sqr88.6%
metadata-eval88.6%
*-commutative88.6%
*-rgt-identity88.6%
distribute-lft-out--88.6%
Simplified88.6%
if -1.05000000000000003e-293 < l < 8.40000000000000003e-280Initial program 46.0%
associate-*l/46.0%
*-lft-identity46.0%
Simplified46.0%
Taylor expanded in l around 0 46.1%
unpow246.1%
Simplified46.1%
Taylor expanded in F around 0 26.9%
mul-1-neg26.9%
associate-/l*26.9%
unpow226.9%
associate-*r/27.1%
distribute-neg-frac27.1%
associate-*r/26.9%
Simplified26.9%
Taylor expanded in l around 0 26.9%
unpow226.9%
associate-*r/26.9%
*-commutative26.9%
associate-*l/26.9%
associate-*r*26.9%
associate-/r*27.0%
metadata-eval27.0%
associate-/r*27.0%
neg-mul-127.0%
associate-/r*26.9%
*-commutative26.9%
associate-/r/26.8%
associate-*l/26.9%
*-lft-identity26.9%
associate-/l*27.0%
associate-/r/80.4%
Simplified80.4%
if 8.40000000000000003e-280 < l < 0.5Initial program 93.1%
associate-*l/93.2%
*-lft-identity93.2%
Simplified93.2%
Taylor expanded in l around 0 92.8%
unpow292.8%
Simplified92.8%
add-sqr-sqrt52.1%
pow252.1%
sub-neg52.1%
sub-neg52.1%
div-inv52.1%
pow252.1%
pow-flip52.1%
metadata-eval52.1%
Applied egg-rr52.1%
unpow252.1%
add-sqr-sqrt92.8%
*-commutative92.8%
*-un-lft-identity92.8%
distribute-rgt-out--92.7%
*-commutative92.7%
associate-*r*92.8%
Applied egg-rr92.8%
Final simplification93.3%
(FPCore (F l)
:precision binary64
(if (or (<= (* F F) 5e-292)
(and (not (<= (* F F) 2e-236)) (<= (* F F) 2e-49)))
(* (/ l F) (/ PI (- F)))
(* PI l)))
double code(double F, double l) {
double tmp;
if (((F * F) <= 5e-292) || (!((F * F) <= 2e-236) && ((F * F) <= 2e-49))) {
tmp = (l / F) * (((double) M_PI) / -F);
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((F * F) <= 5e-292) || (!((F * F) <= 2e-236) && ((F * F) <= 2e-49))) {
tmp = (l / F) * (Math.PI / -F);
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if ((F * F) <= 5e-292) or (not ((F * F) <= 2e-236) and ((F * F) <= 2e-49)): tmp = (l / F) * (math.pi / -F) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if ((Float64(F * F) <= 5e-292) || (!(Float64(F * F) <= 2e-236) && (Float64(F * F) <= 2e-49))) tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F))); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((F * F) <= 5e-292) || (~(((F * F) <= 2e-236)) && ((F * F) <= 2e-49))) tmp = (l / F) * (pi / -F); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(F * F), $MachinePrecision], 5e-292], And[N[Not[LessEqual[N[(F * F), $MachinePrecision], 2e-236]], $MachinePrecision], LessEqual[N[(F * F), $MachinePrecision], 2e-49]]], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 5 \cdot 10^{-292} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-236}\right) \land F \cdot F \leq 2 \cdot 10^{-49}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if (*.f64 F F) < 4.99999999999999981e-292 or 2.0000000000000001e-236 < (*.f64 F F) < 1.99999999999999987e-49Initial program 53.7%
associate-*l/53.7%
*-lft-identity53.7%
Simplified53.7%
Taylor expanded in l around 0 45.1%
unpow245.1%
Simplified45.1%
Taylor expanded in F around 0 45.1%
mul-1-neg45.1%
associate-/l*45.2%
unpow245.2%
associate-*r/45.1%
distribute-neg-frac45.1%
associate-*r/45.2%
Simplified45.2%
Taylor expanded in l around 0 45.1%
unpow245.1%
associate-*r/45.1%
*-commutative45.1%
associate-*l/45.1%
associate-*r*45.1%
associate-/r*45.1%
metadata-eval45.1%
associate-/r*45.1%
neg-mul-145.1%
associate-/r*45.1%
*-commutative45.1%
associate-/r/45.1%
associate-*l/45.2%
*-lft-identity45.2%
associate-/l*45.1%
associate-/r/63.4%
Simplified63.4%
if 4.99999999999999981e-292 < (*.f64 F F) < 2.0000000000000001e-236 or 1.99999999999999987e-49 < (*.f64 F F) Initial program 94.8%
associate-*l/94.8%
*-lft-identity94.8%
Simplified94.8%
Taylor expanded in l around 0 90.7%
unpow290.7%
Simplified90.7%
Taylor expanded in F around inf 95.3%
Final simplification83.2%
(FPCore (F l)
:precision binary64
(if (<= (* F F) 5e-292)
(* (/ l F) (/ PI (- F)))
(if (or (<= (* F F) 2e-236) (not (<= (* F F) 2e-49)))
(* PI l)
(/ (- l) (/ (* F F) PI)))))
double code(double F, double l) {
double tmp;
if ((F * F) <= 5e-292) {
tmp = (l / F) * (((double) M_PI) / -F);
} else if (((F * F) <= 2e-236) || !((F * F) <= 2e-49)) {
tmp = ((double) M_PI) * l;
} else {
tmp = -l / ((F * F) / ((double) M_PI));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F * F) <= 5e-292) {
tmp = (l / F) * (Math.PI / -F);
} else if (((F * F) <= 2e-236) || !((F * F) <= 2e-49)) {
tmp = Math.PI * l;
} else {
tmp = -l / ((F * F) / Math.PI);
}
return tmp;
}
def code(F, l): tmp = 0 if (F * F) <= 5e-292: tmp = (l / F) * (math.pi / -F) elif ((F * F) <= 2e-236) or not ((F * F) <= 2e-49): tmp = math.pi * l else: tmp = -l / ((F * F) / math.pi) return tmp
function code(F, l) tmp = 0.0 if (Float64(F * F) <= 5e-292) tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F))); elseif ((Float64(F * F) <= 2e-236) || !(Float64(F * F) <= 2e-49)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) / Float64(Float64(F * F) / pi)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 5e-292) tmp = (l / F) * (pi / -F); elseif (((F * F) <= 2e-236) || ~(((F * F) <= 2e-49))) tmp = pi * l; else tmp = -l / ((F * F) / pi); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 5e-292], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(F * F), $MachinePrecision], 2e-236], N[Not[LessEqual[N[(F * F), $MachinePrecision], 2e-49]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(N[(F * F), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 5 \cdot 10^{-292}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\
\mathbf{elif}\;F \cdot F \leq 2 \cdot 10^{-236} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-49}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{\frac{F \cdot F}{\pi}}\\
\end{array}
\end{array}
if (*.f64 F F) < 4.99999999999999981e-292Initial program 34.0%
associate-*l/34.0%
*-lft-identity34.0%
Simplified34.0%
Taylor expanded in l around 0 29.3%
unpow229.3%
Simplified29.3%
Taylor expanded in F around 0 29.3%
mul-1-neg29.3%
associate-/l*29.3%
unpow229.3%
associate-*r/29.3%
distribute-neg-frac29.3%
associate-*r/29.3%
Simplified29.3%
Taylor expanded in l around 0 29.3%
unpow229.3%
associate-*r/29.3%
*-commutative29.3%
associate-*l/29.3%
associate-*r*29.3%
associate-/r*29.3%
metadata-eval29.3%
associate-/r*29.3%
neg-mul-129.3%
associate-/r*29.3%
*-commutative29.3%
associate-/r/29.3%
associate-*l/29.3%
*-lft-identity29.3%
associate-/l*29.3%
associate-/r/57.9%
Simplified57.9%
if 4.99999999999999981e-292 < (*.f64 F F) < 2.0000000000000001e-236 or 1.99999999999999987e-49 < (*.f64 F F) Initial program 94.8%
associate-*l/94.8%
*-lft-identity94.8%
Simplified94.8%
Taylor expanded in l around 0 90.7%
unpow290.7%
Simplified90.7%
Taylor expanded in F around inf 95.3%
if 2.0000000000000001e-236 < (*.f64 F F) < 1.99999999999999987e-49Initial program 88.5%
associate-*l/88.6%
*-lft-identity88.6%
Simplified88.6%
Taylor expanded in l around 0 73.1%
unpow273.1%
Simplified73.1%
Taylor expanded in F around 0 73.2%
mul-1-neg73.2%
associate-/l*73.3%
unpow273.3%
associate-*r/73.1%
distribute-neg-frac73.1%
associate-*r/73.3%
Simplified73.3%
Final simplification83.2%
(FPCore (F l) :precision binary64 (* PI l))
double code(double F, double l) {
return ((double) M_PI) * l;
}
public static double code(double F, double l) {
return Math.PI * l;
}
def code(F, l): return math.pi * l
function code(F, l) return Float64(pi * l) end
function tmp = code(F, l) tmp = pi * l; end
code[F_, l_] := N[(Pi * l), $MachinePrecision]
\begin{array}{l}
\\
\pi \cdot \ell
\end{array}
Initial program 79.2%
associate-*l/79.2%
*-lft-identity79.2%
Simplified79.2%
Taylor expanded in l around 0 73.4%
unpow273.4%
Simplified73.4%
Taylor expanded in F around inf 72.5%
Final simplification72.5%
herbie shell --seed 2023171
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))