
(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 19 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) (cosh im)))
double code(double re, double im) {
return sin(re) * cosh(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sin(re) * cosh(im)
end function
public static double code(double re, double im) {
return Math.sin(re) * Math.cosh(im);
}
def code(re, im): return math.sin(re) * math.cosh(im)
function code(re, im) return Float64(sin(re) * cosh(im)) end
function tmp = code(re, im) tmp = sin(re) * cosh(im); end
code[re_, im_] := N[(N[Sin[re], $MachinePrecision] * N[Cosh[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin re \cdot \cosh im
\end{array}
Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
(FPCore (re im)
:precision binary64
(let* ((t_0
(+
0.5
(*
(* im im)
(+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))))
(t_1 (* (* im im) t_0)))
(if (<= im 7e+51)
(* (sin re) (/ (+ (* (* im im) (* t_0 t_1)) -1.0) (+ t_1 -1.0)))
(*
(sin re)
(+
1.0
(*
(* im im)
(+
0.5
(*
(* im im)
(+ 0.041666666666666664 (* im (* im 0.001388888888888889)))))))))))
double code(double re, double im) {
double t_0 = 0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)));
double t_1 = (im * im) * t_0;
double tmp;
if (im <= 7e+51) {
tmp = sin(re) * ((((im * im) * (t_0 * t_1)) + -1.0) / (t_1 + -1.0));
} else {
tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))));
}
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 + ((im * im) * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))
t_1 = (im * im) * t_0
if (im <= 7d+51) then
tmp = sin(re) * ((((im * im) * (t_0 * t_1)) + (-1.0d0)) / (t_1 + (-1.0d0)))
else
tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0)))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)));
double t_1 = (im * im) * t_0;
double tmp;
if (im <= 7e+51) {
tmp = Math.sin(re) * ((((im * im) * (t_0 * t_1)) + -1.0) / (t_1 + -1.0));
} else {
tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))));
}
return tmp;
}
def code(re, im): t_0 = 0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889))) t_1 = (im * im) * t_0 tmp = 0 if im <= 7e+51: tmp = math.sin(re) * ((((im * im) * (t_0 * t_1)) + -1.0) / (t_1 + -1.0)) else: tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))) return tmp
function code(re, im) t_0 = Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889)))) t_1 = Float64(Float64(im * im) * t_0) tmp = 0.0 if (im <= 7e+51) tmp = Float64(sin(re) * Float64(Float64(Float64(Float64(im * im) * Float64(t_0 * t_1)) + -1.0) / Float64(t_1 + -1.0))); else tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889)))))))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889))); t_1 = (im * im) * t_0; tmp = 0.0; if (im <= 7e+51) tmp = sin(re) * ((((im * im) * (t_0 * t_1)) + -1.0) / (t_1 + -1.0)); else tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[im, 7e+51], N[(N[Sin[re], $MachinePrecision] * N[(N[(N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\\
t_1 := \left(im \cdot im\right) \cdot t\_0\\
\mathbf{if}\;im \leq 7 \cdot 10^{+51}:\\
\;\;\;\;\sin re \cdot \frac{\left(im \cdot im\right) \cdot \left(t\_0 \cdot t\_1\right) + -1}{t\_1 + -1}\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\\
\end{array}
\end{array}
if im < 7e51Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6492.5%
Simplified92.5%
+-commutativeN/A
flip-+N/A
/-lowering-/.f64N/A
Applied egg-rr70.1%
if 7e51 < im Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification75.2%
(FPCore (re im)
:precision binary64
(if (<= re 0.43)
(*
(cosh im)
(*
re
(+
1.0
(*
(* re re)
(+
-0.16666666666666666
(*
re
(*
re
(+ 0.008333333333333333 (* (* re re) -0.0001984126984126984)))))))))
(*
(sin re)
(+
1.0
(*
(* im im)
(+
0.5
(*
(* im im)
(+ 0.041666666666666664 (* im (* im 0.001388888888888889))))))))))
double code(double re, double im) {
double tmp;
if (re <= 0.43) {
tmp = cosh(im) * (re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984))))))));
} else {
tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 0.43d0) then
tmp = cosh(im) * (re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + (re * (re * (0.008333333333333333d0 + ((re * re) * (-0.0001984126984126984d0)))))))))
else
tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0)))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 0.43) {
tmp = Math.cosh(im) * (re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984))))))));
} else {
tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 0.43: tmp = math.cosh(im) * (re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984)))))))) else: tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 0.43) tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(re * Float64(re * Float64(0.008333333333333333 + Float64(Float64(re * re) * -0.0001984126984126984))))))))); else tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889)))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 0.43) tmp = cosh(im) * (re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984)))))))); else tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 0.43], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(re * N[(re * N[(0.008333333333333333 + N[(N[(re * re), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 0.43:\\
\;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + re \cdot \left(re \cdot \left(0.008333333333333333 + \left(re \cdot re\right) \cdot -0.0001984126984126984\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\\
\end{array}
\end{array}
if re < 0.429999999999999993Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6468.6%
Simplified68.6%
if 0.429999999999999993 < re Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.1%
Simplified96.1%
Final simplification75.1%
(FPCore (re im)
:precision binary64
(if (<= re 0.43)
(*
(cosh im)
(*
re
(+
1.0
(*
(* re re)
(+ -0.16666666666666666 (* (* re re) 0.008333333333333333))))))
(*
(sin re)
(+
1.0
(*
(* im im)
(+
0.5
(*
(* im im)
(+ 0.041666666666666664 (* im (* im 0.001388888888888889))))))))))
double code(double re, double im) {
double tmp;
if (re <= 0.43) {
tmp = cosh(im) * (re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
} else {
tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 0.43d0) then
tmp = cosh(im) * (re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0)))))
else
tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0)))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 0.43) {
tmp = Math.cosh(im) * (re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
} else {
tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 0.43: tmp = math.cosh(im) * (re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))) else: tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 0.43) tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333)))))); else tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889)))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 0.43) tmp = cosh(im) * (re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))); else tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 0.43], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 0.43:\\
\;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\\
\end{array}
\end{array}
if re < 0.429999999999999993Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lft-identityN/A
cosh-lowering-cosh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6471.1%
Simplified71.1%
if 0.429999999999999993 < re Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.1%
Simplified96.1%
Final simplification76.9%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
(sin re)
(+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664))))))))
(if (<= im 135.0) t_0 (if (<= im 2.5e+77) (* re (cosh im)) t_0))))
double code(double re, double im) {
double t_0 = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
double tmp;
if (im <= 135.0) {
tmp = t_0;
} else if (im <= 2.5e+77) {
tmp = re * cosh(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) * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
if (im <= 135.0d0) then
tmp = t_0
else if (im <= 2.5d+77) then
tmp = re * cosh(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) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
double tmp;
if (im <= 135.0) {
tmp = t_0;
} else if (im <= 2.5e+77) {
tmp = re * Math.cosh(im);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))) tmp = 0 if im <= 135.0: tmp = t_0 elif im <= 2.5e+77: tmp = re * math.cosh(im) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))) tmp = 0.0 if (im <= 135.0) tmp = t_0; elseif (im <= 2.5e+77) tmp = Float64(re * cosh(im)); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))); tmp = 0.0; if (im <= 135.0) tmp = t_0; elseif (im <= 2.5e+77) tmp = re * cosh(im); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 135.0], t$95$0, If[LessEqual[im, 2.5e+77], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{if}\;im \leq 135:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;im \leq 2.5 \cdot 10^{+77}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if im < 135 or 2.50000000000000002e77 < im Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified94.5%
if 135 < im < 2.50000000000000002e77Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified90.9%
*-lft-identityN/A
cosh-lowering-cosh.f6490.9%
Applied egg-rr90.9%
Final simplification94.4%
(FPCore (re im) :precision binary64 (if (<= im 135.0) (* (* (sin re) 0.5) (+ (* im im) 2.0)) (if (<= im 6e+144) (* re (cosh im)) (* (sin re) (* (* im im) 0.5)))))
double code(double re, double im) {
double tmp;
if (im <= 135.0) {
tmp = (sin(re) * 0.5) * ((im * im) + 2.0);
} else if (im <= 6e+144) {
tmp = re * cosh(im);
} else {
tmp = sin(re) * ((im * im) * 0.5);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 135.0d0) then
tmp = (sin(re) * 0.5d0) * ((im * im) + 2.0d0)
else if (im <= 6d+144) then
tmp = re * cosh(im)
else
tmp = sin(re) * ((im * im) * 0.5d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 135.0) {
tmp = (Math.sin(re) * 0.5) * ((im * im) + 2.0);
} else if (im <= 6e+144) {
tmp = re * Math.cosh(im);
} else {
tmp = Math.sin(re) * ((im * im) * 0.5);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 135.0: tmp = (math.sin(re) * 0.5) * ((im * im) + 2.0) elif im <= 6e+144: tmp = re * math.cosh(im) else: tmp = math.sin(re) * ((im * im) * 0.5) return tmp
function code(re, im) tmp = 0.0 if (im <= 135.0) tmp = Float64(Float64(sin(re) * 0.5) * Float64(Float64(im * im) + 2.0)); elseif (im <= 6e+144) tmp = Float64(re * cosh(im)); else tmp = Float64(sin(re) * Float64(Float64(im * im) * 0.5)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 135.0) tmp = (sin(re) * 0.5) * ((im * im) + 2.0); elseif (im <= 6e+144) tmp = re * cosh(im); else tmp = sin(re) * ((im * im) * 0.5); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 135.0], N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 6e+144], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 135:\\
\;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
\mathbf{elif}\;im \leq 6 \cdot 10^{+144}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(\left(im \cdot im\right) \cdot 0.5\right)\\
\end{array}
\end{array}
if im < 135Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6484.1%
Simplified84.1%
if 135 < im < 5.9999999999999998e144Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified78.6%
*-lft-identityN/A
cosh-lowering-cosh.f6478.6%
Applied egg-rr78.6%
if 5.9999999999999998e144 < im Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification84.9%
(FPCore (re im) :precision binary64 (if (<= im 135.0) (sin re) (if (<= im 6e+144) (* re (cosh im)) (* (sin re) (* (* im im) 0.5)))))
double code(double re, double im) {
double tmp;
if (im <= 135.0) {
tmp = sin(re);
} else if (im <= 6e+144) {
tmp = re * cosh(im);
} else {
tmp = sin(re) * ((im * im) * 0.5);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 135.0d0) then
tmp = sin(re)
else if (im <= 6d+144) then
tmp = re * cosh(im)
else
tmp = sin(re) * ((im * im) * 0.5d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 135.0) {
tmp = Math.sin(re);
} else if (im <= 6e+144) {
tmp = re * Math.cosh(im);
} else {
tmp = Math.sin(re) * ((im * im) * 0.5);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 135.0: tmp = math.sin(re) elif im <= 6e+144: tmp = re * math.cosh(im) else: tmp = math.sin(re) * ((im * im) * 0.5) return tmp
function code(re, im) tmp = 0.0 if (im <= 135.0) tmp = sin(re); elseif (im <= 6e+144) tmp = Float64(re * cosh(im)); else tmp = Float64(sin(re) * Float64(Float64(im * im) * 0.5)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 135.0) tmp = sin(re); elseif (im <= 6e+144) tmp = re * cosh(im); else tmp = sin(re) * ((im * im) * 0.5); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 135.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 6e+144], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 135:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 6 \cdot 10^{+144}:\\
\;\;\;\;re \cdot \cosh im\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(\left(im \cdot im\right) \cdot 0.5\right)\\
\end{array}
\end{array}
if im < 135Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6468.5%
Simplified68.5%
if 135 < im < 5.9999999999999998e144Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified78.6%
*-lft-identityN/A
cosh-lowering-cosh.f6478.6%
Applied egg-rr78.6%
if 5.9999999999999998e144 < im Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification72.3%
(FPCore (re im) :precision binary64 (if (<= im 135.0) (sin re) (* re (cosh im))))
double code(double re, double im) {
double tmp;
if (im <= 135.0) {
tmp = sin(re);
} else {
tmp = re * cosh(im);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 135.0d0) then
tmp = sin(re)
else
tmp = re * cosh(im)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 135.0) {
tmp = Math.sin(re);
} else {
tmp = re * Math.cosh(im);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 135.0: tmp = math.sin(re) else: tmp = re * math.cosh(im) return tmp
function code(re, im) tmp = 0.0 if (im <= 135.0) tmp = sin(re); else tmp = Float64(re * cosh(im)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 135.0) tmp = sin(re); else tmp = re * cosh(im); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 135.0], N[Sin[re], $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 135:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \cosh im\\
\end{array}
\end{array}
if im < 135Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6468.5%
Simplified68.5%
if 135 < im Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified74.0%
*-lft-identityN/A
cosh-lowering-cosh.f6474.0%
Applied egg-rr74.0%
Final simplification69.5%
(FPCore (re im)
:precision binary64
(if (<= im 580.0)
(sin re)
(*
(*
re
(+
0.5
(*
re
(*
re
(+
-0.08333333333333333
(*
(* re re)
(+ 0.004166666666666667 (* (* re re) -9.92063492063492e-5))))))))
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* (* im im) 0.002777777777777778)))))))))
double code(double re, double im) {
double tmp;
if (im <= 580.0) {
tmp = sin(re);
} else {
tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 580.0d0) then
tmp = sin(re)
else
tmp = (re * (0.5d0 + (re * (re * ((-0.08333333333333333d0) + ((re * re) * (0.004166666666666667d0 + ((re * re) * (-9.92063492063492d-5))))))))) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 580.0) {
tmp = Math.sin(re);
} else {
tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 580.0: tmp = math.sin(re) else: tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 580.0) tmp = sin(re); else tmp = Float64(Float64(re * Float64(0.5 + Float64(re * Float64(re * Float64(-0.08333333333333333 + Float64(Float64(re * re) * Float64(0.004166666666666667 + Float64(Float64(re * re) * -9.92063492063492e-5)))))))) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 580.0) tmp = sin(re); else tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 580.0], N[Sin[re], $MachinePrecision], N[(N[(re * N[(0.5 + N[(re * N[(re * N[(-0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * N[(0.004166666666666667 + N[(N[(re * re), $MachinePrecision] * -9.92063492063492e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 580:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\\
\end{array}
\end{array}
if im < 580Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6468.5%
Simplified68.5%
if 580 < im Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6488.4%
Simplified88.4%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.3%
Simplified70.3%
(FPCore (re im)
:precision binary64
(if (<= re 5e+179)
(*
(*
re
(+
0.5
(*
re
(*
re
(+
-0.08333333333333333
(*
(* re re)
(+ 0.004166666666666667 (* (* re re) -9.92063492063492e-5))))))))
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* (* im im) 0.002777777777777778)))))))
(* re (+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664))))))))
double code(double re, double im) {
double tmp;
if (re <= 5e+179) {
tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
} else {
tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 5d+179) then
tmp = (re * (0.5d0 + (re * (re * ((-0.08333333333333333d0) + ((re * re) * (0.004166666666666667d0 + ((re * re) * (-9.92063492063492d-5))))))))) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0))))))
else
tmp = re * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 5e+179) {
tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
} else {
tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 5e+179: tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) else: tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 5e+179) tmp = Float64(Float64(re * Float64(0.5 + Float64(re * Float64(re * Float64(-0.08333333333333333 + Float64(Float64(re * re) * Float64(0.004166666666666667 + Float64(Float64(re * re) * -9.92063492063492e-5)))))))) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778))))))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 5e+179) tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))); else tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 5e+179], N[(N[(re * N[(0.5 + N[(re * N[(re * N[(-0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * N[(0.004166666666666667 + N[(N[(re * re), $MachinePrecision] * -9.92063492063492e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 5 \cdot 10^{+179}:\\
\;\;\;\;\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if re < 5e179Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6493.9%
Simplified93.9%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.5%
Simplified59.5%
if 5e179 < re Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified89.1%
Taylor expanded in re around 0
Simplified20.4%
(FPCore (re im)
:precision binary64
(*
(+
2.0
(*
(* im im)
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* (* im im) 0.002777777777777778))))))
(*
re
(+
0.5
(*
(* re re)
(+ -0.08333333333333333 (* re (* re 0.004166666666666667))))))))
double code(double re, double im) {
return (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667))))));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0)))))) * (re * (0.5d0 + ((re * re) * ((-0.08333333333333333d0) + (re * (re * 0.004166666666666667d0))))))
end function
public static double code(double re, double im) {
return (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667))))));
}
def code(re, im): return (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667))))))
function code(re, im) return Float64(Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778)))))) * Float64(re * Float64(0.5 + Float64(Float64(re * re) * Float64(-0.08333333333333333 + Float64(re * Float64(re * 0.004166666666666667))))))) end
function tmp = code(re, im) tmp = (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667)))))); end
code[re_, im_] := N[(N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(0.5 + N[(N[(re * re), $MachinePrecision] * N[(-0.08333333333333333 + N[(re * N[(re * 0.004166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right) \cdot \left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + re \cdot \left(re \cdot 0.004166666666666667\right)\right)\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6493.8%
Simplified93.8%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6456.0%
Simplified56.0%
Final simplification56.0%
(FPCore (re im)
:precision binary64
(if (<= re 5e+179)
(*
re
(*
(+
2.0
(*
im
(*
im
(+
1.0
(*
(* im im)
(+ 0.08333333333333333 (* im (* im 0.002777777777777778))))))))
(+ 0.5 (* (* re re) -0.08333333333333333))))
(* re (+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664))))))))
double code(double re, double im) {
double tmp;
if (re <= 5e+179) {
tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 5d+179) then
tmp = re * ((2.0d0 + (im * (im * (1.0d0 + ((im * im) * (0.08333333333333333d0 + (im * (im * 0.002777777777777778d0)))))))) * (0.5d0 + ((re * re) * (-0.08333333333333333d0))))
else
tmp = re * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 5e+179) {
tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333)));
} else {
tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 5e+179: tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333))) else: tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))) return tmp
function code(re, im) tmp = 0.0 if (re <= 5e+179) tmp = Float64(re * Float64(Float64(2.0 + Float64(im * Float64(im * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(im * Float64(im * 0.002777777777777778)))))))) * Float64(0.5 + Float64(Float64(re * re) * -0.08333333333333333)))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 5e+179) tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333))); else tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 5e+179], N[(re * N[(N[(2.0 + N[(im * N[(im * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(im * N[(im * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 5 \cdot 10^{+179}:\\
\;\;\;\;re \cdot \left(\left(2 + im \cdot \left(im \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right)\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
\end{array}
\end{array}
if re < 5e179Initial program 100.0%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6493.9%
Simplified93.9%
Taylor expanded in re around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-outN/A
Simplified59.2%
if 5e179 < re Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified89.1%
Taylor expanded in re around 0
Simplified20.4%
Final simplification55.2%
(FPCore (re im)
:precision binary64
(*
re
(+
1.0
(*
(* im im)
(+
0.5
(*
(* im im)
(+ 0.041666666666666664 (* im (* im 0.001388888888888889)))))))))
double code(double re, double im) {
return re * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0)))))))
end function
public static double code(double re, double im) {
return re * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))));
}
def code(re, im): return re * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889)))))))
function code(re, im) return Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889)))))))) end
function tmp = code(re, im) tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))))))); end
code[re_, im_] := N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)
\end{array}
Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified58.9%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6455.9%
Simplified55.9%
Final simplification55.9%
(FPCore (re im) :precision binary64 (* re (+ 1.0 (* (* im im) (+ 0.5 (* (* im im) (* (* im im) 0.001388888888888889)))))))
double code(double re, double im) {
return re * (1.0 + ((im * im) * (0.5 + ((im * im) * ((im * im) * 0.001388888888888889)))));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * ((im * im) * 0.001388888888888889d0)))))
end function
public static double code(double re, double im) {
return re * (1.0 + ((im * im) * (0.5 + ((im * im) * ((im * im) * 0.001388888888888889)))));
}
def code(re, im): return re * (1.0 + ((im * im) * (0.5 + ((im * im) * ((im * im) * 0.001388888888888889)))))
function code(re, im) return Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * Float64(Float64(im * im) * 0.001388888888888889)))))) end
function tmp = code(re, im) tmp = re * (1.0 + ((im * im) * (0.5 + ((im * im) * ((im * im) * 0.001388888888888889))))); end
code[re_, im_] := N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)
\end{array}
Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified58.9%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6455.9%
Simplified55.9%
Taylor expanded in im around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.9%
Simplified55.9%
Final simplification55.9%
(FPCore (re im) :precision binary64 (* re (+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664)))))))
double code(double re, double im) {
return re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
end function
public static double code(double re, double im) {
return re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
}
def code(re, im): return re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))))
function code(re, im) return Float64(re * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))) end
function tmp = code(re, im) tmp = re * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))); end
code[re_, im_] := N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
*-rgt-identityN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
Simplified90.7%
Taylor expanded in re around 0
Simplified54.7%
(FPCore (re im) :precision binary64 (if (<= im 1e+116) (* re (+ 1.0 (* re (* re -0.16666666666666666)))) (* re (+ 1.0 (* (* im im) 0.5)))))
double code(double re, double im) {
double tmp;
if (im <= 1e+116) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = re * (1.0 + ((im * im) * 0.5));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1d+116) then
tmp = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
else
tmp = re * (1.0d0 + ((im * im) * 0.5d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1e+116) {
tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
} else {
tmp = re * (1.0 + ((im * im) * 0.5));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1e+116: tmp = re * (1.0 + (re * (re * -0.16666666666666666))) else: tmp = re * (1.0 + ((im * im) * 0.5)) return tmp
function code(re, im) tmp = 0.0 if (im <= 1e+116) tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))); else tmp = Float64(re * Float64(1.0 + Float64(Float64(im * im) * 0.5))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1e+116) tmp = re * (1.0 + (re * (re * -0.16666666666666666))); else tmp = re * (1.0 + ((im * im) * 0.5)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1e+116], N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(N[(im * im), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 10^{+116}:\\
\;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot 0.5\right)\\
\end{array}
\end{array}
if im < 1.00000000000000002e116Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6462.1%
Simplified62.1%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6438.0%
Simplified38.0%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f6437.7%
Simplified37.7%
if 1.00000000000000002e116 < im Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sub0-negN/A
cosh-undefN/A
associate-*r*N/A
metadata-evalN/A
exp-0N/A
*-lowering-*.f64N/A
exp-0N/A
cosh-lowering-cosh.f64N/A
sin-lowering-sin.f64100.0%
Applied egg-rr100.0%
Taylor expanded in re around 0
Simplified71.4%
Taylor expanded in im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6461.3%
Simplified61.3%
Final simplification40.3%
(FPCore (re im) :precision binary64 (if (<= re 4.2e+115) re (* -0.16666666666666666 (* re (* re re)))))
double code(double re, double im) {
double tmp;
if (re <= 4.2e+115) {
tmp = re;
} else {
tmp = -0.16666666666666666 * (re * (re * re));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 4.2d+115) then
tmp = re
else
tmp = (-0.16666666666666666d0) * (re * (re * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 4.2e+115) {
tmp = re;
} else {
tmp = -0.16666666666666666 * (re * (re * re));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 4.2e+115: tmp = re else: tmp = -0.16666666666666666 * (re * (re * re)) return tmp
function code(re, im) tmp = 0.0 if (re <= 4.2e+115) tmp = re; else tmp = Float64(-0.16666666666666666 * Float64(re * Float64(re * re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 4.2e+115) tmp = re; else tmp = -0.16666666666666666 * (re * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 4.2e+115], re, N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 4.2 \cdot 10^{+115}:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 4.20000000000000007e115Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6456.2%
Simplified56.2%
Taylor expanded in re around 0
Simplified31.5%
if 4.20000000000000007e115 < re Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6451.6%
Simplified51.6%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6433.3%
Simplified33.3%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f6433.3%
Simplified33.3%
Taylor expanded in re around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6433.3%
Simplified33.3%
(FPCore (re im) :precision binary64 (* re (+ 1.0 (* re (* re -0.16666666666666666)))))
double code(double re, double im) {
return re * (1.0 + (re * (re * -0.16666666666666666)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
end function
public static double code(double re, double im) {
return re * (1.0 + (re * (re * -0.16666666666666666)));
}
def code(re, im): return re * (1.0 + (re * (re * -0.16666666666666666)))
function code(re, im) return Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))) end
function tmp = code(re, im) tmp = re * (1.0 + (re * (re * -0.16666666666666666))); end
code[re_, im_] := N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in im around 0
sin-lowering-sin.f6455.6%
Simplified55.6%
Taylor expanded in re around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.0%
Simplified36.0%
Taylor expanded in re around 0
*-commutativeN/A
*-lowering-*.f6435.0%
Simplified35.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%
Taylor expanded in im around 0
sin-lowering-sin.f6455.6%
Simplified55.6%
Taylor expanded in re around 0
Simplified27.6%
herbie shell --seed 2024161
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))