
(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 13 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) -1e+17) (not (<= (* PI l) 10000000.0))) (* PI l) (+ (* PI l) (/ (/ -1.0 F) (* F (/ 1.0 (tan (* PI l))))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+17) || !((((double) M_PI) * l) <= 10000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + ((-1.0 / F) / (F * (1.0 / tan((((double) M_PI) * l)))));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -1e+17) || !((Math.PI * l) <= 10000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + ((-1.0 / F) / (F * (1.0 / Math.tan((Math.PI * l)))));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -1e+17) or not ((math.pi * l) <= 10000000.0): tmp = math.pi * l else: tmp = (math.pi * l) + ((-1.0 / F) / (F * (1.0 / math.tan((math.pi * l))))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -1e+17) || !(Float64(pi * l) <= 10000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(-1.0 / F) / Float64(F * Float64(1.0 / tan(Float64(pi * l)))))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -1e+17) || ~(((pi * l) <= 10000000.0))) tmp = pi * l; else tmp = (pi * l) + ((-1.0 / F) / (F * (1.0 / tan((pi * l))))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -1e+17], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(-1.0 / F), $MachinePrecision] / N[(F * N[(1.0 / N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+17} \lor \neg \left(\pi \cdot \ell \leq 10000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{1}{\tan \left(\pi \cdot \ell\right)}}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1e17 or 1e7 < (*.f64 (PI.f64) l) Initial program 66.6%
Taylor expanded in F around 0 66.6%
unpow266.6%
associate-/r*66.6%
*-rgt-identity66.6%
associate-*r/66.6%
unpow-166.6%
unpow-166.6%
pow-sqr66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in l around inf 99.6%
if -1e17 < (*.f64 (PI.f64) l) < 1e7Initial program 90.5%
associate-/r/91.6%
associate-/l*99.5%
clear-num99.6%
add-sqr-sqrt51.2%
sqrt-prod66.4%
sqr-neg66.4%
sqrt-unprod19.1%
div-inv19.1%
metadata-eval19.1%
add-sqr-sqrt0.0%
sqrt-prod44.3%
sqrt-div43.4%
add-sqr-sqrt71.5%
associate-*l/71.5%
clear-num71.5%
associate-*l/71.5%
*-un-lft-identity71.5%
Applied egg-rr99.6%
clear-num99.5%
associate-/r/99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -1e+17) (not (<= (* PI l) 10000000.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) <= -1e+17) || !((((double) M_PI) * l) <= 10000000.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) <= -1e+17) || !((Math.PI * l) <= 10000000.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) <= -1e+17) or not ((math.pi * l) <= 10000000.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) <= -1e+17) || !(Float64(pi * l) <= 10000000.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) <= -1e+17) || ~(((pi * l) <= 10000000.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], -1e+17], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000.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 -1 \cdot 10^{+17} \lor \neg \left(\pi \cdot \ell \leq 10000000\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) < -1e17 or 1e7 < (*.f64 (PI.f64) l) Initial program 66.6%
Taylor expanded in F around 0 66.6%
unpow266.6%
associate-/r*66.6%
*-rgt-identity66.6%
associate-*r/66.6%
unpow-166.6%
unpow-166.6%
pow-sqr66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in l around inf 99.6%
if -1e17 < (*.f64 (PI.f64) l) < 1e7Initial program 90.5%
sqr-neg90.5%
associate-*l/91.6%
*-lft-identity91.6%
sqr-neg91.6%
Simplified91.6%
associate-/r*99.6%
div-inv99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -1e+17) (not (<= (* PI l) 10000000.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) <= -1e+17) || !((((double) M_PI) * l) <= 10000000.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) <= -1e+17) || !((Math.PI * l) <= 10000000.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) <= -1e+17) or not ((math.pi * l) <= 10000000.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) <= -1e+17) || !(Float64(pi * l) <= 10000000.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) <= -1e+17) || ~(((pi * l) <= 10000000.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], -1e+17], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000.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 -1 \cdot 10^{+17} \lor \neg \left(\pi \cdot \ell \leq 10000000\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) < -1e17 or 1e7 < (*.f64 (PI.f64) l) Initial program 66.6%
Taylor expanded in F around 0 66.6%
unpow266.6%
associate-/r*66.6%
*-rgt-identity66.6%
associate-*r/66.6%
unpow-166.6%
unpow-166.6%
pow-sqr66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in l around inf 99.6%
if -1e17 < (*.f64 (PI.f64) l) < 1e7Initial program 90.5%
associate-/r/91.6%
associate-/l*99.5%
clear-num99.6%
add-sqr-sqrt51.2%
sqrt-prod66.4%
sqr-neg66.4%
sqrt-unprod19.1%
div-inv19.1%
metadata-eval19.1%
add-sqr-sqrt0.0%
sqrt-prod44.3%
sqrt-div43.4%
add-sqr-sqrt71.5%
associate-*l/71.5%
clear-num71.5%
associate-*l/71.5%
*-un-lft-identity71.5%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5.0) (not (<= (* PI l) 4e-19))) (* PI l) (+ (* PI l) (/ (/ -1.0 F) (* F (/ 1.0 (* PI l)))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5.0) || !((((double) M_PI) * l) <= 4e-19)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + ((-1.0 / F) / (F * (1.0 / (((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) <= 4e-19)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + ((-1.0 / F) / (F * (1.0 / (Math.PI * l))));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -5.0) or not ((math.pi * l) <= 4e-19): tmp = math.pi * l else: tmp = (math.pi * l) + ((-1.0 / F) / (F * (1.0 / (math.pi * l)))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5.0) || !(Float64(pi * l) <= 4e-19)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(-1.0 / F) / Float64(F * Float64(1.0 / Float64(pi * l))))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5.0) || ~(((pi * l) <= 4e-19))) tmp = pi * l; else tmp = (pi * l) + ((-1.0 / F) / (F * (1.0 / (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], 4e-19]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(-1.0 / F), $MachinePrecision] / N[(F * N[(1.0 / N[(Pi * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \lor \neg \left(\pi \cdot \ell \leq 4 \cdot 10^{-19}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{1}{\pi \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5 or 3.9999999999999999e-19 < (*.f64 (PI.f64) l) Initial program 68.4%
Taylor expanded in F around 0 68.4%
unpow268.4%
associate-/r*68.4%
*-rgt-identity68.4%
associate-*r/68.4%
unpow-168.4%
unpow-168.4%
pow-sqr68.4%
metadata-eval68.4%
Simplified68.4%
Taylor expanded in l around inf 98.1%
if -5 < (*.f64 (PI.f64) l) < 3.9999999999999999e-19Initial program 90.1%
associate-/r/91.2%
associate-/l*99.5%
clear-num99.6%
add-sqr-sqrt51.7%
sqrt-prod65.4%
sqr-neg65.4%
sqrt-unprod17.8%
div-inv17.8%
metadata-eval17.8%
add-sqr-sqrt0.0%
sqrt-prod43.6%
sqrt-div42.6%
add-sqr-sqrt70.8%
associate-*l/70.8%
clear-num70.8%
associate-*l/70.8%
*-un-lft-identity70.8%
Applied egg-rr99.6%
clear-num99.5%
associate-/r/99.6%
Applied egg-rr99.6%
Taylor expanded in l around 0 99.6%
Final simplification98.8%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 5.5e-12))) (* PI l) (+ (* PI l) (/ (/ -1.0 F) (/ F (* PI l))))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 5.5e-12)) {
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 ((l <= -0.5) || !(l <= 5.5e-12)) {
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 (l <= -0.5) or not (l <= 5.5e-12): 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 ((l <= -0.5) || !(l <= 5.5e-12)) 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 ((l <= -0.5) || ~((l <= 5.5e-12))) tmp = pi * l; else tmp = (pi * l) + ((-1.0 / F) / (F / (pi * l))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 5.5e-12]], $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}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{\frac{F}{\pi \cdot \ell}}\\
\end{array}
\end{array}
if l < -0.5 or 5.5000000000000004e-12 < l Initial program 68.4%
Taylor expanded in F around 0 68.4%
unpow268.4%
associate-/r*68.4%
*-rgt-identity68.4%
associate-*r/68.4%
unpow-168.4%
unpow-168.4%
pow-sqr68.4%
metadata-eval68.4%
Simplified68.4%
Taylor expanded in l around inf 98.1%
if -0.5 < l < 5.5000000000000004e-12Initial program 90.1%
associate-/r/91.2%
associate-/l*99.5%
clear-num99.6%
add-sqr-sqrt51.7%
sqrt-prod65.4%
sqr-neg65.4%
sqrt-unprod17.8%
div-inv17.8%
metadata-eval17.8%
add-sqr-sqrt0.0%
sqrt-prod43.6%
sqrt-div42.6%
add-sqr-sqrt70.8%
associate-*l/70.8%
clear-num70.8%
associate-*l/70.8%
*-un-lft-identity70.8%
Applied egg-rr99.6%
Taylor expanded in l around 0 99.6%
Final simplification98.8%
(FPCore (F l)
:precision binary64
(if (<= l -1.58e-54)
(* PI l)
(if (<= l -2.25e-136)
(* l (* (pow F -2.0) (- PI)))
(if (or (<= l 2.2e-240) (not (<= l 2.25e-46)))
(* PI l)
(/ (- l) (/ (pow F 2.0) PI))))))
double code(double F, double l) {
double tmp;
if (l <= -1.58e-54) {
tmp = ((double) M_PI) * l;
} else if (l <= -2.25e-136) {
tmp = l * (pow(F, -2.0) * -((double) M_PI));
} else if ((l <= 2.2e-240) || !(l <= 2.25e-46)) {
tmp = ((double) M_PI) * l;
} else {
tmp = -l / (pow(F, 2.0) / ((double) M_PI));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (l <= -1.58e-54) {
tmp = Math.PI * l;
} else if (l <= -2.25e-136) {
tmp = l * (Math.pow(F, -2.0) * -Math.PI);
} else if ((l <= 2.2e-240) || !(l <= 2.25e-46)) {
tmp = Math.PI * l;
} else {
tmp = -l / (Math.pow(F, 2.0) / Math.PI);
}
return tmp;
}
def code(F, l): tmp = 0 if l <= -1.58e-54: tmp = math.pi * l elif l <= -2.25e-136: tmp = l * (math.pow(F, -2.0) * -math.pi) elif (l <= 2.2e-240) or not (l <= 2.25e-46): tmp = math.pi * l else: tmp = -l / (math.pow(F, 2.0) / math.pi) return tmp
function code(F, l) tmp = 0.0 if (l <= -1.58e-54) tmp = Float64(pi * l); elseif (l <= -2.25e-136) tmp = Float64(l * Float64((F ^ -2.0) * Float64(-pi))); elseif ((l <= 2.2e-240) || !(l <= 2.25e-46)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) / Float64((F ^ 2.0) / pi)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (l <= -1.58e-54) tmp = pi * l; elseif (l <= -2.25e-136) tmp = l * ((F ^ -2.0) * -pi); elseif ((l <= 2.2e-240) || ~((l <= 2.25e-46))) tmp = pi * l; else tmp = -l / ((F ^ 2.0) / pi); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[l, -1.58e-54], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -2.25e-136], N[(l * N[(N[Power[F, -2.0], $MachinePrecision] * (-Pi)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 2.2e-240], N[Not[LessEqual[l, 2.25e-46]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(N[Power[F, 2.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.58 \cdot 10^{-54}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq -2.25 \cdot 10^{-136}:\\
\;\;\;\;\ell \cdot \left({F}^{-2} \cdot \left(-\pi\right)\right)\\
\mathbf{elif}\;\ell \leq 2.2 \cdot 10^{-240} \lor \neg \left(\ell \leq 2.25 \cdot 10^{-46}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{\frac{{F}^{2}}{\pi}}\\
\end{array}
\end{array}
if l < -1.57999999999999989e-54 or -2.24999999999999986e-136 < l < 2.1999999999999999e-240 or 2.25e-46 < l Initial program 74.6%
Taylor expanded in F around 0 74.6%
unpow274.6%
associate-/r*74.6%
*-rgt-identity74.6%
associate-*r/74.5%
unpow-174.5%
unpow-174.5%
pow-sqr74.6%
metadata-eval74.6%
Simplified74.6%
Taylor expanded in l around inf 86.7%
if -1.57999999999999989e-54 < l < -2.24999999999999986e-136Initial program 95.7%
sqr-neg95.7%
associate-*l/95.7%
*-lft-identity95.7%
sqr-neg95.7%
Simplified95.7%
Taylor expanded in l around 0 95.6%
Taylor expanded in F around 0 70.8%
mul-1-neg70.8%
associate-/l*70.7%
distribute-neg-frac70.7%
unpow270.7%
sqr-neg70.7%
associate-*l/70.7%
distribute-neg-frac70.7%
associate-*l/70.7%
sqr-neg70.7%
associate-*l/70.7%
associate-/l/74.6%
remove-double-neg74.6%
neg-mul-174.6%
distribute-lft-neg-in74.6%
metadata-eval74.6%
associate-*l/74.6%
associate-*l/70.7%
Simplified70.8%
if 2.1999999999999999e-240 < l < 2.25e-46Initial program 89.1%
sqr-neg89.1%
associate-*l/90.9%
*-lft-identity90.9%
sqr-neg90.9%
Simplified90.9%
Taylor expanded in l around 0 89.1%
Taylor expanded in F around 0 55.8%
mul-1-neg55.8%
associate-/l*55.8%
Simplified55.8%
Final simplification80.0%
(FPCore (F l)
:precision binary64
(if (<= l -1.58e-54)
(* PI l)
(if (<= l -1.36e-135)
(* l (* (pow F -2.0) (- PI)))
(if (or (<= l 3.15e-251) (not (<= l 2.6e-46)))
(* PI l)
(* PI (/ (- l) (pow F 2.0)))))))
double code(double F, double l) {
double tmp;
if (l <= -1.58e-54) {
tmp = ((double) M_PI) * l;
} else if (l <= -1.36e-135) {
tmp = l * (pow(F, -2.0) * -((double) M_PI));
} else if ((l <= 3.15e-251) || !(l <= 2.6e-46)) {
tmp = ((double) M_PI) * l;
} else {
tmp = ((double) M_PI) * (-l / pow(F, 2.0));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (l <= -1.58e-54) {
tmp = Math.PI * l;
} else if (l <= -1.36e-135) {
tmp = l * (Math.pow(F, -2.0) * -Math.PI);
} else if ((l <= 3.15e-251) || !(l <= 2.6e-46)) {
tmp = Math.PI * l;
} else {
tmp = Math.PI * (-l / Math.pow(F, 2.0));
}
return tmp;
}
def code(F, l): tmp = 0 if l <= -1.58e-54: tmp = math.pi * l elif l <= -1.36e-135: tmp = l * (math.pow(F, -2.0) * -math.pi) elif (l <= 3.15e-251) or not (l <= 2.6e-46): tmp = math.pi * l else: tmp = math.pi * (-l / math.pow(F, 2.0)) return tmp
function code(F, l) tmp = 0.0 if (l <= -1.58e-54) tmp = Float64(pi * l); elseif (l <= -1.36e-135) tmp = Float64(l * Float64((F ^ -2.0) * Float64(-pi))); elseif ((l <= 3.15e-251) || !(l <= 2.6e-46)) tmp = Float64(pi * l); else tmp = Float64(pi * Float64(Float64(-l) / (F ^ 2.0))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (l <= -1.58e-54) tmp = pi * l; elseif (l <= -1.36e-135) tmp = l * ((F ^ -2.0) * -pi); elseif ((l <= 3.15e-251) || ~((l <= 2.6e-46))) tmp = pi * l; else tmp = pi * (-l / (F ^ 2.0)); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[l, -1.58e-54], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -1.36e-135], N[(l * N[(N[Power[F, -2.0], $MachinePrecision] * (-Pi)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 3.15e-251], N[Not[LessEqual[l, 2.6e-46]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * N[((-l) / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.58 \cdot 10^{-54}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq -1.36 \cdot 10^{-135}:\\
\;\;\;\;\ell \cdot \left({F}^{-2} \cdot \left(-\pi\right)\right)\\
\mathbf{elif}\;\ell \leq 3.15 \cdot 10^{-251} \lor \neg \left(\ell \leq 2.6 \cdot 10^{-46}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \frac{-\ell}{{F}^{2}}\\
\end{array}
\end{array}
if l < -1.57999999999999989e-54 or -1.36e-135 < l < 3.1499999999999999e-251 or 2.6000000000000002e-46 < l Initial program 74.6%
Taylor expanded in F around 0 74.6%
unpow274.6%
associate-/r*74.6%
*-rgt-identity74.6%
associate-*r/74.5%
unpow-174.5%
unpow-174.5%
pow-sqr74.6%
metadata-eval74.6%
Simplified74.6%
Taylor expanded in l around inf 86.7%
if -1.57999999999999989e-54 < l < -1.36e-135Initial program 95.7%
sqr-neg95.7%
associate-*l/95.7%
*-lft-identity95.7%
sqr-neg95.7%
Simplified95.7%
Taylor expanded in l around 0 95.6%
Taylor expanded in F around 0 70.8%
mul-1-neg70.8%
associate-/l*70.7%
distribute-neg-frac70.7%
unpow270.7%
sqr-neg70.7%
associate-*l/70.7%
distribute-neg-frac70.7%
associate-*l/70.7%
sqr-neg70.7%
associate-*l/70.7%
associate-/l/74.6%
remove-double-neg74.6%
neg-mul-174.6%
distribute-lft-neg-in74.6%
metadata-eval74.6%
associate-*l/74.6%
associate-*l/70.7%
Simplified70.8%
if 3.1499999999999999e-251 < l < 2.6000000000000002e-46Initial program 89.1%
sqr-neg89.1%
associate-*l/90.9%
*-lft-identity90.9%
sqr-neg90.9%
Simplified90.9%
Taylor expanded in l around 0 90.9%
associate-/r*99.6%
div-inv99.5%
associate-/l*99.4%
Applied egg-rr99.4%
associate-*l/99.5%
div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in F around 0 55.8%
mul-1-neg55.8%
associate-/l*55.8%
distribute-frac-neg55.8%
associate-/r/55.8%
Simplified55.8%
Final simplification80.0%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 5.5e-12))) (* PI l) (- (* PI l) (* (/ l F) (/ PI F)))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 5.5e-12)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((l / F) * (((double) M_PI) / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 5.5e-12)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l / F) * (Math.PI / F));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -0.5) or not (l <= 5.5e-12): tmp = math.pi * l else: tmp = (math.pi * l) - ((l / F) * (math.pi / F)) return tmp
function code(F, l) tmp = 0.0 if ((l <= -0.5) || !(l <= 5.5e-12)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l / F) * Float64(pi / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -0.5) || ~((l <= 5.5e-12))) tmp = pi * l; else tmp = (pi * l) - ((l / F) * (pi / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 5.5e-12]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / F), $MachinePrecision] * N[(Pi / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F}\\
\end{array}
\end{array}
if l < -0.5 or 5.5000000000000004e-12 < l Initial program 68.4%
Taylor expanded in F around 0 68.4%
unpow268.4%
associate-/r*68.4%
*-rgt-identity68.4%
associate-*r/68.4%
unpow-168.4%
unpow-168.4%
pow-sqr68.4%
metadata-eval68.4%
Simplified68.4%
Taylor expanded in l around inf 98.1%
if -0.5 < l < 5.5000000000000004e-12Initial program 90.1%
sqr-neg90.1%
associate-*l/91.2%
*-lft-identity91.2%
sqr-neg91.2%
Simplified91.2%
Taylor expanded in l around 0 91.2%
*-commutative91.2%
times-frac99.6%
Applied egg-rr99.6%
Final simplification98.8%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 5.5e-12))) (* PI l) (- (* PI l) (/ (* PI (/ l F)) F))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 5.5e-12)) {
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 <= -0.5) || !(l <= 5.5e-12)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI * (l / F)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -0.5) or not (l <= 5.5e-12): 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 <= -0.5) || !(l <= 5.5e-12)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi * Float64(l / F)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -0.5) || ~((l <= 5.5e-12))) tmp = pi * l; else tmp = (pi * l) - ((pi * (l / F)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 5.5e-12]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi * N[(l / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \frac{\ell}{F}}{F}\\
\end{array}
\end{array}
if l < -0.5 or 5.5000000000000004e-12 < l Initial program 68.4%
Taylor expanded in F around 0 68.4%
unpow268.4%
associate-/r*68.4%
*-rgt-identity68.4%
associate-*r/68.4%
unpow-168.4%
unpow-168.4%
pow-sqr68.4%
metadata-eval68.4%
Simplified68.4%
Taylor expanded in l around inf 98.1%
if -0.5 < l < 5.5000000000000004e-12Initial program 90.1%
sqr-neg90.1%
associate-*l/91.2%
*-lft-identity91.2%
sqr-neg91.2%
Simplified91.2%
Taylor expanded in l around 0 91.2%
associate-/r*99.6%
div-inv99.6%
associate-/l*99.5%
Applied egg-rr99.5%
associate-*l/99.5%
associate-/l*99.6%
*-commutative99.6%
div-inv99.6%
Applied egg-rr99.6%
Final simplification98.8%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 5.5e-12))) (* PI l) (- (* PI l) (/ (/ l F) (/ F PI)))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 5.5e-12)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((l / F) / (F / ((double) M_PI)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 5.5e-12)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l / F) / (F / Math.PI));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -0.5) or not (l <= 5.5e-12): tmp = math.pi * l else: tmp = (math.pi * l) - ((l / F) / (F / math.pi)) return tmp
function code(F, l) tmp = 0.0 if ((l <= -0.5) || !(l <= 5.5e-12)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l / F) / Float64(F / pi))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -0.5) || ~((l <= 5.5e-12))) tmp = pi * l; else tmp = (pi * l) - ((l / F) / (F / pi)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 5.5e-12]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / F), $MachinePrecision] / N[(F / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\ell}{F}}{\frac{F}{\pi}}\\
\end{array}
\end{array}
if l < -0.5 or 5.5000000000000004e-12 < l Initial program 68.4%
Taylor expanded in F around 0 68.4%
unpow268.4%
associate-/r*68.4%
*-rgt-identity68.4%
associate-*r/68.4%
unpow-168.4%
unpow-168.4%
pow-sqr68.4%
metadata-eval68.4%
Simplified68.4%
Taylor expanded in l around inf 98.1%
if -0.5 < l < 5.5000000000000004e-12Initial program 90.1%
sqr-neg90.1%
associate-*l/91.2%
*-lft-identity91.2%
sqr-neg91.2%
Simplified91.2%
Taylor expanded in l around 0 91.2%
associate-/r*99.6%
div-inv99.6%
associate-/l*99.5%
Applied egg-rr99.5%
associate-*l/99.5%
div-inv99.6%
Applied egg-rr99.6%
Final simplification98.8%
(FPCore (F l) :precision binary64 (if (or (<= F 2.4e-259) (and (not (<= F 5.5e-46)) (<= F 8.6e-5))) (/ (- l) (/ (pow F 2.0) PI)) (* PI l)))
double code(double F, double l) {
double tmp;
if ((F <= 2.4e-259) || (!(F <= 5.5e-46) && (F <= 8.6e-5))) {
tmp = -l / (pow(F, 2.0) / ((double) M_PI));
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F <= 2.4e-259) || (!(F <= 5.5e-46) && (F <= 8.6e-5))) {
tmp = -l / (Math.pow(F, 2.0) / Math.PI);
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 2.4e-259) or (not (F <= 5.5e-46) and (F <= 8.6e-5)): tmp = -l / (math.pow(F, 2.0) / math.pi) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if ((F <= 2.4e-259) || (!(F <= 5.5e-46) && (F <= 8.6e-5))) tmp = Float64(Float64(-l) / Float64((F ^ 2.0) / pi)); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 2.4e-259) || (~((F <= 5.5e-46)) && (F <= 8.6e-5))) tmp = -l / ((F ^ 2.0) / pi); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 2.4e-259], And[N[Not[LessEqual[F, 5.5e-46]], $MachinePrecision], LessEqual[F, 8.6e-5]]], N[((-l) / N[(N[Power[F, 2.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.4 \cdot 10^{-259} \lor \neg \left(F \leq 5.5 \cdot 10^{-46}\right) \land F \leq 8.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{-\ell}{\frac{{F}^{2}}{\pi}}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if F < 2.4000000000000001e-259 or 5.49999999999999983e-46 < F < 8.6000000000000003e-5Initial program 79.2%
sqr-neg79.2%
associate-*l/80.0%
*-lft-identity80.0%
sqr-neg80.0%
Simplified80.0%
Taylor expanded in l around 0 67.9%
Taylor expanded in F around 0 31.7%
mul-1-neg31.7%
associate-/l*31.7%
Simplified31.7%
if 2.4000000000000001e-259 < F < 5.49999999999999983e-46 or 8.6000000000000003e-5 < F Initial program 78.6%
Taylor expanded in F around 0 78.6%
unpow278.6%
associate-/r*78.6%
*-rgt-identity78.6%
associate-*r/78.6%
unpow-178.6%
unpow-178.6%
pow-sqr78.7%
metadata-eval78.7%
Simplified78.7%
Taylor expanded in l around inf 83.7%
Final simplification53.1%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 5.5e-12))) (* PI l) (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 5.5e-12)) {
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 <= -0.5) || !(l <= 5.5e-12)) {
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 <= -0.5) or not (l <= 5.5e-12): 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 <= -0.5) || !(l <= 5.5e-12)) 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 <= -0.5) || ~((l <= 5.5e-12))) tmp = pi * l; else tmp = l * (pi * (1.0 - (F ^ -2.0))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 5.5e-12]], $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 -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\
\end{array}
\end{array}
if l < -0.5 or 5.5000000000000004e-12 < l Initial program 68.4%
Taylor expanded in F around 0 68.4%
unpow268.4%
associate-/r*68.4%
*-rgt-identity68.4%
associate-*r/68.4%
unpow-168.4%
unpow-168.4%
pow-sqr68.4%
metadata-eval68.4%
Simplified68.4%
Taylor expanded in l around inf 98.1%
if -0.5 < l < 5.5000000000000004e-12Initial program 90.1%
sqr-neg90.1%
associate-*l/91.2%
*-lft-identity91.2%
sqr-neg91.2%
Simplified91.2%
Taylor expanded in l around 0 90.0%
Taylor expanded in F around 0 91.2%
Simplified90.0%
Final simplification94.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.0%
Taylor expanded in F around 0 79.0%
unpow279.0%
associate-/r*79.0%
*-rgt-identity79.0%
associate-*r/78.9%
unpow-178.9%
unpow-178.9%
pow-sqr79.0%
metadata-eval79.0%
Simplified79.0%
Taylor expanded in l around inf 72.8%
Final simplification72.8%
herbie shell --seed 2023300
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))