
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp(-im) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp(-im) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp(-im) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp(-im) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp(-im) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + e^{im}\right)
\end{array}
Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (sin re) (* (pow im 4.0) 0.041666666666666664))))
(if (<= im -1.16e+77)
t_0
(if (<= im -2400000000.0)
(log (/ -2.0 (exp re)))
(if (<= im 6.8)
(* (* 0.5 (sin re)) (+ 2.0 (* im im)))
(if (<= im 1.15e+77) (* re (+ 0.5 (* 0.5 (exp im)))) t_0))))))
double code(double re, double im) {
double t_0 = sin(re) * (pow(im, 4.0) * 0.041666666666666664);
double tmp;
if (im <= -1.16e+77) {
tmp = t_0;
} else if (im <= -2400000000.0) {
tmp = log((-2.0 / exp(re)));
} else if (im <= 6.8) {
tmp = (0.5 * sin(re)) * (2.0 + (im * im));
} else if (im <= 1.15e+77) {
tmp = re * (0.5 + (0.5 * exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = sin(re) * ((im ** 4.0d0) * 0.041666666666666664d0)
if (im <= (-1.16d+77)) then
tmp = t_0
else if (im <= (-2400000000.0d0)) then
tmp = log(((-2.0d0) / exp(re)))
else if (im <= 6.8d0) then
tmp = (0.5d0 * sin(re)) * (2.0d0 + (im * im))
else if (im <= 1.15d+77) then
tmp = re * (0.5d0 + (0.5d0 * exp(im)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.sin(re) * (Math.pow(im, 4.0) * 0.041666666666666664);
double tmp;
if (im <= -1.16e+77) {
tmp = t_0;
} else if (im <= -2400000000.0) {
tmp = Math.log((-2.0 / Math.exp(re)));
} else if (im <= 6.8) {
tmp = (0.5 * Math.sin(re)) * (2.0 + (im * im));
} else if (im <= 1.15e+77) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.sin(re) * (math.pow(im, 4.0) * 0.041666666666666664) tmp = 0 if im <= -1.16e+77: tmp = t_0 elif im <= -2400000000.0: tmp = math.log((-2.0 / math.exp(re))) elif im <= 6.8: tmp = (0.5 * math.sin(re)) * (2.0 + (im * im)) elif im <= 1.15e+77: tmp = re * (0.5 + (0.5 * math.exp(im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(sin(re) * Float64((im ^ 4.0) * 0.041666666666666664)) tmp = 0.0 if (im <= -1.16e+77) tmp = t_0; elseif (im <= -2400000000.0) tmp = log(Float64(-2.0 / exp(re))); elseif (im <= 6.8) tmp = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))); elseif (im <= 1.15e+77) tmp = Float64(re * Float64(0.5 + Float64(0.5 * exp(im)))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = sin(re) * ((im ^ 4.0) * 0.041666666666666664); tmp = 0.0; if (im <= -1.16e+77) tmp = t_0; elseif (im <= -2400000000.0) tmp = log((-2.0 / exp(re))); elseif (im <= 6.8) tmp = (0.5 * sin(re)) * (2.0 + (im * im)); elseif (im <= 1.15e+77) tmp = re * (0.5 + (0.5 * exp(im))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Sin[re], $MachinePrecision] * N[(N[Power[im, 4.0], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.16e+77], t$95$0, If[LessEqual[im, -2400000000.0], N[Log[N[(-2.0 / N[Exp[re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 6.8], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.15e+77], N[(re * N[(0.5 + N[(0.5 * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin re \cdot \left({im}^{4} \cdot 0.041666666666666664\right)\\
\mathbf{if}\;im \leq -1.16 \cdot 10^{+77}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -2400000000:\\
\;\;\;\;\log \left(\frac{-2}{e^{re}}\right)\\
\mathbf{elif}\;im \leq 6.8:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -1.1600000000000001e77 or 1.14999999999999997e77 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
unpow2100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
if -1.1600000000000001e77 < im < -2.4e9Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in re around 0 53.3%
distribute-lft-out53.3%
+-commutative53.3%
rec-exp53.3%
Simplified53.3%
Applied egg-rr46.7%
if -2.4e9 < im < 6.79999999999999982Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 97.5%
unpow297.5%
Simplified97.5%
if 6.79999999999999982 < im < 1.14999999999999997e77Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 71.4%
Final simplification94.0%
(FPCore (re im)
:precision binary64
(if (<= im -3.2e+72)
(* (sin re) (* (pow im 4.0) 0.041666666666666664))
(if (<= im -9.2e-10)
(* 0.5 (+ (/ re (exp im)) (* re (exp im))))
(* (sin re) (+ 0.5 (* 0.5 (exp im)))))))
double code(double re, double im) {
double tmp;
if (im <= -3.2e+72) {
tmp = sin(re) * (pow(im, 4.0) * 0.041666666666666664);
} else if (im <= -9.2e-10) {
tmp = 0.5 * ((re / exp(im)) + (re * exp(im)));
} else {
tmp = sin(re) * (0.5 + (0.5 * exp(im)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= (-3.2d+72)) then
tmp = sin(re) * ((im ** 4.0d0) * 0.041666666666666664d0)
else if (im <= (-9.2d-10)) then
tmp = 0.5d0 * ((re / exp(im)) + (re * exp(im)))
else
tmp = sin(re) * (0.5d0 + (0.5d0 * exp(im)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= -3.2e+72) {
tmp = Math.sin(re) * (Math.pow(im, 4.0) * 0.041666666666666664);
} else if (im <= -9.2e-10) {
tmp = 0.5 * ((re / Math.exp(im)) + (re * Math.exp(im)));
} else {
tmp = Math.sin(re) * (0.5 + (0.5 * Math.exp(im)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= -3.2e+72: tmp = math.sin(re) * (math.pow(im, 4.0) * 0.041666666666666664) elif im <= -9.2e-10: tmp = 0.5 * ((re / math.exp(im)) + (re * math.exp(im))) else: tmp = math.sin(re) * (0.5 + (0.5 * math.exp(im))) return tmp
function code(re, im) tmp = 0.0 if (im <= -3.2e+72) tmp = Float64(sin(re) * Float64((im ^ 4.0) * 0.041666666666666664)); elseif (im <= -9.2e-10) tmp = Float64(0.5 * Float64(Float64(re / exp(im)) + Float64(re * exp(im)))); else tmp = Float64(sin(re) * Float64(0.5 + Float64(0.5 * exp(im)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= -3.2e+72) tmp = sin(re) * ((im ^ 4.0) * 0.041666666666666664); elseif (im <= -9.2e-10) tmp = 0.5 * ((re / exp(im)) + (re * exp(im))); else tmp = sin(re) * (0.5 + (0.5 * exp(im))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, -3.2e+72], N[(N[Sin[re], $MachinePrecision] * N[(N[Power[im, 4.0], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, -9.2e-10], N[(0.5 * N[(N[(re / N[Exp[im], $MachinePrecision]), $MachinePrecision] + N[(re * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(0.5 + N[(0.5 * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -3.2 \cdot 10^{+72}:\\
\;\;\;\;\sin re \cdot \left({im}^{4} \cdot 0.041666666666666664\right)\\
\mathbf{elif}\;im \leq -9.2 \cdot 10^{-10}:\\
\;\;\;\;0.5 \cdot \left(\frac{re}{e^{im}} + re \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\end{array}
\end{array}
if im < -3.2000000000000001e72Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 98.4%
unpow298.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in im around inf 98.4%
*-commutative98.4%
associate-*l*98.4%
Simplified98.4%
if -3.2000000000000001e72 < im < -9.20000000000000028e-10Initial program 99.9%
distribute-lft-in99.8%
+-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
associate-*r*99.8%
distribute-rgt-in99.9%
fma-def99.9%
exp-diff99.8%
associate-*l/99.8%
exp-099.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in re around 0 58.1%
+-commutative58.1%
distribute-lft-in58.1%
*-commutative58.1%
associate-*r*58.1%
*-commutative58.1%
associate-*r*58.1%
distribute-rgt-in58.1%
fma-def58.1%
associate-*r/58.1%
*-rgt-identity58.1%
Simplified58.1%
Taylor expanded in im around inf 58.1%
if -9.20000000000000028e-10 < im Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 99.5%
fma-udef99.5%
Applied egg-rr99.5%
Final simplification96.2%
(FPCore (re im)
:precision binary64
(if (<= im -3.2e+72)
(* (sin re) (* (pow im 4.0) 0.041666666666666664))
(if (<= im -9.2e-10)
(* re (* 0.5 (+ (exp (- im)) (exp im))))
(* (sin re) (+ 0.5 (* 0.5 (exp im)))))))
double code(double re, double im) {
double tmp;
if (im <= -3.2e+72) {
tmp = sin(re) * (pow(im, 4.0) * 0.041666666666666664);
} else if (im <= -9.2e-10) {
tmp = re * (0.5 * (exp(-im) + exp(im)));
} else {
tmp = sin(re) * (0.5 + (0.5 * exp(im)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= (-3.2d+72)) then
tmp = sin(re) * ((im ** 4.0d0) * 0.041666666666666664d0)
else if (im <= (-9.2d-10)) then
tmp = re * (0.5d0 * (exp(-im) + exp(im)))
else
tmp = sin(re) * (0.5d0 + (0.5d0 * exp(im)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= -3.2e+72) {
tmp = Math.sin(re) * (Math.pow(im, 4.0) * 0.041666666666666664);
} else if (im <= -9.2e-10) {
tmp = re * (0.5 * (Math.exp(-im) + Math.exp(im)));
} else {
tmp = Math.sin(re) * (0.5 + (0.5 * Math.exp(im)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= -3.2e+72: tmp = math.sin(re) * (math.pow(im, 4.0) * 0.041666666666666664) elif im <= -9.2e-10: tmp = re * (0.5 * (math.exp(-im) + math.exp(im))) else: tmp = math.sin(re) * (0.5 + (0.5 * math.exp(im))) return tmp
function code(re, im) tmp = 0.0 if (im <= -3.2e+72) tmp = Float64(sin(re) * Float64((im ^ 4.0) * 0.041666666666666664)); elseif (im <= -9.2e-10) tmp = Float64(re * Float64(0.5 * Float64(exp(Float64(-im)) + exp(im)))); else tmp = Float64(sin(re) * Float64(0.5 + Float64(0.5 * exp(im)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= -3.2e+72) tmp = sin(re) * ((im ^ 4.0) * 0.041666666666666664); elseif (im <= -9.2e-10) tmp = re * (0.5 * (exp(-im) + exp(im))); else tmp = sin(re) * (0.5 + (0.5 * exp(im))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, -3.2e+72], N[(N[Sin[re], $MachinePrecision] * N[(N[Power[im, 4.0], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, -9.2e-10], N[(re * N[(0.5 * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(0.5 + N[(0.5 * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -3.2 \cdot 10^{+72}:\\
\;\;\;\;\sin re \cdot \left({im}^{4} \cdot 0.041666666666666664\right)\\
\mathbf{elif}\;im \leq -9.2 \cdot 10^{-10}:\\
\;\;\;\;re \cdot \left(0.5 \cdot \left(e^{-im} + e^{im}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\end{array}
\end{array}
if im < -3.2000000000000001e72Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 98.4%
unpow298.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in im around inf 98.4%
*-commutative98.4%
associate-*l*98.4%
Simplified98.4%
if -3.2000000000000001e72 < im < -9.20000000000000028e-10Initial program 99.9%
distribute-lft-in99.8%
+-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
associate-*r*99.8%
distribute-rgt-in99.9%
fma-def99.9%
exp-diff99.8%
associate-*l/99.8%
exp-099.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in re around 0 58.1%
distribute-lft-out58.1%
+-commutative58.1%
rec-exp58.1%
Simplified58.1%
if -9.20000000000000028e-10 < im Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 99.5%
fma-udef99.5%
Applied egg-rr99.5%
Final simplification96.2%
(FPCore (re im)
:precision binary64
(if (<= im -7.2e+76)
(* (sin re) (* (pow im 4.0) 0.041666666666666664))
(if (<= im -2400000000.0)
(log (/ -2.0 (exp re)))
(* (sin re) (+ 0.5 (* 0.5 (exp im)))))))
double code(double re, double im) {
double tmp;
if (im <= -7.2e+76) {
tmp = sin(re) * (pow(im, 4.0) * 0.041666666666666664);
} else if (im <= -2400000000.0) {
tmp = log((-2.0 / exp(re)));
} else {
tmp = sin(re) * (0.5 + (0.5 * exp(im)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= (-7.2d+76)) then
tmp = sin(re) * ((im ** 4.0d0) * 0.041666666666666664d0)
else if (im <= (-2400000000.0d0)) then
tmp = log(((-2.0d0) / exp(re)))
else
tmp = sin(re) * (0.5d0 + (0.5d0 * exp(im)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= -7.2e+76) {
tmp = Math.sin(re) * (Math.pow(im, 4.0) * 0.041666666666666664);
} else if (im <= -2400000000.0) {
tmp = Math.log((-2.0 / Math.exp(re)));
} else {
tmp = Math.sin(re) * (0.5 + (0.5 * Math.exp(im)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= -7.2e+76: tmp = math.sin(re) * (math.pow(im, 4.0) * 0.041666666666666664) elif im <= -2400000000.0: tmp = math.log((-2.0 / math.exp(re))) else: tmp = math.sin(re) * (0.5 + (0.5 * math.exp(im))) return tmp
function code(re, im) tmp = 0.0 if (im <= -7.2e+76) tmp = Float64(sin(re) * Float64((im ^ 4.0) * 0.041666666666666664)); elseif (im <= -2400000000.0) tmp = log(Float64(-2.0 / exp(re))); else tmp = Float64(sin(re) * Float64(0.5 + Float64(0.5 * exp(im)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= -7.2e+76) tmp = sin(re) * ((im ^ 4.0) * 0.041666666666666664); elseif (im <= -2400000000.0) tmp = log((-2.0 / exp(re))); else tmp = sin(re) * (0.5 + (0.5 * exp(im))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, -7.2e+76], N[(N[Sin[re], $MachinePrecision] * N[(N[Power[im, 4.0], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, -2400000000.0], N[Log[N[(-2.0 / N[Exp[re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(0.5 + N[(0.5 * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -7.2 \cdot 10^{+76}:\\
\;\;\;\;\sin re \cdot \left({im}^{4} \cdot 0.041666666666666664\right)\\
\mathbf{elif}\;im \leq -2400000000:\\
\;\;\;\;\log \left(\frac{-2}{e^{re}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\end{array}
\end{array}
if im < -7.2000000000000006e76Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
unpow2100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
if -7.2000000000000006e76 < im < -2.4e9Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in re around 0 53.3%
distribute-lft-out53.3%
+-commutative53.3%
rec-exp53.3%
Simplified53.3%
Applied egg-rr46.7%
if -2.4e9 < im Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 97.5%
fma-udef97.5%
Applied egg-rr97.5%
Final simplification95.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 2.0 (* im im)))
(t_1 (* 0.5 (sin re)))
(t_2 (* t_1 (* im im)))
(t_3
(*
t_1
(/ (- (* t_0 t_0) 1.1736111111111112) (- t_0 1.0833333333333333)))))
(if (<= im -1.35e+154)
t_2
(if (<= im -9e+76)
t_3
(if (<= im -2400000000.0)
(log (/ -2.0 (exp re)))
(if (<= im 7.0)
(* t_1 t_0)
(if (<= im 1.15e+77)
(* re (+ 0.5 (* 0.5 (exp im))))
(if (<= im 1.35e+154) t_3 t_2))))))))
double code(double re, double im) {
double t_0 = 2.0 + (im * im);
double t_1 = 0.5 * sin(re);
double t_2 = t_1 * (im * im);
double t_3 = t_1 * (((t_0 * t_0) - 1.1736111111111112) / (t_0 - 1.0833333333333333));
double tmp;
if (im <= -1.35e+154) {
tmp = t_2;
} else if (im <= -9e+76) {
tmp = t_3;
} else if (im <= -2400000000.0) {
tmp = log((-2.0 / exp(re)));
} else if (im <= 7.0) {
tmp = t_1 * t_0;
} else if (im <= 1.15e+77) {
tmp = re * (0.5 + (0.5 * exp(im)));
} else if (im <= 1.35e+154) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = 2.0d0 + (im * im)
t_1 = 0.5d0 * sin(re)
t_2 = t_1 * (im * im)
t_3 = t_1 * (((t_0 * t_0) - 1.1736111111111112d0) / (t_0 - 1.0833333333333333d0))
if (im <= (-1.35d+154)) then
tmp = t_2
else if (im <= (-9d+76)) then
tmp = t_3
else if (im <= (-2400000000.0d0)) then
tmp = log(((-2.0d0) / exp(re)))
else if (im <= 7.0d0) then
tmp = t_1 * t_0
else if (im <= 1.15d+77) then
tmp = re * (0.5d0 + (0.5d0 * exp(im)))
else if (im <= 1.35d+154) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 2.0 + (im * im);
double t_1 = 0.5 * Math.sin(re);
double t_2 = t_1 * (im * im);
double t_3 = t_1 * (((t_0 * t_0) - 1.1736111111111112) / (t_0 - 1.0833333333333333));
double tmp;
if (im <= -1.35e+154) {
tmp = t_2;
} else if (im <= -9e+76) {
tmp = t_3;
} else if (im <= -2400000000.0) {
tmp = Math.log((-2.0 / Math.exp(re)));
} else if (im <= 7.0) {
tmp = t_1 * t_0;
} else if (im <= 1.15e+77) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else if (im <= 1.35e+154) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(re, im): t_0 = 2.0 + (im * im) t_1 = 0.5 * math.sin(re) t_2 = t_1 * (im * im) t_3 = t_1 * (((t_0 * t_0) - 1.1736111111111112) / (t_0 - 1.0833333333333333)) tmp = 0 if im <= -1.35e+154: tmp = t_2 elif im <= -9e+76: tmp = t_3 elif im <= -2400000000.0: tmp = math.log((-2.0 / math.exp(re))) elif im <= 7.0: tmp = t_1 * t_0 elif im <= 1.15e+77: tmp = re * (0.5 + (0.5 * math.exp(im))) elif im <= 1.35e+154: tmp = t_3 else: tmp = t_2 return tmp
function code(re, im) t_0 = Float64(2.0 + Float64(im * im)) t_1 = Float64(0.5 * sin(re)) t_2 = Float64(t_1 * Float64(im * im)) t_3 = Float64(t_1 * Float64(Float64(Float64(t_0 * t_0) - 1.1736111111111112) / Float64(t_0 - 1.0833333333333333))) tmp = 0.0 if (im <= -1.35e+154) tmp = t_2; elseif (im <= -9e+76) tmp = t_3; elseif (im <= -2400000000.0) tmp = log(Float64(-2.0 / exp(re))); elseif (im <= 7.0) tmp = Float64(t_1 * t_0); elseif (im <= 1.15e+77) tmp = Float64(re * Float64(0.5 + Float64(0.5 * exp(im)))); elseif (im <= 1.35e+154) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(re, im) t_0 = 2.0 + (im * im); t_1 = 0.5 * sin(re); t_2 = t_1 * (im * im); t_3 = t_1 * (((t_0 * t_0) - 1.1736111111111112) / (t_0 - 1.0833333333333333)); tmp = 0.0; if (im <= -1.35e+154) tmp = t_2; elseif (im <= -9e+76) tmp = t_3; elseif (im <= -2400000000.0) tmp = log((-2.0 / exp(re))); elseif (im <= 7.0) tmp = t_1 * t_0; elseif (im <= 1.15e+77) tmp = re * (0.5 + (0.5 * exp(im))); elseif (im <= 1.35e+154) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] - 1.1736111111111112), $MachinePrecision] / N[(t$95$0 - 1.0833333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.35e+154], t$95$2, If[LessEqual[im, -9e+76], t$95$3, If[LessEqual[im, -2400000000.0], N[Log[N[(-2.0 / N[Exp[re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 7.0], N[(t$95$1 * t$95$0), $MachinePrecision], If[LessEqual[im, 1.15e+77], N[(re * N[(0.5 + N[(0.5 * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + im \cdot im\\
t_1 := 0.5 \cdot \sin re\\
t_2 := t_1 \cdot \left(im \cdot im\right)\\
t_3 := t_1 \cdot \frac{t_0 \cdot t_0 - 1.1736111111111112}{t_0 - 1.0833333333333333}\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;im \leq -9 \cdot 10^{+76}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;im \leq -2400000000:\\
\;\;\;\;\log \left(\frac{-2}{e^{re}}\right)\\
\mathbf{elif}\;im \leq 7:\\
\;\;\;\;t_1 \cdot t_0\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if im < -1.35000000000000003e154 or 1.35000000000000003e154 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
if -1.35000000000000003e154 < im < -8.9999999999999995e76 or 1.14999999999999997e77 < im < 1.35000000000000003e154Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
unpow2100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr5.4%
associate-+r+5.4%
flip-+100.0%
metadata-eval100.0%
Applied egg-rr100.0%
if -8.9999999999999995e76 < im < -2.4e9Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in re around 0 53.3%
distribute-lft-out53.3%
+-commutative53.3%
rec-exp53.3%
Simplified53.3%
Applied egg-rr46.7%
if -2.4e9 < im < 7Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 97.5%
unpow297.5%
Simplified97.5%
if 7 < im < 1.14999999999999997e77Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 71.4%
Final simplification94.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 2.0 (* im im)))
(t_1 (* 0.5 (sin re)))
(t_2 (* t_1 (* im im)))
(t_3
(*
t_1
(/ (- (* t_0 t_0) 1.1736111111111112) (- t_0 1.0833333333333333)))))
(if (<= im -1.35e+154)
t_2
(if (<= im -1.55)
t_3
(if (<= im 6.8)
(* t_1 t_0)
(if (<= im 1.15e+77)
(* re (+ 0.5 (* 0.5 (exp im))))
(if (<= im 1.35e+154) t_3 t_2)))))))
double code(double re, double im) {
double t_0 = 2.0 + (im * im);
double t_1 = 0.5 * sin(re);
double t_2 = t_1 * (im * im);
double t_3 = t_1 * (((t_0 * t_0) - 1.1736111111111112) / (t_0 - 1.0833333333333333));
double tmp;
if (im <= -1.35e+154) {
tmp = t_2;
} else if (im <= -1.55) {
tmp = t_3;
} else if (im <= 6.8) {
tmp = t_1 * t_0;
} else if (im <= 1.15e+77) {
tmp = re * (0.5 + (0.5 * exp(im)));
} else if (im <= 1.35e+154) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = 2.0d0 + (im * im)
t_1 = 0.5d0 * sin(re)
t_2 = t_1 * (im * im)
t_3 = t_1 * (((t_0 * t_0) - 1.1736111111111112d0) / (t_0 - 1.0833333333333333d0))
if (im <= (-1.35d+154)) then
tmp = t_2
else if (im <= (-1.55d0)) then
tmp = t_3
else if (im <= 6.8d0) then
tmp = t_1 * t_0
else if (im <= 1.15d+77) then
tmp = re * (0.5d0 + (0.5d0 * exp(im)))
else if (im <= 1.35d+154) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 2.0 + (im * im);
double t_1 = 0.5 * Math.sin(re);
double t_2 = t_1 * (im * im);
double t_3 = t_1 * (((t_0 * t_0) - 1.1736111111111112) / (t_0 - 1.0833333333333333));
double tmp;
if (im <= -1.35e+154) {
tmp = t_2;
} else if (im <= -1.55) {
tmp = t_3;
} else if (im <= 6.8) {
tmp = t_1 * t_0;
} else if (im <= 1.15e+77) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else if (im <= 1.35e+154) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(re, im): t_0 = 2.0 + (im * im) t_1 = 0.5 * math.sin(re) t_2 = t_1 * (im * im) t_3 = t_1 * (((t_0 * t_0) - 1.1736111111111112) / (t_0 - 1.0833333333333333)) tmp = 0 if im <= -1.35e+154: tmp = t_2 elif im <= -1.55: tmp = t_3 elif im <= 6.8: tmp = t_1 * t_0 elif im <= 1.15e+77: tmp = re * (0.5 + (0.5 * math.exp(im))) elif im <= 1.35e+154: tmp = t_3 else: tmp = t_2 return tmp
function code(re, im) t_0 = Float64(2.0 + Float64(im * im)) t_1 = Float64(0.5 * sin(re)) t_2 = Float64(t_1 * Float64(im * im)) t_3 = Float64(t_1 * Float64(Float64(Float64(t_0 * t_0) - 1.1736111111111112) / Float64(t_0 - 1.0833333333333333))) tmp = 0.0 if (im <= -1.35e+154) tmp = t_2; elseif (im <= -1.55) tmp = t_3; elseif (im <= 6.8) tmp = Float64(t_1 * t_0); elseif (im <= 1.15e+77) tmp = Float64(re * Float64(0.5 + Float64(0.5 * exp(im)))); elseif (im <= 1.35e+154) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(re, im) t_0 = 2.0 + (im * im); t_1 = 0.5 * sin(re); t_2 = t_1 * (im * im); t_3 = t_1 * (((t_0 * t_0) - 1.1736111111111112) / (t_0 - 1.0833333333333333)); tmp = 0.0; if (im <= -1.35e+154) tmp = t_2; elseif (im <= -1.55) tmp = t_3; elseif (im <= 6.8) tmp = t_1 * t_0; elseif (im <= 1.15e+77) tmp = re * (0.5 + (0.5 * exp(im))); elseif (im <= 1.35e+154) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] - 1.1736111111111112), $MachinePrecision] / N[(t$95$0 - 1.0833333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.35e+154], t$95$2, If[LessEqual[im, -1.55], t$95$3, If[LessEqual[im, 6.8], N[(t$95$1 * t$95$0), $MachinePrecision], If[LessEqual[im, 1.15e+77], N[(re * N[(0.5 + N[(0.5 * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + im \cdot im\\
t_1 := 0.5 \cdot \sin re\\
t_2 := t_1 \cdot \left(im \cdot im\right)\\
t_3 := t_1 \cdot \frac{t_0 \cdot t_0 - 1.1736111111111112}{t_0 - 1.0833333333333333}\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;im \leq -1.55:\\
\;\;\;\;t_3\\
\mathbf{elif}\;im \leq 6.8:\\
\;\;\;\;t_1 \cdot t_0\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if im < -1.35000000000000003e154 or 1.35000000000000003e154 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
if -1.35000000000000003e154 < im < -1.55000000000000004 or 1.14999999999999997e77 < im < 1.35000000000000003e154Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 67.7%
unpow267.7%
*-commutative67.7%
Simplified67.7%
Applied egg-rr4.9%
associate-+r+4.9%
flip-+67.4%
metadata-eval67.4%
Applied egg-rr67.4%
if -1.55000000000000004 < im < 6.79999999999999982Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 99.6%
unpow299.6%
Simplified99.6%
if 6.79999999999999982 < im < 1.14999999999999997e77Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 71.4%
Final simplification91.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (sin re))) (t_1 (* t_0 (* im im))))
(if (<= im -1.35e+154)
t_1
(if (<= im -1.3e+95)
(/ (* (* 0.5 re) (- 4.0 (pow im 4.0))) (- 2.0 (* im im)))
(if (<= im 5.6)
(* t_0 (+ 2.0 (* im im)))
(if (<= im 1.35e+154) (* re (+ 0.5 (* 0.5 (exp im)))) t_1))))))
double code(double re, double im) {
double t_0 = 0.5 * sin(re);
double t_1 = t_0 * (im * im);
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -1.3e+95) {
tmp = ((0.5 * re) * (4.0 - pow(im, 4.0))) / (2.0 - (im * im));
} else if (im <= 5.6) {
tmp = t_0 * (2.0 + (im * im));
} else if (im <= 1.35e+154) {
tmp = re * (0.5 + (0.5 * exp(im)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.5d0 * sin(re)
t_1 = t_0 * (im * im)
if (im <= (-1.35d+154)) then
tmp = t_1
else if (im <= (-1.3d+95)) then
tmp = ((0.5d0 * re) * (4.0d0 - (im ** 4.0d0))) / (2.0d0 - (im * im))
else if (im <= 5.6d0) then
tmp = t_0 * (2.0d0 + (im * im))
else if (im <= 1.35d+154) then
tmp = re * (0.5d0 + (0.5d0 * exp(im)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 * Math.sin(re);
double t_1 = t_0 * (im * im);
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -1.3e+95) {
tmp = ((0.5 * re) * (4.0 - Math.pow(im, 4.0))) / (2.0 - (im * im));
} else if (im <= 5.6) {
tmp = t_0 * (2.0 + (im * im));
} else if (im <= 1.35e+154) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 0.5 * math.sin(re) t_1 = t_0 * (im * im) tmp = 0 if im <= -1.35e+154: tmp = t_1 elif im <= -1.3e+95: tmp = ((0.5 * re) * (4.0 - math.pow(im, 4.0))) / (2.0 - (im * im)) elif im <= 5.6: tmp = t_0 * (2.0 + (im * im)) elif im <= 1.35e+154: tmp = re * (0.5 + (0.5 * math.exp(im))) else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(0.5 * sin(re)) t_1 = Float64(t_0 * Float64(im * im)) tmp = 0.0 if (im <= -1.35e+154) tmp = t_1; elseif (im <= -1.3e+95) tmp = Float64(Float64(Float64(0.5 * re) * Float64(4.0 - (im ^ 4.0))) / Float64(2.0 - Float64(im * im))); elseif (im <= 5.6) tmp = Float64(t_0 * Float64(2.0 + Float64(im * im))); elseif (im <= 1.35e+154) tmp = Float64(re * Float64(0.5 + Float64(0.5 * exp(im)))); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * sin(re); t_1 = t_0 * (im * im); tmp = 0.0; if (im <= -1.35e+154) tmp = t_1; elseif (im <= -1.3e+95) tmp = ((0.5 * re) * (4.0 - (im ^ 4.0))) / (2.0 - (im * im)); elseif (im <= 5.6) tmp = t_0 * (2.0 + (im * im)); elseif (im <= 1.35e+154) tmp = re * (0.5 + (0.5 * exp(im))); else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.35e+154], t$95$1, If[LessEqual[im, -1.3e+95], N[(N[(N[(0.5 * re), $MachinePrecision] * N[(4.0 - N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5.6], N[(t$95$0 * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(re * N[(0.5 + N[(0.5 * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \sin re\\
t_1 := t_0 \cdot \left(im \cdot im\right)\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -1.3 \cdot 10^{+95}:\\
\;\;\;\;\frac{\left(0.5 \cdot re\right) \cdot \left(4 - {im}^{4}\right)}{2 - im \cdot im}\\
\mathbf{elif}\;im \leq 5.6:\\
\;\;\;\;t_0 \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.35000000000000003e154 or 1.35000000000000003e154 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
if -1.35000000000000003e154 < im < -1.29999999999999995e95Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in re around 0 64.3%
distribute-lft-out64.3%
+-commutative64.3%
rec-exp64.3%
Simplified64.3%
Taylor expanded in im around 0 10.2%
unpow210.2%
Simplified10.2%
associate-*r*10.2%
flip-+64.3%
associate-*r/64.3%
metadata-eval64.3%
pow264.3%
pow264.3%
pow-prod-up64.3%
metadata-eval64.3%
Applied egg-rr64.3%
if -1.29999999999999995e95 < im < 5.5999999999999996Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 86.6%
unpow286.6%
Simplified86.6%
if 5.5999999999999996 < im < 1.35000000000000003e154Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 69.7%
Final simplification86.5%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* 0.5 (sin re)) (* im im)))
(t_1
(+
8874444426961748000.0
(+
(/ 26623333280885244000.0 (* re re))
(* (* re re) 1774888885392349700.0)))))
(if (<= im -1.35e+154)
t_0
(if (<= im -2300000000000.0)
t_1
(if (<= im 3e+56) (sin re) (if (<= im 2.3e+139) t_1 t_0))))))
double code(double re, double im) {
double t_0 = (0.5 * sin(re)) * (im * im);
double t_1 = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0));
double tmp;
if (im <= -1.35e+154) {
tmp = t_0;
} else if (im <= -2300000000000.0) {
tmp = t_1;
} else if (im <= 3e+56) {
tmp = sin(re);
} else if (im <= 2.3e+139) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (0.5d0 * sin(re)) * (im * im)
t_1 = 8874444426961748000.0d0 + ((26623333280885244000.0d0 / (re * re)) + ((re * re) * 1774888885392349700.0d0))
if (im <= (-1.35d+154)) then
tmp = t_0
else if (im <= (-2300000000000.0d0)) then
tmp = t_1
else if (im <= 3d+56) then
tmp = sin(re)
else if (im <= 2.3d+139) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (0.5 * Math.sin(re)) * (im * im);
double t_1 = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0));
double tmp;
if (im <= -1.35e+154) {
tmp = t_0;
} else if (im <= -2300000000000.0) {
tmp = t_1;
} else if (im <= 3e+56) {
tmp = Math.sin(re);
} else if (im <= 2.3e+139) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (0.5 * math.sin(re)) * (im * im) t_1 = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0)) tmp = 0 if im <= -1.35e+154: tmp = t_0 elif im <= -2300000000000.0: tmp = t_1 elif im <= 3e+56: tmp = math.sin(re) elif im <= 2.3e+139: tmp = t_1 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(0.5 * sin(re)) * Float64(im * im)) t_1 = Float64(8874444426961748000.0 + Float64(Float64(26623333280885244000.0 / Float64(re * re)) + Float64(Float64(re * re) * 1774888885392349700.0))) tmp = 0.0 if (im <= -1.35e+154) tmp = t_0; elseif (im <= -2300000000000.0) tmp = t_1; elseif (im <= 3e+56) tmp = sin(re); elseif (im <= 2.3e+139) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (0.5 * sin(re)) * (im * im); t_1 = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0)); tmp = 0.0; if (im <= -1.35e+154) tmp = t_0; elseif (im <= -2300000000000.0) tmp = t_1; elseif (im <= 3e+56) tmp = sin(re); elseif (im <= 2.3e+139) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(8874444426961748000.0 + N[(N[(26623333280885244000.0 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 1774888885392349700.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.35e+154], t$95$0, If[LessEqual[im, -2300000000000.0], t$95$1, If[LessEqual[im, 3e+56], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.3e+139], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\
t_1 := 8874444426961748000 + \left(\frac{26623333280885244000}{re \cdot re} + \left(re \cdot re\right) \cdot 1774888885392349700\right)\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -2300000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 3 \cdot 10^{+56}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.3 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -1.35000000000000003e154 or 2.3e139 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 97.2%
unpow297.2%
Simplified97.2%
Taylor expanded in im around inf 97.2%
associate-*r*97.2%
*-commutative97.2%
unpow297.2%
Simplified97.2%
if -1.35000000000000003e154 < im < -2.3e12 or 3.00000000000000006e56 < im < 2.3e139Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.3%
unpow266.3%
*-commutative66.3%
Simplified66.3%
Applied egg-rr16.9%
Taylor expanded in re around 0 24.6%
associate-*r/24.6%
metadata-eval24.6%
unpow224.6%
*-commutative24.6%
unpow224.6%
Simplified24.6%
if -2.3e12 < im < 3.00000000000000006e56Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 90.0%
Final simplification78.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* 0.5 (sin re)) (* im im))))
(if (<= im -1.35e+154)
t_0
(if (<= im -2300000000000.0)
(+
8874444426961748000.0
(+
(/ 26623333280885244000.0 (* re re))
(* (* re re) 1774888885392349700.0)))
(if (<= im 3.8)
(sin re)
(if (<= im 1.35e+154) (* re (+ 0.5 (* 0.5 (exp im)))) t_0))))))
double code(double re, double im) {
double t_0 = (0.5 * sin(re)) * (im * im);
double tmp;
if (im <= -1.35e+154) {
tmp = t_0;
} else if (im <= -2300000000000.0) {
tmp = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0));
} else if (im <= 3.8) {
tmp = sin(re);
} else if (im <= 1.35e+154) {
tmp = re * (0.5 + (0.5 * exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (0.5d0 * sin(re)) * (im * im)
if (im <= (-1.35d+154)) then
tmp = t_0
else if (im <= (-2300000000000.0d0)) then
tmp = 8874444426961748000.0d0 + ((26623333280885244000.0d0 / (re * re)) + ((re * re) * 1774888885392349700.0d0))
else if (im <= 3.8d0) then
tmp = sin(re)
else if (im <= 1.35d+154) then
tmp = re * (0.5d0 + (0.5d0 * exp(im)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (0.5 * Math.sin(re)) * (im * im);
double tmp;
if (im <= -1.35e+154) {
tmp = t_0;
} else if (im <= -2300000000000.0) {
tmp = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0));
} else if (im <= 3.8) {
tmp = Math.sin(re);
} else if (im <= 1.35e+154) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (0.5 * math.sin(re)) * (im * im) tmp = 0 if im <= -1.35e+154: tmp = t_0 elif im <= -2300000000000.0: tmp = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0)) elif im <= 3.8: tmp = math.sin(re) elif im <= 1.35e+154: tmp = re * (0.5 + (0.5 * math.exp(im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(0.5 * sin(re)) * Float64(im * im)) tmp = 0.0 if (im <= -1.35e+154) tmp = t_0; elseif (im <= -2300000000000.0) tmp = Float64(8874444426961748000.0 + Float64(Float64(26623333280885244000.0 / Float64(re * re)) + Float64(Float64(re * re) * 1774888885392349700.0))); elseif (im <= 3.8) tmp = sin(re); elseif (im <= 1.35e+154) tmp = Float64(re * Float64(0.5 + Float64(0.5 * exp(im)))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (0.5 * sin(re)) * (im * im); tmp = 0.0; if (im <= -1.35e+154) tmp = t_0; elseif (im <= -2300000000000.0) tmp = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0)); elseif (im <= 3.8) tmp = sin(re); elseif (im <= 1.35e+154) tmp = re * (0.5 + (0.5 * exp(im))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.35e+154], t$95$0, If[LessEqual[im, -2300000000000.0], N[(8874444426961748000.0 + N[(N[(26623333280885244000.0 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 1774888885392349700.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.8], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(re * N[(0.5 + N[(0.5 * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -2300000000000:\\
\;\;\;\;8874444426961748000 + \left(\frac{26623333280885244000}{re \cdot re} + \left(re \cdot re\right) \cdot 1774888885392349700\right)\\
\mathbf{elif}\;im \leq 3.8:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -1.35000000000000003e154 or 1.35000000000000003e154 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
if -1.35000000000000003e154 < im < -2.3e12Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 55.3%
unpow255.3%
*-commutative55.3%
Simplified55.3%
Applied egg-rr14.4%
Taylor expanded in re around 0 21.2%
associate-*r/21.2%
metadata-eval21.2%
unpow221.2%
*-commutative21.2%
unpow221.2%
Simplified21.2%
if -2.3e12 < im < 3.7999999999999998Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 96.6%
if 3.7999999999999998 < im < 1.35000000000000003e154Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 69.7%
Final simplification85.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (sin re))) (t_1 (* t_0 (* im im))))
(if (<= im -1.35e+154)
t_1
(if (<= im -2300000000000.0)
(+
8874444426961748000.0
(+
(/ 26623333280885244000.0 (* re re))
(* (* re re) 1774888885392349700.0)))
(if (<= im 7.4)
(* t_0 (+ 2.0 (* im im)))
(if (<= im 1.35e+154) (* re (+ 0.5 (* 0.5 (exp im)))) t_1))))))
double code(double re, double im) {
double t_0 = 0.5 * sin(re);
double t_1 = t_0 * (im * im);
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -2300000000000.0) {
tmp = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0));
} else if (im <= 7.4) {
tmp = t_0 * (2.0 + (im * im));
} else if (im <= 1.35e+154) {
tmp = re * (0.5 + (0.5 * exp(im)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.5d0 * sin(re)
t_1 = t_0 * (im * im)
if (im <= (-1.35d+154)) then
tmp = t_1
else if (im <= (-2300000000000.0d0)) then
tmp = 8874444426961748000.0d0 + ((26623333280885244000.0d0 / (re * re)) + ((re * re) * 1774888885392349700.0d0))
else if (im <= 7.4d0) then
tmp = t_0 * (2.0d0 + (im * im))
else if (im <= 1.35d+154) then
tmp = re * (0.5d0 + (0.5d0 * exp(im)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 * Math.sin(re);
double t_1 = t_0 * (im * im);
double tmp;
if (im <= -1.35e+154) {
tmp = t_1;
} else if (im <= -2300000000000.0) {
tmp = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0));
} else if (im <= 7.4) {
tmp = t_0 * (2.0 + (im * im));
} else if (im <= 1.35e+154) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 0.5 * math.sin(re) t_1 = t_0 * (im * im) tmp = 0 if im <= -1.35e+154: tmp = t_1 elif im <= -2300000000000.0: tmp = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0)) elif im <= 7.4: tmp = t_0 * (2.0 + (im * im)) elif im <= 1.35e+154: tmp = re * (0.5 + (0.5 * math.exp(im))) else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(0.5 * sin(re)) t_1 = Float64(t_0 * Float64(im * im)) tmp = 0.0 if (im <= -1.35e+154) tmp = t_1; elseif (im <= -2300000000000.0) tmp = Float64(8874444426961748000.0 + Float64(Float64(26623333280885244000.0 / Float64(re * re)) + Float64(Float64(re * re) * 1774888885392349700.0))); elseif (im <= 7.4) tmp = Float64(t_0 * Float64(2.0 + Float64(im * im))); elseif (im <= 1.35e+154) tmp = Float64(re * Float64(0.5 + Float64(0.5 * exp(im)))); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * sin(re); t_1 = t_0 * (im * im); tmp = 0.0; if (im <= -1.35e+154) tmp = t_1; elseif (im <= -2300000000000.0) tmp = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0)); elseif (im <= 7.4) tmp = t_0 * (2.0 + (im * im)); elseif (im <= 1.35e+154) tmp = re * (0.5 + (0.5 * exp(im))); else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.35e+154], t$95$1, If[LessEqual[im, -2300000000000.0], N[(8874444426961748000.0 + N[(N[(26623333280885244000.0 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 1774888885392349700.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.4], N[(t$95$0 * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(re * N[(0.5 + N[(0.5 * N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \sin re\\
t_1 := t_0 \cdot \left(im \cdot im\right)\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -2300000000000:\\
\;\;\;\;8874444426961748000 + \left(\frac{26623333280885244000}{re \cdot re} + \left(re \cdot re\right) \cdot 1774888885392349700\right)\\
\mathbf{elif}\;im \leq 7.4:\\
\;\;\;\;t_0 \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < -1.35000000000000003e154 or 1.35000000000000003e154 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
if -1.35000000000000003e154 < im < -2.3e12Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 55.3%
unpow255.3%
*-commutative55.3%
Simplified55.3%
Applied egg-rr14.4%
Taylor expanded in re around 0 21.2%
associate-*r/21.2%
metadata-eval21.2%
unpow221.2%
*-commutative21.2%
unpow221.2%
Simplified21.2%
if -2.3e12 < im < 7.4000000000000004Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 96.8%
unpow296.8%
Simplified96.8%
if 7.4000000000000004 < im < 1.35000000000000003e154Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 69.7%
Final simplification85.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (* re (* im im))))
(t_1
(+
8874444426961748000.0
(+
(/ 26623333280885244000.0 (* re re))
(* (* re re) 1774888885392349700.0)))))
(if (<= im -8.2e+152)
t_0
(if (<= im -2300000000000.0)
t_1
(if (<= im 3e+56) (sin re) (if (<= im 2.3e+138) t_1 t_0))))))
double code(double re, double im) {
double t_0 = 0.5 * (re * (im * im));
double t_1 = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0));
double tmp;
if (im <= -8.2e+152) {
tmp = t_0;
} else if (im <= -2300000000000.0) {
tmp = t_1;
} else if (im <= 3e+56) {
tmp = sin(re);
} else if (im <= 2.3e+138) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.5d0 * (re * (im * im))
t_1 = 8874444426961748000.0d0 + ((26623333280885244000.0d0 / (re * re)) + ((re * re) * 1774888885392349700.0d0))
if (im <= (-8.2d+152)) then
tmp = t_0
else if (im <= (-2300000000000.0d0)) then
tmp = t_1
else if (im <= 3d+56) then
tmp = sin(re)
else if (im <= 2.3d+138) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 * (re * (im * im));
double t_1 = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0));
double tmp;
if (im <= -8.2e+152) {
tmp = t_0;
} else if (im <= -2300000000000.0) {
tmp = t_1;
} else if (im <= 3e+56) {
tmp = Math.sin(re);
} else if (im <= 2.3e+138) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = 0.5 * (re * (im * im)) t_1 = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0)) tmp = 0 if im <= -8.2e+152: tmp = t_0 elif im <= -2300000000000.0: tmp = t_1 elif im <= 3e+56: tmp = math.sin(re) elif im <= 2.3e+138: tmp = t_1 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(0.5 * Float64(re * Float64(im * im))) t_1 = Float64(8874444426961748000.0 + Float64(Float64(26623333280885244000.0 / Float64(re * re)) + Float64(Float64(re * re) * 1774888885392349700.0))) tmp = 0.0 if (im <= -8.2e+152) tmp = t_0; elseif (im <= -2300000000000.0) tmp = t_1; elseif (im <= 3e+56) tmp = sin(re); elseif (im <= 2.3e+138) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * (re * (im * im)); t_1 = 8874444426961748000.0 + ((26623333280885244000.0 / (re * re)) + ((re * re) * 1774888885392349700.0)); tmp = 0.0; if (im <= -8.2e+152) tmp = t_0; elseif (im <= -2300000000000.0) tmp = t_1; elseif (im <= 3e+56) tmp = sin(re); elseif (im <= 2.3e+138) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(8874444426961748000.0 + N[(N[(26623333280885244000.0 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 1774888885392349700.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -8.2e+152], t$95$0, If[LessEqual[im, -2300000000000.0], t$95$1, If[LessEqual[im, 3e+56], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.3e+138], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
t_1 := 8874444426961748000 + \left(\frac{26623333280885244000}{re \cdot re} + \left(re \cdot re\right) \cdot 1774888885392349700\right)\\
\mathbf{if}\;im \leq -8.2 \cdot 10^{+152}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -2300000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 3 \cdot 10^{+56}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.3 \cdot 10^{+138}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -8.1999999999999996e152 or 2.30000000000000008e138 < im Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in re around 0 75.0%
distribute-lft-out75.0%
+-commutative75.0%
rec-exp75.0%
Simplified75.0%
Taylor expanded in im around 0 75.0%
unpow275.0%
Simplified75.0%
Taylor expanded in im around inf 75.0%
unpow275.0%
Simplified75.0%
if -8.1999999999999996e152 < im < -2.3e12 or 3.00000000000000006e56 < im < 2.30000000000000008e138Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.3%
unpow266.3%
*-commutative66.3%
Simplified66.3%
Applied egg-rr16.9%
Taylor expanded in re around 0 24.6%
associate-*r/24.6%
metadata-eval24.6%
unpow224.6%
*-commutative24.6%
unpow224.6%
Simplified24.6%
if -2.3e12 < im < 3.00000000000000006e56Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in im around 0 90.0%
Final simplification73.2%
(FPCore (re im) :precision binary64 (if (or (<= im -19.5) (not (<= im 1.45))) (* 0.5 (* re (* im im))) re))
double code(double re, double im) {
double tmp;
if ((im <= -19.5) || !(im <= 1.45)) {
tmp = 0.5 * (re * (im * im));
} else {
tmp = re;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-19.5d0)) .or. (.not. (im <= 1.45d0))) then
tmp = 0.5d0 * (re * (im * im))
else
tmp = re
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -19.5) || !(im <= 1.45)) {
tmp = 0.5 * (re * (im * im));
} else {
tmp = re;
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -19.5) or not (im <= 1.45): tmp = 0.5 * (re * (im * im)) else: tmp = re return tmp
function code(re, im) tmp = 0.0 if ((im <= -19.5) || !(im <= 1.45)) tmp = Float64(0.5 * Float64(re * Float64(im * im))); else tmp = re; end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -19.5) || ~((im <= 1.45))) tmp = 0.5 * (re * (im * im)); else tmp = re; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -19.5], N[Not[LessEqual[im, 1.45]], $MachinePrecision]], N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], re]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -19.5 \lor \neg \left(im \leq 1.45\right):\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re\\
\end{array}
\end{array}
if im < -19.5 or 1.44999999999999996 < im Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in re around 0 68.7%
distribute-lft-out68.7%
+-commutative68.7%
rec-exp68.7%
Simplified68.7%
Taylor expanded in im around 0 40.3%
unpow240.3%
Simplified40.3%
Taylor expanded in im around inf 40.3%
unpow240.3%
Simplified40.3%
if -19.5 < im < 1.44999999999999996Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in re around 0 46.7%
distribute-lft-out46.7%
+-commutative46.7%
rec-exp46.7%
Simplified46.7%
Taylor expanded in im around 0 46.7%
Final simplification43.5%
(FPCore (re im) :precision binary64 (if (or (<= im -1.5e+37) (not (<= im 4.7e+47))) (/ 26623333280885244000.0 (* re re)) re))
double code(double re, double im) {
double tmp;
if ((im <= -1.5e+37) || !(im <= 4.7e+47)) {
tmp = 26623333280885244000.0 / (re * re);
} else {
tmp = re;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-1.5d+37)) .or. (.not. (im <= 4.7d+47))) then
tmp = 26623333280885244000.0d0 / (re * re)
else
tmp = re
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -1.5e+37) || !(im <= 4.7e+47)) {
tmp = 26623333280885244000.0 / (re * re);
} else {
tmp = re;
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -1.5e+37) or not (im <= 4.7e+47): tmp = 26623333280885244000.0 / (re * re) else: tmp = re return tmp
function code(re, im) tmp = 0.0 if ((im <= -1.5e+37) || !(im <= 4.7e+47)) tmp = Float64(26623333280885244000.0 / Float64(re * re)); else tmp = re; end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -1.5e+37) || ~((im <= 4.7e+47))) tmp = 26623333280885244000.0 / (re * re); else tmp = re; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -1.5e+37], N[Not[LessEqual[im, 4.7e+47]], $MachinePrecision]], N[(26623333280885244000.0 / N[(re * re), $MachinePrecision]), $MachinePrecision], re]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -1.5 \cdot 10^{+37} \lor \neg \left(im \leq 4.7 \cdot 10^{+47}\right):\\
\;\;\;\;\frac{26623333280885244000}{re \cdot re}\\
\mathbf{else}:\\
\;\;\;\;re\\
\end{array}
\end{array}
if im < -1.50000000000000011e37 or 4.69999999999999964e47 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 88.0%
unpow288.0%
*-commutative88.0%
Simplified88.0%
Applied egg-rr14.2%
Taylor expanded in re around 0 14.1%
unpow214.1%
Simplified14.1%
if -1.50000000000000011e37 < im < 4.69999999999999964e47Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in re around 0 48.1%
distribute-lft-out48.1%
+-commutative48.1%
rec-exp48.1%
Simplified48.1%
Taylor expanded in im around 0 41.5%
Final simplification29.6%
(FPCore (re im) :precision binary64 (* re (* 0.5 (+ 2.0 (* im im)))))
double code(double re, double im) {
return re * (0.5 * (2.0 + (im * im)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (0.5d0 * (2.0d0 + (im * im)))
end function
public static double code(double re, double im) {
return re * (0.5 * (2.0 + (im * im)));
}
def code(re, im): return re * (0.5 * (2.0 + (im * im)))
function code(re, im) return Float64(re * Float64(0.5 * Float64(2.0 + Float64(im * im)))) end
function tmp = code(re, im) tmp = re * (0.5 * (2.0 + (im * im))); end
code[re_, im_] := N[(re * N[(0.5 * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
re \cdot \left(0.5 \cdot \left(2 + im \cdot im\right)\right)
\end{array}
Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in re around 0 57.7%
distribute-lft-out57.7%
+-commutative57.7%
rec-exp57.7%
Simplified57.7%
Taylor expanded in im around 0 43.5%
unpow243.5%
Simplified43.5%
Final simplification43.5%
(FPCore (re im) :precision binary64 1.0)
double code(double re, double im) {
return 1.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 1.0d0
end function
public static double code(double re, double im) {
return 1.0;
}
def code(re, im): return 1.0
function code(re, im) return 1.0 end
function tmp = code(re, im) tmp = 1.0; end
code[re_, im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 88.0%
unpow288.0%
*-commutative88.0%
Simplified88.0%
Applied egg-rr4.4%
*-inverses4.4%
Simplified4.4%
Final simplification4.4%
(FPCore (re im) :precision binary64 re)
double code(double re, double im) {
return re;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re
end function
public static double code(double re, double im) {
return re;
}
def code(re, im): return re
function code(re, im) return re end
function tmp = code(re, im) tmp = re; end
code[re_, im_] := re
\begin{array}{l}
\\
re
\end{array}
Initial program 100.0%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
fma-def100.0%
exp-diff100.0%
associate-*l/100.0%
exp-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in re around 0 57.7%
distribute-lft-out57.7%
+-commutative57.7%
rec-exp57.7%
Simplified57.7%
Taylor expanded in im around 0 24.5%
Final simplification24.5%
herbie shell --seed 2023178
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))