
(FPCore (x y) :precision binary64 (let* ((t_0 (/ x (* y 2.0)))) (/ (tan t_0) (sin t_0))))
double code(double x, double y) {
double t_0 = x / (y * 2.0);
return tan(t_0) / sin(t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = x / (y * 2.0d0)
code = tan(t_0) / sin(t_0)
end function
public static double code(double x, double y) {
double t_0 = x / (y * 2.0);
return Math.tan(t_0) / Math.sin(t_0);
}
def code(x, y): t_0 = x / (y * 2.0) return math.tan(t_0) / math.sin(t_0)
function code(x, y) t_0 = Float64(x / Float64(y * 2.0)) return Float64(tan(t_0) / sin(t_0)) end
function tmp = code(x, y) t_0 = x / (y * 2.0); tmp = tan(t_0) / sin(t_0); end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Tan[t$95$0], $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot 2}\\
\frac{\tan t\_0}{\sin t\_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (let* ((t_0 (/ x (* y 2.0)))) (/ (tan t_0) (sin t_0))))
double code(double x, double y) {
double t_0 = x / (y * 2.0);
return tan(t_0) / sin(t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = x / (y * 2.0d0)
code = tan(t_0) / sin(t_0)
end function
public static double code(double x, double y) {
double t_0 = x / (y * 2.0);
return Math.tan(t_0) / Math.sin(t_0);
}
def code(x, y): t_0 = x / (y * 2.0) return math.tan(t_0) / math.sin(t_0)
function code(x, y) t_0 = Float64(x / Float64(y * 2.0)) return Float64(tan(t_0) / sin(t_0)) end
function tmp = code(x, y) t_0 = x / (y * 2.0); tmp = tan(t_0) / sin(t_0); end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Tan[t$95$0], $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot 2}\\
\frac{\tan t\_0}{\sin t\_0}
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y 2.0))))
(if (<= (/ (tan t_0) (sin t_0)) 2.0)
(/
1.0
(cos (* 0.5 (* (pow (pow (cbrt (cbrt x)) 2.0) 3.0) (/ (cbrt x) y)))))
1.0)))
double code(double x, double y) {
double t_0 = x / (y * 2.0);
double tmp;
if ((tan(t_0) / sin(t_0)) <= 2.0) {
tmp = 1.0 / cos((0.5 * (pow(pow(cbrt(cbrt(x)), 2.0), 3.0) * (cbrt(x) / y))));
} else {
tmp = 1.0;
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = x / (y * 2.0);
double tmp;
if ((Math.tan(t_0) / Math.sin(t_0)) <= 2.0) {
tmp = 1.0 / Math.cos((0.5 * (Math.pow(Math.pow(Math.cbrt(Math.cbrt(x)), 2.0), 3.0) * (Math.cbrt(x) / y))));
} else {
tmp = 1.0;
}
return tmp;
}
function code(x, y) t_0 = Float64(x / Float64(y * 2.0)) tmp = 0.0 if (Float64(tan(t_0) / sin(t_0)) <= 2.0) tmp = Float64(1.0 / cos(Float64(0.5 * Float64(((cbrt(cbrt(x)) ^ 2.0) ^ 3.0) * Float64(cbrt(x) / y))))); else tmp = 1.0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Tan[t$95$0], $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], N[(1.0 / N[Cos[N[(0.5 * N[(N[Power[N[Power[N[Power[N[Power[x, 1/3], $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision], 3.0], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot 2}\\
\mathbf{if}\;\frac{\tan t\_0}{\sin t\_0} \leq 2:\\
\;\;\;\;\frac{1}{\cos \left(0.5 \cdot \left({\left({\left(\sqrt[3]{\sqrt[3]{x}}\right)}^{2}\right)}^{3} \cdot \frac{\sqrt[3]{x}}{y}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (/.f64 (tan.f64 (/.f64 x (*.f64 y #s(literal 2 binary64)))) (sin.f64 (/.f64 x (*.f64 y #s(literal 2 binary64))))) < 2Initial program 64.6%
Taylor expanded in x around inf 64.6%
add-cube-cbrt64.7%
associate-/l*65.5%
pow265.5%
Applied egg-rr65.5%
unpow265.5%
add-sqr-sqrt30.1%
associate-*r*30.2%
pow130.2%
metadata-eval30.2%
sqrt-pow130.2%
sqrt-prod30.7%
unpow230.7%
add-cube-cbrt30.3%
pow1/330.5%
sqrt-pow130.5%
metadata-eval30.5%
Applied egg-rr30.5%
pow1/230.5%
pow-prod-up29.7%
metadata-eval29.7%
metadata-eval29.7%
pow-pow29.5%
pow1/365.5%
add-cube-cbrt64.5%
pow364.8%
unpow264.8%
cbrt-prod65.9%
pow266.0%
Applied egg-rr66.0%
if 2 < (/.f64 (tan.f64 (/.f64 x (*.f64 y #s(literal 2 binary64)))) (sin.f64 (/.f64 x (*.f64 y #s(literal 2 binary64))))) Initial program 1.0%
remove-double-neg1.0%
distribute-frac-neg1.0%
tan-neg1.0%
distribute-frac-neg21.0%
distribute-lft-neg-out1.0%
distribute-frac-neg21.0%
distribute-lft-neg-out1.0%
distribute-frac-neg21.0%
distribute-frac-neg1.0%
neg-mul-11.0%
*-commutative1.0%
associate-/l*0.6%
*-commutative0.6%
associate-/r*0.6%
metadata-eval0.6%
sin-neg0.6%
distribute-frac-neg0.6%
Simplified1.3%
Taylor expanded in x around 0 48.0%
(FPCore (x y) :precision binary64 (if (<= (/ x (* y 2.0)) 3e+127) (/ 1.0 (cos (/ 0.5 (exp (log (/ y x)))))) 1.0))
double code(double x, double y) {
double tmp;
if ((x / (y * 2.0)) <= 3e+127) {
tmp = 1.0 / cos((0.5 / exp(log((y / x)))));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x / (y * 2.0d0)) <= 3d+127) then
tmp = 1.0d0 / cos((0.5d0 / exp(log((y / x)))))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x / (y * 2.0)) <= 3e+127) {
tmp = 1.0 / Math.cos((0.5 / Math.exp(Math.log((y / x)))));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (x / (y * 2.0)) <= 3e+127: tmp = 1.0 / math.cos((0.5 / math.exp(math.log((y / x))))) else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (Float64(x / Float64(y * 2.0)) <= 3e+127) tmp = Float64(1.0 / cos(Float64(0.5 / exp(log(Float64(y / x)))))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x / (y * 2.0)) <= 3e+127) tmp = 1.0 / cos((0.5 / exp(log((y / x))))); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision], 3e+127], N[(1.0 / N[Cos[N[(0.5 / N[Exp[N[Log[N[(y / x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y \cdot 2} \leq 3 \cdot 10^{+127}:\\
\;\;\;\;\frac{1}{\cos \left(\frac{0.5}{e^{\log \left(\frac{y}{x}\right)}}\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (/.f64 x (*.f64 y #s(literal 2 binary64))) < 3.0000000000000002e127Initial program 55.5%
Taylor expanded in x around inf 68.6%
clear-num68.6%
un-div-inv68.6%
Applied egg-rr68.6%
add-exp-log32.3%
Applied egg-rr32.3%
if 3.0000000000000002e127 < (/.f64 x (*.f64 y #s(literal 2 binary64))) Initial program 5.1%
remove-double-neg5.1%
distribute-frac-neg5.1%
tan-neg5.1%
distribute-frac-neg25.1%
distribute-lft-neg-out5.1%
distribute-frac-neg25.1%
distribute-lft-neg-out5.1%
distribute-frac-neg25.1%
distribute-frac-neg5.1%
neg-mul-15.1%
*-commutative5.1%
associate-/l*5.7%
*-commutative5.7%
associate-/r*5.7%
metadata-eval5.7%
sin-neg5.7%
distribute-frac-neg5.7%
Simplified5.5%
Taylor expanded in x around 0 11.3%
(FPCore (x y) :precision binary64 (if (<= (/ x (* y 2.0)) 3e+127) (/ 1.0 (cos (* 0.5 (expm1 (log1p (/ x y)))))) 1.0))
double code(double x, double y) {
double tmp;
if ((x / (y * 2.0)) <= 3e+127) {
tmp = 1.0 / cos((0.5 * expm1(log1p((x / y)))));
} else {
tmp = 1.0;
}
return tmp;
}
public static double code(double x, double y) {
double tmp;
if ((x / (y * 2.0)) <= 3e+127) {
tmp = 1.0 / Math.cos((0.5 * Math.expm1(Math.log1p((x / y)))));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (x / (y * 2.0)) <= 3e+127: tmp = 1.0 / math.cos((0.5 * math.expm1(math.log1p((x / y))))) else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (Float64(x / Float64(y * 2.0)) <= 3e+127) tmp = Float64(1.0 / cos(Float64(0.5 * expm1(log1p(Float64(x / y)))))); else tmp = 1.0; end return tmp end
code[x_, y_] := If[LessEqual[N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision], 3e+127], N[(1.0 / N[Cos[N[(0.5 * N[(Exp[N[Log[1 + N[(x / y), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y \cdot 2} \leq 3 \cdot 10^{+127}:\\
\;\;\;\;\frac{1}{\cos \left(0.5 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{y}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (/.f64 x (*.f64 y #s(literal 2 binary64))) < 3.0000000000000002e127Initial program 55.5%
Taylor expanded in x around inf 68.6%
expm1-log1p-u66.8%
expm1-undefine66.8%
Applied egg-rr66.8%
expm1-define66.8%
Simplified66.8%
if 3.0000000000000002e127 < (/.f64 x (*.f64 y #s(literal 2 binary64))) Initial program 5.1%
remove-double-neg5.1%
distribute-frac-neg5.1%
tan-neg5.1%
distribute-frac-neg25.1%
distribute-lft-neg-out5.1%
distribute-frac-neg25.1%
distribute-lft-neg-out5.1%
distribute-frac-neg25.1%
distribute-frac-neg5.1%
neg-mul-15.1%
*-commutative5.1%
associate-/l*5.7%
*-commutative5.7%
associate-/r*5.7%
metadata-eval5.7%
sin-neg5.7%
distribute-frac-neg5.7%
Simplified5.5%
Taylor expanded in x around 0 11.3%
(FPCore (x y) :precision binary64 (if (<= (/ x (* y 2.0)) 6e+24) (/ 1.0 (cos (exp (log (* x (/ 0.5 y)))))) 1.0))
double code(double x, double y) {
double tmp;
if ((x / (y * 2.0)) <= 6e+24) {
tmp = 1.0 / cos(exp(log((x * (0.5 / y)))));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x / (y * 2.0d0)) <= 6d+24) then
tmp = 1.0d0 / cos(exp(log((x * (0.5d0 / y)))))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x / (y * 2.0)) <= 6e+24) {
tmp = 1.0 / Math.cos(Math.exp(Math.log((x * (0.5 / y)))));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (x / (y * 2.0)) <= 6e+24: tmp = 1.0 / math.cos(math.exp(math.log((x * (0.5 / y))))) else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (Float64(x / Float64(y * 2.0)) <= 6e+24) tmp = Float64(1.0 / cos(exp(log(Float64(x * Float64(0.5 / y)))))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x / (y * 2.0)) <= 6e+24) tmp = 1.0 / cos(exp(log((x * (0.5 / y))))); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision], 6e+24], N[(1.0 / N[Cos[N[Exp[N[Log[N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y \cdot 2} \leq 6 \cdot 10^{+24}:\\
\;\;\;\;\frac{1}{\cos \left(e^{\log \left(x \cdot \frac{0.5}{y}\right)}\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (/.f64 x (*.f64 y #s(literal 2 binary64))) < 5.9999999999999999e24Initial program 59.9%
Taylor expanded in x around inf 74.3%
associate-*r/74.3%
associate-*l/74.4%
*-commutative74.4%
add-exp-log40.9%
Applied egg-rr40.9%
if 5.9999999999999999e24 < (/.f64 x (*.f64 y #s(literal 2 binary64))) Initial program 6.7%
remove-double-neg6.7%
distribute-frac-neg6.7%
tan-neg6.7%
distribute-frac-neg26.7%
distribute-lft-neg-out6.7%
distribute-frac-neg26.7%
distribute-lft-neg-out6.7%
distribute-frac-neg26.7%
distribute-frac-neg6.7%
neg-mul-16.7%
*-commutative6.7%
associate-/l*7.3%
*-commutative7.3%
associate-/r*7.3%
metadata-eval7.3%
sin-neg7.3%
distribute-frac-neg7.3%
Simplified7.0%
Taylor expanded in x around 0 11.4%
(FPCore (x y) :precision binary64 (if (<= (/ x (* y 2.0)) 6e+24) (/ 1.0 (cos (/ (/ 0.5 y) (/ 1.0 x)))) 1.0))
double code(double x, double y) {
double tmp;
if ((x / (y * 2.0)) <= 6e+24) {
tmp = 1.0 / cos(((0.5 / y) / (1.0 / x)));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x / (y * 2.0d0)) <= 6d+24) then
tmp = 1.0d0 / cos(((0.5d0 / y) / (1.0d0 / x)))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x / (y * 2.0)) <= 6e+24) {
tmp = 1.0 / Math.cos(((0.5 / y) / (1.0 / x)));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (x / (y * 2.0)) <= 6e+24: tmp = 1.0 / math.cos(((0.5 / y) / (1.0 / x))) else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (Float64(x / Float64(y * 2.0)) <= 6e+24) tmp = Float64(1.0 / cos(Float64(Float64(0.5 / y) / Float64(1.0 / x)))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x / (y * 2.0)) <= 6e+24) tmp = 1.0 / cos(((0.5 / y) / (1.0 / x))); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision], 6e+24], N[(1.0 / N[Cos[N[(N[(0.5 / y), $MachinePrecision] / N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y \cdot 2} \leq 6 \cdot 10^{+24}:\\
\;\;\;\;\frac{1}{\cos \left(\frac{\frac{0.5}{y}}{\frac{1}{x}}\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (/.f64 x (*.f64 y #s(literal 2 binary64))) < 5.9999999999999999e24Initial program 59.9%
Taylor expanded in x around inf 74.3%
associate-*r/74.3%
associate-*l/74.4%
*-commutative74.4%
expm1-log1p-u71.6%
Applied egg-rr71.6%
expm1-log1p-u74.4%
*-commutative74.4%
add-cube-cbrt74.4%
associate-*r*74.8%
pow274.8%
Applied egg-rr74.8%
associate-*l*74.4%
unpow274.4%
add-cube-cbrt74.4%
associate-/r/74.4%
div-inv74.5%
associate-/r*74.6%
Applied egg-rr74.6%
if 5.9999999999999999e24 < (/.f64 x (*.f64 y #s(literal 2 binary64))) Initial program 6.7%
remove-double-neg6.7%
distribute-frac-neg6.7%
tan-neg6.7%
distribute-frac-neg26.7%
distribute-lft-neg-out6.7%
distribute-frac-neg26.7%
distribute-lft-neg-out6.7%
distribute-frac-neg26.7%
distribute-frac-neg6.7%
neg-mul-16.7%
*-commutative6.7%
associate-/l*7.3%
*-commutative7.3%
associate-/r*7.3%
metadata-eval7.3%
sin-neg7.3%
distribute-frac-neg7.3%
Simplified7.0%
Taylor expanded in x around 0 11.4%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 47.2%
remove-double-neg47.2%
distribute-frac-neg47.2%
tan-neg47.2%
distribute-frac-neg247.2%
distribute-lft-neg-out47.2%
distribute-frac-neg247.2%
distribute-lft-neg-out47.2%
distribute-frac-neg247.2%
distribute-frac-neg47.2%
neg-mul-147.2%
*-commutative47.2%
associate-/l*47.1%
*-commutative47.1%
associate-/r*47.1%
metadata-eval47.1%
sin-neg47.1%
distribute-frac-neg47.1%
Simplified47.4%
Taylor expanded in x around 0 58.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y 2.0))) (t_1 (sin t_0)))
(if (< y -1.2303690911306994e+114)
1.0
(if (< y -9.102852406811914e-222)
(/ t_1 (* t_1 (log (exp (cos t_0)))))
1.0))))
double code(double x, double y) {
double t_0 = x / (y * 2.0);
double t_1 = sin(t_0);
double tmp;
if (y < -1.2303690911306994e+114) {
tmp = 1.0;
} else if (y < -9.102852406811914e-222) {
tmp = t_1 / (t_1 * log(exp(cos(t_0))));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / (y * 2.0d0)
t_1 = sin(t_0)
if (y < (-1.2303690911306994d+114)) then
tmp = 1.0d0
else if (y < (-9.102852406811914d-222)) then
tmp = t_1 / (t_1 * log(exp(cos(t_0))))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y * 2.0);
double t_1 = Math.sin(t_0);
double tmp;
if (y < -1.2303690911306994e+114) {
tmp = 1.0;
} else if (y < -9.102852406811914e-222) {
tmp = t_1 / (t_1 * Math.log(Math.exp(Math.cos(t_0))));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): t_0 = x / (y * 2.0) t_1 = math.sin(t_0) tmp = 0 if y < -1.2303690911306994e+114: tmp = 1.0 elif y < -9.102852406811914e-222: tmp = t_1 / (t_1 * math.log(math.exp(math.cos(t_0)))) else: tmp = 1.0 return tmp
function code(x, y) t_0 = Float64(x / Float64(y * 2.0)) t_1 = sin(t_0) tmp = 0.0 if (y < -1.2303690911306994e+114) tmp = 1.0; elseif (y < -9.102852406811914e-222) tmp = Float64(t_1 / Float64(t_1 * log(exp(cos(t_0))))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y * 2.0); t_1 = sin(t_0); tmp = 0.0; if (y < -1.2303690911306994e+114) tmp = 1.0; elseif (y < -9.102852406811914e-222) tmp = t_1 / (t_1 * log(exp(cos(t_0)))); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[Less[y, -1.2303690911306994e+114], 1.0, If[Less[y, -9.102852406811914e-222], N[(t$95$1 / N[(t$95$1 * N[Log[N[Exp[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot 2}\\
t_1 := \sin t\_0\\
\mathbf{if}\;y < -1.2303690911306994 \cdot 10^{+114}:\\
\;\;\;\;1\\
\mathbf{elif}\;y < -9.102852406811914 \cdot 10^{-222}:\\
\;\;\;\;\frac{t\_1}{t\_1 \cdot \log \left(e^{\cos t\_0}\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
herbie shell --seed 2024145
(FPCore (x y)
:name "Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5"
:precision binary64
:alt
(! :herbie-platform default (if (< y -1230369091130699400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) 1 (if (< y -4551426203405957/500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (sin (/ x (* y 2))) (* (sin (/ x (* y 2))) (log (exp (cos (/ x (* y 2))))))) 1)))
(/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))))