
(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 11 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) -5e+26) (not (<= (* PI l) 200000000000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+26) || !((((double) M_PI) * l) <= 200000000000.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) <= -5e+26) || !((Math.PI * l) <= 200000000000.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) <= -5e+26) or not ((math.pi * l) <= 200000000000.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) <= -5e+26) || !(Float64(pi * l) <= 200000000000.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) <= -5e+26) || ~(((pi * l) <= 200000000000.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], -5e+26], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 200000000000.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 -5 \cdot 10^{+26} \lor \neg \left(\pi \cdot \ell \leq 200000000000\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) < -5.0000000000000001e26 or 2e11 < (*.f64 (PI.f64) l) Initial program 56.9%
sqr-neg56.9%
associate-*l/56.9%
*-lft-identity56.9%
sqr-neg56.9%
Simplified56.9%
Taylor expanded in l around 0 44.2%
unpow244.2%
Simplified44.2%
Taylor expanded in F around inf 99.6%
if -5.0000000000000001e26 < (*.f64 (PI.f64) l) < 2e11Initial program 86.7%
associate-*l/87.7%
*-un-lft-identity87.7%
associate-/r*99.2%
Applied egg-rr99.2%
Final simplification99.4%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+26) (not (<= (* PI l) 5e-16))) (* PI l) (- (* PI l) (/ (/ (* PI l) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+26) || !((((double) M_PI) * l) <= 5e-16)) {
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) <= -5e+26) || !((Math.PI * l) <= 5e-16)) {
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) <= -5e+26) or not ((math.pi * l) <= 5e-16): 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) <= -5e+26) || !(Float64(pi * l) <= 5e-16)) 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) <= -5e+26) || ~(((pi * l) <= 5e-16))) 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], -5e+26], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 5e-16]], $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 \cdot 10^{+26} \lor \neg \left(\pi \cdot \ell \leq 5 \cdot 10^{-16}\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.0000000000000001e26 or 5.0000000000000004e-16 < (*.f64 (PI.f64) l) Initial program 58.5%
sqr-neg58.5%
associate-*l/58.5%
*-lft-identity58.5%
sqr-neg58.5%
Simplified58.5%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 97.4%
if -5.0000000000000001e26 < (*.f64 (PI.f64) l) < 5.0000000000000004e-16Initial program 86.4%
associate-*l/87.6%
*-un-lft-identity87.6%
associate-/r*99.5%
Applied egg-rr99.5%
Taylor expanded in l around 0 99.5%
Final simplification98.4%
(FPCore (F l) :precision binary64 (if (or (<= l -1.8e+22) (not (<= l 1.25e-15))) (* PI l) (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
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 ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (Math.PI * (l / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -1.8e+22) or not (l <= 1.25e-15): tmp = math.pi * l else: tmp = (math.pi * l) - (math.pi * (l / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -1.8e+22) || !(l <= 1.25e-15)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(pi * Float64(l / Float64(F * F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -1.8e+22) || ~((l <= 1.25e-15))) tmp = pi * l; else tmp = (pi * l) - (pi * (l / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -1.8e+22], N[Not[LessEqual[l, 1.25e-15]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(Pi * N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\
\end{array}
\end{array}
if l < -1.8e22 or 1.25e-15 < l Initial program 58.5%
sqr-neg58.5%
associate-*l/58.5%
*-lft-identity58.5%
sqr-neg58.5%
Simplified58.5%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 97.4%
if -1.8e22 < l < 1.25e-15Initial program 86.4%
Taylor expanded in l around 0 87.6%
associate-/l*87.4%
associate-/r/87.6%
unpow287.6%
Simplified87.6%
Final simplification92.7%
(FPCore (F l) :precision binary64 (if (or (<= l -1.8e+22) (not (<= l 1.25e-15))) (* PI l) (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
double tmp;
if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((((double) M_PI) / F) * (l / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI / F) * (l / F));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -1.8e+22) or not (l <= 1.25e-15): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.pi / F) * (l / F)) return tmp
function code(F, l) tmp = 0.0 if ((l <= -1.8e+22) || !(l <= 1.25e-15)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi / F) * Float64(l / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -1.8e+22) || ~((l <= 1.25e-15))) tmp = pi * l; else tmp = (pi * l) - ((pi / F) * (l / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -1.8e+22], N[Not[LessEqual[l, 1.25e-15]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi / F), $MachinePrecision] * N[(l / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi}{F} \cdot \frac{\ell}{F}\\
\end{array}
\end{array}
if l < -1.8e22 or 1.25e-15 < l Initial program 58.5%
sqr-neg58.5%
associate-*l/58.5%
*-lft-identity58.5%
sqr-neg58.5%
Simplified58.5%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 97.4%
if -1.8e22 < l < 1.25e-15Initial program 86.4%
associate-*l/87.6%
*-un-lft-identity87.6%
associate-/r*99.5%
Applied egg-rr99.5%
Taylor expanded in l around 0 87.6%
*-commutative87.6%
unpow287.6%
times-frac99.5%
Simplified99.5%
Final simplification98.4%
(FPCore (F l) :precision binary64 (if (or (<= l -1.8e+22) (not (<= l 1.25e-15))) (* PI l) (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (((double) M_PI) * (1.0 - pow(F, -2.0)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI * (1.0 - Math.pow(F, -2.0)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -1.8e+22) or not (l <= 1.25e-15): tmp = math.pi * l else: tmp = l * (math.pi * (1.0 - math.pow(F, -2.0))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -1.8e+22) || !(l <= 1.25e-15)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(pi * Float64(1.0 - (F ^ -2.0)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -1.8e+22) || ~((l <= 1.25e-15))) tmp = pi * l; else tmp = l * (pi * (1.0 - (F ^ -2.0))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -1.8e+22], N[Not[LessEqual[l, 1.25e-15]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi * N[(1.0 - N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\
\end{array}
\end{array}
if l < -1.8e22 or 1.25e-15 < l Initial program 58.5%
sqr-neg58.5%
associate-*l/58.5%
*-lft-identity58.5%
sqr-neg58.5%
Simplified58.5%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 97.4%
if -1.8e22 < l < 1.25e-15Initial program 86.4%
sqr-neg86.4%
associate-*l/87.6%
*-lft-identity87.6%
sqr-neg87.6%
Simplified87.6%
Taylor expanded in l around 0 86.5%
unpow286.5%
Simplified86.5%
sub-neg86.5%
distribute-lft-in86.5%
*-commutative86.5%
div-inv86.5%
distribute-rgt-neg-in86.5%
pow286.5%
pow-flip86.5%
metadata-eval86.5%
Applied egg-rr86.5%
*-commutative86.5%
distribute-rgt-out86.5%
distribute-rgt-neg-out86.5%
sub-neg86.5%
*-rgt-identity86.5%
distribute-lft-out--86.5%
Simplified86.5%
Final simplification92.2%
(FPCore (F l) :precision binary64 (if (or (<= l -1.8e+22) (not (<= l 1.25e-15))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (((double) M_PI) - (((double) M_PI) / (F * F)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -1.8e+22) or not (l <= 1.25e-15): tmp = math.pi * l else: tmp = l * (math.pi - (math.pi / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -1.8e+22) || !(l <= 1.25e-15)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(pi - Float64(pi / Float64(F * F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -1.8e+22) || ~((l <= 1.25e-15))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -1.8e+22], N[Not[LessEqual[l, 1.25e-15]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi - N[(Pi / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if l < -1.8e22 or 1.25e-15 < l Initial program 58.5%
sqr-neg58.5%
associate-*l/58.5%
*-lft-identity58.5%
sqr-neg58.5%
Simplified58.5%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 97.4%
if -1.8e22 < l < 1.25e-15Initial program 86.4%
sqr-neg86.4%
associate-*l/87.6%
*-lft-identity87.6%
sqr-neg87.6%
Simplified87.6%
Taylor expanded in l around 0 86.5%
unpow286.5%
Simplified86.5%
Final simplification92.2%
(FPCore (F l)
:precision binary64
(let* ((t_0 (* l (/ (- PI) (* F F)))))
(if (<= l -118000.0)
(* PI l)
(if (<= l -7e-92)
t_0
(if (<= l -2.4e-203)
(* PI l)
(if (<= l 2.95e-183)
(/ PI (* (- F) (/ F l)))
(if (or (<= l 2.9e-116) (not (<= l 3.4e-16))) (* PI l) t_0)))))))
double code(double F, double l) {
double t_0 = l * (-((double) M_PI) / (F * F));
double tmp;
if (l <= -118000.0) {
tmp = ((double) M_PI) * l;
} else if (l <= -7e-92) {
tmp = t_0;
} else if (l <= -2.4e-203) {
tmp = ((double) M_PI) * l;
} else if (l <= 2.95e-183) {
tmp = ((double) M_PI) / (-F * (F / l));
} else if ((l <= 2.9e-116) || !(l <= 3.4e-16)) {
tmp = ((double) M_PI) * l;
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double F, double l) {
double t_0 = l * (-Math.PI / (F * F));
double tmp;
if (l <= -118000.0) {
tmp = Math.PI * l;
} else if (l <= -7e-92) {
tmp = t_0;
} else if (l <= -2.4e-203) {
tmp = Math.PI * l;
} else if (l <= 2.95e-183) {
tmp = Math.PI / (-F * (F / l));
} else if ((l <= 2.9e-116) || !(l <= 3.4e-16)) {
tmp = Math.PI * l;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, l): t_0 = l * (-math.pi / (F * F)) tmp = 0 if l <= -118000.0: tmp = math.pi * l elif l <= -7e-92: tmp = t_0 elif l <= -2.4e-203: tmp = math.pi * l elif l <= 2.95e-183: tmp = math.pi / (-F * (F / l)) elif (l <= 2.9e-116) or not (l <= 3.4e-16): tmp = math.pi * l else: tmp = t_0 return tmp
function code(F, l) t_0 = Float64(l * Float64(Float64(-pi) / Float64(F * F))) tmp = 0.0 if (l <= -118000.0) tmp = Float64(pi * l); elseif (l <= -7e-92) tmp = t_0; elseif (l <= -2.4e-203) tmp = Float64(pi * l); elseif (l <= 2.95e-183) tmp = Float64(pi / Float64(Float64(-F) * Float64(F / l))); elseif ((l <= 2.9e-116) || !(l <= 3.4e-16)) tmp = Float64(pi * l); else tmp = t_0; end return tmp end
function tmp_2 = code(F, l) t_0 = l * (-pi / (F * F)); tmp = 0.0; if (l <= -118000.0) tmp = pi * l; elseif (l <= -7e-92) tmp = t_0; elseif (l <= -2.4e-203) tmp = pi * l; elseif (l <= 2.95e-183) tmp = pi / (-F * (F / l)); elseif ((l <= 2.9e-116) || ~((l <= 3.4e-16))) tmp = pi * l; else tmp = t_0; end tmp_2 = tmp; end
code[F_, l_] := Block[{t$95$0 = N[(l * N[((-Pi) / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -118000.0], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -7e-92], t$95$0, If[LessEqual[l, -2.4e-203], N[(Pi * l), $MachinePrecision], If[LessEqual[l, 2.95e-183], N[(Pi / N[((-F) * N[(F / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 2.9e-116], N[Not[LessEqual[l, 3.4e-16]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \ell \cdot \frac{-\pi}{F \cdot F}\\
\mathbf{if}\;\ell \leq -118000:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq -7 \cdot 10^{-92}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -2.4 \cdot 10^{-203}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq 2.95 \cdot 10^{-183}:\\
\;\;\;\;\frac{\pi}{\left(-F\right) \cdot \frac{F}{\ell}}\\
\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{-116} \lor \neg \left(\ell \leq 3.4 \cdot 10^{-16}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -118000 or -7e-92 < l < -2.3999999999999999e-203 or 2.94999999999999992e-183 < l < 2.8999999999999998e-116 or 3.4e-16 < l Initial program 65.8%
sqr-neg65.8%
associate-*l/66.0%
*-lft-identity66.0%
sqr-neg66.0%
Simplified66.0%
Taylor expanded in l around 0 55.0%
unpow255.0%
Simplified55.0%
Taylor expanded in F around inf 90.7%
if -118000 < l < -7e-92 or 2.8999999999999998e-116 < l < 3.4e-16Initial program 99.4%
sqr-neg99.4%
associate-*l/99.4%
*-lft-identity99.4%
sqr-neg99.4%
Simplified99.4%
Taylor expanded in l around 0 99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in F around 0 66.6%
associate-*r/66.6%
neg-mul-166.6%
unpow266.6%
Simplified66.6%
if -2.3999999999999999e-203 < l < 2.94999999999999992e-183Initial program 73.8%
sqr-neg73.8%
associate-*l/76.1%
*-lft-identity76.1%
sqr-neg76.1%
Simplified76.1%
Taylor expanded in l around 0 74.0%
unpow274.0%
Simplified74.0%
Taylor expanded in F around 0 39.4%
associate-*r/39.4%
neg-mul-139.4%
unpow239.4%
Simplified39.4%
clear-num39.4%
un-div-inv41.2%
add-sqr-sqrt0.0%
sqrt-unprod3.9%
sqr-neg3.9%
sqrt-unprod3.9%
add-sqr-sqrt3.9%
associate-/l*4.0%
frac-times4.0%
clear-num4.0%
frac-2neg4.0%
frac-times4.0%
*-un-lft-identity4.0%
add-sqr-sqrt0.0%
sqrt-unprod65.1%
sqr-neg65.1%
sqrt-unprod64.4%
add-sqr-sqrt65.1%
Applied egg-rr65.1%
Final simplification82.6%
(FPCore (F l)
:precision binary64
(if (<= l -16500.0)
(* PI l)
(if (<= l -5.8e-93)
(/ (* PI (/ l F)) (- F))
(if (<= l -4.6e-203)
(* PI l)
(if (<= l 5.6e-182)
(/ PI (* (- F) (/ F l)))
(if (or (<= l 2.5e-116) (not (<= l 3.6e-16)))
(* PI l)
(* l (/ (- PI) (* F F)))))))))
double code(double F, double l) {
double tmp;
if (l <= -16500.0) {
tmp = ((double) M_PI) * l;
} else if (l <= -5.8e-93) {
tmp = (((double) M_PI) * (l / F)) / -F;
} else if (l <= -4.6e-203) {
tmp = ((double) M_PI) * l;
} else if (l <= 5.6e-182) {
tmp = ((double) M_PI) / (-F * (F / l));
} else if ((l <= 2.5e-116) || !(l <= 3.6e-16)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (-((double) M_PI) / (F * F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (l <= -16500.0) {
tmp = Math.PI * l;
} else if (l <= -5.8e-93) {
tmp = (Math.PI * (l / F)) / -F;
} else if (l <= -4.6e-203) {
tmp = Math.PI * l;
} else if (l <= 5.6e-182) {
tmp = Math.PI / (-F * (F / l));
} else if ((l <= 2.5e-116) || !(l <= 3.6e-16)) {
tmp = Math.PI * l;
} else {
tmp = l * (-Math.PI / (F * F));
}
return tmp;
}
def code(F, l): tmp = 0 if l <= -16500.0: tmp = math.pi * l elif l <= -5.8e-93: tmp = (math.pi * (l / F)) / -F elif l <= -4.6e-203: tmp = math.pi * l elif l <= 5.6e-182: tmp = math.pi / (-F * (F / l)) elif (l <= 2.5e-116) or not (l <= 3.6e-16): tmp = math.pi * l else: tmp = l * (-math.pi / (F * F)) return tmp
function code(F, l) tmp = 0.0 if (l <= -16500.0) tmp = Float64(pi * l); elseif (l <= -5.8e-93) tmp = Float64(Float64(pi * Float64(l / F)) / Float64(-F)); elseif (l <= -4.6e-203) tmp = Float64(pi * l); elseif (l <= 5.6e-182) tmp = Float64(pi / Float64(Float64(-F) * Float64(F / l))); elseif ((l <= 2.5e-116) || !(l <= 3.6e-16)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(Float64(-pi) / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (l <= -16500.0) tmp = pi * l; elseif (l <= -5.8e-93) tmp = (pi * (l / F)) / -F; elseif (l <= -4.6e-203) tmp = pi * l; elseif (l <= 5.6e-182) tmp = pi / (-F * (F / l)); elseif ((l <= 2.5e-116) || ~((l <= 3.6e-16))) tmp = pi * l; else tmp = l * (-pi / (F * F)); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[l, -16500.0], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -5.8e-93], N[(N[(Pi * N[(l / F), $MachinePrecision]), $MachinePrecision] / (-F)), $MachinePrecision], If[LessEqual[l, -4.6e-203], N[(Pi * l), $MachinePrecision], If[LessEqual[l, 5.6e-182], N[(Pi / N[((-F) * N[(F / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 2.5e-116], N[Not[LessEqual[l, 3.6e-16]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[((-Pi) / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -16500:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq -5.8 \cdot 10^{-93}:\\
\;\;\;\;\frac{\pi \cdot \frac{\ell}{F}}{-F}\\
\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-203}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq 5.6 \cdot 10^{-182}:\\
\;\;\;\;\frac{\pi}{\left(-F\right) \cdot \frac{F}{\ell}}\\
\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{-116} \lor \neg \left(\ell \leq 3.6 \cdot 10^{-16}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\
\end{array}
\end{array}
if l < -16500 or -5.7999999999999997e-93 < l < -4.59999999999999983e-203 or 5.59999999999999986e-182 < l < 2.5000000000000001e-116 or 3.59999999999999983e-16 < l Initial program 65.8%
sqr-neg65.8%
associate-*l/66.0%
*-lft-identity66.0%
sqr-neg66.0%
Simplified66.0%
Taylor expanded in l around 0 55.0%
unpow255.0%
Simplified55.0%
Taylor expanded in F around inf 90.7%
if -16500 < l < -5.7999999999999997e-93Initial program 99.3%
sqr-neg99.3%
associate-*l/99.5%
*-lft-identity99.5%
sqr-neg99.5%
Simplified99.5%
Taylor expanded in l around 0 99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in F around 0 62.2%
associate-*r/62.2%
neg-mul-162.2%
unpow262.2%
Simplified62.2%
clear-num62.2%
un-div-inv62.2%
add-sqr-sqrt0.0%
sqrt-unprod1.7%
sqr-neg1.7%
sqrt-unprod1.7%
add-sqr-sqrt1.7%
associate-/l*1.7%
frac-times1.7%
frac-2neg1.7%
associate-*r/1.7%
add-sqr-sqrt0.0%
sqrt-unprod62.3%
sqr-neg62.3%
sqrt-unprod62.1%
add-sqr-sqrt62.3%
*-commutative62.3%
Applied egg-rr62.3%
if -4.59999999999999983e-203 < l < 5.59999999999999986e-182Initial program 73.8%
sqr-neg73.8%
associate-*l/76.1%
*-lft-identity76.1%
sqr-neg76.1%
Simplified76.1%
Taylor expanded in l around 0 74.0%
unpow274.0%
Simplified74.0%
Taylor expanded in F around 0 39.4%
associate-*r/39.4%
neg-mul-139.4%
unpow239.4%
Simplified39.4%
clear-num39.4%
un-div-inv41.2%
add-sqr-sqrt0.0%
sqrt-unprod3.9%
sqr-neg3.9%
sqrt-unprod3.9%
add-sqr-sqrt3.9%
associate-/l*4.0%
frac-times4.0%
clear-num4.0%
frac-2neg4.0%
frac-times4.0%
*-un-lft-identity4.0%
add-sqr-sqrt0.0%
sqrt-unprod65.1%
sqr-neg65.1%
sqrt-unprod64.4%
add-sqr-sqrt65.1%
Applied egg-rr65.1%
if 2.5000000000000001e-116 < l < 3.59999999999999983e-16Initial program 99.4%
sqr-neg99.4%
associate-*l/99.4%
*-lft-identity99.4%
sqr-neg99.4%
Simplified99.4%
Taylor expanded in l around 0 99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in F around 0 71.3%
associate-*r/71.3%
neg-mul-171.3%
unpow271.3%
Simplified71.3%
Final simplification82.6%
(FPCore (F l)
:precision binary64
(if (or (<= F 1.66e-139)
(not (or (<= F 2.3e-127) (and (not (<= F 2.55e-64)) (<= F 2.1e-42)))))
(* PI l)
(* l (/ (- PI) (* F F)))))
double code(double F, double l) {
double tmp;
if ((F <= 1.66e-139) || !((F <= 2.3e-127) || (!(F <= 2.55e-64) && (F <= 2.1e-42)))) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (-((double) M_PI) / (F * F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F <= 1.66e-139) || !((F <= 2.3e-127) || (!(F <= 2.55e-64) && (F <= 2.1e-42)))) {
tmp = Math.PI * l;
} else {
tmp = l * (-Math.PI / (F * F));
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 1.66e-139) or not ((F <= 2.3e-127) or (not (F <= 2.55e-64) and (F <= 2.1e-42))): tmp = math.pi * l else: tmp = l * (-math.pi / (F * F)) return tmp
function code(F, l) tmp = 0.0 if ((F <= 1.66e-139) || !((F <= 2.3e-127) || (!(F <= 2.55e-64) && (F <= 2.1e-42)))) tmp = Float64(pi * l); else tmp = Float64(l * Float64(Float64(-pi) / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 1.66e-139) || ~(((F <= 2.3e-127) || (~((F <= 2.55e-64)) && (F <= 2.1e-42))))) tmp = pi * l; else tmp = l * (-pi / (F * F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 1.66e-139], N[Not[Or[LessEqual[F, 2.3e-127], And[N[Not[LessEqual[F, 2.55e-64]], $MachinePrecision], LessEqual[F, 2.1e-42]]]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[((-Pi) / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.66 \cdot 10^{-139} \lor \neg \left(F \leq 2.3 \cdot 10^{-127} \lor \neg \left(F \leq 2.55 \cdot 10^{-64}\right) \land F \leq 2.1 \cdot 10^{-42}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\
\end{array}
\end{array}
if F < 1.6599999999999999e-139 or 2.30000000000000019e-127 < F < 2.54999999999999992e-64 or 2.10000000000000006e-42 < F Initial program 71.0%
sqr-neg71.0%
associate-*l/71.6%
*-lft-identity71.6%
sqr-neg71.6%
Simplified71.6%
Taylor expanded in l around 0 63.5%
unpow263.5%
Simplified63.5%
Taylor expanded in F around inf 75.7%
if 1.6599999999999999e-139 < F < 2.30000000000000019e-127 or 2.54999999999999992e-64 < F < 2.10000000000000006e-42Initial program 98.7%
sqr-neg98.7%
associate-*l/99.0%
*-lft-identity99.0%
sqr-neg99.0%
Simplified99.0%
Taylor expanded in l around 0 99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in F around 0 99.6%
associate-*r/99.6%
neg-mul-199.6%
unpow299.6%
Simplified99.6%
Final simplification76.4%
(FPCore (F l) :precision binary64 (if (or (<= l -1.8e+22) (not (<= l 1.25e-15))) (* PI l) (* l (* PI (- 1.0 (/ 1.0 (* F F)))))))
double code(double F, double l) {
double tmp;
if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (((double) M_PI) * (1.0 - (1.0 / (F * F))));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI * (1.0 - (1.0 / (F * F))));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -1.8e+22) or not (l <= 1.25e-15): tmp = math.pi * l else: tmp = l * (math.pi * (1.0 - (1.0 / (F * F)))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -1.8e+22) || !(l <= 1.25e-15)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(pi * Float64(1.0 - Float64(1.0 / Float64(F * F))))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -1.8e+22) || ~((l <= 1.25e-15))) tmp = pi * l; else tmp = l * (pi * (1.0 - (1.0 / (F * F)))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -1.8e+22], N[Not[LessEqual[l, 1.25e-15]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi * N[(1.0 - N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - \frac{1}{F \cdot F}\right)\right)\\
\end{array}
\end{array}
if l < -1.8e22 or 1.25e-15 < l Initial program 58.5%
sqr-neg58.5%
associate-*l/58.5%
*-lft-identity58.5%
sqr-neg58.5%
Simplified58.5%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 97.4%
if -1.8e22 < l < 1.25e-15Initial program 86.4%
sqr-neg86.4%
associate-*l/87.6%
*-lft-identity87.6%
sqr-neg87.6%
Simplified87.6%
Taylor expanded in l around 0 86.5%
unpow286.5%
Simplified86.5%
sub-neg86.5%
distribute-lft-in86.5%
*-commutative86.5%
div-inv86.5%
distribute-rgt-neg-in86.5%
pow286.5%
pow-flip86.5%
metadata-eval86.5%
Applied egg-rr86.5%
*-commutative86.5%
distribute-rgt-out86.5%
distribute-rgt-neg-out86.5%
sub-neg86.5%
*-rgt-identity86.5%
distribute-lft-out--86.5%
Simplified86.5%
Taylor expanded in l around 0 86.5%
unpow286.5%
Simplified86.5%
Final simplification92.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 71.9%
sqr-neg71.9%
associate-*l/72.4%
*-lft-identity72.4%
sqr-neg72.4%
Simplified72.4%
Taylor expanded in l around 0 64.6%
unpow264.6%
Simplified64.6%
Taylor expanded in F around inf 73.4%
Final simplification73.4%
herbie shell --seed 2023272
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))