
(FPCore (z1 z0) :precision binary64 (let* ((t_0 (* PI (* z1 z0)))) (/ (sin t_0) t_0)))
double code(double z1, double z0) {
double t_0 = ((double) M_PI) * (z1 * z0);
return sin(t_0) / t_0;
}
public static double code(double z1, double z0) {
double t_0 = Math.PI * (z1 * z0);
return Math.sin(t_0) / t_0;
}
def code(z1, z0): t_0 = math.pi * (z1 * z0) return math.sin(t_0) / t_0
function code(z1, z0) t_0 = Float64(pi * Float64(z1 * z0)) return Float64(sin(t_0) / t_0) end
function tmp = code(z1, z0) t_0 = pi * (z1 * z0); tmp = sin(t_0) / t_0; end
code[z1_, z0_] := Block[{t$95$0 = N[(Pi * N[(z1 * z0), $MachinePrecision]), $MachinePrecision]}, N[(N[Sin[t$95$0], $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
t_0 := \pi \cdot \left(z1 \cdot z0\right)\\
\frac{\sin t\_0}{t\_0}
\end{array}
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (z1 z0) :precision binary64 (let* ((t_0 (* PI (* z1 z0)))) (/ (sin t_0) t_0)))
double code(double z1, double z0) {
double t_0 = ((double) M_PI) * (z1 * z0);
return sin(t_0) / t_0;
}
public static double code(double z1, double z0) {
double t_0 = Math.PI * (z1 * z0);
return Math.sin(t_0) / t_0;
}
def code(z1, z0): t_0 = math.pi * (z1 * z0) return math.sin(t_0) / t_0
function code(z1, z0) t_0 = Float64(pi * Float64(z1 * z0)) return Float64(sin(t_0) / t_0) end
function tmp = code(z1, z0) t_0 = pi * (z1 * z0); tmp = sin(t_0) / t_0; end
code[z1_, z0_] := Block[{t$95$0 = N[(Pi * N[(z1 * z0), $MachinePrecision]), $MachinePrecision]}, N[(N[Sin[t$95$0], $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
t_0 := \pi \cdot \left(z1 \cdot z0\right)\\
\frac{\sin t\_0}{t\_0}
\end{array}
(FPCore (z1 z0)
:precision binary64
(let* ((t_0
(*
(* (pow PI 0.6666666666666666) (* (fabs z0) (fabs z1)))
(cbrt PI)))
(t_1 (* PI (* (fabs z1) (fabs z0)))))
(if (<= t_1 0.0)
1.0
(if (<= t_1 5e+28)
(/ (sin t_0) t_0)
(/ (* 0.5 (- (cos (- PI (* 0.5 PI))) (cos (* 0.5 PI)))) t_1)))))double code(double z1, double z0) {
double t_0 = (pow(((double) M_PI), 0.6666666666666666) * (fabs(z0) * fabs(z1))) * cbrt(((double) M_PI));
double t_1 = ((double) M_PI) * (fabs(z1) * fabs(z0));
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0;
} else if (t_1 <= 5e+28) {
tmp = sin(t_0) / t_0;
} else {
tmp = (0.5 * (cos((((double) M_PI) - (0.5 * ((double) M_PI)))) - cos((0.5 * ((double) M_PI))))) / t_1;
}
return tmp;
}
public static double code(double z1, double z0) {
double t_0 = (Math.pow(Math.PI, 0.6666666666666666) * (Math.abs(z0) * Math.abs(z1))) * Math.cbrt(Math.PI);
double t_1 = Math.PI * (Math.abs(z1) * Math.abs(z0));
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0;
} else if (t_1 <= 5e+28) {
tmp = Math.sin(t_0) / t_0;
} else {
tmp = (0.5 * (Math.cos((Math.PI - (0.5 * Math.PI))) - Math.cos((0.5 * Math.PI)))) / t_1;
}
return tmp;
}
function code(z1, z0) t_0 = Float64(Float64((pi ^ 0.6666666666666666) * Float64(abs(z0) * abs(z1))) * cbrt(pi)) t_1 = Float64(pi * Float64(abs(z1) * abs(z0))) tmp = 0.0 if (t_1 <= 0.0) tmp = 1.0; elseif (t_1 <= 5e+28) tmp = Float64(sin(t_0) / t_0); else tmp = Float64(Float64(0.5 * Float64(cos(Float64(pi - Float64(0.5 * pi))) - cos(Float64(0.5 * pi)))) / t_1); end return tmp end
code[z1_, z0_] := Block[{t$95$0 = N[(N[(N[Power[Pi, 0.6666666666666666], $MachinePrecision] * N[(N[Abs[z0], $MachinePrecision] * N[Abs[z1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(N[Abs[z1], $MachinePrecision] * N[Abs[z0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], 1.0, If[LessEqual[t$95$1, 5e+28], N[(N[Sin[t$95$0], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(0.5 * N[(N[Cos[N[(Pi - N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Cos[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left({\pi}^{0.6666666666666666} \cdot \left(\left|z0\right| \cdot \left|z1\right|\right)\right) \cdot \sqrt[3]{\pi}\\
t_1 := \pi \cdot \left(\left|z1\right| \cdot \left|z0\right|\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{\sin t\_0}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(\cos \left(\pi - 0.5 \cdot \pi\right) - \cos \left(0.5 \cdot \pi\right)\right)}{t\_1}\\
\end{array}
if (*.f64 (PI.f64) (*.f64 z1 z0)) < 0.0Initial program 42.2%
Taylor expanded in z1 around 0
Applied rewrites50.9%
if 0.0 < (*.f64 (PI.f64) (*.f64 z1 z0)) < 4.9999999999999996e28Initial program 42.2%
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
pow1/3N/A
lift-PI.f64N/A
pow1/3N/A
pow-prod-upN/A
lower-pow.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f6441.6%
Applied rewrites41.6%
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
pow1/3N/A
lift-PI.f64N/A
pow1/3N/A
pow-prod-upN/A
lower-pow.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f6442.2%
Applied rewrites42.2%
if 4.9999999999999996e28 < (*.f64 (PI.f64) (*.f64 z1 z0)) Initial program 42.2%
Taylor expanded in z1 around inf
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6441.7%
Applied rewrites41.7%
Applied rewrites6.2%
lift-neg.f64N/A
lift-sin.f64N/A
cos-+PI/2-revN/A
lift-PI.f64N/A
mult-flip-revN/A
metadata-evalN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-cos.f6425.9%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6425.9%
Applied rewrites25.9%
Taylor expanded in z1 around 0
lower-*.f64N/A
lower--.f64N/A
lower-cos.f64N/A
lower--.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-PI.f6447.2%
Applied rewrites47.2%
(FPCore (z1 z0)
:precision binary64
(let* ((t_0 (fmin (fabs z1) (fabs z0)))
(t_1 (fmax (fabs z1) (fabs z0)))
(t_2 (* PI (* t_0 t_1)))
(t_3 (* (* t_1 PI) t_0)))
(if (<= t_2 0.0)
1.0
(if (<= t_2 5e+28)
(/ (sin t_3) t_3)
(/ (* 0.5 (- (cos (- PI (* 0.5 PI))) (cos (* 0.5 PI)))) t_2)))))double code(double z1, double z0) {
double t_0 = fmin(fabs(z1), fabs(z0));
double t_1 = fmax(fabs(z1), fabs(z0));
double t_2 = ((double) M_PI) * (t_0 * t_1);
double t_3 = (t_1 * ((double) M_PI)) * t_0;
double tmp;
if (t_2 <= 0.0) {
tmp = 1.0;
} else if (t_2 <= 5e+28) {
tmp = sin(t_3) / t_3;
} else {
tmp = (0.5 * (cos((((double) M_PI) - (0.5 * ((double) M_PI)))) - cos((0.5 * ((double) M_PI))))) / t_2;
}
return tmp;
}
public static double code(double z1, double z0) {
double t_0 = fmin(Math.abs(z1), Math.abs(z0));
double t_1 = fmax(Math.abs(z1), Math.abs(z0));
double t_2 = Math.PI * (t_0 * t_1);
double t_3 = (t_1 * Math.PI) * t_0;
double tmp;
if (t_2 <= 0.0) {
tmp = 1.0;
} else if (t_2 <= 5e+28) {
tmp = Math.sin(t_3) / t_3;
} else {
tmp = (0.5 * (Math.cos((Math.PI - (0.5 * Math.PI))) - Math.cos((0.5 * Math.PI)))) / t_2;
}
return tmp;
}
def code(z1, z0): t_0 = fmin(math.fabs(z1), math.fabs(z0)) t_1 = fmax(math.fabs(z1), math.fabs(z0)) t_2 = math.pi * (t_0 * t_1) t_3 = (t_1 * math.pi) * t_0 tmp = 0 if t_2 <= 0.0: tmp = 1.0 elif t_2 <= 5e+28: tmp = math.sin(t_3) / t_3 else: tmp = (0.5 * (math.cos((math.pi - (0.5 * math.pi))) - math.cos((0.5 * math.pi)))) / t_2 return tmp
function code(z1, z0) t_0 = fmin(abs(z1), abs(z0)) t_1 = fmax(abs(z1), abs(z0)) t_2 = Float64(pi * Float64(t_0 * t_1)) t_3 = Float64(Float64(t_1 * pi) * t_0) tmp = 0.0 if (t_2 <= 0.0) tmp = 1.0; elseif (t_2 <= 5e+28) tmp = Float64(sin(t_3) / t_3); else tmp = Float64(Float64(0.5 * Float64(cos(Float64(pi - Float64(0.5 * pi))) - cos(Float64(0.5 * pi)))) / t_2); end return tmp end
function tmp_2 = code(z1, z0) t_0 = min(abs(z1), abs(z0)); t_1 = max(abs(z1), abs(z0)); t_2 = pi * (t_0 * t_1); t_3 = (t_1 * pi) * t_0; tmp = 0.0; if (t_2 <= 0.0) tmp = 1.0; elseif (t_2 <= 5e+28) tmp = sin(t_3) / t_3; else tmp = (0.5 * (cos((pi - (0.5 * pi))) - cos((0.5 * pi)))) / t_2; end tmp_2 = tmp; end
code[z1_, z0_] := Block[{t$95$0 = N[Min[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * Pi), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], 1.0, If[LessEqual[t$95$2, 5e+28], N[(N[Sin[t$95$3], $MachinePrecision] / t$95$3), $MachinePrecision], N[(N[(0.5 * N[(N[Cos[N[(Pi - N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Cos[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(\left|z1\right|, \left|z0\right|\right)\\
t_1 := \mathsf{max}\left(\left|z1\right|, \left|z0\right|\right)\\
t_2 := \pi \cdot \left(t\_0 \cdot t\_1\right)\\
t_3 := \left(t\_1 \cdot \pi\right) \cdot t\_0\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{\sin t\_3}{t\_3}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(\cos \left(\pi - 0.5 \cdot \pi\right) - \cos \left(0.5 \cdot \pi\right)\right)}{t\_2}\\
\end{array}
if (*.f64 (PI.f64) (*.f64 z1 z0)) < 0.0Initial program 42.2%
Taylor expanded in z1 around 0
Applied rewrites50.9%
if 0.0 < (*.f64 (PI.f64) (*.f64 z1 z0)) < 4.9999999999999996e28Initial program 42.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6442.3%
Applied rewrites42.3%
if 4.9999999999999996e28 < (*.f64 (PI.f64) (*.f64 z1 z0)) Initial program 42.2%
Taylor expanded in z1 around inf
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6441.7%
Applied rewrites41.7%
Applied rewrites6.2%
lift-neg.f64N/A
lift-sin.f64N/A
cos-+PI/2-revN/A
lift-PI.f64N/A
mult-flip-revN/A
metadata-evalN/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-cos.f6425.9%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6425.9%
Applied rewrites25.9%
Taylor expanded in z1 around 0
lower-*.f64N/A
lower--.f64N/A
lower-cos.f64N/A
lower--.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-PI.f6447.2%
Applied rewrites47.2%
(FPCore (z1 z0)
:precision binary64
(let* ((t_0 (fmin (fabs z1) (fabs z0)))
(t_1 (fmax (fabs z1) (fabs z0)))
(t_2 (* PI (* t_0 t_1)))
(t_3 (* (* t_1 PI) t_0)))
(if (<= t_2 0.0)
1.0
(if (<= t_2 5e+28)
(/ (sin t_3) t_3)
(/ (/ (/ (sin PI) PI) t_1) t_0)))))double code(double z1, double z0) {
double t_0 = fmin(fabs(z1), fabs(z0));
double t_1 = fmax(fabs(z1), fabs(z0));
double t_2 = ((double) M_PI) * (t_0 * t_1);
double t_3 = (t_1 * ((double) M_PI)) * t_0;
double tmp;
if (t_2 <= 0.0) {
tmp = 1.0;
} else if (t_2 <= 5e+28) {
tmp = sin(t_3) / t_3;
} else {
tmp = ((sin(((double) M_PI)) / ((double) M_PI)) / t_1) / t_0;
}
return tmp;
}
public static double code(double z1, double z0) {
double t_0 = fmin(Math.abs(z1), Math.abs(z0));
double t_1 = fmax(Math.abs(z1), Math.abs(z0));
double t_2 = Math.PI * (t_0 * t_1);
double t_3 = (t_1 * Math.PI) * t_0;
double tmp;
if (t_2 <= 0.0) {
tmp = 1.0;
} else if (t_2 <= 5e+28) {
tmp = Math.sin(t_3) / t_3;
} else {
tmp = ((Math.sin(Math.PI) / Math.PI) / t_1) / t_0;
}
return tmp;
}
def code(z1, z0): t_0 = fmin(math.fabs(z1), math.fabs(z0)) t_1 = fmax(math.fabs(z1), math.fabs(z0)) t_2 = math.pi * (t_0 * t_1) t_3 = (t_1 * math.pi) * t_0 tmp = 0 if t_2 <= 0.0: tmp = 1.0 elif t_2 <= 5e+28: tmp = math.sin(t_3) / t_3 else: tmp = ((math.sin(math.pi) / math.pi) / t_1) / t_0 return tmp
function code(z1, z0) t_0 = fmin(abs(z1), abs(z0)) t_1 = fmax(abs(z1), abs(z0)) t_2 = Float64(pi * Float64(t_0 * t_1)) t_3 = Float64(Float64(t_1 * pi) * t_0) tmp = 0.0 if (t_2 <= 0.0) tmp = 1.0; elseif (t_2 <= 5e+28) tmp = Float64(sin(t_3) / t_3); else tmp = Float64(Float64(Float64(sin(pi) / pi) / t_1) / t_0); end return tmp end
function tmp_2 = code(z1, z0) t_0 = min(abs(z1), abs(z0)); t_1 = max(abs(z1), abs(z0)); t_2 = pi * (t_0 * t_1); t_3 = (t_1 * pi) * t_0; tmp = 0.0; if (t_2 <= 0.0) tmp = 1.0; elseif (t_2 <= 5e+28) tmp = sin(t_3) / t_3; else tmp = ((sin(pi) / pi) / t_1) / t_0; end tmp_2 = tmp; end
code[z1_, z0_] := Block[{t$95$0 = N[Min[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * Pi), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], 1.0, If[LessEqual[t$95$2, 5e+28], N[(N[Sin[t$95$3], $MachinePrecision] / t$95$3), $MachinePrecision], N[(N[(N[(N[Sin[Pi], $MachinePrecision] / Pi), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(\left|z1\right|, \left|z0\right|\right)\\
t_1 := \mathsf{max}\left(\left|z1\right|, \left|z0\right|\right)\\
t_2 := \pi \cdot \left(t\_0 \cdot t\_1\right)\\
t_3 := \left(t\_1 \cdot \pi\right) \cdot t\_0\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{\sin t\_3}{t\_3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\sin \pi}{\pi}}{t\_1}}{t\_0}\\
\end{array}
if (*.f64 (PI.f64) (*.f64 z1 z0)) < 0.0Initial program 42.2%
Taylor expanded in z1 around 0
Applied rewrites50.9%
if 0.0 < (*.f64 (PI.f64) (*.f64 z1 z0)) < 4.9999999999999996e28Initial program 42.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6442.3%
Applied rewrites42.3%
if 4.9999999999999996e28 < (*.f64 (PI.f64) (*.f64 z1 z0)) Initial program 42.2%
Taylor expanded in z1 around inf
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6442.2%
remove-double-negN/A
lift-sin.f64N/A
sin-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
sin-+PI-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lower-+.f64N/A
Applied rewrites6.1%
Taylor expanded in z1 around 0
lower-PI.f6417.0%
Applied rewrites17.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites17.1%
(FPCore (z1 z0)
:precision binary64
(let* ((t_0 (fmin (fabs z1) (fabs z0)))
(t_1 (fmax (fabs z1) (fabs z0)))
(t_2 (* t_0 t_1))
(t_3 (* PI t_2))
(t_4 (* (* t_1 PI) t_0)))
(if (<= t_3 0.0)
1.0
(if (<= t_3 5e+28)
(/ (sin t_4) t_4)
(/ 1.0 (/ (* t_2 PI) (sin PI)))))))double code(double z1, double z0) {
double t_0 = fmin(fabs(z1), fabs(z0));
double t_1 = fmax(fabs(z1), fabs(z0));
double t_2 = t_0 * t_1;
double t_3 = ((double) M_PI) * t_2;
double t_4 = (t_1 * ((double) M_PI)) * t_0;
double tmp;
if (t_3 <= 0.0) {
tmp = 1.0;
} else if (t_3 <= 5e+28) {
tmp = sin(t_4) / t_4;
} else {
tmp = 1.0 / ((t_2 * ((double) M_PI)) / sin(((double) M_PI)));
}
return tmp;
}
public static double code(double z1, double z0) {
double t_0 = fmin(Math.abs(z1), Math.abs(z0));
double t_1 = fmax(Math.abs(z1), Math.abs(z0));
double t_2 = t_0 * t_1;
double t_3 = Math.PI * t_2;
double t_4 = (t_1 * Math.PI) * t_0;
double tmp;
if (t_3 <= 0.0) {
tmp = 1.0;
} else if (t_3 <= 5e+28) {
tmp = Math.sin(t_4) / t_4;
} else {
tmp = 1.0 / ((t_2 * Math.PI) / Math.sin(Math.PI));
}
return tmp;
}
def code(z1, z0): t_0 = fmin(math.fabs(z1), math.fabs(z0)) t_1 = fmax(math.fabs(z1), math.fabs(z0)) t_2 = t_0 * t_1 t_3 = math.pi * t_2 t_4 = (t_1 * math.pi) * t_0 tmp = 0 if t_3 <= 0.0: tmp = 1.0 elif t_3 <= 5e+28: tmp = math.sin(t_4) / t_4 else: tmp = 1.0 / ((t_2 * math.pi) / math.sin(math.pi)) return tmp
function code(z1, z0) t_0 = fmin(abs(z1), abs(z0)) t_1 = fmax(abs(z1), abs(z0)) t_2 = Float64(t_0 * t_1) t_3 = Float64(pi * t_2) t_4 = Float64(Float64(t_1 * pi) * t_0) tmp = 0.0 if (t_3 <= 0.0) tmp = 1.0; elseif (t_3 <= 5e+28) tmp = Float64(sin(t_4) / t_4); else tmp = Float64(1.0 / Float64(Float64(t_2 * pi) / sin(pi))); end return tmp end
function tmp_2 = code(z1, z0) t_0 = min(abs(z1), abs(z0)); t_1 = max(abs(z1), abs(z0)); t_2 = t_0 * t_1; t_3 = pi * t_2; t_4 = (t_1 * pi) * t_0; tmp = 0.0; if (t_3 <= 0.0) tmp = 1.0; elseif (t_3 <= 5e+28) tmp = sin(t_4) / t_4; else tmp = 1.0 / ((t_2 * pi) / sin(pi)); end tmp_2 = tmp; end
code[z1_, z0_] := Block[{t$95$0 = N[Min[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(Pi * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$1 * Pi), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], 1.0, If[LessEqual[t$95$3, 5e+28], N[(N[Sin[t$95$4], $MachinePrecision] / t$95$4), $MachinePrecision], N[(1.0 / N[(N[(t$95$2 * Pi), $MachinePrecision] / N[Sin[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(\left|z1\right|, \left|z0\right|\right)\\
t_1 := \mathsf{max}\left(\left|z1\right|, \left|z0\right|\right)\\
t_2 := t\_0 \cdot t\_1\\
t_3 := \pi \cdot t\_2\\
t_4 := \left(t\_1 \cdot \pi\right) \cdot t\_0\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{\sin t\_4}{t\_4}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{t\_2 \cdot \pi}{\sin \pi}}\\
\end{array}
if (*.f64 (PI.f64) (*.f64 z1 z0)) < 0.0Initial program 42.2%
Taylor expanded in z1 around 0
Applied rewrites50.9%
if 0.0 < (*.f64 (PI.f64) (*.f64 z1 z0)) < 4.9999999999999996e28Initial program 42.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6442.3%
Applied rewrites42.3%
if 4.9999999999999996e28 < (*.f64 (PI.f64) (*.f64 z1 z0)) Initial program 42.2%
Taylor expanded in z1 around inf
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6442.2%
remove-double-negN/A
lift-sin.f64N/A
sin-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
sin-+PI-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lower-+.f64N/A
Applied rewrites6.1%
Taylor expanded in z1 around 0
lower-PI.f6417.0%
Applied rewrites17.0%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6417.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6417.4%
Applied rewrites17.4%
(FPCore (z1 z0)
:precision binary64
(let* ((t_0 (fmin (fabs z1) (fabs z0)))
(t_1 (fmax (fabs z1) (fabs z0)))
(t_2 (* PI (* t_0 t_1)))
(t_3 (* (* t_1 PI) t_0)))
(if (<= t_2 0.0)
1.0
(if (<= t_2 5e+28) (/ (sin t_3) t_3) (/ (sin PI) t_2)))))double code(double z1, double z0) {
double t_0 = fmin(fabs(z1), fabs(z0));
double t_1 = fmax(fabs(z1), fabs(z0));
double t_2 = ((double) M_PI) * (t_0 * t_1);
double t_3 = (t_1 * ((double) M_PI)) * t_0;
double tmp;
if (t_2 <= 0.0) {
tmp = 1.0;
} else if (t_2 <= 5e+28) {
tmp = sin(t_3) / t_3;
} else {
tmp = sin(((double) M_PI)) / t_2;
}
return tmp;
}
public static double code(double z1, double z0) {
double t_0 = fmin(Math.abs(z1), Math.abs(z0));
double t_1 = fmax(Math.abs(z1), Math.abs(z0));
double t_2 = Math.PI * (t_0 * t_1);
double t_3 = (t_1 * Math.PI) * t_0;
double tmp;
if (t_2 <= 0.0) {
tmp = 1.0;
} else if (t_2 <= 5e+28) {
tmp = Math.sin(t_3) / t_3;
} else {
tmp = Math.sin(Math.PI) / t_2;
}
return tmp;
}
def code(z1, z0): t_0 = fmin(math.fabs(z1), math.fabs(z0)) t_1 = fmax(math.fabs(z1), math.fabs(z0)) t_2 = math.pi * (t_0 * t_1) t_3 = (t_1 * math.pi) * t_0 tmp = 0 if t_2 <= 0.0: tmp = 1.0 elif t_2 <= 5e+28: tmp = math.sin(t_3) / t_3 else: tmp = math.sin(math.pi) / t_2 return tmp
function code(z1, z0) t_0 = fmin(abs(z1), abs(z0)) t_1 = fmax(abs(z1), abs(z0)) t_2 = Float64(pi * Float64(t_0 * t_1)) t_3 = Float64(Float64(t_1 * pi) * t_0) tmp = 0.0 if (t_2 <= 0.0) tmp = 1.0; elseif (t_2 <= 5e+28) tmp = Float64(sin(t_3) / t_3); else tmp = Float64(sin(pi) / t_2); end return tmp end
function tmp_2 = code(z1, z0) t_0 = min(abs(z1), abs(z0)); t_1 = max(abs(z1), abs(z0)); t_2 = pi * (t_0 * t_1); t_3 = (t_1 * pi) * t_0; tmp = 0.0; if (t_2 <= 0.0) tmp = 1.0; elseif (t_2 <= 5e+28) tmp = sin(t_3) / t_3; else tmp = sin(pi) / t_2; end tmp_2 = tmp; end
code[z1_, z0_] := Block[{t$95$0 = N[Min[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * Pi), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], 1.0, If[LessEqual[t$95$2, 5e+28], N[(N[Sin[t$95$3], $MachinePrecision] / t$95$3), $MachinePrecision], N[(N[Sin[Pi], $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(\left|z1\right|, \left|z0\right|\right)\\
t_1 := \mathsf{max}\left(\left|z1\right|, \left|z0\right|\right)\\
t_2 := \pi \cdot \left(t\_0 \cdot t\_1\right)\\
t_3 := \left(t\_1 \cdot \pi\right) \cdot t\_0\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{\sin t\_3}{t\_3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \pi}{t\_2}\\
\end{array}
if (*.f64 (PI.f64) (*.f64 z1 z0)) < 0.0Initial program 42.2%
Taylor expanded in z1 around 0
Applied rewrites50.9%
if 0.0 < (*.f64 (PI.f64) (*.f64 z1 z0)) < 4.9999999999999996e28Initial program 42.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6442.3%
Applied rewrites42.3%
if 4.9999999999999996e28 < (*.f64 (PI.f64) (*.f64 z1 z0)) Initial program 42.2%
Taylor expanded in z1 around inf
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6442.2%
remove-double-negN/A
lift-sin.f64N/A
sin-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
sin-+PI-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lower-+.f64N/A
Applied rewrites6.1%
Taylor expanded in z1 around 0
lower-PI.f6417.0%
Applied rewrites17.0%
(FPCore (z1 z0)
:precision binary64
(let* ((t_0 (fmin (fabs z1) (fabs z0)))
(t_1 (fmax (fabs z1) (fabs z0)))
(t_2 (* PI (* t_0 t_1))))
(if (<= t_2 2e-8)
1.0
(if (<= t_2 5e+28)
(/ (sin (* (* PI t_1) t_0)) t_2)
(/ (sin PI) t_2)))))double code(double z1, double z0) {
double t_0 = fmin(fabs(z1), fabs(z0));
double t_1 = fmax(fabs(z1), fabs(z0));
double t_2 = ((double) M_PI) * (t_0 * t_1);
double tmp;
if (t_2 <= 2e-8) {
tmp = 1.0;
} else if (t_2 <= 5e+28) {
tmp = sin(((((double) M_PI) * t_1) * t_0)) / t_2;
} else {
tmp = sin(((double) M_PI)) / t_2;
}
return tmp;
}
public static double code(double z1, double z0) {
double t_0 = fmin(Math.abs(z1), Math.abs(z0));
double t_1 = fmax(Math.abs(z1), Math.abs(z0));
double t_2 = Math.PI * (t_0 * t_1);
double tmp;
if (t_2 <= 2e-8) {
tmp = 1.0;
} else if (t_2 <= 5e+28) {
tmp = Math.sin(((Math.PI * t_1) * t_0)) / t_2;
} else {
tmp = Math.sin(Math.PI) / t_2;
}
return tmp;
}
def code(z1, z0): t_0 = fmin(math.fabs(z1), math.fabs(z0)) t_1 = fmax(math.fabs(z1), math.fabs(z0)) t_2 = math.pi * (t_0 * t_1) tmp = 0 if t_2 <= 2e-8: tmp = 1.0 elif t_2 <= 5e+28: tmp = math.sin(((math.pi * t_1) * t_0)) / t_2 else: tmp = math.sin(math.pi) / t_2 return tmp
function code(z1, z0) t_0 = fmin(abs(z1), abs(z0)) t_1 = fmax(abs(z1), abs(z0)) t_2 = Float64(pi * Float64(t_0 * t_1)) tmp = 0.0 if (t_2 <= 2e-8) tmp = 1.0; elseif (t_2 <= 5e+28) tmp = Float64(sin(Float64(Float64(pi * t_1) * t_0)) / t_2); else tmp = Float64(sin(pi) / t_2); end return tmp end
function tmp_2 = code(z1, z0) t_0 = min(abs(z1), abs(z0)); t_1 = max(abs(z1), abs(z0)); t_2 = pi * (t_0 * t_1); tmp = 0.0; if (t_2 <= 2e-8) tmp = 1.0; elseif (t_2 <= 5e+28) tmp = sin(((pi * t_1) * t_0)) / t_2; else tmp = sin(pi) / t_2; end tmp_2 = tmp; end
code[z1_, z0_] := Block[{t$95$0 = N[Min[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 2e-8], 1.0, If[LessEqual[t$95$2, 5e+28], N[(N[Sin[N[(N[(Pi * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[Sin[Pi], $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(\left|z1\right|, \left|z0\right|\right)\\
t_1 := \mathsf{max}\left(\left|z1\right|, \left|z0\right|\right)\\
t_2 := \pi \cdot \left(t\_0 \cdot t\_1\right)\\
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{-8}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{\sin \left(\left(\pi \cdot t\_1\right) \cdot t\_0\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \pi}{t\_2}\\
\end{array}
if (*.f64 (PI.f64) (*.f64 z1 z0)) < 2e-8Initial program 42.2%
Taylor expanded in z1 around 0
Applied rewrites50.9%
if 2e-8 < (*.f64 (PI.f64) (*.f64 z1 z0)) < 4.9999999999999996e28Initial program 42.2%
Taylor expanded in z1 around inf
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6441.7%
Applied rewrites41.7%
if 4.9999999999999996e28 < (*.f64 (PI.f64) (*.f64 z1 z0)) Initial program 42.2%
Taylor expanded in z1 around inf
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6442.2%
remove-double-negN/A
lift-sin.f64N/A
sin-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
sin-+PI-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lower-+.f64N/A
Applied rewrites6.1%
Taylor expanded in z1 around 0
lower-PI.f6417.0%
Applied rewrites17.0%
(FPCore (z1 z0)
:precision binary64
(let* ((t_0 (* PI (* (fabs z1) (fabs z0)))))
(if (<= t_0 2e-8)
1.0
(if (<= t_0 5e+28)
(/ (sin (* (fabs z0) (* (fabs z1) PI))) t_0)
(/ (sin PI) t_0)))))double code(double z1, double z0) {
double t_0 = ((double) M_PI) * (fabs(z1) * fabs(z0));
double tmp;
if (t_0 <= 2e-8) {
tmp = 1.0;
} else if (t_0 <= 5e+28) {
tmp = sin((fabs(z0) * (fabs(z1) * ((double) M_PI)))) / t_0;
} else {
tmp = sin(((double) M_PI)) / t_0;
}
return tmp;
}
public static double code(double z1, double z0) {
double t_0 = Math.PI * (Math.abs(z1) * Math.abs(z0));
double tmp;
if (t_0 <= 2e-8) {
tmp = 1.0;
} else if (t_0 <= 5e+28) {
tmp = Math.sin((Math.abs(z0) * (Math.abs(z1) * Math.PI))) / t_0;
} else {
tmp = Math.sin(Math.PI) / t_0;
}
return tmp;
}
def code(z1, z0): t_0 = math.pi * (math.fabs(z1) * math.fabs(z0)) tmp = 0 if t_0 <= 2e-8: tmp = 1.0 elif t_0 <= 5e+28: tmp = math.sin((math.fabs(z0) * (math.fabs(z1) * math.pi))) / t_0 else: tmp = math.sin(math.pi) / t_0 return tmp
function code(z1, z0) t_0 = Float64(pi * Float64(abs(z1) * abs(z0))) tmp = 0.0 if (t_0 <= 2e-8) tmp = 1.0; elseif (t_0 <= 5e+28) tmp = Float64(sin(Float64(abs(z0) * Float64(abs(z1) * pi))) / t_0); else tmp = Float64(sin(pi) / t_0); end return tmp end
function tmp_2 = code(z1, z0) t_0 = pi * (abs(z1) * abs(z0)); tmp = 0.0; if (t_0 <= 2e-8) tmp = 1.0; elseif (t_0 <= 5e+28) tmp = sin((abs(z0) * (abs(z1) * pi))) / t_0; else tmp = sin(pi) / t_0; end tmp_2 = tmp; end
code[z1_, z0_] := Block[{t$95$0 = N[(Pi * N[(N[Abs[z1], $MachinePrecision] * N[Abs[z0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-8], 1.0, If[LessEqual[t$95$0, 5e+28], N[(N[Sin[N[(N[Abs[z0], $MachinePrecision] * N[(N[Abs[z1], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sin[Pi], $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \pi \cdot \left(\left|z1\right| \cdot \left|z0\right|\right)\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-8}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{\sin \left(\left|z0\right| \cdot \left(\left|z1\right| \cdot \pi\right)\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \pi}{t\_0}\\
\end{array}
if (*.f64 (PI.f64) (*.f64 z1 z0)) < 2e-8Initial program 42.2%
Taylor expanded in z1 around 0
Applied rewrites50.9%
if 2e-8 < (*.f64 (PI.f64) (*.f64 z1 z0)) < 4.9999999999999996e28Initial program 42.2%
Taylor expanded in z1 around inf
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6441.7%
Applied rewrites41.7%
if 4.9999999999999996e28 < (*.f64 (PI.f64) (*.f64 z1 z0)) Initial program 42.2%
Taylor expanded in z1 around inf
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6442.2%
remove-double-negN/A
lift-sin.f64N/A
sin-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
sin-+PI-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lower-+.f64N/A
Applied rewrites6.1%
Taylor expanded in z1 around 0
lower-PI.f6417.0%
Applied rewrites17.0%
(FPCore (z1 z0) :precision binary64 (if (<= (* PI (* (fabs z1) (fabs z0))) 1e+19) 1.0 (/ (sin (- PI)) (* (fabs z0) (* (fabs z1) PI)))))
double code(double z1, double z0) {
double tmp;
if ((((double) M_PI) * (fabs(z1) * fabs(z0))) <= 1e+19) {
tmp = 1.0;
} else {
tmp = sin(-((double) M_PI)) / (fabs(z0) * (fabs(z1) * ((double) M_PI)));
}
return tmp;
}
public static double code(double z1, double z0) {
double tmp;
if ((Math.PI * (Math.abs(z1) * Math.abs(z0))) <= 1e+19) {
tmp = 1.0;
} else {
tmp = Math.sin(-Math.PI) / (Math.abs(z0) * (Math.abs(z1) * Math.PI));
}
return tmp;
}
def code(z1, z0): tmp = 0 if (math.pi * (math.fabs(z1) * math.fabs(z0))) <= 1e+19: tmp = 1.0 else: tmp = math.sin(-math.pi) / (math.fabs(z0) * (math.fabs(z1) * math.pi)) return tmp
function code(z1, z0) tmp = 0.0 if (Float64(pi * Float64(abs(z1) * abs(z0))) <= 1e+19) tmp = 1.0; else tmp = Float64(sin(Float64(-pi)) / Float64(abs(z0) * Float64(abs(z1) * pi))); end return tmp end
function tmp_2 = code(z1, z0) tmp = 0.0; if ((pi * (abs(z1) * abs(z0))) <= 1e+19) tmp = 1.0; else tmp = sin(-pi) / (abs(z0) * (abs(z1) * pi)); end tmp_2 = tmp; end
code[z1_, z0_] := If[LessEqual[N[(Pi * N[(N[Abs[z1], $MachinePrecision] * N[Abs[z0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+19], 1.0, N[(N[Sin[(-Pi)], $MachinePrecision] / N[(N[Abs[z0], $MachinePrecision] * N[(N[Abs[z1], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\pi \cdot \left(\left|z1\right| \cdot \left|z0\right|\right) \leq 10^{+19}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(-\pi\right)}{\left|z0\right| \cdot \left(\left|z1\right| \cdot \pi\right)}\\
\end{array}
if (*.f64 (PI.f64) (*.f64 z1 z0)) < 1e19Initial program 42.2%
Taylor expanded in z1 around 0
Applied rewrites50.9%
if 1e19 < (*.f64 (PI.f64) (*.f64 z1 z0)) Initial program 42.2%
remove-double-negN/A
lift-sin.f64N/A
cos-+PI/2-revN/A
sin-+PI/2-revN/A
sin-neg-revN/A
lower-sin.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
Applied rewrites6.1%
Taylor expanded in z1 around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-neg.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6417.1%
Applied rewrites17.1%
(FPCore (z1 z0) :precision binary64 (let* ((t_0 (* PI (* (fabs z1) (fabs z0))))) (if (<= t_0 4.6e+18) 1.0 (/ (sin PI) t_0))))
double code(double z1, double z0) {
double t_0 = ((double) M_PI) * (fabs(z1) * fabs(z0));
double tmp;
if (t_0 <= 4.6e+18) {
tmp = 1.0;
} else {
tmp = sin(((double) M_PI)) / t_0;
}
return tmp;
}
public static double code(double z1, double z0) {
double t_0 = Math.PI * (Math.abs(z1) * Math.abs(z0));
double tmp;
if (t_0 <= 4.6e+18) {
tmp = 1.0;
} else {
tmp = Math.sin(Math.PI) / t_0;
}
return tmp;
}
def code(z1, z0): t_0 = math.pi * (math.fabs(z1) * math.fabs(z0)) tmp = 0 if t_0 <= 4.6e+18: tmp = 1.0 else: tmp = math.sin(math.pi) / t_0 return tmp
function code(z1, z0) t_0 = Float64(pi * Float64(abs(z1) * abs(z0))) tmp = 0.0 if (t_0 <= 4.6e+18) tmp = 1.0; else tmp = Float64(sin(pi) / t_0); end return tmp end
function tmp_2 = code(z1, z0) t_0 = pi * (abs(z1) * abs(z0)); tmp = 0.0; if (t_0 <= 4.6e+18) tmp = 1.0; else tmp = sin(pi) / t_0; end tmp_2 = tmp; end
code[z1_, z0_] := Block[{t$95$0 = N[(Pi * N[(N[Abs[z1], $MachinePrecision] * N[Abs[z0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4.6e+18], 1.0, N[(N[Sin[Pi], $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
t_0 := \pi \cdot \left(\left|z1\right| \cdot \left|z0\right|\right)\\
\mathbf{if}\;t\_0 \leq 4.6 \cdot 10^{+18}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \pi}{t\_0}\\
\end{array}
if (*.f64 (PI.f64) (*.f64 z1 z0)) < 4.6e18Initial program 42.2%
Taylor expanded in z1 around 0
Applied rewrites50.9%
if 4.6e18 < (*.f64 (PI.f64) (*.f64 z1 z0)) Initial program 42.2%
Taylor expanded in z1 around inf
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6441.7%
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6442.2%
remove-double-negN/A
lift-sin.f64N/A
sin-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
sin-+PI-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lower-+.f64N/A
Applied rewrites6.1%
Taylor expanded in z1 around 0
lower-PI.f6417.0%
Applied rewrites17.0%
(FPCore (z1 z0) :precision binary64 1.0)
double code(double z1, double z0) {
return 1.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(z1, z0)
use fmin_fmax_functions
real(8), intent (in) :: z1
real(8), intent (in) :: z0
code = 1.0d0
end function
public static double code(double z1, double z0) {
return 1.0;
}
def code(z1, z0): return 1.0
function code(z1, z0) return 1.0 end
function tmp = code(z1, z0) tmp = 1.0; end
code[z1_, z0_] := 1.0
1
Initial program 42.2%
Taylor expanded in z1 around 0
Applied rewrites50.9%
herbie shell --seed 2025250
(FPCore (z1 z0)
:name "(/ (sin (* PI (* z1 z0))) (* PI (* z1 z0)))"
:precision binary64
(/ (sin (* PI (* z1 z0))) (* PI (* z1 z0))))