
(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+26) (not (<= (* PI l) 500000000.0))) (* PI l) (+ (* PI l) (/ (* (tan (* PI l)) (/ -1.0 F)) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+26) || !((((double) M_PI) * l) <= 500000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + ((tan((((double) M_PI) * l)) * (-1.0 / F)) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -1e+26) || !((Math.PI * l) <= 500000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + ((Math.tan((Math.PI * l)) * (-1.0 / F)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -1e+26) or not ((math.pi * l) <= 500000000.0): tmp = math.pi * l else: tmp = (math.pi * l) + ((math.tan((math.pi * l)) * (-1.0 / F)) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -1e+26) || !(Float64(pi * l) <= 500000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(tan(Float64(pi * l)) * Float64(-1.0 / F)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -1e+26) || ~(((pi * l) <= 500000000.0))) tmp = pi * l; else tmp = (pi * l) + ((tan((pi * l)) * (-1.0 / F)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -1e+26], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 500000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+26} \lor \neg \left(\pi \cdot \ell \leq 500000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right) \cdot \frac{-1}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1.00000000000000005e26 or 5e8 < (*.f64 (PI.f64) l) Initial program 57.3%
Taylor expanded in l around 0 48.4%
associate-/l*49.2%
unpow249.2%
Simplified49.2%
Taylor expanded in F around inf 99.7%
if -1.00000000000000005e26 < (*.f64 (PI.f64) l) < 5e8Initial program 86.7%
associate-/r*86.7%
metadata-eval86.7%
add-sqr-sqrt45.7%
sqrt-prod72.4%
sqrt-div72.4%
associate-*l/72.5%
sqrt-div73.5%
metadata-eval73.5%
sqrt-prod55.5%
add-sqr-sqrt99.4%
Applied egg-rr99.4%
Final simplification99.5%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -1e+26) (not (<= (* PI l) 500000000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+26) || !((((double) M_PI) * l) <= 500000000.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) <= -1e+26) || !((Math.PI * l) <= 500000000.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) <= -1e+26) or not ((math.pi * l) <= 500000000.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) <= -1e+26) || !(Float64(pi * l) <= 500000000.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) <= -1e+26) || ~(((pi * l) <= 500000000.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], -1e+26], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 500000000.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 -1 \cdot 10^{+26} \lor \neg \left(\pi \cdot \ell \leq 500000000\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) < -1.00000000000000005e26 or 5e8 < (*.f64 (PI.f64) l) Initial program 57.3%
Taylor expanded in l around 0 48.4%
associate-/l*49.2%
unpow249.2%
Simplified49.2%
Taylor expanded in F around inf 99.7%
if -1.00000000000000005e26 < (*.f64 (PI.f64) l) < 5e8Initial program 86.7%
associate-*l/87.8%
*-un-lft-identity87.8%
associate-/r*99.4%
Applied egg-rr99.4%
Final simplification99.5%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -500000000.0) (not (<= (* PI l) 2e-16))) (* PI l) (+ (* PI l) (/ (* (* PI l) (/ -1.0 F)) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -500000000.0) || !((((double) M_PI) * l) <= 2e-16)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + (((((double) M_PI) * l) * (-1.0 / F)) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -500000000.0) || !((Math.PI * l) <= 2e-16)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + (((Math.PI * l) * (-1.0 / F)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -500000000.0) or not ((math.pi * l) <= 2e-16): tmp = math.pi * l else: tmp = (math.pi * l) + (((math.pi * l) * (-1.0 / F)) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -500000000.0) || !(Float64(pi * l) <= 2e-16)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(Float64(pi * l) * Float64(-1.0 / F)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -500000000.0) || ~(((pi * l) <= 2e-16))) tmp = pi * l; else tmp = (pi * l) + (((pi * l) * (-1.0 / F)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -500000000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2e-16]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[(Pi * l), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -500000000 \lor \neg \left(\pi \cdot \ell \leq 2 \cdot 10^{-16}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\left(\pi \cdot \ell\right) \cdot \frac{-1}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5e8 or 2e-16 < (*.f64 (PI.f64) l) Initial program 58.6%
Taylor expanded in l around 0 48.8%
associate-/l*49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in F around inf 98.2%
if -5e8 < (*.f64 (PI.f64) l) < 2e-16Initial program 86.6%
associate-/r*86.6%
metadata-eval86.6%
add-sqr-sqrt45.5%
sqrt-prod71.7%
sqrt-div71.7%
associate-*l/71.8%
sqrt-div72.8%
metadata-eval72.8%
sqrt-prod55.7%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
Taylor expanded in l around 0 99.7%
Final simplification99.0%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -500000000.0) (not (<= (* PI l) 2e-16))) (* PI l) (- (* PI l) (/ (/ PI (/ F l)) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -500000000.0) || !((((double) M_PI) * l) <= 2e-16)) {
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 (((Math.PI * l) <= -500000000.0) || !((Math.PI * l) <= 2e-16)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI / (F / l)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -500000000.0) or not ((math.pi * l) <= 2e-16): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.pi / (F / l)) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -500000000.0) || !(Float64(pi * l) <= 2e-16)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi / Float64(F / l)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -500000000.0) || ~(((pi * l) <= 2e-16))) tmp = pi * l; else tmp = (pi * l) - ((pi / (F / l)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -500000000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2e-16]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi / N[(F / l), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -500000000 \lor \neg \left(\pi \cdot \ell \leq 2 \cdot 10^{-16}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\pi}{\frac{F}{\ell}}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5e8 or 2e-16 < (*.f64 (PI.f64) l) Initial program 58.6%
Taylor expanded in l around 0 48.8%
associate-/l*49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in F around inf 98.2%
if -5e8 < (*.f64 (PI.f64) l) < 2e-16Initial program 86.6%
associate-/r*86.6%
metadata-eval86.6%
add-sqr-sqrt45.5%
sqrt-prod71.7%
sqrt-div71.7%
associate-*l/71.8%
sqrt-div72.8%
metadata-eval72.8%
sqrt-prod55.7%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
Taylor expanded in l around 0 99.7%
associate-*r/99.7%
Simplified99.7%
associate-*r/99.7%
*-commutative99.7%
associate-/l*99.7%
Applied egg-rr99.7%
Final simplification98.9%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 0.5))) (* PI l) (- (* PI l) (/ l (/ (* F F) PI)))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 0.5)) {
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 <= 0.5)) {
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 <= 0.5): 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 <= 0.5)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(l / Float64(Float64(F * F) / pi))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -0.5) || ~((l <= 0.5))) 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, 0.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(l / N[(N[(F * F), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 0.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\ell}{\frac{F \cdot F}{\pi}}\\
\end{array}
\end{array}
if l < -0.5 or 0.5 < l Initial program 58.6%
Taylor expanded in l around 0 48.8%
associate-/l*49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in F around inf 98.2%
if -0.5 < l < 0.5Initial program 86.6%
Taylor expanded in l around 0 87.7%
associate-/l*87.6%
unpow287.6%
Simplified87.6%
Final simplification93.0%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 0.5))) (* PI l) (- (* PI l) (/ (* PI l) (* F F)))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 0.5)) {
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 <= 0.5)) {
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 <= 0.5): 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 <= 0.5)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi * l) / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -0.5) || ~((l <= 0.5))) 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, 0.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi * l), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 0.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \ell}{F \cdot F}\\
\end{array}
\end{array}
if l < -0.5 or 0.5 < l Initial program 58.6%
Taylor expanded in l around 0 48.8%
associate-/l*49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in F around inf 98.2%
if -0.5 < l < 0.5Initial program 86.6%
sqr-neg86.6%
associate-*l/87.7%
*-lft-identity87.7%
sqr-neg87.7%
Simplified87.7%
Taylor expanded in l around 0 87.7%
Final simplification93.0%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 0.5))) (* PI l) (- (* PI l) (/ (* l (/ PI F)) F))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 0.5)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((l * (((double) M_PI) / F)) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 0.5)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l * (Math.PI / F)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -0.5) or not (l <= 0.5): tmp = math.pi * l else: tmp = (math.pi * l) - ((l * (math.pi / F)) / F) return tmp
function code(F, l) tmp = 0.0 if ((l <= -0.5) || !(l <= 0.5)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l * Float64(pi / F)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -0.5) || ~((l <= 0.5))) tmp = pi * l; else tmp = (pi * l) - ((l * (pi / F)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 0.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l * N[(Pi / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 0.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\ell \cdot \frac{\pi}{F}}{F}\\
\end{array}
\end{array}
if l < -0.5 or 0.5 < l Initial program 58.6%
Taylor expanded in l around 0 48.8%
associate-/l*49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in F around inf 98.2%
if -0.5 < l < 0.5Initial program 86.6%
associate-/r*86.6%
metadata-eval86.6%
add-sqr-sqrt45.5%
sqrt-prod71.7%
sqrt-div71.7%
associate-*l/71.8%
sqrt-div72.8%
metadata-eval72.8%
sqrt-prod55.7%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
Taylor expanded in l around 0 99.7%
associate-*r/99.7%
Simplified99.7%
Final simplification98.9%
(FPCore (F l)
:precision binary64
(if (<= F 2.8e-265)
(/ (- l) (* F (/ F PI)))
(if (or (<= F 3.1e-106) (not (<= F 6e-73)))
(* PI l)
(* (pow F -2.0) (* PI (- l))))))
double code(double F, double l) {
double tmp;
if (F <= 2.8e-265) {
tmp = -l / (F * (F / ((double) M_PI)));
} else if ((F <= 3.1e-106) || !(F <= 6e-73)) {
tmp = ((double) M_PI) * l;
} else {
tmp = pow(F, -2.0) * (((double) M_PI) * -l);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (F <= 2.8e-265) {
tmp = -l / (F * (F / Math.PI));
} else if ((F <= 3.1e-106) || !(F <= 6e-73)) {
tmp = Math.PI * l;
} else {
tmp = Math.pow(F, -2.0) * (Math.PI * -l);
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 2.8e-265: tmp = -l / (F * (F / math.pi)) elif (F <= 3.1e-106) or not (F <= 6e-73): tmp = math.pi * l else: tmp = math.pow(F, -2.0) * (math.pi * -l) return tmp
function code(F, l) tmp = 0.0 if (F <= 2.8e-265) tmp = Float64(Float64(-l) / Float64(F * Float64(F / pi))); elseif ((F <= 3.1e-106) || !(F <= 6e-73)) tmp = Float64(pi * l); else tmp = Float64((F ^ -2.0) * Float64(pi * Float64(-l))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (F <= 2.8e-265) tmp = -l / (F * (F / pi)); elseif ((F <= 3.1e-106) || ~((F <= 6e-73))) tmp = pi * l; else tmp = (F ^ -2.0) * (pi * -l); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 2.8e-265], N[((-l) / N[(F * N[(F / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 3.1e-106], N[Not[LessEqual[F, 6e-73]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[Power[F, -2.0], $MachinePrecision] * N[(Pi * (-l)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.8 \cdot 10^{-265}:\\
\;\;\;\;\frac{-\ell}{F \cdot \frac{F}{\pi}}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{-106} \lor \neg \left(F \leq 6 \cdot 10^{-73}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;{F}^{-2} \cdot \left(\pi \cdot \left(-\ell\right)\right)\\
\end{array}
\end{array}
if F < 2.80000000000000023e-265Initial program 72.0%
Taylor expanded in l around 0 67.4%
associate-/l*68.2%
unpow268.2%
Simplified68.2%
Taylor expanded in F around 0 21.9%
mul-1-neg21.9%
unpow221.9%
associate-/l*21.9%
associate-*r/21.9%
Simplified21.9%
if 2.80000000000000023e-265 < F < 3.09999999999999985e-106 or 6e-73 < F Initial program 72.9%
Taylor expanded in l around 0 69.4%
associate-/l*69.3%
unpow269.3%
Simplified69.3%
Taylor expanded in F around inf 75.2%
if 3.09999999999999985e-106 < F < 6e-73Initial program 74.8%
Taylor expanded in l around 0 50.1%
associate-/l*49.7%
unpow249.7%
Simplified49.7%
Taylor expanded in F around 0 50.1%
mul-1-neg50.1%
unpow249.7%
*-commutative49.7%
*-lft-identity49.7%
*-commutative49.7%
associate-*r/49.7%
associate-/r*49.7%
*-rgt-identity49.7%
associate-*r/49.7%
unpow-149.7%
unpow-149.7%
pow-sqr50.1%
metadata-eval50.1%
distribute-rgt-neg-in50.1%
*-commutative50.1%
Simplified50.1%
Final simplification48.2%
(FPCore (F l)
:precision binary64
(if (<= F 2.9e-265)
(/ (- l) (* F (/ F PI)))
(if (or (<= F 2.6e-106) (not (<= F 5e-73)))
(* PI l)
(/ (* PI (- l)) (pow F 2.0)))))
double code(double F, double l) {
double tmp;
if (F <= 2.9e-265) {
tmp = -l / (F * (F / ((double) M_PI)));
} else if ((F <= 2.6e-106) || !(F <= 5e-73)) {
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 (F <= 2.9e-265) {
tmp = -l / (F * (F / Math.PI));
} else if ((F <= 2.6e-106) || !(F <= 5e-73)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * -l) / Math.pow(F, 2.0);
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 2.9e-265: tmp = -l / (F * (F / math.pi)) elif (F <= 2.6e-106) or not (F <= 5e-73): tmp = math.pi * l else: tmp = (math.pi * -l) / math.pow(F, 2.0) return tmp
function code(F, l) tmp = 0.0 if (F <= 2.9e-265) tmp = Float64(Float64(-l) / Float64(F * Float64(F / pi))); elseif ((F <= 2.6e-106) || !(F <= 5e-73)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * Float64(-l)) / (F ^ 2.0)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (F <= 2.9e-265) tmp = -l / (F * (F / pi)); elseif ((F <= 2.6e-106) || ~((F <= 5e-73))) tmp = pi * l; else tmp = (pi * -l) / (F ^ 2.0); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 2.9e-265], N[((-l) / N[(F * N[(F / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 2.6e-106], N[Not[LessEqual[F, 5e-73]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * (-l)), $MachinePrecision] / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.9 \cdot 10^{-265}:\\
\;\;\;\;\frac{-\ell}{F \cdot \frac{F}{\pi}}\\
\mathbf{elif}\;F \leq 2.6 \cdot 10^{-106} \lor \neg \left(F \leq 5 \cdot 10^{-73}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi \cdot \left(-\ell\right)}{{F}^{2}}\\
\end{array}
\end{array}
if F < 2.89999999999999975e-265Initial program 72.0%
Taylor expanded in l around 0 67.4%
associate-/l*68.2%
unpow268.2%
Simplified68.2%
Taylor expanded in F around 0 21.9%
mul-1-neg21.9%
unpow221.9%
associate-/l*21.9%
associate-*r/21.9%
Simplified21.9%
if 2.89999999999999975e-265 < F < 2.6000000000000001e-106 or 4.9999999999999998e-73 < F Initial program 72.9%
Taylor expanded in l around 0 69.4%
associate-/l*69.3%
unpow269.3%
Simplified69.3%
Taylor expanded in F around inf 75.2%
if 2.6000000000000001e-106 < F < 4.9999999999999998e-73Initial program 74.8%
Taylor expanded in l around 0 50.1%
associate-/l*49.7%
unpow249.7%
Simplified49.7%
Taylor expanded in F around 0 50.1%
Final simplification48.2%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 0.5))) (* PI l) (* PI (- l (* l (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 0.5)) {
tmp = ((double) M_PI) * l;
} else {
tmp = ((double) M_PI) * (l - (l * pow(F, -2.0)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 0.5)) {
tmp = Math.PI * l;
} else {
tmp = Math.PI * (l - (l * Math.pow(F, -2.0)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -0.5) or not (l <= 0.5): tmp = math.pi * l else: tmp = math.pi * (l - (l * math.pow(F, -2.0))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -0.5) || !(l <= 0.5)) tmp = Float64(pi * l); else tmp = Float64(pi * Float64(l - Float64(l * (F ^ -2.0)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -0.5) || ~((l <= 0.5))) tmp = pi * l; else tmp = pi * (l - (l * (F ^ -2.0))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 0.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * N[(l - N[(l * 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 0.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(\ell - \ell \cdot {F}^{-2}\right)\\
\end{array}
\end{array}
if l < -0.5 or 0.5 < l Initial program 58.6%
Taylor expanded in l around 0 48.8%
associate-/l*49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in F around inf 98.2%
if -0.5 < l < 0.5Initial program 86.6%
Taylor expanded in l around 0 87.7%
associate-/l*87.6%
unpow287.6%
Simplified87.6%
Taylor expanded in l around 0 86.6%
sub-neg86.6%
mul-1-neg86.6%
distribute-rgt-in86.6%
mul-1-neg86.6%
*-lft-identity86.6%
unpow286.6%
associate-*l/86.6%
associate-/r*86.6%
*-rgt-identity86.6%
associate-*r/86.5%
unpow-186.5%
unpow-186.5%
pow-sqr86.6%
metadata-eval86.6%
*-commutative86.6%
*-commutative86.6%
Simplified86.6%
Final simplification92.5%
(FPCore (F l) :precision binary64 (if (or (<= F 2.2e-265) (and (not (<= F 2.5e-106)) (<= F 7.5e-73))) (/ (- l) (* F (/ F PI))) (* PI l)))
double code(double F, double l) {
double tmp;
if ((F <= 2.2e-265) || (!(F <= 2.5e-106) && (F <= 7.5e-73))) {
tmp = -l / (F * (F / ((double) M_PI)));
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F <= 2.2e-265) || (!(F <= 2.5e-106) && (F <= 7.5e-73))) {
tmp = -l / (F * (F / Math.PI));
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 2.2e-265) or (not (F <= 2.5e-106) and (F <= 7.5e-73)): tmp = -l / (F * (F / math.pi)) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if ((F <= 2.2e-265) || (!(F <= 2.5e-106) && (F <= 7.5e-73))) tmp = Float64(Float64(-l) / Float64(F * Float64(F / pi))); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 2.2e-265) || (~((F <= 2.5e-106)) && (F <= 7.5e-73))) tmp = -l / (F * (F / pi)); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 2.2e-265], And[N[Not[LessEqual[F, 2.5e-106]], $MachinePrecision], LessEqual[F, 7.5e-73]]], N[((-l) / N[(F * N[(F / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.2 \cdot 10^{-265} \lor \neg \left(F \leq 2.5 \cdot 10^{-106}\right) \land F \leq 7.5 \cdot 10^{-73}:\\
\;\;\;\;\frac{-\ell}{F \cdot \frac{F}{\pi}}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if F < 2.2000000000000001e-265 or 2.49999999999999991e-106 < F < 7.5e-73Initial program 72.1%
Taylor expanded in l around 0 66.9%
associate-/l*67.6%
unpow267.6%
Simplified67.6%
Taylor expanded in F around 0 22.7%
mul-1-neg22.7%
unpow222.7%
associate-/l*22.7%
associate-*r/22.7%
Simplified22.7%
if 2.2000000000000001e-265 < F < 2.49999999999999991e-106 or 7.5e-73 < F Initial program 72.9%
Taylor expanded in l around 0 69.4%
associate-/l*69.3%
unpow269.3%
Simplified69.3%
Taylor expanded in F around inf 75.2%
Final simplification48.2%
(FPCore (F l)
:precision binary64
(if (<= F 1.9e-265)
(/ (- l) (* F (/ F PI)))
(if (or (<= F 1.85e-106) (not (<= F 4.4e-73)))
(* PI l)
(/ (- l) (/ F (/ PI F))))))
double code(double F, double l) {
double tmp;
if (F <= 1.9e-265) {
tmp = -l / (F * (F / ((double) M_PI)));
} else if ((F <= 1.85e-106) || !(F <= 4.4e-73)) {
tmp = ((double) M_PI) * l;
} else {
tmp = -l / (F / (((double) M_PI) / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (F <= 1.9e-265) {
tmp = -l / (F * (F / Math.PI));
} else if ((F <= 1.85e-106) || !(F <= 4.4e-73)) {
tmp = Math.PI * l;
} else {
tmp = -l / (F / (Math.PI / F));
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 1.9e-265: tmp = -l / (F * (F / math.pi)) elif (F <= 1.85e-106) or not (F <= 4.4e-73): tmp = math.pi * l else: tmp = -l / (F / (math.pi / F)) return tmp
function code(F, l) tmp = 0.0 if (F <= 1.9e-265) tmp = Float64(Float64(-l) / Float64(F * Float64(F / pi))); elseif ((F <= 1.85e-106) || !(F <= 4.4e-73)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) / Float64(F / Float64(pi / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (F <= 1.9e-265) tmp = -l / (F * (F / pi)); elseif ((F <= 1.85e-106) || ~((F <= 4.4e-73))) tmp = pi * l; else tmp = -l / (F / (pi / F)); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 1.9e-265], N[((-l) / N[(F * N[(F / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.85e-106], N[Not[LessEqual[F, 4.4e-73]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(F / N[(Pi / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.9 \cdot 10^{-265}:\\
\;\;\;\;\frac{-\ell}{F \cdot \frac{F}{\pi}}\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{-106} \lor \neg \left(F \leq 4.4 \cdot 10^{-73}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{\frac{F}{\frac{\pi}{F}}}\\
\end{array}
\end{array}
if F < 1.8999999999999999e-265Initial program 72.0%
Taylor expanded in l around 0 67.4%
associate-/l*68.2%
unpow268.2%
Simplified68.2%
Taylor expanded in F around 0 21.9%
mul-1-neg21.9%
unpow221.9%
associate-/l*21.9%
associate-*r/21.9%
Simplified21.9%
if 1.8999999999999999e-265 < F < 1.8499999999999999e-106 or 4.4e-73 < F Initial program 72.9%
Taylor expanded in l around 0 69.4%
associate-/l*69.3%
unpow269.3%
Simplified69.3%
Taylor expanded in F around inf 75.2%
if 1.8499999999999999e-106 < F < 4.4e-73Initial program 74.8%
Taylor expanded in l around 0 50.1%
associate-/l*49.7%
unpow249.7%
Simplified49.7%
Taylor expanded in F around 0 50.1%
mul-1-neg50.1%
unpow249.7%
associate-/l*49.7%
associate-*r/49.7%
Simplified49.7%
clear-num49.7%
un-div-inv49.7%
Applied egg-rr49.7%
Final simplification48.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 72.5%
Taylor expanded in l around 0 68.1%
associate-/l*68.5%
unpow268.5%
Simplified68.5%
Taylor expanded in F around inf 74.5%
Final simplification74.5%
herbie shell --seed 2023271
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))