
(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 8 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) 0.0001))) (* 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) <= 0.0001)) {
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) <= 0.0001)) {
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) <= 0.0001): 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) <= 0.0001)) 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) <= 0.0001))) 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], 0.0001]], $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 0.0001\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 1.00000000000000005e-4 < (*.f64 (PI.f64) l) Initial program 58.2%
sqr-neg58.2%
associate-*l/58.2%
*-lft-identity58.2%
sqr-neg58.2%
Simplified58.2%
Taylor expanded in l around 0 45.7%
Taylor expanded in F around inf 99.7%
if -5e19 < (*.f64 (PI.f64) l) < 1.00000000000000005e-4Initial program 91.6%
associate-*l/92.1%
*-un-lft-identity92.1%
associate-/r*99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (F l)
:precision binary64
(if (<= (* PI l) -4e-37)
(* PI l)
(if (<= (* PI l) 4e-298)
(/ (/ l (/ F PI)) (- F))
(if (or (<= (* PI l) 5e-116) (not (<= (* PI l) 2e-45)))
(* PI l)
(/ (* PI l) (* F (- F)))))))
double code(double F, double l) {
double tmp;
if ((((double) M_PI) * l) <= -4e-37) {
tmp = ((double) M_PI) * l;
} else if ((((double) M_PI) * l) <= 4e-298) {
tmp = (l / (F / ((double) M_PI))) / -F;
} else if (((((double) M_PI) * l) <= 5e-116) || !((((double) M_PI) * l) <= 2e-45)) {
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 ((Math.PI * l) <= -4e-37) {
tmp = Math.PI * l;
} else if ((Math.PI * l) <= 4e-298) {
tmp = (l / (F / Math.PI)) / -F;
} else if (((Math.PI * l) <= 5e-116) || !((Math.PI * l) <= 2e-45)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) / (F * -F);
}
return tmp;
}
def code(F, l): tmp = 0 if (math.pi * l) <= -4e-37: tmp = math.pi * l elif (math.pi * l) <= 4e-298: tmp = (l / (F / math.pi)) / -F elif ((math.pi * l) <= 5e-116) or not ((math.pi * l) <= 2e-45): tmp = math.pi * l else: tmp = (math.pi * l) / (F * -F) return tmp
function code(F, l) tmp = 0.0 if (Float64(pi * l) <= -4e-37) tmp = Float64(pi * l); elseif (Float64(pi * l) <= 4e-298) tmp = Float64(Float64(l / Float64(F / pi)) / Float64(-F)); elseif ((Float64(pi * l) <= 5e-116) || !(Float64(pi * l) <= 2e-45)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) / Float64(F * Float64(-F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((pi * l) <= -4e-37) tmp = pi * l; elseif ((pi * l) <= 4e-298) tmp = (l / (F / pi)) / -F; elseif (((pi * l) <= 5e-116) || ~(((pi * l) <= 2e-45))) tmp = pi * l; else tmp = (pi * l) / (F * -F); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(Pi * l), $MachinePrecision], -4e-37], N[(Pi * l), $MachinePrecision], If[LessEqual[N[(Pi * l), $MachinePrecision], 4e-298], N[(N[(l / N[(F / Pi), $MachinePrecision]), $MachinePrecision] / (-F)), $MachinePrecision], If[Or[LessEqual[N[(Pi * l), $MachinePrecision], 5e-116], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2e-45]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] / N[(F * (-F)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -4 \cdot 10^{-37}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\pi \cdot \ell \leq 4 \cdot 10^{-298}:\\
\;\;\;\;\frac{\frac{\ell}{\frac{F}{\pi}}}{-F}\\
\mathbf{elif}\;\pi \cdot \ell \leq 5 \cdot 10^{-116} \lor \neg \left(\pi \cdot \ell \leq 2 \cdot 10^{-45}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi \cdot \ell}{F \cdot \left(-F\right)}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -4.00000000000000027e-37 or 3.99999999999999965e-298 < (*.f64 (PI.f64) l) < 5.0000000000000003e-116 or 1.99999999999999997e-45 < (*.f64 (PI.f64) l) Initial program 68.9%
sqr-neg68.9%
associate-*l/69.2%
*-lft-identity69.2%
sqr-neg69.2%
Simplified69.2%
Taylor expanded in l around 0 60.6%
Taylor expanded in F around inf 91.6%
if -4.00000000000000027e-37 < (*.f64 (PI.f64) l) < 3.99999999999999965e-298Initial program 90.5%
sqr-neg90.5%
associate-*l/90.7%
*-lft-identity90.7%
sqr-neg90.7%
Simplified90.7%
Taylor expanded in l around 0 90.7%
Taylor expanded in F around 0 48.9%
associate-*r/48.9%
*-commutative48.9%
neg-mul-148.9%
*-commutative48.9%
distribute-rgt-neg-in48.9%
Simplified48.9%
*-commutative48.9%
associate-/l*48.8%
unpow248.8%
associate-*l/57.9%
distribute-neg-frac57.9%
associate-/r*57.9%
un-div-inv57.9%
*-commutative57.9%
distribute-lft-neg-in57.9%
distribute-neg-frac57.9%
metadata-eval57.9%
div-inv57.9%
clear-num57.9%
Applied egg-rr57.9%
*-commutative57.9%
frac-2neg57.9%
metadata-eval57.9%
un-div-inv57.9%
associate-*r/58.0%
*-commutative58.0%
associate-/l*57.9%
Applied egg-rr57.9%
if 5.0000000000000003e-116 < (*.f64 (PI.f64) l) < 1.99999999999999997e-45Initial program 99.7%
sqr-neg99.7%
associate-*l/99.9%
*-lft-identity99.9%
sqr-neg99.9%
Simplified99.9%
Taylor expanded in l around 0 99.9%
Taylor expanded in F around 0 99.9%
associate-*r/99.9%
*-commutative99.9%
neg-mul-199.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
*-commutative99.9%
associate-/l*99.1%
unpow299.1%
associate-*l/99.4%
distribute-neg-frac99.4%
associate-/r*99.3%
un-div-inv99.7%
*-commutative99.7%
distribute-lft-neg-in99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
div-inv99.6%
clear-num99.7%
Applied egg-rr99.7%
clear-num99.7%
associate-*r/99.6%
frac-times99.9%
*-un-lft-identity99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Final simplification85.4%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+19) (not (<= (* PI l) 0.0001))) (* PI l) (fma 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) <= 0.0001)) {
tmp = ((double) M_PI) * l;
} else {
tmp = fma(((double) M_PI), l, -(((((double) M_PI) * l) / F) / F));
}
return tmp;
}
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5e+19) || !(Float64(pi * l) <= 0.0001)) tmp = Float64(pi * l); else tmp = fma(pi, l, Float64(-Float64(Float64(Float64(pi * l) / F) / F))); end return tmp end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5e+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 0.0001]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * l + (-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 0.0001\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\pi, \ell, -\frac{\frac{\pi \cdot \ell}{F}}{F}\right)\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5e19 or 1.00000000000000005e-4 < (*.f64 (PI.f64) l) Initial program 58.2%
sqr-neg58.2%
associate-*l/58.2%
*-lft-identity58.2%
sqr-neg58.2%
Simplified58.2%
Taylor expanded in l around 0 45.7%
Taylor expanded in F around inf 99.7%
if -5e19 < (*.f64 (PI.f64) l) < 1.00000000000000005e-4Initial program 91.6%
*-commutative91.6%
sqr-neg91.6%
*-commutative91.6%
fma-neg91.6%
associate-*l/92.1%
times-frac99.7%
distribute-lft-neg-in99.7%
neg-mul-199.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
times-frac92.1%
Simplified99.7%
Taylor expanded in l around 0 99.4%
associate-*r/99.4%
*-commutative99.4%
neg-mul-199.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
Final simplification99.6%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+19) (not (<= (* PI l) 0.0001))) (* 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) <= 0.0001)) {
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) <= 0.0001)) {
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) <= 0.0001): 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) <= 0.0001)) 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) <= 0.0001))) 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], 0.0001]], $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 0.0001\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 1.00000000000000005e-4 < (*.f64 (PI.f64) l) Initial program 58.2%
sqr-neg58.2%
associate-*l/58.2%
*-lft-identity58.2%
sqr-neg58.2%
Simplified58.2%
Taylor expanded in l around 0 45.7%
Taylor expanded in F around inf 99.7%
if -5e19 < (*.f64 (PI.f64) l) < 1.00000000000000005e-4Initial program 91.6%
sqr-neg91.6%
associate-*l/92.1%
*-lft-identity92.1%
sqr-neg92.1%
Simplified92.1%
Taylor expanded in l around 0 91.8%
*-commutative91.8%
times-frac99.4%
Applied egg-rr99.4%
Final simplification99.5%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+19) (not (<= (* PI l) 0.0001))) (* PI l) (- (* PI l) (/ (/ l (/ F PI)) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+19) || !((((double) M_PI) * l) <= 0.0001)) {
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 (((Math.PI * l) <= -5e+19) || !((Math.PI * l) <= 0.0001)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l / (F / Math.PI)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -5e+19) or not ((math.pi * l) <= 0.0001): tmp = math.pi * l else: tmp = (math.pi * l) - ((l / (F / math.pi)) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5e+19) || !(Float64(pi * l) <= 0.0001)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l / Float64(F / pi)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5e+19) || ~(((pi * l) <= 0.0001))) tmp = pi * l; else tmp = (pi * l) - ((l / (F / pi)) / 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], 0.0001]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / N[(F / Pi), $MachinePrecision]), $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 0.0001\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\ell}{\frac{F}{\pi}}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5e19 or 1.00000000000000005e-4 < (*.f64 (PI.f64) l) Initial program 58.2%
sqr-neg58.2%
associate-*l/58.2%
*-lft-identity58.2%
sqr-neg58.2%
Simplified58.2%
Taylor expanded in l around 0 45.7%
Taylor expanded in F around inf 99.7%
if -5e19 < (*.f64 (PI.f64) l) < 1.00000000000000005e-4Initial program 91.6%
associate-*l/92.1%
*-un-lft-identity92.1%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in l around 0 99.4%
associate-/l*99.4%
Simplified99.4%
Final simplification99.6%
(FPCore (F l)
:precision binary64
(if (<= l -6e-38)
(* PI l)
(if (<= l 5.7e-297)
(/ (/ l (/ F PI)) (- F))
(if (or (<= l 7.2e-115) (not (<= l 6.2e-46)))
(* PI l)
(* (/ -1.0 F) (* PI (/ l F)))))))
double code(double F, double l) {
double tmp;
if (l <= -6e-38) {
tmp = ((double) M_PI) * l;
} else if (l <= 5.7e-297) {
tmp = (l / (F / ((double) M_PI))) / -F;
} else if ((l <= 7.2e-115) || !(l <= 6.2e-46)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (-1.0 / F) * (((double) M_PI) * (l / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (l <= -6e-38) {
tmp = Math.PI * l;
} else if (l <= 5.7e-297) {
tmp = (l / (F / Math.PI)) / -F;
} else if ((l <= 7.2e-115) || !(l <= 6.2e-46)) {
tmp = Math.PI * l;
} else {
tmp = (-1.0 / F) * (Math.PI * (l / F));
}
return tmp;
}
def code(F, l): tmp = 0 if l <= -6e-38: tmp = math.pi * l elif l <= 5.7e-297: tmp = (l / (F / math.pi)) / -F elif (l <= 7.2e-115) or not (l <= 6.2e-46): tmp = math.pi * l else: tmp = (-1.0 / F) * (math.pi * (l / F)) return tmp
function code(F, l) tmp = 0.0 if (l <= -6e-38) tmp = Float64(pi * l); elseif (l <= 5.7e-297) tmp = Float64(Float64(l / Float64(F / pi)) / Float64(-F)); elseif ((l <= 7.2e-115) || !(l <= 6.2e-46)) tmp = Float64(pi * l); else tmp = Float64(Float64(-1.0 / F) * Float64(pi * Float64(l / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (l <= -6e-38) tmp = pi * l; elseif (l <= 5.7e-297) tmp = (l / (F / pi)) / -F; elseif ((l <= 7.2e-115) || ~((l <= 6.2e-46))) tmp = pi * l; else tmp = (-1.0 / F) * (pi * (l / F)); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[l, -6e-38], N[(Pi * l), $MachinePrecision], If[LessEqual[l, 5.7e-297], N[(N[(l / N[(F / Pi), $MachinePrecision]), $MachinePrecision] / (-F)), $MachinePrecision], If[Or[LessEqual[l, 7.2e-115], N[Not[LessEqual[l, 6.2e-46]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(-1.0 / F), $MachinePrecision] * N[(Pi * N[(l / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6 \cdot 10^{-38}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq 5.7 \cdot 10^{-297}:\\
\;\;\;\;\frac{\frac{\ell}{\frac{F}{\pi}}}{-F}\\
\mathbf{elif}\;\ell \leq 7.2 \cdot 10^{-115} \lor \neg \left(\ell \leq 6.2 \cdot 10^{-46}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{F} \cdot \left(\pi \cdot \frac{\ell}{F}\right)\\
\end{array}
\end{array}
if l < -5.99999999999999977e-38 or 5.6999999999999997e-297 < l < 7.20000000000000018e-115 or 6.2000000000000002e-46 < l Initial program 68.9%
sqr-neg68.9%
associate-*l/69.2%
*-lft-identity69.2%
sqr-neg69.2%
Simplified69.2%
Taylor expanded in l around 0 60.6%
Taylor expanded in F around inf 91.6%
if -5.99999999999999977e-38 < l < 5.6999999999999997e-297Initial program 90.5%
sqr-neg90.5%
associate-*l/90.7%
*-lft-identity90.7%
sqr-neg90.7%
Simplified90.7%
Taylor expanded in l around 0 90.7%
Taylor expanded in F around 0 48.9%
associate-*r/48.9%
*-commutative48.9%
neg-mul-148.9%
*-commutative48.9%
distribute-rgt-neg-in48.9%
Simplified48.9%
*-commutative48.9%
associate-/l*48.8%
unpow248.8%
associate-*l/57.9%
distribute-neg-frac57.9%
associate-/r*57.9%
un-div-inv57.9%
*-commutative57.9%
distribute-lft-neg-in57.9%
distribute-neg-frac57.9%
metadata-eval57.9%
div-inv57.9%
clear-num57.9%
Applied egg-rr57.9%
*-commutative57.9%
frac-2neg57.9%
metadata-eval57.9%
un-div-inv57.9%
associate-*r/58.0%
*-commutative58.0%
associate-/l*57.9%
Applied egg-rr57.9%
if 7.20000000000000018e-115 < l < 6.2000000000000002e-46Initial program 99.7%
sqr-neg99.7%
associate-*l/99.9%
*-lft-identity99.9%
sqr-neg99.9%
Simplified99.9%
Taylor expanded in l around 0 99.9%
Taylor expanded in F around 0 99.9%
associate-*r/99.9%
*-commutative99.9%
neg-mul-199.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
*-commutative99.9%
associate-/l*99.1%
unpow299.1%
associate-*l/99.4%
distribute-neg-frac99.4%
associate-/r*99.3%
un-div-inv99.7%
*-commutative99.7%
distribute-lft-neg-in99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
div-inv99.6%
clear-num99.7%
Applied egg-rr99.7%
Final simplification85.4%
(FPCore (F l)
:precision binary64
(if (or (<= l -1.1e-37)
(not (or (<= l 4.5e-296) (and (not (<= l 1.2e-114)) (<= l 2.1e-45)))))
(* PI l)
(/ (/ l (/ F PI)) (- F))))
double code(double F, double l) {
double tmp;
if ((l <= -1.1e-37) || !((l <= 4.5e-296) || (!(l <= 1.2e-114) && (l <= 2.1e-45)))) {
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 ((l <= -1.1e-37) || !((l <= 4.5e-296) || (!(l <= 1.2e-114) && (l <= 2.1e-45)))) {
tmp = Math.PI * l;
} else {
tmp = (l / (F / Math.PI)) / -F;
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -1.1e-37) or not ((l <= 4.5e-296) or (not (l <= 1.2e-114) and (l <= 2.1e-45))): tmp = math.pi * l else: tmp = (l / (F / math.pi)) / -F return tmp
function code(F, l) tmp = 0.0 if ((l <= -1.1e-37) || !((l <= 4.5e-296) || (!(l <= 1.2e-114) && (l <= 2.1e-45)))) tmp = Float64(pi * l); else tmp = Float64(Float64(l / Float64(F / pi)) / Float64(-F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -1.1e-37) || ~(((l <= 4.5e-296) || (~((l <= 1.2e-114)) && (l <= 2.1e-45))))) tmp = pi * l; else tmp = (l / (F / pi)) / -F; end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -1.1e-37], N[Not[Or[LessEqual[l, 4.5e-296], And[N[Not[LessEqual[l, 1.2e-114]], $MachinePrecision], LessEqual[l, 2.1e-45]]]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(l / N[(F / Pi), $MachinePrecision]), $MachinePrecision] / (-F)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{-37} \lor \neg \left(\ell \leq 4.5 \cdot 10^{-296} \lor \neg \left(\ell \leq 1.2 \cdot 10^{-114}\right) \land \ell \leq 2.1 \cdot 10^{-45}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{\frac{F}{\pi}}}{-F}\\
\end{array}
\end{array}
if l < -1.10000000000000001e-37 or 4.5000000000000002e-296 < l < 1.2000000000000001e-114 or 2.09999999999999995e-45 < l Initial program 68.9%
sqr-neg68.9%
associate-*l/69.2%
*-lft-identity69.2%
sqr-neg69.2%
Simplified69.2%
Taylor expanded in l around 0 60.6%
Taylor expanded in F around inf 91.6%
if -1.10000000000000001e-37 < l < 4.5000000000000002e-296 or 1.2000000000000001e-114 < l < 2.09999999999999995e-45Initial program 92.2%
sqr-neg92.2%
associate-*l/92.3%
*-lft-identity92.3%
sqr-neg92.3%
Simplified92.3%
Taylor expanded in l around 0 92.3%
Taylor expanded in F around 0 58.1%
associate-*r/58.1%
*-commutative58.1%
neg-mul-158.1%
*-commutative58.1%
distribute-rgt-neg-in58.1%
Simplified58.1%
*-commutative58.1%
associate-/l*57.8%
unpow257.8%
associate-*l/65.4%
distribute-neg-frac65.4%
associate-/r*65.4%
un-div-inv65.4%
*-commutative65.4%
distribute-lft-neg-in65.4%
distribute-neg-frac65.4%
metadata-eval65.4%
div-inv65.4%
clear-num65.4%
Applied egg-rr65.4%
*-commutative65.4%
frac-2neg65.4%
metadata-eval65.4%
un-div-inv65.4%
associate-*r/65.5%
*-commutative65.5%
associate-/l*65.4%
Applied egg-rr65.4%
Final simplification85.4%
(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 74.5%
sqr-neg74.5%
associate-*l/74.7%
*-lft-identity74.7%
sqr-neg74.7%
Simplified74.7%
Taylor expanded in l around 0 68.2%
Taylor expanded in F around inf 78.7%
Final simplification78.7%
herbie shell --seed 2023309
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))