
(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 10 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+29) (not (<= (* PI l) 10000000000.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) <= -5e+29) || !((((double) M_PI) * l) <= 10000000000.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) <= -5e+29) || !((Math.PI * l) <= 10000000000.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) <= -5e+29) or not ((math.pi * l) <= 10000000000.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) <= -5e+29) || !(Float64(pi * l) <= 10000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(-1.0 / Float64(F * Float64(F / tan(Float64(pi * l)))))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5e+29) || ~(((pi * l) <= 10000000000.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], -5e+29], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(F * N[(F / N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+29} \lor \neg \left(\pi \cdot \ell \leq 10000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{-1}{F \cdot \frac{F}{\tan \left(\pi \cdot \ell\right)}}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5.0000000000000001e29 or 1e10 < (*.f64 (PI.f64) l) Initial program 61.9%
associate-*l/61.9%
*-lft-identity61.9%
Simplified61.9%
Taylor expanded in l around 0 46.3%
unpow246.3%
Simplified46.3%
Taylor expanded in F around inf 99.6%
if -5.0000000000000001e29 < (*.f64 (PI.f64) l) < 1e10Initial program 87.1%
associate-*l/88.7%
*-lft-identity88.7%
Simplified88.7%
associate-/r*99.0%
div-inv99.0%
Applied egg-rr99.0%
clear-num98.9%
frac-times99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+29) (not (<= (* PI l) 10000000000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+29) || !((((double) M_PI) * l) <= 10000000000.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+29) || !((Math.PI * l) <= 10000000000.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+29) or not ((math.pi * l) <= 10000000000.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+29) || !(Float64(pi * l) <= 10000000000.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+29) || ~(((pi * l) <= 10000000000.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+29], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000000.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^{+29} \lor \neg \left(\pi \cdot \ell \leq 10000000000\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.0000000000000001e29 or 1e10 < (*.f64 (PI.f64) l) Initial program 61.9%
associate-*l/61.9%
*-lft-identity61.9%
Simplified61.9%
Taylor expanded in l around 0 46.3%
unpow246.3%
Simplified46.3%
Taylor expanded in F around inf 99.6%
if -5.0000000000000001e29 < (*.f64 (PI.f64) l) < 1e10Initial program 87.1%
associate-*l/88.7%
*-un-lft-identity88.7%
associate-/r*99.0%
Applied egg-rr99.0%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2000000.0) (not (<= (* PI l) 5e-13))) (* PI l) (- (* PI l) (* PI (/ (/ l F) F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2000000.0) || !((((double) M_PI) * l) <= 5e-13)) {
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) <= -2000000.0) || !((Math.PI * l) <= 5e-13)) {
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) <= -2000000.0) or not ((math.pi * l) <= 5e-13): 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) <= -2000000.0) || !(Float64(pi * l) <= 5e-13)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(pi * Float64(Float64(l / F) / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2000000.0) || ~(((pi * l) <= 5e-13))) 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], -2000000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 5e-13]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(Pi * N[(N[(l / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2000000 \lor \neg \left(\pi \cdot \ell \leq 5 \cdot 10^{-13}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\frac{\ell}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -2e6 or 4.9999999999999999e-13 < (*.f64 (PI.f64) l) Initial program 64.0%
associate-*l/64.0%
*-lft-identity64.0%
Simplified64.0%
Taylor expanded in l around 0 47.0%
unpow247.0%
Simplified47.0%
Taylor expanded in F around inf 96.4%
if -2e6 < (*.f64 (PI.f64) l) < 4.9999999999999999e-13Initial program 87.0%
associate-*l/88.6%
*-un-lft-identity88.6%
associate-/r*99.6%
Applied egg-rr99.6%
Taylor expanded in l around 0 99.3%
associate-/l*99.3%
associate-/r/99.3%
Simplified99.3%
associate-/l*99.3%
associate-/r/99.3%
Applied egg-rr99.3%
Final simplification98.0%
(FPCore (F l) :precision binary64 (if (or (<= l -380000.0) (not (<= l 0.038))) (* PI l) (- (* PI l) (* (/ l F) (/ PI F)))))
double code(double F, double l) {
double tmp;
if ((l <= -380000.0) || !(l <= 0.038)) {
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 <= -380000.0) || !(l <= 0.038)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l / F) * (Math.PI / F));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -380000.0) or not (l <= 0.038): 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 <= -380000.0) || !(l <= 0.038)) 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 <= -380000.0) || ~((l <= 0.038))) tmp = pi * l; else tmp = (pi * l) - ((l / F) * (pi / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -380000.0], N[Not[LessEqual[l, 0.038]], $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 -380000 \lor \neg \left(\ell \leq 0.038\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F}\\
\end{array}
\end{array}
if l < -3.8e5 or 0.0379999999999999991 < l Initial program 64.0%
associate-*l/64.0%
*-lft-identity64.0%
Simplified64.0%
Taylor expanded in l around 0 47.0%
unpow247.0%
Simplified47.0%
Taylor expanded in F around inf 96.4%
if -3.8e5 < l < 0.0379999999999999991Initial program 87.0%
associate-*l/88.6%
*-lft-identity88.6%
Simplified88.6%
Taylor expanded in l around 0 86.7%
unpow286.7%
Simplified86.7%
Taylor expanded in F around 0 88.3%
*-commutative88.3%
mul-1-neg88.3%
unsub-neg88.3%
*-commutative88.3%
*-commutative88.3%
unpow288.3%
times-frac99.3%
Simplified99.3%
Final simplification98.0%
(FPCore (F l) :precision binary64 (if (or (<= l -380000.0) (not (<= l 0.038))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -380000.0) || !(l <= 0.038)) {
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 <= -380000.0) || !(l <= 0.038)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -380000.0) or not (l <= 0.038): tmp = math.pi * l else: tmp = l * (math.pi - (math.pi / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -380000.0) || !(l <= 0.038)) 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 <= -380000.0) || ~((l <= 0.038))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -380000.0], N[Not[LessEqual[l, 0.038]], $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 -380000 \lor \neg \left(\ell \leq 0.038\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if l < -3.8e5 or 0.0379999999999999991 < l Initial program 64.0%
associate-*l/64.0%
*-lft-identity64.0%
Simplified64.0%
Taylor expanded in l around 0 47.0%
unpow247.0%
Simplified47.0%
Taylor expanded in F around inf 96.4%
if -3.8e5 < l < 0.0379999999999999991Initial program 87.0%
associate-*l/88.6%
*-lft-identity88.6%
Simplified88.6%
Taylor expanded in l around 0 86.7%
unpow286.7%
Simplified86.7%
Final simplification91.1%
(FPCore (F l)
:precision binary64
(if (or (<= (* F F) 1e-292)
(and (not (<= (* F F) 5e-138)) (<= (* F F) 2e-80)))
(* (/ l F) (/ -1.0 (/ F PI)))
(* PI l)))
double code(double F, double l) {
double tmp;
if (((F * F) <= 1e-292) || (!((F * F) <= 5e-138) && ((F * F) <= 2e-80))) {
tmp = (l / F) * (-1.0 / (F / ((double) M_PI)));
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((F * F) <= 1e-292) || (!((F * F) <= 5e-138) && ((F * F) <= 2e-80))) {
tmp = (l / F) * (-1.0 / (F / Math.PI));
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if ((F * F) <= 1e-292) or (not ((F * F) <= 5e-138) and ((F * F) <= 2e-80)): tmp = (l / F) * (-1.0 / (F / math.pi)) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if ((Float64(F * F) <= 1e-292) || (!(Float64(F * F) <= 5e-138) && (Float64(F * F) <= 2e-80))) tmp = Float64(Float64(l / F) * Float64(-1.0 / Float64(F / pi))); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((F * F) <= 1e-292) || (~(((F * F) <= 5e-138)) && ((F * F) <= 2e-80))) tmp = (l / F) * (-1.0 / (F / pi)); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(F * F), $MachinePrecision], 1e-292], And[N[Not[LessEqual[N[(F * F), $MachinePrecision], 5e-138]], $MachinePrecision], LessEqual[N[(F * F), $MachinePrecision], 2e-80]]], N[(N[(l / F), $MachinePrecision] * N[(-1.0 / N[(F / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 10^{-292} \lor \neg \left(F \cdot F \leq 5 \cdot 10^{-138}\right) \land F \cdot F \leq 2 \cdot 10^{-80}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{-1}{\frac{F}{\pi}}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if (*.f64 F F) < 1.0000000000000001e-292 or 4.99999999999999989e-138 < (*.f64 F F) < 1.99999999999999992e-80Initial program 47.4%
associate-*l/50.1%
*-lft-identity50.1%
Simplified50.1%
Taylor expanded in l around 0 42.1%
unpow242.1%
Simplified42.1%
Taylor expanded in F around 0 44.8%
mul-1-neg44.8%
associate-/l*44.7%
distribute-neg-frac44.7%
unpow244.7%
*-lft-identity44.7%
times-frac44.7%
/-rgt-identity44.7%
Simplified44.7%
neg-mul-144.7%
*-commutative44.7%
times-frac63.0%
Applied egg-rr63.0%
if 1.0000000000000001e-292 < (*.f64 F F) < 4.99999999999999989e-138 or 1.99999999999999992e-80 < (*.f64 F F) Initial program 90.7%
associate-*l/90.7%
*-lft-identity90.7%
Simplified90.7%
Taylor expanded in l around 0 81.5%
unpow281.5%
Simplified81.5%
Taylor expanded in F around inf 88.8%
Final simplification80.3%
(FPCore (F l)
:precision binary64
(if (<= (* F F) 1e-292)
(* (/ -1.0 F) (/ l (/ F PI)))
(if (or (<= (* F F) 5e-138) (not (<= (* F F) 2e-80)))
(* PI l)
(/ (* PI (- l)) (* F F)))))
double code(double F, double l) {
double tmp;
if ((F * F) <= 1e-292) {
tmp = (-1.0 / F) * (l / (F / ((double) M_PI)));
} else if (((F * F) <= 5e-138) || !((F * F) <= 2e-80)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * -l) / (F * F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F * F) <= 1e-292) {
tmp = (-1.0 / F) * (l / (F / Math.PI));
} else if (((F * F) <= 5e-138) || !((F * F) <= 2e-80)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * -l) / (F * F);
}
return tmp;
}
def code(F, l): tmp = 0 if (F * F) <= 1e-292: tmp = (-1.0 / F) * (l / (F / math.pi)) elif ((F * F) <= 5e-138) or not ((F * F) <= 2e-80): tmp = math.pi * l else: tmp = (math.pi * -l) / (F * F) return tmp
function code(F, l) tmp = 0.0 if (Float64(F * F) <= 1e-292) tmp = Float64(Float64(-1.0 / F) * Float64(l / Float64(F / pi))); elseif ((Float64(F * F) <= 5e-138) || !(Float64(F * F) <= 2e-80)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * Float64(-l)) / Float64(F * F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 1e-292) tmp = (-1.0 / F) * (l / (F / pi)); elseif (((F * F) <= 5e-138) || ~(((F * F) <= 2e-80))) tmp = pi * l; else tmp = (pi * -l) / (F * F); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 1e-292], N[(N[(-1.0 / F), $MachinePrecision] * N[(l / N[(F / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(F * F), $MachinePrecision], 5e-138], N[Not[LessEqual[N[(F * F), $MachinePrecision], 2e-80]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * (-l)), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 10^{-292}:\\
\;\;\;\;\frac{-1}{F} \cdot \frac{\ell}{\frac{F}{\pi}}\\
\mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-138} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-80}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi \cdot \left(-\ell\right)}{F \cdot F}\\
\end{array}
\end{array}
if (*.f64 F F) < 1.0000000000000001e-292Initial program 38.5%
associate-*l/41.8%
*-lft-identity41.8%
Simplified41.8%
Taylor expanded in l around 0 35.8%
unpow235.8%
Simplified35.8%
Taylor expanded in F around 0 39.1%
mul-1-neg39.1%
associate-/l*39.1%
distribute-neg-frac39.1%
unpow239.1%
*-lft-identity39.1%
times-frac39.1%
/-rgt-identity39.1%
Simplified39.1%
neg-mul-139.1%
times-frac61.7%
Applied egg-rr61.7%
if 1.0000000000000001e-292 < (*.f64 F F) < 4.99999999999999989e-138 or 1.99999999999999992e-80 < (*.f64 F F) Initial program 90.7%
associate-*l/90.7%
*-lft-identity90.7%
Simplified90.7%
Taylor expanded in l around 0 81.5%
unpow281.5%
Simplified81.5%
Taylor expanded in F around inf 88.8%
if 4.99999999999999989e-138 < (*.f64 F F) < 1.99999999999999992e-80Initial program 85.2%
associate-*l/85.5%
*-lft-identity85.5%
Simplified85.5%
Taylor expanded in l around 0 68.8%
unpow268.8%
Simplified68.8%
Taylor expanded in F around 0 68.8%
mul-1-neg68.8%
unpow268.8%
Simplified68.8%
Final simplification80.3%
(FPCore (F l)
:precision binary64
(if (or (<= l -1.35e-24)
(not (or (<= l -7e-155) (and (not (<= l 1.1e-145)) (<= l 1.5e-79)))))
(* PI l)
(/ (* PI (- l)) (* F F))))
double code(double F, double l) {
double tmp;
if ((l <= -1.35e-24) || !((l <= -7e-155) || (!(l <= 1.1e-145) && (l <= 1.5e-79)))) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * -l) / (F * F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -1.35e-24) || !((l <= -7e-155) || (!(l <= 1.1e-145) && (l <= 1.5e-79)))) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * -l) / (F * F);
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -1.35e-24) or not ((l <= -7e-155) or (not (l <= 1.1e-145) and (l <= 1.5e-79))): tmp = math.pi * l else: tmp = (math.pi * -l) / (F * F) return tmp
function code(F, l) tmp = 0.0 if ((l <= -1.35e-24) || !((l <= -7e-155) || (!(l <= 1.1e-145) && (l <= 1.5e-79)))) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * Float64(-l)) / Float64(F * F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -1.35e-24) || ~(((l <= -7e-155) || (~((l <= 1.1e-145)) && (l <= 1.5e-79))))) tmp = pi * l; else tmp = (pi * -l) / (F * F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -1.35e-24], N[Not[Or[LessEqual[l, -7e-155], And[N[Not[LessEqual[l, 1.1e-145]], $MachinePrecision], LessEqual[l, 1.5e-79]]]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * (-l)), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.35 \cdot 10^{-24} \lor \neg \left(\ell \leq -7 \cdot 10^{-155} \lor \neg \left(\ell \leq 1.1 \cdot 10^{-145}\right) \land \ell \leq 1.5 \cdot 10^{-79}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi \cdot \left(-\ell\right)}{F \cdot F}\\
\end{array}
\end{array}
if l < -1.35000000000000003e-24 or -7.00000000000000031e-155 < l < 1.1e-145 or 1.5e-79 < l Initial program 74.1%
associate-*l/74.7%
*-lft-identity74.7%
Simplified74.7%
Taylor expanded in l around 0 64.4%
unpow264.4%
Simplified64.4%
Taylor expanded in F around inf 80.5%
if -1.35000000000000003e-24 < l < -7.00000000000000031e-155 or 1.1e-145 < l < 1.5e-79Initial program 87.5%
associate-*l/89.4%
*-lft-identity89.4%
Simplified89.4%
Taylor expanded in l around 0 87.6%
unpow287.6%
Simplified87.6%
Taylor expanded in F around 0 62.1%
mul-1-neg62.1%
unpow262.1%
Simplified62.1%
Final simplification77.2%
(FPCore (F l)
:precision binary64
(if (<= l -5.5e-23)
(* PI l)
(if (<= l -9.6e-155)
(/ (* PI (- l)) (* F F))
(if (or (<= l 3.8e-142) (not (<= l 6.7e-80)))
(* PI l)
(/ (- l) (* F (/ F PI)))))))
double code(double F, double l) {
double tmp;
if (l <= -5.5e-23) {
tmp = ((double) M_PI) * l;
} else if (l <= -9.6e-155) {
tmp = (((double) M_PI) * -l) / (F * F);
} else if ((l <= 3.8e-142) || !(l <= 6.7e-80)) {
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 (l <= -5.5e-23) {
tmp = Math.PI * l;
} else if (l <= -9.6e-155) {
tmp = (Math.PI * -l) / (F * F);
} else if ((l <= 3.8e-142) || !(l <= 6.7e-80)) {
tmp = Math.PI * l;
} else {
tmp = -l / (F * (F / Math.PI));
}
return tmp;
}
def code(F, l): tmp = 0 if l <= -5.5e-23: tmp = math.pi * l elif l <= -9.6e-155: tmp = (math.pi * -l) / (F * F) elif (l <= 3.8e-142) or not (l <= 6.7e-80): tmp = math.pi * l else: tmp = -l / (F * (F / math.pi)) return tmp
function code(F, l) tmp = 0.0 if (l <= -5.5e-23) tmp = Float64(pi * l); elseif (l <= -9.6e-155) tmp = Float64(Float64(pi * Float64(-l)) / Float64(F * F)); elseif ((l <= 3.8e-142) || !(l <= 6.7e-80)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) / Float64(F * Float64(F / pi))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (l <= -5.5e-23) tmp = pi * l; elseif (l <= -9.6e-155) tmp = (pi * -l) / (F * F); elseif ((l <= 3.8e-142) || ~((l <= 6.7e-80))) tmp = pi * l; else tmp = -l / (F * (F / pi)); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[l, -5.5e-23], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -9.6e-155], N[(N[(Pi * (-l)), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 3.8e-142], N[Not[LessEqual[l, 6.7e-80]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(F * N[(F / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.5 \cdot 10^{-23}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq -9.6 \cdot 10^{-155}:\\
\;\;\;\;\frac{\pi \cdot \left(-\ell\right)}{F \cdot F}\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-142} \lor \neg \left(\ell \leq 6.7 \cdot 10^{-80}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{F \cdot \frac{F}{\pi}}\\
\end{array}
\end{array}
if l < -5.5000000000000001e-23 or -9.600000000000001e-155 < l < 3.79999999999999972e-142 or 6.70000000000000002e-80 < l Initial program 74.1%
associate-*l/74.7%
*-lft-identity74.7%
Simplified74.7%
Taylor expanded in l around 0 64.4%
unpow264.4%
Simplified64.4%
Taylor expanded in F around inf 80.5%
if -5.5000000000000001e-23 < l < -9.600000000000001e-155Initial program 89.0%
associate-*l/89.2%
*-lft-identity89.2%
Simplified89.2%
Taylor expanded in l around 0 89.2%
unpow289.2%
Simplified89.2%
Taylor expanded in F around 0 63.0%
mul-1-neg63.0%
unpow263.0%
Simplified63.0%
if 3.79999999999999972e-142 < l < 6.70000000000000002e-80Initial program 85.5%
associate-*l/89.8%
*-lft-identity89.8%
Simplified89.8%
Taylor expanded in l around 0 85.5%
unpow285.5%
Simplified85.5%
Taylor expanded in F around 0 61.0%
mul-1-neg61.0%
associate-/l*60.7%
distribute-neg-frac60.7%
unpow260.7%
*-lft-identity60.7%
times-frac61.1%
/-rgt-identity61.1%
Simplified61.1%
Final simplification77.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 76.5%
associate-*l/77.4%
*-lft-identity77.4%
Simplified77.4%
Taylor expanded in l around 0 68.6%
unpow268.6%
Simplified68.6%
Taylor expanded in F around inf 71.3%
Final simplification71.3%
herbie shell --seed 2023192
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))