
(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 (* (sin re) (fma 0.5 (exp im) (/ 0.5 (exp im)))))
double code(double re, double im) {
return sin(re) * fma(0.5, exp(im), (0.5 / exp(im)));
}
function code(re, im) return Float64(sin(re) * fma(0.5, exp(im), Float64(0.5 / exp(im)))) end
code[re_, im_] := N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[Exp[im], $MachinePrecision] + N[(0.5 / N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{0.5}{e^{im}}\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%
Final simplification100.0%
(FPCore (re im) :precision binary64 (* (sin re) (* 0.5 (+ (exp im) (exp (- im))))))
double code(double re, double im) {
return sin(re) * (0.5 * (exp(im) + exp(-im)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sin(re) * (0.5d0 * (exp(im) + exp(-im)))
end function
public static double code(double re, double im) {
return Math.sin(re) * (0.5 * (Math.exp(im) + Math.exp(-im)));
}
def code(re, im): return math.sin(re) * (0.5 * (math.exp(im) + math.exp(-im)))
function code(re, im) return Float64(sin(re) * Float64(0.5 * Float64(exp(im) + exp(Float64(-im))))) end
function tmp = code(re, im) tmp = sin(re) * (0.5 * (exp(im) + exp(-im))); end
code[re_, im_] := N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(N[Exp[im], $MachinePrecision] + N[Exp[(-im)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin re \cdot \left(0.5 \cdot \left(e^{im} + e^{-im}\right)\right)
\end{array}
Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 4.0) (* (sin re) 0.041666666666666664))))
(if (<= im -4.5e+72)
t_0
(if (<= im -460.0)
(* 0.5 (log1p (expm1 (* re (* im im)))))
(if (<= im 10.0)
(* (sin re) (+ 1.0 (* 0.5 (* im im))))
(if (<= im 4.2e+68) (* re (+ 0.5 (* 0.5 (exp im)))) t_0))))))
double code(double re, double im) {
double t_0 = pow(im, 4.0) * (sin(re) * 0.041666666666666664);
double tmp;
if (im <= -4.5e+72) {
tmp = t_0;
} else if (im <= -460.0) {
tmp = 0.5 * log1p(expm1((re * (im * im))));
} else if (im <= 10.0) {
tmp = sin(re) * (1.0 + (0.5 * (im * im)));
} else if (im <= 4.2e+68) {
tmp = re * (0.5 + (0.5 * exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double re, double im) {
double t_0 = Math.pow(im, 4.0) * (Math.sin(re) * 0.041666666666666664);
double tmp;
if (im <= -4.5e+72) {
tmp = t_0;
} else if (im <= -460.0) {
tmp = 0.5 * Math.log1p(Math.expm1((re * (im * im))));
} else if (im <= 10.0) {
tmp = Math.sin(re) * (1.0 + (0.5 * (im * im)));
} else if (im <= 4.2e+68) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 4.0) * (math.sin(re) * 0.041666666666666664) tmp = 0 if im <= -4.5e+72: tmp = t_0 elif im <= -460.0: tmp = 0.5 * math.log1p(math.expm1((re * (im * im)))) elif im <= 10.0: tmp = math.sin(re) * (1.0 + (0.5 * (im * im))) elif im <= 4.2e+68: tmp = re * (0.5 + (0.5 * math.exp(im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64((im ^ 4.0) * Float64(sin(re) * 0.041666666666666664)) tmp = 0.0 if (im <= -4.5e+72) tmp = t_0; elseif (im <= -460.0) tmp = Float64(0.5 * log1p(expm1(Float64(re * Float64(im * im))))); elseif (im <= 10.0) tmp = Float64(sin(re) * Float64(1.0 + Float64(0.5 * Float64(im * im)))); elseif (im <= 4.2e+68) tmp = Float64(re * Float64(0.5 + Float64(0.5 * exp(im)))); else tmp = t_0; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[Power[im, 4.0], $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -4.5e+72], t$95$0, If[LessEqual[im, -460.0], N[(0.5 * N[Log[1 + N[(Exp[N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 10.0], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.2e+68], 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 := {im}^{4} \cdot \left(\sin re \cdot 0.041666666666666664\right)\\
\mathbf{if}\;im \leq -4.5 \cdot 10^{+72}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -460:\\
\;\;\;\;0.5 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{elif}\;im \leq 10:\\
\;\;\;\;\sin re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{elif}\;im \leq 4.2 \cdot 10^{+68}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -4.4999999999999998e72 or 4.20000000000000002e68 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 96.6%
unpow296.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in im around inf 96.6%
*-commutative96.6%
*-commutative96.6%
associate-*l*96.6%
Simplified96.6%
if -4.4999999999999998e72 < im < -460Initial 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 3.2%
unpow23.2%
Simplified3.2%
Taylor expanded in im around inf 3.2%
associate-*r*3.2%
*-commutative3.2%
unpow23.2%
Simplified3.2%
Taylor expanded in re around 0 11.5%
unpow211.5%
*-commutative11.5%
associate-*l*11.5%
Simplified11.5%
log1p-expm1-u59.4%
associate-*r*59.4%
*-commutative59.4%
Applied egg-rr59.4%
if -460 < im < 10Initial program 100.0%
distribute-lft-in99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*r*99.9%
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.1%
unpow299.1%
Simplified99.1%
if 10 < im < 4.20000000000000002e68Initial 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 90.0%
Final simplification95.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (pow im 4.0) (* (sin re) 0.041666666666666664))))
(if (<= im -3.7)
t_0
(if (<= im 10.0)
(* (sin re) (+ 1.0 (* 0.5 (* im im))))
(if (<= im 4.2e+68) (* re (+ 0.5 (* 0.5 (exp im)))) t_0)))))
double code(double re, double im) {
double t_0 = pow(im, 4.0) * (sin(re) * 0.041666666666666664);
double tmp;
if (im <= -3.7) {
tmp = t_0;
} else if (im <= 10.0) {
tmp = sin(re) * (1.0 + (0.5 * (im * im)));
} else if (im <= 4.2e+68) {
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 = (im ** 4.0d0) * (sin(re) * 0.041666666666666664d0)
if (im <= (-3.7d0)) then
tmp = t_0
else if (im <= 10.0d0) then
tmp = sin(re) * (1.0d0 + (0.5d0 * (im * im)))
else if (im <= 4.2d+68) 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.pow(im, 4.0) * (Math.sin(re) * 0.041666666666666664);
double tmp;
if (im <= -3.7) {
tmp = t_0;
} else if (im <= 10.0) {
tmp = Math.sin(re) * (1.0 + (0.5 * (im * im)));
} else if (im <= 4.2e+68) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.pow(im, 4.0) * (math.sin(re) * 0.041666666666666664) tmp = 0 if im <= -3.7: tmp = t_0 elif im <= 10.0: tmp = math.sin(re) * (1.0 + (0.5 * (im * im))) elif im <= 4.2e+68: tmp = re * (0.5 + (0.5 * math.exp(im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64((im ^ 4.0) * Float64(sin(re) * 0.041666666666666664)) tmp = 0.0 if (im <= -3.7) tmp = t_0; elseif (im <= 10.0) tmp = Float64(sin(re) * Float64(1.0 + Float64(0.5 * Float64(im * im)))); elseif (im <= 4.2e+68) 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 = (im ^ 4.0) * (sin(re) * 0.041666666666666664); tmp = 0.0; if (im <= -3.7) tmp = t_0; elseif (im <= 10.0) tmp = sin(re) * (1.0 + (0.5 * (im * im))); elseif (im <= 4.2e+68) 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[Power[im, 4.0], $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -3.7], t$95$0, If[LessEqual[im, 10.0], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.2e+68], 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 := {im}^{4} \cdot \left(\sin re \cdot 0.041666666666666664\right)\\
\mathbf{if}\;im \leq -3.7:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 10:\\
\;\;\;\;\sin re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{elif}\;im \leq 4.2 \cdot 10^{+68}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -3.7000000000000002 or 4.20000000000000002e68 < im Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 87.5%
unpow287.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in im around inf 87.5%
*-commutative87.5%
*-commutative87.5%
associate-*l*87.5%
Simplified87.5%
if -3.7000000000000002 < im < 10Initial program 100.0%
distribute-lft-in99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*r*99.9%
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.1%
unpow299.1%
Simplified99.1%
if 10 < im < 4.20000000000000002e68Initial 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 90.0%
Final simplification93.2%
(FPCore (re im)
:precision binary64
(if (<= im -4.5e+72)
(* (pow im 4.0) (* (sin re) 0.041666666666666664))
(if (<= im -6.9e-6)
(* 0.5 (* re (+ (exp im) (exp (- im)))))
(* (sin re) (+ 0.5 (* 0.5 (exp im)))))))
double code(double re, double im) {
double tmp;
if (im <= -4.5e+72) {
tmp = pow(im, 4.0) * (sin(re) * 0.041666666666666664);
} else if (im <= -6.9e-6) {
tmp = 0.5 * (re * (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 <= (-4.5d+72)) then
tmp = (im ** 4.0d0) * (sin(re) * 0.041666666666666664d0)
else if (im <= (-6.9d-6)) then
tmp = 0.5d0 * (re * (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 <= -4.5e+72) {
tmp = Math.pow(im, 4.0) * (Math.sin(re) * 0.041666666666666664);
} else if (im <= -6.9e-6) {
tmp = 0.5 * (re * (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 <= -4.5e+72: tmp = math.pow(im, 4.0) * (math.sin(re) * 0.041666666666666664) elif im <= -6.9e-6: tmp = 0.5 * (re * (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 <= -4.5e+72) tmp = Float64((im ^ 4.0) * Float64(sin(re) * 0.041666666666666664)); elseif (im <= -6.9e-6) tmp = Float64(0.5 * Float64(re * Float64(exp(im) + exp(Float64(-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 <= -4.5e+72) tmp = (im ^ 4.0) * (sin(re) * 0.041666666666666664); elseif (im <= -6.9e-6) tmp = 0.5 * (re * (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, -4.5e+72], N[(N[Power[im, 4.0], $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, -6.9e-6], N[(0.5 * N[(re * 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 -4.5 \cdot 10^{+72}:\\
\;\;\;\;{im}^{4} \cdot \left(\sin re \cdot 0.041666666666666664\right)\\
\mathbf{elif}\;im \leq -6.9 \cdot 10^{-6}:\\
\;\;\;\;0.5 \cdot \left(re \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 < -4.4999999999999998e72Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 98.3%
unpow298.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in im around inf 98.3%
*-commutative98.3%
*-commutative98.3%
associate-*l*98.3%
Simplified98.3%
if -4.4999999999999998e72 < im < -6.9e-6Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 100.0%
if -6.9e-6 < 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 98.7%
Taylor expanded in re around inf 98.7%
Final simplification98.6%
(FPCore (re im)
:precision binary64
(if (<= im -4.5e+72)
(* (pow im 4.0) (* (sin re) 0.041666666666666664))
(if (<= im -510.0)
(* 0.5 (log1p (expm1 (* re (* im im)))))
(* (sin re) (+ 0.5 (* 0.5 (exp im)))))))
double code(double re, double im) {
double tmp;
if (im <= -4.5e+72) {
tmp = pow(im, 4.0) * (sin(re) * 0.041666666666666664);
} else if (im <= -510.0) {
tmp = 0.5 * log1p(expm1((re * (im * im))));
} else {
tmp = sin(re) * (0.5 + (0.5 * exp(im)));
}
return tmp;
}
public static double code(double re, double im) {
double tmp;
if (im <= -4.5e+72) {
tmp = Math.pow(im, 4.0) * (Math.sin(re) * 0.041666666666666664);
} else if (im <= -510.0) {
tmp = 0.5 * Math.log1p(Math.expm1((re * (im * im))));
} else {
tmp = Math.sin(re) * (0.5 + (0.5 * Math.exp(im)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= -4.5e+72: tmp = math.pow(im, 4.0) * (math.sin(re) * 0.041666666666666664) elif im <= -510.0: tmp = 0.5 * math.log1p(math.expm1((re * (im * im)))) else: tmp = math.sin(re) * (0.5 + (0.5 * math.exp(im))) return tmp
function code(re, im) tmp = 0.0 if (im <= -4.5e+72) tmp = Float64((im ^ 4.0) * Float64(sin(re) * 0.041666666666666664)); elseif (im <= -510.0) tmp = Float64(0.5 * log1p(expm1(Float64(re * Float64(im * im))))); else tmp = Float64(sin(re) * Float64(0.5 + Float64(0.5 * exp(im)))); end return tmp end
code[re_, im_] := If[LessEqual[im, -4.5e+72], N[(N[Power[im, 4.0], $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, -510.0], N[(0.5 * N[Log[1 + N[(Exp[N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]] - 1), $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 -4.5 \cdot 10^{+72}:\\
\;\;\;\;{im}^{4} \cdot \left(\sin re \cdot 0.041666666666666664\right)\\
\mathbf{elif}\;im \leq -510:\\
\;\;\;\;0.5 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot \left(im \cdot im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\end{array}
\end{array}
if im < -4.4999999999999998e72Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 98.3%
unpow298.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in im around inf 98.3%
*-commutative98.3%
*-commutative98.3%
associate-*l*98.3%
Simplified98.3%
if -4.4999999999999998e72 < im < -510Initial 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 3.2%
unpow23.2%
Simplified3.2%
Taylor expanded in im around inf 3.2%
associate-*r*3.2%
*-commutative3.2%
unpow23.2%
Simplified3.2%
Taylor expanded in re around 0 11.5%
unpow211.5%
*-commutative11.5%
associate-*l*11.5%
Simplified11.5%
log1p-expm1-u59.4%
associate-*r*59.4%
*-commutative59.4%
Applied egg-rr59.4%
if -510 < 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 98.7%
Taylor expanded in re around inf 98.7%
Final simplification96.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) (* (sin re) 0.5))))
(if (<= im -3e+196)
t_0
(if (<= im -200.0)
(*
0.5
(* re (+ 2.0 (+ (* im im) (* (pow im 4.0) 0.08333333333333333)))))
(if (<= im 10.0)
(* (sin re) (+ 1.0 (* 0.5 (* im im))))
(if (<= im 1.35e+150) (* re (+ 0.5 (* 0.5 (exp im)))) t_0))))))
double code(double re, double im) {
double t_0 = (im * im) * (sin(re) * 0.5);
double tmp;
if (im <= -3e+196) {
tmp = t_0;
} else if (im <= -200.0) {
tmp = 0.5 * (re * (2.0 + ((im * im) + (pow(im, 4.0) * 0.08333333333333333))));
} else if (im <= 10.0) {
tmp = sin(re) * (1.0 + (0.5 * (im * im)));
} else if (im <= 1.35e+150) {
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 = (im * im) * (sin(re) * 0.5d0)
if (im <= (-3d+196)) then
tmp = t_0
else if (im <= (-200.0d0)) then
tmp = 0.5d0 * (re * (2.0d0 + ((im * im) + ((im ** 4.0d0) * 0.08333333333333333d0))))
else if (im <= 10.0d0) then
tmp = sin(re) * (1.0d0 + (0.5d0 * (im * im)))
else if (im <= 1.35d+150) 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 = (im * im) * (Math.sin(re) * 0.5);
double tmp;
if (im <= -3e+196) {
tmp = t_0;
} else if (im <= -200.0) {
tmp = 0.5 * (re * (2.0 + ((im * im) + (Math.pow(im, 4.0) * 0.08333333333333333))));
} else if (im <= 10.0) {
tmp = Math.sin(re) * (1.0 + (0.5 * (im * im)));
} else if (im <= 1.35e+150) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (im * im) * (math.sin(re) * 0.5) tmp = 0 if im <= -3e+196: tmp = t_0 elif im <= -200.0: tmp = 0.5 * (re * (2.0 + ((im * im) + (math.pow(im, 4.0) * 0.08333333333333333)))) elif im <= 10.0: tmp = math.sin(re) * (1.0 + (0.5 * (im * im))) elif im <= 1.35e+150: tmp = re * (0.5 + (0.5 * math.exp(im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * Float64(sin(re) * 0.5)) tmp = 0.0 if (im <= -3e+196) tmp = t_0; elseif (im <= -200.0) tmp = Float64(0.5 * Float64(re * Float64(2.0 + Float64(Float64(im * im) + Float64((im ^ 4.0) * 0.08333333333333333))))); elseif (im <= 10.0) tmp = Float64(sin(re) * Float64(1.0 + Float64(0.5 * Float64(im * im)))); elseif (im <= 1.35e+150) 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 = (im * im) * (sin(re) * 0.5); tmp = 0.0; if (im <= -3e+196) tmp = t_0; elseif (im <= -200.0) tmp = 0.5 * (re * (2.0 + ((im * im) + ((im ^ 4.0) * 0.08333333333333333)))); elseif (im <= 10.0) tmp = sin(re) * (1.0 + (0.5 * (im * im))); elseif (im <= 1.35e+150) 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[(im * im), $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -3e+196], t$95$0, If[LessEqual[im, -200.0], N[(0.5 * N[(re * N[(2.0 + N[(N[(im * im), $MachinePrecision] + N[(N[Power[im, 4.0], $MachinePrecision] * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 10.0], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+150], 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(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\
\mathbf{if}\;im \leq -3 \cdot 10^{+196}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -200:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)\right)\\
\mathbf{elif}\;im \leq 10:\\
\;\;\;\;\sin re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+150}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -2.9999999999999999e196 or 1.35000000000000004e150 < 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 98.6%
unpow298.6%
Simplified98.6%
Taylor expanded in im around inf 98.6%
associate-*r*98.6%
*-commutative98.6%
unpow298.6%
Simplified98.6%
if -2.9999999999999999e196 < im < -200Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 84.6%
Taylor expanded in im around 0 60.0%
unpow260.0%
*-commutative60.0%
Simplified60.0%
if -200 < im < 10Initial program 100.0%
distribute-lft-in99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*r*99.9%
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.1%
unpow299.1%
Simplified99.1%
if 10 < im < 1.35000000000000004e150Initial 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 72.4%
Final simplification90.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* 0.5 (* (sin re) im))))
(t_1 (* re (+ 1.0 (* 0.5 (* im im))))))
(if (<= im -2.35e+198)
t_0
(if (<= im -0.00042)
t_1
(if (<= im 3e+28)
(sin re)
(if (or (<= im 2.03e+210) (not (<= im 2.45e+227))) t_1 t_0))))))
double code(double re, double im) {
double t_0 = im * (0.5 * (sin(re) * im));
double t_1 = re * (1.0 + (0.5 * (im * im)));
double tmp;
if (im <= -2.35e+198) {
tmp = t_0;
} else if (im <= -0.00042) {
tmp = t_1;
} else if (im <= 3e+28) {
tmp = sin(re);
} else if ((im <= 2.03e+210) || !(im <= 2.45e+227)) {
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 = im * (0.5d0 * (sin(re) * im))
t_1 = re * (1.0d0 + (0.5d0 * (im * im)))
if (im <= (-2.35d+198)) then
tmp = t_0
else if (im <= (-0.00042d0)) then
tmp = t_1
else if (im <= 3d+28) then
tmp = sin(re)
else if ((im <= 2.03d+210) .or. (.not. (im <= 2.45d+227))) 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 = im * (0.5 * (Math.sin(re) * im));
double t_1 = re * (1.0 + (0.5 * (im * im)));
double tmp;
if (im <= -2.35e+198) {
tmp = t_0;
} else if (im <= -0.00042) {
tmp = t_1;
} else if (im <= 3e+28) {
tmp = Math.sin(re);
} else if ((im <= 2.03e+210) || !(im <= 2.45e+227)) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = im * (0.5 * (math.sin(re) * im)) t_1 = re * (1.0 + (0.5 * (im * im))) tmp = 0 if im <= -2.35e+198: tmp = t_0 elif im <= -0.00042: tmp = t_1 elif im <= 3e+28: tmp = math.sin(re) elif (im <= 2.03e+210) or not (im <= 2.45e+227): tmp = t_1 else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(im * Float64(0.5 * Float64(sin(re) * im))) t_1 = Float64(re * Float64(1.0 + Float64(0.5 * Float64(im * im)))) tmp = 0.0 if (im <= -2.35e+198) tmp = t_0; elseif (im <= -0.00042) tmp = t_1; elseif (im <= 3e+28) tmp = sin(re); elseif ((im <= 2.03e+210) || !(im <= 2.45e+227)) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = im * (0.5 * (sin(re) * im)); t_1 = re * (1.0 + (0.5 * (im * im))); tmp = 0.0; if (im <= -2.35e+198) tmp = t_0; elseif (im <= -0.00042) tmp = t_1; elseif (im <= 3e+28) tmp = sin(re); elseif ((im <= 2.03e+210) || ~((im <= 2.45e+227))) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(0.5 * N[(N[Sin[re], $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -2.35e+198], t$95$0, If[LessEqual[im, -0.00042], t$95$1, If[LessEqual[im, 3e+28], N[Sin[re], $MachinePrecision], If[Or[LessEqual[im, 2.03e+210], N[Not[LessEqual[im, 2.45e+227]], $MachinePrecision]], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(0.5 \cdot \left(\sin re \cdot im\right)\right)\\
t_1 := re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{if}\;im \leq -2.35 \cdot 10^{+198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -0.00042:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 3 \cdot 10^{+28}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.03 \cdot 10^{+210} \lor \neg \left(im \leq 2.45 \cdot 10^{+227}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -2.3500000000000001e198 or 2.0299999999999999e210 < im < 2.45000000000000002e227Initial 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%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
associate-*r*100.0%
unpow2100.0%
associate-*r*88.7%
associate-*r*88.7%
*-commutative88.7%
*-commutative88.7%
Simplified88.7%
if -2.3500000000000001e198 < im < -4.2000000000000002e-4 or 3.0000000000000001e28 < im < 2.0299999999999999e210 or 2.45000000000000002e227 < 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 39.4%
unpow239.4%
Simplified39.4%
Taylor expanded in re around 0 49.7%
*-commutative49.7%
*-commutative49.7%
unpow249.7%
Simplified49.7%
if -4.2000000000000002e-4 < im < 3.0000000000000001e28Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 97.1%
Final simplification78.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) (* (sin re) 0.5))))
(if (<= im -2.6e+196)
t_0
(if (<= im -1760.0)
(* re (+ 1.0 (* 0.5 (* im im))))
(if (<= im 3.8e+30)
(sin re)
(if (<= im 1.35e+150) (* 0.5 (* im (* re im))) t_0))))))
double code(double re, double im) {
double t_0 = (im * im) * (sin(re) * 0.5);
double tmp;
if (im <= -2.6e+196) {
tmp = t_0;
} else if (im <= -1760.0) {
tmp = re * (1.0 + (0.5 * (im * im)));
} else if (im <= 3.8e+30) {
tmp = sin(re);
} else if (im <= 1.35e+150) {
tmp = 0.5 * (im * (re * 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 = (im * im) * (sin(re) * 0.5d0)
if (im <= (-2.6d+196)) then
tmp = t_0
else if (im <= (-1760.0d0)) then
tmp = re * (1.0d0 + (0.5d0 * (im * im)))
else if (im <= 3.8d+30) then
tmp = sin(re)
else if (im <= 1.35d+150) then
tmp = 0.5d0 * (im * (re * im))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (im * im) * (Math.sin(re) * 0.5);
double tmp;
if (im <= -2.6e+196) {
tmp = t_0;
} else if (im <= -1760.0) {
tmp = re * (1.0 + (0.5 * (im * im)));
} else if (im <= 3.8e+30) {
tmp = Math.sin(re);
} else if (im <= 1.35e+150) {
tmp = 0.5 * (im * (re * im));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (im * im) * (math.sin(re) * 0.5) tmp = 0 if im <= -2.6e+196: tmp = t_0 elif im <= -1760.0: tmp = re * (1.0 + (0.5 * (im * im))) elif im <= 3.8e+30: tmp = math.sin(re) elif im <= 1.35e+150: tmp = 0.5 * (im * (re * im)) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * Float64(sin(re) * 0.5)) tmp = 0.0 if (im <= -2.6e+196) tmp = t_0; elseif (im <= -1760.0) tmp = Float64(re * Float64(1.0 + Float64(0.5 * Float64(im * im)))); elseif (im <= 3.8e+30) tmp = sin(re); elseif (im <= 1.35e+150) tmp = Float64(0.5 * Float64(im * Float64(re * im))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (im * im) * (sin(re) * 0.5); tmp = 0.0; if (im <= -2.6e+196) tmp = t_0; elseif (im <= -1760.0) tmp = re * (1.0 + (0.5 * (im * im))); elseif (im <= 3.8e+30) tmp = sin(re); elseif (im <= 1.35e+150) tmp = 0.5 * (im * (re * im)); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -2.6e+196], t$95$0, If[LessEqual[im, -1760.0], N[(re * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.8e+30], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.35e+150], N[(0.5 * N[(im * N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\
\mathbf{if}\;im \leq -2.6 \cdot 10^{+196}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -1760:\\
\;\;\;\;re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{elif}\;im \leq 3.8 \cdot 10^{+30}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+150}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(re \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -2.60000000000000012e196 or 1.35000000000000004e150 < 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 98.6%
unpow298.6%
Simplified98.6%
Taylor expanded in im around inf 98.6%
associate-*r*98.6%
*-commutative98.6%
unpow298.6%
Simplified98.6%
if -2.60000000000000012e196 < im < -1760Initial 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 17.3%
unpow217.3%
Simplified17.3%
Taylor expanded in re around 0 35.3%
*-commutative35.3%
*-commutative35.3%
unpow235.3%
Simplified35.3%
if -1760 < im < 3.8000000000000001e30Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 97.1%
if 3.8000000000000001e30 < im < 1.35000000000000004e150Initial 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 5.0%
unpow25.0%
Simplified5.0%
Taylor expanded in im around inf 5.0%
associate-*r*5.0%
*-commutative5.0%
unpow25.0%
Simplified5.0%
Taylor expanded in re around 0 27.8%
unpow227.8%
*-commutative27.8%
associate-*l*27.8%
Simplified27.8%
Final simplification80.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) (* (sin re) 0.5))))
(if (<= im -2.6e+196)
t_0
(if (<= im -650.0)
(* re (+ 1.0 (* 0.5 (* im im))))
(if (<= im 10.0)
(sin re)
(if (<= im 1.35e+150) (* re (+ 0.5 (* 0.5 (exp im)))) t_0))))))
double code(double re, double im) {
double t_0 = (im * im) * (sin(re) * 0.5);
double tmp;
if (im <= -2.6e+196) {
tmp = t_0;
} else if (im <= -650.0) {
tmp = re * (1.0 + (0.5 * (im * im)));
} else if (im <= 10.0) {
tmp = sin(re);
} else if (im <= 1.35e+150) {
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 = (im * im) * (sin(re) * 0.5d0)
if (im <= (-2.6d+196)) then
tmp = t_0
else if (im <= (-650.0d0)) then
tmp = re * (1.0d0 + (0.5d0 * (im * im)))
else if (im <= 10.0d0) then
tmp = sin(re)
else if (im <= 1.35d+150) 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 = (im * im) * (Math.sin(re) * 0.5);
double tmp;
if (im <= -2.6e+196) {
tmp = t_0;
} else if (im <= -650.0) {
tmp = re * (1.0 + (0.5 * (im * im)));
} else if (im <= 10.0) {
tmp = Math.sin(re);
} else if (im <= 1.35e+150) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (im * im) * (math.sin(re) * 0.5) tmp = 0 if im <= -2.6e+196: tmp = t_0 elif im <= -650.0: tmp = re * (1.0 + (0.5 * (im * im))) elif im <= 10.0: tmp = math.sin(re) elif im <= 1.35e+150: tmp = re * (0.5 + (0.5 * math.exp(im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * Float64(sin(re) * 0.5)) tmp = 0.0 if (im <= -2.6e+196) tmp = t_0; elseif (im <= -650.0) tmp = Float64(re * Float64(1.0 + Float64(0.5 * Float64(im * im)))); elseif (im <= 10.0) tmp = sin(re); elseif (im <= 1.35e+150) 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 = (im * im) * (sin(re) * 0.5); tmp = 0.0; if (im <= -2.6e+196) tmp = t_0; elseif (im <= -650.0) tmp = re * (1.0 + (0.5 * (im * im))); elseif (im <= 10.0) tmp = sin(re); elseif (im <= 1.35e+150) 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[(im * im), $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -2.6e+196], t$95$0, If[LessEqual[im, -650.0], N[(re * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 10.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.35e+150], 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(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\
\mathbf{if}\;im \leq -2.6 \cdot 10^{+196}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -650:\\
\;\;\;\;re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{elif}\;im \leq 10:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+150}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -2.60000000000000012e196 or 1.35000000000000004e150 < 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 98.6%
unpow298.6%
Simplified98.6%
Taylor expanded in im around inf 98.6%
associate-*r*98.6%
*-commutative98.6%
unpow298.6%
Simplified98.6%
if -2.60000000000000012e196 < im < -650Initial 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 17.3%
unpow217.3%
Simplified17.3%
Taylor expanded in re around 0 35.3%
*-commutative35.3%
*-commutative35.3%
unpow235.3%
Simplified35.3%
if -650 < im < 10Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 98.6%
if 10 < im < 1.35000000000000004e150Initial 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 72.4%
Final simplification86.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) (* (sin re) 0.5))))
(if (<= im -2.6e+196)
t_0
(if (<= im -300.0)
(* 0.5 (* (pow im 4.0) (* re 0.08333333333333333)))
(if (<= im 10.0)
(sin re)
(if (<= im 1.35e+150) (* re (+ 0.5 (* 0.5 (exp im)))) t_0))))))
double code(double re, double im) {
double t_0 = (im * im) * (sin(re) * 0.5);
double tmp;
if (im <= -2.6e+196) {
tmp = t_0;
} else if (im <= -300.0) {
tmp = 0.5 * (pow(im, 4.0) * (re * 0.08333333333333333));
} else if (im <= 10.0) {
tmp = sin(re);
} else if (im <= 1.35e+150) {
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 = (im * im) * (sin(re) * 0.5d0)
if (im <= (-2.6d+196)) then
tmp = t_0
else if (im <= (-300.0d0)) then
tmp = 0.5d0 * ((im ** 4.0d0) * (re * 0.08333333333333333d0))
else if (im <= 10.0d0) then
tmp = sin(re)
else if (im <= 1.35d+150) 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 = (im * im) * (Math.sin(re) * 0.5);
double tmp;
if (im <= -2.6e+196) {
tmp = t_0;
} else if (im <= -300.0) {
tmp = 0.5 * (Math.pow(im, 4.0) * (re * 0.08333333333333333));
} else if (im <= 10.0) {
tmp = Math.sin(re);
} else if (im <= 1.35e+150) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (im * im) * (math.sin(re) * 0.5) tmp = 0 if im <= -2.6e+196: tmp = t_0 elif im <= -300.0: tmp = 0.5 * (math.pow(im, 4.0) * (re * 0.08333333333333333)) elif im <= 10.0: tmp = math.sin(re) elif im <= 1.35e+150: tmp = re * (0.5 + (0.5 * math.exp(im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * Float64(sin(re) * 0.5)) tmp = 0.0 if (im <= -2.6e+196) tmp = t_0; elseif (im <= -300.0) tmp = Float64(0.5 * Float64((im ^ 4.0) * Float64(re * 0.08333333333333333))); elseif (im <= 10.0) tmp = sin(re); elseif (im <= 1.35e+150) 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 = (im * im) * (sin(re) * 0.5); tmp = 0.0; if (im <= -2.6e+196) tmp = t_0; elseif (im <= -300.0) tmp = 0.5 * ((im ^ 4.0) * (re * 0.08333333333333333)); elseif (im <= 10.0) tmp = sin(re); elseif (im <= 1.35e+150) 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[(im * im), $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -2.6e+196], t$95$0, If[LessEqual[im, -300.0], N[(0.5 * N[(N[Power[im, 4.0], $MachinePrecision] * N[(re * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 10.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.35e+150], 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(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\
\mathbf{if}\;im \leq -2.6 \cdot 10^{+196}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -300:\\
\;\;\;\;0.5 \cdot \left({im}^{4} \cdot \left(re \cdot 0.08333333333333333\right)\right)\\
\mathbf{elif}\;im \leq 10:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+150}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -2.60000000000000012e196 or 1.35000000000000004e150 < 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 98.6%
unpow298.6%
Simplified98.6%
Taylor expanded in im around inf 98.6%
associate-*r*98.6%
*-commutative98.6%
unpow298.6%
Simplified98.6%
if -2.60000000000000012e196 < im < -300Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 84.6%
Taylor expanded in im around 0 60.0%
unpow260.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in im around inf 60.0%
associate-*r*60.0%
*-commutative60.0%
Simplified60.0%
if -300 < im < 10Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 98.6%
if 10 < im < 1.35000000000000004e150Initial 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 72.4%
Final simplification89.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) (* (sin re) 0.5))))
(if (<= im -2e+198)
t_0
(if (<= im -420.0)
(* 0.5 (* (pow im 4.0) (* re 0.08333333333333333)))
(if (<= im 10.0)
(* (sin re) (+ 1.0 (* 0.5 (* im im))))
(if (<= im 1.35e+150) (* re (+ 0.5 (* 0.5 (exp im)))) t_0))))))
double code(double re, double im) {
double t_0 = (im * im) * (sin(re) * 0.5);
double tmp;
if (im <= -2e+198) {
tmp = t_0;
} else if (im <= -420.0) {
tmp = 0.5 * (pow(im, 4.0) * (re * 0.08333333333333333));
} else if (im <= 10.0) {
tmp = sin(re) * (1.0 + (0.5 * (im * im)));
} else if (im <= 1.35e+150) {
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 = (im * im) * (sin(re) * 0.5d0)
if (im <= (-2d+198)) then
tmp = t_0
else if (im <= (-420.0d0)) then
tmp = 0.5d0 * ((im ** 4.0d0) * (re * 0.08333333333333333d0))
else if (im <= 10.0d0) then
tmp = sin(re) * (1.0d0 + (0.5d0 * (im * im)))
else if (im <= 1.35d+150) 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 = (im * im) * (Math.sin(re) * 0.5);
double tmp;
if (im <= -2e+198) {
tmp = t_0;
} else if (im <= -420.0) {
tmp = 0.5 * (Math.pow(im, 4.0) * (re * 0.08333333333333333));
} else if (im <= 10.0) {
tmp = Math.sin(re) * (1.0 + (0.5 * (im * im)));
} else if (im <= 1.35e+150) {
tmp = re * (0.5 + (0.5 * Math.exp(im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (im * im) * (math.sin(re) * 0.5) tmp = 0 if im <= -2e+198: tmp = t_0 elif im <= -420.0: tmp = 0.5 * (math.pow(im, 4.0) * (re * 0.08333333333333333)) elif im <= 10.0: tmp = math.sin(re) * (1.0 + (0.5 * (im * im))) elif im <= 1.35e+150: tmp = re * (0.5 + (0.5 * math.exp(im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * Float64(sin(re) * 0.5)) tmp = 0.0 if (im <= -2e+198) tmp = t_0; elseif (im <= -420.0) tmp = Float64(0.5 * Float64((im ^ 4.0) * Float64(re * 0.08333333333333333))); elseif (im <= 10.0) tmp = Float64(sin(re) * Float64(1.0 + Float64(0.5 * Float64(im * im)))); elseif (im <= 1.35e+150) 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 = (im * im) * (sin(re) * 0.5); tmp = 0.0; if (im <= -2e+198) tmp = t_0; elseif (im <= -420.0) tmp = 0.5 * ((im ^ 4.0) * (re * 0.08333333333333333)); elseif (im <= 10.0) tmp = sin(re) * (1.0 + (0.5 * (im * im))); elseif (im <= 1.35e+150) 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[(im * im), $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -2e+198], t$95$0, If[LessEqual[im, -420.0], N[(0.5 * N[(N[Power[im, 4.0], $MachinePrecision] * N[(re * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 10.0], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+150], 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(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\
\mathbf{if}\;im \leq -2 \cdot 10^{+198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq -420:\\
\;\;\;\;0.5 \cdot \left({im}^{4} \cdot \left(re \cdot 0.08333333333333333\right)\right)\\
\mathbf{elif}\;im \leq 10:\\
\;\;\;\;\sin re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+150}:\\
\;\;\;\;re \cdot \left(0.5 + 0.5 \cdot e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < -2.00000000000000004e198 or 1.35000000000000004e150 < 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 98.6%
unpow298.6%
Simplified98.6%
Taylor expanded in im around inf 98.6%
associate-*r*98.6%
*-commutative98.6%
unpow298.6%
Simplified98.6%
if -2.00000000000000004e198 < im < -420Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 84.6%
Taylor expanded in im around 0 60.0%
unpow260.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in im around inf 60.0%
associate-*r*60.0%
*-commutative60.0%
Simplified60.0%
if -420 < im < 10Initial program 100.0%
distribute-lft-in99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*r*99.9%
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.1%
unpow299.1%
Simplified99.1%
if 10 < im < 1.35000000000000004e150Initial 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 72.4%
Final simplification90.0%
(FPCore (re im) :precision binary64 (if (or (<= im -0.000102) (not (<= im 2.8e+30))) (* re (+ 1.0 (* 0.5 (* im im)))) (sin re)))
double code(double re, double im) {
double tmp;
if ((im <= -0.000102) || !(im <= 2.8e+30)) {
tmp = re * (1.0 + (0.5 * (im * im)));
} else {
tmp = sin(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= (-0.000102d0)) .or. (.not. (im <= 2.8d+30))) then
tmp = re * (1.0d0 + (0.5d0 * (im * im)))
else
tmp = sin(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -0.000102) || !(im <= 2.8e+30)) {
tmp = re * (1.0 + (0.5 * (im * im)));
} else {
tmp = Math.sin(re);
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -0.000102) or not (im <= 2.8e+30): tmp = re * (1.0 + (0.5 * (im * im))) else: tmp = math.sin(re) return tmp
function code(re, im) tmp = 0.0 if ((im <= -0.000102) || !(im <= 2.8e+30)) tmp = Float64(re * Float64(1.0 + Float64(0.5 * Float64(im * im)))); else tmp = sin(re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -0.000102) || ~((im <= 2.8e+30))) tmp = re * (1.0 + (0.5 * (im * im))); else tmp = sin(re); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -0.000102], N[Not[LessEqual[im, 2.8e+30]], $MachinePrecision]], N[(re * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -0.000102 \lor \neg \left(im \leq 2.8 \cdot 10^{+30}\right):\\
\;\;\;\;re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re\\
\end{array}
\end{array}
if im < -1.01999999999999999e-4 or 2.79999999999999983e30 < 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 54.4%
unpow254.4%
Simplified54.4%
Taylor expanded in re around 0 52.1%
*-commutative52.1%
*-commutative52.1%
unpow252.1%
Simplified52.1%
if -1.01999999999999999e-4 < im < 2.79999999999999983e30Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 97.1%
Final simplification74.4%
(FPCore (re im) :precision binary64 (if (or (<= im -1.42) (not (<= im 0.0085))) (* 0.5 (* im (* re im))) re))
double code(double re, double im) {
double tmp;
if ((im <= -1.42) || !(im <= 0.0085)) {
tmp = 0.5 * (im * (re * 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 <= (-1.42d0)) .or. (.not. (im <= 0.0085d0))) then
tmp = 0.5d0 * (im * (re * im))
else
tmp = re
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= -1.42) || !(im <= 0.0085)) {
tmp = 0.5 * (im * (re * im));
} else {
tmp = re;
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -1.42) or not (im <= 0.0085): tmp = 0.5 * (im * (re * im)) else: tmp = re return tmp
function code(re, im) tmp = 0.0 if ((im <= -1.42) || !(im <= 0.0085)) tmp = Float64(0.5 * Float64(im * Float64(re * im))); else tmp = re; end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= -1.42) || ~((im <= 0.0085))) tmp = 0.5 * (im * (re * im)); else tmp = re; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -1.42], N[Not[LessEqual[im, 0.0085]], $MachinePrecision]], N[(0.5 * N[(im * N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], re]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -1.42 \lor \neg \left(im \leq 0.0085\right):\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(re \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re\\
\end{array}
\end{array}
if im < -1.4199999999999999 or 0.0085000000000000006 < 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 53.5%
unpow253.5%
Simplified53.5%
Taylor expanded in im around inf 53.1%
associate-*r*53.1%
*-commutative53.1%
unpow253.1%
Simplified53.1%
Taylor expanded in re around 0 50.7%
unpow250.7%
*-commutative50.7%
associate-*l*40.9%
Simplified40.9%
if -1.4199999999999999 < im < 0.0085000000000000006Initial program 100.0%
distribute-lft-in99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*r*99.9%
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%
unpow2100.0%
Simplified100.0%
Taylor expanded in re around 0 55.6%
*-commutative55.6%
*-commutative55.6%
unpow255.6%
Simplified55.6%
Taylor expanded in im around 0 55.3%
Final simplification47.9%
(FPCore (re im) :precision binary64 (if (or (<= im -1.42) (not (<= im 0.0085))) (* 0.5 (* re (* im im))) re))
double code(double re, double im) {
double tmp;
if ((im <= -1.42) || !(im <= 0.0085)) {
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 <= (-1.42d0)) .or. (.not. (im <= 0.0085d0))) 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 <= -1.42) || !(im <= 0.0085)) {
tmp = 0.5 * (re * (im * im));
} else {
tmp = re;
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= -1.42) or not (im <= 0.0085): tmp = 0.5 * (re * (im * im)) else: tmp = re return tmp
function code(re, im) tmp = 0.0 if ((im <= -1.42) || !(im <= 0.0085)) 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 <= -1.42) || ~((im <= 0.0085))) tmp = 0.5 * (re * (im * im)); else tmp = re; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, -1.42], N[Not[LessEqual[im, 0.0085]], $MachinePrecision]], N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], re]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq -1.42 \lor \neg \left(im \leq 0.0085\right):\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re\\
\end{array}
\end{array}
if im < -1.4199999999999999 or 0.0085000000000000006 < 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 53.5%
unpow253.5%
Simplified53.5%
Taylor expanded in im around inf 53.1%
associate-*r*53.1%
*-commutative53.1%
unpow253.1%
Simplified53.1%
Taylor expanded in re around 0 50.7%
unpow250.7%
Simplified50.7%
if -1.4199999999999999 < im < 0.0085000000000000006Initial program 100.0%
distribute-lft-in99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*r*99.9%
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%
unpow2100.0%
Simplified100.0%
Taylor expanded in re around 0 55.6%
*-commutative55.6%
*-commutative55.6%
unpow255.6%
Simplified55.6%
Taylor expanded in im around 0 55.3%
Final simplification52.9%
(FPCore (re im) :precision binary64 (* re (+ 1.0 (* 0.5 (* im im)))))
double code(double re, double im) {
return re * (1.0 + (0.5 * (im * im)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (1.0d0 + (0.5d0 * (im * im)))
end function
public static double code(double re, double im) {
return re * (1.0 + (0.5 * (im * im)));
}
def code(re, im): return re * (1.0 + (0.5 * (im * im)))
function code(re, im) return Float64(re * Float64(1.0 + Float64(0.5 * Float64(im * im)))) end
function tmp = code(re, im) tmp = re * (1.0 + (0.5 * (im * im))); end
code[re_, im_] := N[(re * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
re \cdot \left(1 + 0.5 \cdot \left(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 im around 0 75.8%
unpow275.8%
Simplified75.8%
Taylor expanded in re around 0 53.0%
*-commutative53.0%
*-commutative53.0%
unpow253.0%
Simplified53.0%
Final simplification53.0%
(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 im around 0 75.8%
unpow275.8%
Simplified75.8%
Taylor expanded in re around 0 53.0%
*-commutative53.0%
*-commutative53.0%
unpow253.0%
Simplified53.0%
Taylor expanded in im around 0 28.0%
Final simplification28.0%
herbie shell --seed 2023181
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))