
(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 12 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+19) (not (<= (* PI l) 50000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+19) || !((((double) M_PI) * l) <= 50000.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+19) || !((Math.PI * l) <= 50000.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+19) or not ((math.pi * l) <= 50000.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+19) || !(Float64(pi * l) <= 50000.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+19) || ~(((pi * l) <= 50000.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+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 50000.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^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\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) < -5e19 or 5e4 < (*.f64 (PI.f64) l) Initial program 67.3%
associate-*l/67.3%
*-lft-identity67.3%
Simplified67.3%
Taylor expanded in l around 0 52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in F around inf 99.6%
if -5e19 < (*.f64 (PI.f64) l) < 5e4Initial program 88.8%
associate-*l/89.2%
*-un-lft-identity89.2%
associate-/r*99.0%
Applied egg-rr99.0%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+19) (not (<= (* PI l) 50000.0))) (* PI l) (+ (* PI l) (/ -1.0 (* F (/ (/ F PI) l))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+19) || !((((double) M_PI) * l) <= 50000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + (-1.0 / (F * ((F / ((double) M_PI)) / l)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -5e+19) || !((Math.PI * l) <= 50000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + (-1.0 / (F * ((F / Math.PI) / l)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -5e+19) or not ((math.pi * l) <= 50000.0): tmp = math.pi * l else: tmp = (math.pi * l) + (-1.0 / (F * ((F / math.pi) / l))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5e+19) || !(Float64(pi * l) <= 50000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(-1.0 / Float64(F * Float64(Float64(F / pi) / l)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5e+19) || ~(((pi * l) <= 50000.0))) tmp = pi * l; else tmp = (pi * l) + (-1.0 / (F * ((F / pi) / l))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5e+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 50000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(F * N[(N[(F / Pi), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{-1}{F \cdot \frac{\frac{F}{\pi}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5e19 or 5e4 < (*.f64 (PI.f64) l) Initial program 67.3%
associate-*l/67.3%
*-lft-identity67.3%
Simplified67.3%
Taylor expanded in l around 0 52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in F around inf 99.6%
if -5e19 < (*.f64 (PI.f64) l) < 5e4Initial program 88.8%
associate-*l/89.2%
*-lft-identity89.2%
Simplified89.2%
associate-/r*99.0%
div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in l around 0 97.0%
clear-num97.0%
frac-times97.0%
metadata-eval97.0%
*-commutative97.0%
associate-/r*97.1%
Applied egg-rr97.1%
Final simplification98.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+19) (not (<= (* PI l) 50000.0))) (* PI l) (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+19) || !((((double) M_PI) * l) <= 50000.0)) {
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+19) || !((Math.PI * l) <= 50000.0)) {
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+19) or not ((math.pi * l) <= 50000.0): 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+19) || !(Float64(pi * l) <= 50000.0)) 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 (((pi * l) <= -5e+19) || ~(((pi * l) <= 50000.0))) 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+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 50000.0]], $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}\;\pi \cdot \ell \leq -5 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5e19 or 5e4 < (*.f64 (PI.f64) l) Initial program 67.3%
associate-*l/67.3%
*-lft-identity67.3%
Simplified67.3%
Taylor expanded in l around 0 52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in F around inf 99.6%
if -5e19 < (*.f64 (PI.f64) l) < 5e4Initial program 88.8%
Taylor expanded in l around 0 87.3%
associate-/l*87.2%
associate-/r/87.3%
unpow287.3%
Simplified87.3%
Final simplification93.4%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+19) (not (<= (* PI l) 50000.0))) (* PI l) (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+19) || !((((double) M_PI) * l) <= 50000.0)) {
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) <= -5e+19) || !((Math.PI * l) <= 50000.0)) {
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) <= -5e+19) or not ((math.pi * l) <= 50000.0): 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) <= -5e+19) || !(Float64(pi * l) <= 50000.0)) 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 (((pi * l) <= -5e+19) || ~(((pi * l) <= 50000.0))) 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], -5e+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 50000.0]], $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}\;\pi \cdot \ell \leq -5 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi}{F} \cdot \frac{\ell}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5e19 or 5e4 < (*.f64 (PI.f64) l) Initial program 67.3%
associate-*l/67.3%
*-lft-identity67.3%
Simplified67.3%
Taylor expanded in l around 0 52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in F around inf 99.6%
if -5e19 < (*.f64 (PI.f64) l) < 5e4Initial program 88.8%
associate-*l/89.2%
*-lft-identity89.2%
Simplified89.2%
associate-/r*99.0%
div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in l around 0 97.0%
Taylor expanded in l around 0 87.3%
*-commutative87.3%
unpow287.3%
times-frac97.0%
Simplified97.0%
Final simplification98.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+19) (not (<= (* PI l) 50000.0))) (* PI l) (- (* PI l) (/ (/ (* PI l) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+19) || !((((double) M_PI) * l) <= 50000.0)) {
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+19) || !((Math.PI * l) <= 50000.0)) {
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+19) or not ((math.pi * l) <= 50000.0): 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+19) || !(Float64(pi * l) <= 50000.0)) 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+19) || ~(((pi * l) <= 50000.0))) 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+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 50000.0]], $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^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\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) < -5e19 or 5e4 < (*.f64 (PI.f64) l) Initial program 67.3%
associate-*l/67.3%
*-lft-identity67.3%
Simplified67.3%
Taylor expanded in l around 0 52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in F around inf 99.6%
if -5e19 < (*.f64 (PI.f64) l) < 5e4Initial program 88.8%
associate-*l/89.2%
*-lft-identity89.2%
Simplified89.2%
associate-/r*99.0%
div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in l around 0 97.0%
un-div-inv97.0%
associate-/l*97.0%
associate-/r/97.0%
Applied egg-rr97.0%
associate-*l/97.0%
*-commutative97.0%
Applied egg-rr97.0%
Final simplification98.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+19) (not (<= (* PI l) 50000.0))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+19) || !((((double) M_PI) * l) <= 50000.0)) {
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 (((Math.PI * l) <= -5e+19) || !((Math.PI * l) <= 50000.0)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -5e+19) or not ((math.pi * l) <= 50000.0): tmp = math.pi * l else: tmp = l * (math.pi - (math.pi / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5e+19) || !(Float64(pi * l) <= 50000.0)) 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 (((pi * l) <= -5e+19) || ~(((pi * l) <= 50000.0))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5e+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 50000.0]], $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}\;\pi \cdot \ell \leq -5 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5e19 or 5e4 < (*.f64 (PI.f64) l) Initial program 67.3%
associate-*l/67.3%
*-lft-identity67.3%
Simplified67.3%
Taylor expanded in l around 0 52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in F around inf 99.6%
if -5e19 < (*.f64 (PI.f64) l) < 5e4Initial program 88.8%
associate-*l/89.2%
*-lft-identity89.2%
Simplified89.2%
Taylor expanded in l around 0 86.2%
unpow286.2%
Simplified86.2%
Final simplification92.9%
(FPCore (F l)
:precision binary64
(if (<= (* F F) 2e-289)
(* PI (* (/ l F) (/ -1.0 F)))
(if (or (<= (* F F) 5e-90) (not (<= (* F F) 2e-41)))
(* PI l)
(* (* PI l) (- (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((F * F) <= 2e-289) {
tmp = ((double) M_PI) * ((l / F) * (-1.0 / F));
} else if (((F * F) <= 5e-90) || !((F * F) <= 2e-41)) {
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 * F) <= 2e-289) {
tmp = Math.PI * ((l / F) * (-1.0 / F));
} else if (((F * F) <= 5e-90) || !((F * F) <= 2e-41)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) * -Math.pow(F, -2.0);
}
return tmp;
}
def code(F, l): tmp = 0 if (F * F) <= 2e-289: tmp = math.pi * ((l / F) * (-1.0 / F)) elif ((F * F) <= 5e-90) or not ((F * F) <= 2e-41): tmp = math.pi * l else: tmp = (math.pi * l) * -math.pow(F, -2.0) return tmp
function code(F, l) tmp = 0.0 if (Float64(F * F) <= 2e-289) tmp = Float64(pi * Float64(Float64(l / F) * Float64(-1.0 / F))); elseif ((Float64(F * F) <= 5e-90) || !(Float64(F * F) <= 2e-41)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) * Float64(-(F ^ -2.0))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 2e-289) tmp = pi * ((l / F) * (-1.0 / F)); elseif (((F * F) <= 5e-90) || ~(((F * F) <= 2e-41))) tmp = pi * l; else tmp = (pi * l) * -(F ^ -2.0); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 2e-289], N[(Pi * N[(N[(l / F), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(F * F), $MachinePrecision], 5e-90], N[Not[LessEqual[N[(F * F), $MachinePrecision], 2e-41]], $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 \cdot F \leq 2 \cdot 10^{-289}:\\
\;\;\;\;\pi \cdot \left(\frac{\ell}{F} \cdot \frac{-1}{F}\right)\\
\mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-90} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-41}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \ell\right) \cdot \left(-{F}^{-2}\right)\\
\end{array}
\end{array}
if (*.f64 F F) < 2e-289Initial program 39.2%
associate-*l/40.0%
*-lft-identity40.0%
Simplified40.0%
Taylor expanded in l around 0 34.9%
unpow234.9%
Simplified34.9%
Taylor expanded in F around 0 37.3%
mul-1-neg37.3%
unpow237.3%
Simplified37.3%
associate-/r*58.3%
associate-*l/58.2%
div-inv58.3%
*-commutative58.3%
associate-*l*58.3%
Applied egg-rr58.3%
if 2e-289 < (*.f64 F F) < 5.00000000000000019e-90 or 2.00000000000000001e-41 < (*.f64 F F) Initial program 89.5%
associate-*l/89.5%
*-lft-identity89.5%
Simplified89.5%
Taylor expanded in l around 0 80.5%
unpow280.5%
Simplified80.5%
Taylor expanded in F around inf 89.6%
if 5.00000000000000019e-90 < (*.f64 F F) < 2.00000000000000001e-41Initial program 99.7%
associate-*l/99.5%
*-lft-identity99.5%
Simplified99.5%
Taylor expanded in l around 0 72.6%
unpow272.6%
Simplified72.6%
Taylor expanded in F around 0 72.3%
mul-1-neg72.3%
unpow272.3%
Simplified72.3%
clear-num72.3%
associate-/r/72.6%
pow272.6%
pow-flip72.7%
metadata-eval72.7%
*-commutative72.7%
Applied egg-rr72.7%
Final simplification81.5%
(FPCore (F l)
:precision binary64
(if (<= (* F F) 2e-289)
(* (/ (/ l F) F) (- PI))
(if (or (<= (* F F) 5e-90) (not (<= (* F F) 2e-41)))
(* PI l)
(* (/ l F) (/ (- PI) F)))))
double code(double F, double l) {
double tmp;
if ((F * F) <= 2e-289) {
tmp = ((l / F) / F) * -((double) M_PI);
} else if (((F * F) <= 5e-90) || !((F * F) <= 2e-41)) {
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 * F) <= 2e-289) {
tmp = ((l / F) / F) * -Math.PI;
} else if (((F * F) <= 5e-90) || !((F * F) <= 2e-41)) {
tmp = Math.PI * l;
} else {
tmp = (l / F) * (-Math.PI / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (F * F) <= 2e-289: tmp = ((l / F) / F) * -math.pi elif ((F * F) <= 5e-90) or not ((F * F) <= 2e-41): tmp = math.pi * l else: tmp = (l / F) * (-math.pi / F) return tmp
function code(F, l) tmp = 0.0 if (Float64(F * F) <= 2e-289) tmp = Float64(Float64(Float64(l / F) / F) * Float64(-pi)); elseif ((Float64(F * F) <= 5e-90) || !(Float64(F * F) <= 2e-41)) tmp = Float64(pi * l); else tmp = Float64(Float64(l / F) * Float64(Float64(-pi) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 2e-289) tmp = ((l / F) / F) * -pi; elseif (((F * F) <= 5e-90) || ~(((F * F) <= 2e-41))) tmp = pi * l; else tmp = (l / F) * (-pi / F); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 2e-289], N[(N[(N[(l / F), $MachinePrecision] / F), $MachinePrecision] * (-Pi)), $MachinePrecision], If[Or[LessEqual[N[(F * F), $MachinePrecision], 5e-90], N[Not[LessEqual[N[(F * F), $MachinePrecision], 2e-41]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(l / F), $MachinePrecision] * N[((-Pi) / F), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2 \cdot 10^{-289}:\\
\;\;\;\;\frac{\frac{\ell}{F}}{F} \cdot \left(-\pi\right)\\
\mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-90} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-41}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{-\pi}{F}\\
\end{array}
\end{array}
if (*.f64 F F) < 2e-289Initial program 39.2%
associate-*l/40.0%
*-lft-identity40.0%
Simplified40.0%
Taylor expanded in l around 0 34.9%
unpow234.9%
Simplified34.9%
Taylor expanded in F around 0 37.3%
mul-1-neg37.3%
unpow237.3%
Simplified37.3%
associate-/r*58.3%
associate-*l/58.2%
associate-/l*58.3%
associate-/r/58.3%
Applied egg-rr58.3%
if 2e-289 < (*.f64 F F) < 5.00000000000000019e-90 or 2.00000000000000001e-41 < (*.f64 F F) Initial program 89.5%
associate-*l/89.5%
*-lft-identity89.5%
Simplified89.5%
Taylor expanded in l around 0 80.5%
unpow280.5%
Simplified80.5%
Taylor expanded in F around inf 89.6%
if 5.00000000000000019e-90 < (*.f64 F F) < 2.00000000000000001e-41Initial program 99.7%
associate-*l/99.5%
*-lft-identity99.5%
Simplified99.5%
Taylor expanded in l around 0 72.6%
unpow272.6%
Simplified72.6%
Taylor expanded in F around 0 72.3%
mul-1-neg72.3%
unpow272.3%
Simplified72.3%
*-commutative72.3%
times-frac72.4%
Applied egg-rr72.4%
Final simplification81.5%
(FPCore (F l)
:precision binary64
(if (<= (* F F) 2e-289)
(* (/ (/ l F) F) (- PI))
(if (or (<= (* F F) 5e-90) (not (<= (* F F) 2e-41)))
(* PI l)
(/ (- l) (/ (* F F) PI)))))
double code(double F, double l) {
double tmp;
if ((F * F) <= 2e-289) {
tmp = ((l / F) / F) * -((double) M_PI);
} else if (((F * F) <= 5e-90) || !((F * F) <= 2e-41)) {
tmp = ((double) M_PI) * l;
} else {
tmp = -l / ((F * F) / ((double) M_PI));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F * F) <= 2e-289) {
tmp = ((l / F) / F) * -Math.PI;
} else if (((F * F) <= 5e-90) || !((F * F) <= 2e-41)) {
tmp = Math.PI * l;
} else {
tmp = -l / ((F * F) / Math.PI);
}
return tmp;
}
def code(F, l): tmp = 0 if (F * F) <= 2e-289: tmp = ((l / F) / F) * -math.pi elif ((F * F) <= 5e-90) or not ((F * F) <= 2e-41): tmp = math.pi * l else: tmp = -l / ((F * F) / math.pi) return tmp
function code(F, l) tmp = 0.0 if (Float64(F * F) <= 2e-289) tmp = Float64(Float64(Float64(l / F) / F) * Float64(-pi)); elseif ((Float64(F * F) <= 5e-90) || !(Float64(F * F) <= 2e-41)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) / Float64(Float64(F * F) / pi)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 2e-289) tmp = ((l / F) / F) * -pi; elseif (((F * F) <= 5e-90) || ~(((F * F) <= 2e-41))) tmp = pi * l; else tmp = -l / ((F * F) / pi); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 2e-289], N[(N[(N[(l / F), $MachinePrecision] / F), $MachinePrecision] * (-Pi)), $MachinePrecision], If[Or[LessEqual[N[(F * F), $MachinePrecision], 5e-90], N[Not[LessEqual[N[(F * F), $MachinePrecision], 2e-41]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(N[(F * F), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2 \cdot 10^{-289}:\\
\;\;\;\;\frac{\frac{\ell}{F}}{F} \cdot \left(-\pi\right)\\
\mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-90} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-41}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{\frac{F \cdot F}{\pi}}\\
\end{array}
\end{array}
if (*.f64 F F) < 2e-289Initial program 39.2%
associate-*l/40.0%
*-lft-identity40.0%
Simplified40.0%
Taylor expanded in l around 0 34.9%
unpow234.9%
Simplified34.9%
Taylor expanded in F around 0 37.3%
mul-1-neg37.3%
unpow237.3%
Simplified37.3%
associate-/r*58.3%
associate-*l/58.2%
associate-/l*58.3%
associate-/r/58.3%
Applied egg-rr58.3%
if 2e-289 < (*.f64 F F) < 5.00000000000000019e-90 or 2.00000000000000001e-41 < (*.f64 F F) Initial program 89.5%
associate-*l/89.5%
*-lft-identity89.5%
Simplified89.5%
Taylor expanded in l around 0 80.5%
unpow280.5%
Simplified80.5%
Taylor expanded in F around inf 89.6%
if 5.00000000000000019e-90 < (*.f64 F F) < 2.00000000000000001e-41Initial program 99.7%
associate-*l/99.5%
*-lft-identity99.5%
Simplified99.5%
Taylor expanded in l around 0 72.6%
unpow272.6%
Simplified72.6%
Taylor expanded in F around 0 72.3%
mul-1-neg72.3%
unpow272.3%
associate-/l*72.6%
distribute-neg-frac72.6%
Simplified72.6%
Final simplification81.5%
(FPCore (F l)
:precision binary64
(if (<= (* F F) 2e-289)
(* PI (* (/ l F) (/ -1.0 F)))
(if (or (<= (* F F) 5e-90) (not (<= (* F F) 2e-41)))
(* PI l)
(/ (- l) (/ (* F F) PI)))))
double code(double F, double l) {
double tmp;
if ((F * F) <= 2e-289) {
tmp = ((double) M_PI) * ((l / F) * (-1.0 / F));
} else if (((F * F) <= 5e-90) || !((F * F) <= 2e-41)) {
tmp = ((double) M_PI) * l;
} else {
tmp = -l / ((F * F) / ((double) M_PI));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F * F) <= 2e-289) {
tmp = Math.PI * ((l / F) * (-1.0 / F));
} else if (((F * F) <= 5e-90) || !((F * F) <= 2e-41)) {
tmp = Math.PI * l;
} else {
tmp = -l / ((F * F) / Math.PI);
}
return tmp;
}
def code(F, l): tmp = 0 if (F * F) <= 2e-289: tmp = math.pi * ((l / F) * (-1.0 / F)) elif ((F * F) <= 5e-90) or not ((F * F) <= 2e-41): tmp = math.pi * l else: tmp = -l / ((F * F) / math.pi) return tmp
function code(F, l) tmp = 0.0 if (Float64(F * F) <= 2e-289) tmp = Float64(pi * Float64(Float64(l / F) * Float64(-1.0 / F))); elseif ((Float64(F * F) <= 5e-90) || !(Float64(F * F) <= 2e-41)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) / Float64(Float64(F * F) / pi)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 2e-289) tmp = pi * ((l / F) * (-1.0 / F)); elseif (((F * F) <= 5e-90) || ~(((F * F) <= 2e-41))) tmp = pi * l; else tmp = -l / ((F * F) / pi); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 2e-289], N[(Pi * N[(N[(l / F), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(F * F), $MachinePrecision], 5e-90], N[Not[LessEqual[N[(F * F), $MachinePrecision], 2e-41]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(N[(F * F), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2 \cdot 10^{-289}:\\
\;\;\;\;\pi \cdot \left(\frac{\ell}{F} \cdot \frac{-1}{F}\right)\\
\mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-90} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-41}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{\frac{F \cdot F}{\pi}}\\
\end{array}
\end{array}
if (*.f64 F F) < 2e-289Initial program 39.2%
associate-*l/40.0%
*-lft-identity40.0%
Simplified40.0%
Taylor expanded in l around 0 34.9%
unpow234.9%
Simplified34.9%
Taylor expanded in F around 0 37.3%
mul-1-neg37.3%
unpow237.3%
Simplified37.3%
associate-/r*58.3%
associate-*l/58.2%
div-inv58.3%
*-commutative58.3%
associate-*l*58.3%
Applied egg-rr58.3%
if 2e-289 < (*.f64 F F) < 5.00000000000000019e-90 or 2.00000000000000001e-41 < (*.f64 F F) Initial program 89.5%
associate-*l/89.5%
*-lft-identity89.5%
Simplified89.5%
Taylor expanded in l around 0 80.5%
unpow280.5%
Simplified80.5%
Taylor expanded in F around inf 89.6%
if 5.00000000000000019e-90 < (*.f64 F F) < 2.00000000000000001e-41Initial program 99.7%
associate-*l/99.5%
*-lft-identity99.5%
Simplified99.5%
Taylor expanded in l around 0 72.6%
unpow272.6%
Simplified72.6%
Taylor expanded in F around 0 72.3%
mul-1-neg72.3%
unpow272.3%
associate-/l*72.6%
distribute-neg-frac72.6%
Simplified72.6%
Final simplification81.5%
(FPCore (F l) :precision binary64 (if (or (<= F 4.2e-145) (and (not (<= F 4.4e-45)) (<= F 5.8e-20))) (* (/ l F) (/ (- PI) F)) (* PI l)))
double code(double F, double l) {
double tmp;
if ((F <= 4.2e-145) || (!(F <= 4.4e-45) && (F <= 5.8e-20))) {
tmp = (l / F) * (-((double) M_PI) / F);
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F <= 4.2e-145) || (!(F <= 4.4e-45) && (F <= 5.8e-20))) {
tmp = (l / F) * (-Math.PI / F);
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 4.2e-145) or (not (F <= 4.4e-45) and (F <= 5.8e-20)): tmp = (l / F) * (-math.pi / F) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if ((F <= 4.2e-145) || (!(F <= 4.4e-45) && (F <= 5.8e-20))) tmp = Float64(Float64(l / F) * Float64(Float64(-pi) / F)); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 4.2e-145) || (~((F <= 4.4e-45)) && (F <= 5.8e-20))) tmp = (l / F) * (-pi / F); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 4.2e-145], And[N[Not[LessEqual[F, 4.4e-45]], $MachinePrecision], LessEqual[F, 5.8e-20]]], N[(N[(l / F), $MachinePrecision] * N[((-Pi) / F), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.2 \cdot 10^{-145} \lor \neg \left(F \leq 4.4 \cdot 10^{-45}\right) \land F \leq 5.8 \cdot 10^{-20}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{-\pi}{F}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if F < 4.19999999999999982e-145 or 4.39999999999999987e-45 < F < 5.8e-20Initial program 72.5%
associate-*l/72.8%
*-lft-identity72.8%
Simplified72.8%
Taylor expanded in l around 0 64.0%
unpow264.0%
Simplified64.0%
Taylor expanded in F around 0 22.2%
mul-1-neg22.2%
unpow222.2%
Simplified22.2%
*-commutative22.2%
times-frac29.3%
Applied egg-rr29.3%
if 4.19999999999999982e-145 < F < 4.39999999999999987e-45 or 5.8e-20 < F Initial program 90.6%
associate-*l/90.6%
*-lft-identity90.6%
Simplified90.6%
Taylor expanded in l around 0 81.5%
unpow281.5%
Simplified81.5%
Taylor expanded in F around inf 87.8%
Final simplification47.6%
(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 78.1%
associate-*l/78.3%
*-lft-identity78.3%
Simplified78.3%
Taylor expanded in l around 0 69.5%
unpow269.5%
Simplified69.5%
Taylor expanded in F around inf 75.5%
Final simplification75.5%
herbie shell --seed 2023249
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))