
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp(-im) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp(-im) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp(-im) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp(-im) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp(-im) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + e^{im}\right)
\end{array}
Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (re im)
:precision binary64
(if (<= im 0.19)
(*
(* 0.5 (sin re))
(+ (+ 2.0 (* im im)) (* (pow im 4.0) 0.08333333333333333)))
(if (<= im 1.15e+77)
(* (* 0.5 re) (+ (exp (- im)) (exp im)))
(* 0.041666666666666664 (* (sin re) (pow im 4.0))))))
double code(double re, double im) {
double tmp;
if (im <= 0.19) {
tmp = (0.5 * sin(re)) * ((2.0 + (im * im)) + (pow(im, 4.0) * 0.08333333333333333));
} else if (im <= 1.15e+77) {
tmp = (0.5 * re) * (exp(-im) + exp(im));
} else {
tmp = 0.041666666666666664 * (sin(re) * pow(im, 4.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 0.19d0) then
tmp = (0.5d0 * sin(re)) * ((2.0d0 + (im * im)) + ((im ** 4.0d0) * 0.08333333333333333d0))
else if (im <= 1.15d+77) then
tmp = (0.5d0 * re) * (exp(-im) + exp(im))
else
tmp = 0.041666666666666664d0 * (sin(re) * (im ** 4.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.19) {
tmp = (0.5 * Math.sin(re)) * ((2.0 + (im * im)) + (Math.pow(im, 4.0) * 0.08333333333333333));
} else if (im <= 1.15e+77) {
tmp = (0.5 * re) * (Math.exp(-im) + Math.exp(im));
} else {
tmp = 0.041666666666666664 * (Math.sin(re) * Math.pow(im, 4.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.19: tmp = (0.5 * math.sin(re)) * ((2.0 + (im * im)) + (math.pow(im, 4.0) * 0.08333333333333333)) elif im <= 1.15e+77: tmp = (0.5 * re) * (math.exp(-im) + math.exp(im)) else: tmp = 0.041666666666666664 * (math.sin(re) * math.pow(im, 4.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.19) tmp = Float64(Float64(0.5 * sin(re)) * Float64(Float64(2.0 + Float64(im * im)) + Float64((im ^ 4.0) * 0.08333333333333333))); elseif (im <= 1.15e+77) tmp = Float64(Float64(0.5 * re) * Float64(exp(Float64(-im)) + exp(im))); else tmp = Float64(0.041666666666666664 * Float64(sin(re) * (im ^ 4.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.19) tmp = (0.5 * sin(re)) * ((2.0 + (im * im)) + ((im ^ 4.0) * 0.08333333333333333)); elseif (im <= 1.15e+77) tmp = (0.5 * re) * (exp(-im) + exp(im)); else tmp = 0.041666666666666664 * (sin(re) * (im ^ 4.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.19], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] + N[(N[Power[im, 4.0], $MachinePrecision] * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.15e+77], N[(N[(0.5 * re), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.041666666666666664 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.19:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(\left(2 + im \cdot im\right) + {im}^{4} \cdot 0.08333333333333333\right)\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;0.041666666666666664 \cdot \left(\sin re \cdot {im}^{4}\right)\\
\end{array}
\end{array}
if im < 0.19Initial program 99.5%
sub0-neg99.5%
Simplified99.5%
Taylor expanded in im around 0 91.1%
Simplified91.1%
if 0.19 < im < 1.14999999999999997e77Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 70.6%
Simplified70.6%
if 1.14999999999999997e77 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification91.3%
(FPCore (re im)
:precision binary64
(if (<= im 0.05)
(* (* 0.5 (sin re)) (+ 2.0 (* im im)))
(if (<= im 5e+76)
(* (* 0.5 re) (+ (exp (- im)) (exp im)))
(* 0.041666666666666664 (* (sin re) (pow im 4.0))))))
double code(double re, double im) {
double tmp;
if (im <= 0.05) {
tmp = (0.5 * sin(re)) * (2.0 + (im * im));
} else if (im <= 5e+76) {
tmp = (0.5 * re) * (exp(-im) + exp(im));
} else {
tmp = 0.041666666666666664 * (sin(re) * pow(im, 4.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 0.05d0) then
tmp = (0.5d0 * sin(re)) * (2.0d0 + (im * im))
else if (im <= 5d+76) then
tmp = (0.5d0 * re) * (exp(-im) + exp(im))
else
tmp = 0.041666666666666664d0 * (sin(re) * (im ** 4.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.05) {
tmp = (0.5 * Math.sin(re)) * (2.0 + (im * im));
} else if (im <= 5e+76) {
tmp = (0.5 * re) * (Math.exp(-im) + Math.exp(im));
} else {
tmp = 0.041666666666666664 * (Math.sin(re) * Math.pow(im, 4.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.05: tmp = (0.5 * math.sin(re)) * (2.0 + (im * im)) elif im <= 5e+76: tmp = (0.5 * re) * (math.exp(-im) + math.exp(im)) else: tmp = 0.041666666666666664 * (math.sin(re) * math.pow(im, 4.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.05) tmp = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))); elseif (im <= 5e+76) tmp = Float64(Float64(0.5 * re) * Float64(exp(Float64(-im)) + exp(im))); else tmp = Float64(0.041666666666666664 * Float64(sin(re) * (im ^ 4.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.05) tmp = (0.5 * sin(re)) * (2.0 + (im * im)); elseif (im <= 5e+76) tmp = (0.5 * re) * (exp(-im) + exp(im)); else tmp = 0.041666666666666664 * (sin(re) * (im ^ 4.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.05], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5e+76], N[(N[(0.5 * re), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.041666666666666664 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.05:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 5 \cdot 10^{+76}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;0.041666666666666664 \cdot \left(\sin re \cdot {im}^{4}\right)\\
\end{array}
\end{array}
if im < 0.050000000000000003Initial program 99.5%
sub0-neg99.5%
Simplified99.5%
Taylor expanded in im around 0 80.8%
Simplified80.8%
if 0.050000000000000003 < im < 4.99999999999999991e76Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 70.6%
Simplified70.6%
if 4.99999999999999991e76 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification83.6%
(FPCore (re im)
:precision binary64
(if (<= im 0.045)
(+ (sin re) (* (* 0.5 (sin re)) (* im im)))
(if (<= im 1.15e+77)
(* (* 0.5 re) (+ (exp (- im)) (exp im)))
(* 0.041666666666666664 (* (sin re) (pow im 4.0))))))
double code(double re, double im) {
double tmp;
if (im <= 0.045) {
tmp = sin(re) + ((0.5 * sin(re)) * (im * im));
} else if (im <= 1.15e+77) {
tmp = (0.5 * re) * (exp(-im) + exp(im));
} else {
tmp = 0.041666666666666664 * (sin(re) * pow(im, 4.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 0.045d0) then
tmp = sin(re) + ((0.5d0 * sin(re)) * (im * im))
else if (im <= 1.15d+77) then
tmp = (0.5d0 * re) * (exp(-im) + exp(im))
else
tmp = 0.041666666666666664d0 * (sin(re) * (im ** 4.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 0.045) {
tmp = Math.sin(re) + ((0.5 * Math.sin(re)) * (im * im));
} else if (im <= 1.15e+77) {
tmp = (0.5 * re) * (Math.exp(-im) + Math.exp(im));
} else {
tmp = 0.041666666666666664 * (Math.sin(re) * Math.pow(im, 4.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 0.045: tmp = math.sin(re) + ((0.5 * math.sin(re)) * (im * im)) elif im <= 1.15e+77: tmp = (0.5 * re) * (math.exp(-im) + math.exp(im)) else: tmp = 0.041666666666666664 * (math.sin(re) * math.pow(im, 4.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 0.045) tmp = Float64(sin(re) + Float64(Float64(0.5 * sin(re)) * Float64(im * im))); elseif (im <= 1.15e+77) tmp = Float64(Float64(0.5 * re) * Float64(exp(Float64(-im)) + exp(im))); else tmp = Float64(0.041666666666666664 * Float64(sin(re) * (im ^ 4.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 0.045) tmp = sin(re) + ((0.5 * sin(re)) * (im * im)); elseif (im <= 1.15e+77) tmp = (0.5 * re) * (exp(-im) + exp(im)); else tmp = 0.041666666666666664 * (sin(re) * (im ^ 4.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 0.045], N[(N[Sin[re], $MachinePrecision] + N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.15e+77], N[(N[(0.5 * re), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.041666666666666664 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.045:\\
\;\;\;\;\sin re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;0.041666666666666664 \cdot \left(\sin re \cdot {im}^{4}\right)\\
\end{array}
\end{array}
if im < 0.044999999999999998Initial program 99.5%
sub0-neg99.5%
Simplified99.5%
Taylor expanded in im around 0 80.8%
Simplified80.8%
if 0.044999999999999998 < im < 1.14999999999999997e77Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 70.6%
Simplified70.6%
if 1.14999999999999997e77 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification83.6%
(FPCore (re im)
:precision binary64
(if (<= im 115000.0)
(* (* 0.5 (sin re)) (+ 2.0 (* im im)))
(if (<= im 3.3e+75)
(pow (* (sin re) 1.9380669946781485e-10) -512.0)
(* 0.041666666666666664 (* (sin re) (pow im 4.0))))))
double code(double re, double im) {
double tmp;
if (im <= 115000.0) {
tmp = (0.5 * sin(re)) * (2.0 + (im * im));
} else if (im <= 3.3e+75) {
tmp = pow((sin(re) * 1.9380669946781485e-10), -512.0);
} else {
tmp = 0.041666666666666664 * (sin(re) * pow(im, 4.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 115000.0d0) then
tmp = (0.5d0 * sin(re)) * (2.0d0 + (im * im))
else if (im <= 3.3d+75) then
tmp = (sin(re) * 1.9380669946781485d-10) ** (-512.0d0)
else
tmp = 0.041666666666666664d0 * (sin(re) * (im ** 4.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 115000.0) {
tmp = (0.5 * Math.sin(re)) * (2.0 + (im * im));
} else if (im <= 3.3e+75) {
tmp = Math.pow((Math.sin(re) * 1.9380669946781485e-10), -512.0);
} else {
tmp = 0.041666666666666664 * (Math.sin(re) * Math.pow(im, 4.0));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 115000.0: tmp = (0.5 * math.sin(re)) * (2.0 + (im * im)) elif im <= 3.3e+75: tmp = math.pow((math.sin(re) * 1.9380669946781485e-10), -512.0) else: tmp = 0.041666666666666664 * (math.sin(re) * math.pow(im, 4.0)) return tmp
function code(re, im) tmp = 0.0 if (im <= 115000.0) tmp = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))); elseif (im <= 3.3e+75) tmp = Float64(sin(re) * 1.9380669946781485e-10) ^ -512.0; else tmp = Float64(0.041666666666666664 * Float64(sin(re) * (im ^ 4.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 115000.0) tmp = (0.5 * sin(re)) * (2.0 + (im * im)); elseif (im <= 3.3e+75) tmp = (sin(re) * 1.9380669946781485e-10) ^ -512.0; else tmp = 0.041666666666666664 * (sin(re) * (im ^ 4.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 115000.0], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.3e+75], N[Power[N[(N[Sin[re], $MachinePrecision] * 1.9380669946781485e-10), $MachinePrecision], -512.0], $MachinePrecision], N[(0.041666666666666664 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 115000:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 3.3 \cdot 10^{+75}:\\
\;\;\;\;{\left(\sin re \cdot 1.9380669946781485 \cdot 10^{-10}\right)}^{-512}\\
\mathbf{else}:\\
\;\;\;\;0.041666666666666664 \cdot \left(\sin re \cdot {im}^{4}\right)\\
\end{array}
\end{array}
if im < 115000Initial program 99.5%
sub0-neg99.5%
Simplified99.5%
Taylor expanded in im around 0 80.4%
Simplified80.4%
if 115000 < im < 3.29999999999999998e75Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 5.1%
Simplified5.1%
Applied egg-rr43.8%
if 3.29999999999999998e75 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* 0.5 (sin re)) (+ 2.0 (* im im)))))
(if (<= im 115000.0)
t_0
(if (<= im 1.12e+70)
(pow (* (sin re) 1.9380669946781485e-10) -512.0)
(if (<= im 1.35e+154)
(* 0.5 (/ (* re (- 4.0 (pow im 4.0))) (- 2.0 (* im im))))
t_0)))))
double code(double re, double im) {
double t_0 = (0.5 * sin(re)) * (2.0 + (im * im));
double tmp;
if (im <= 115000.0) {
tmp = t_0;
} else if (im <= 1.12e+70) {
tmp = pow((sin(re) * 1.9380669946781485e-10), -512.0);
} else if (im <= 1.35e+154) {
tmp = 0.5 * ((re * (4.0 - pow(im, 4.0))) / (2.0 - (im * im)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (0.5d0 * sin(re)) * (2.0d0 + (im * im))
if (im <= 115000.0d0) then
tmp = t_0
else if (im <= 1.12d+70) then
tmp = (sin(re) * 1.9380669946781485d-10) ** (-512.0d0)
else if (im <= 1.35d+154) then
tmp = 0.5d0 * ((re * (4.0d0 - (im ** 4.0d0))) / (2.0d0 - (im * im)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (0.5 * Math.sin(re)) * (2.0 + (im * im));
double tmp;
if (im <= 115000.0) {
tmp = t_0;
} else if (im <= 1.12e+70) {
tmp = Math.pow((Math.sin(re) * 1.9380669946781485e-10), -512.0);
} else if (im <= 1.35e+154) {
tmp = 0.5 * ((re * (4.0 - Math.pow(im, 4.0))) / (2.0 - (im * im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (0.5 * math.sin(re)) * (2.0 + (im * im)) tmp = 0 if im <= 115000.0: tmp = t_0 elif im <= 1.12e+70: tmp = math.pow((math.sin(re) * 1.9380669946781485e-10), -512.0) elif im <= 1.35e+154: tmp = 0.5 * ((re * (4.0 - math.pow(im, 4.0))) / (2.0 - (im * im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))) tmp = 0.0 if (im <= 115000.0) tmp = t_0; elseif (im <= 1.12e+70) tmp = Float64(sin(re) * 1.9380669946781485e-10) ^ -512.0; elseif (im <= 1.35e+154) tmp = Float64(0.5 * Float64(Float64(re * Float64(4.0 - (im ^ 4.0))) / Float64(2.0 - Float64(im * im)))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = (0.5 * sin(re)) * (2.0 + (im * im)); tmp = 0.0; if (im <= 115000.0) tmp = t_0; elseif (im <= 1.12e+70) tmp = (sin(re) * 1.9380669946781485e-10) ^ -512.0; elseif (im <= 1.35e+154) tmp = 0.5 * ((re * (4.0 - (im ^ 4.0))) / (2.0 - (im * im))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 115000.0], t$95$0, If[LessEqual[im, 1.12e+70], N[Power[N[(N[Sin[re], $MachinePrecision] * 1.9380669946781485e-10), $MachinePrecision], -512.0], $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(0.5 * N[(N[(re * N[(4.0 - N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{if}\;im \leq 115000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 1.12 \cdot 10^{+70}:\\
\;\;\;\;{\left(\sin re \cdot 1.9380669946781485 \cdot 10^{-10}\right)}^{-512}\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;0.5 \cdot \frac{re \cdot \left(4 - {im}^{4}\right)}{2 - im \cdot im}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < 115000 or 1.35000000000000003e154 < im Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 83.0%
Simplified83.0%
if 115000 < im < 1.11999999999999993e70Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 4.4%
Simplified4.4%
Applied egg-rr42.9%
if 1.11999999999999993e70 < im < 1.35000000000000003e154Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 5.2%
Simplified5.2%
Taylor expanded in re around 0 28.9%
*-commutative28.9%
unpow228.9%
Simplified28.9%
*-commutative28.9%
flip-+89.5%
associate-*l/89.5%
metadata-eval89.5%
pow289.5%
pow289.5%
pow-prod-up89.5%
metadata-eval89.5%
Applied egg-rr89.5%
Final simplification81.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* 0.5 (sin re)) (+ 2.0 (* im im)))))
(if (<= im 115000.0)
t_0
(if (<= im 8e+41)
(log1p (expm1 re))
(if (<= im 1.35e+154)
(* 0.5 (/ (* re (- 4.0 (pow im 4.0))) (- 2.0 (* im im))))
t_0)))))
double code(double re, double im) {
double t_0 = (0.5 * sin(re)) * (2.0 + (im * im));
double tmp;
if (im <= 115000.0) {
tmp = t_0;
} else if (im <= 8e+41) {
tmp = log1p(expm1(re));
} else if (im <= 1.35e+154) {
tmp = 0.5 * ((re * (4.0 - pow(im, 4.0))) / (2.0 - (im * im)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double re, double im) {
double t_0 = (0.5 * Math.sin(re)) * (2.0 + (im * im));
double tmp;
if (im <= 115000.0) {
tmp = t_0;
} else if (im <= 8e+41) {
tmp = Math.log1p(Math.expm1(re));
} else if (im <= 1.35e+154) {
tmp = 0.5 * ((re * (4.0 - Math.pow(im, 4.0))) / (2.0 - (im * im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = (0.5 * math.sin(re)) * (2.0 + (im * im)) tmp = 0 if im <= 115000.0: tmp = t_0 elif im <= 8e+41: tmp = math.log1p(math.expm1(re)) elif im <= 1.35e+154: tmp = 0.5 * ((re * (4.0 - math.pow(im, 4.0))) / (2.0 - (im * im))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))) tmp = 0.0 if (im <= 115000.0) tmp = t_0; elseif (im <= 8e+41) tmp = log1p(expm1(re)); elseif (im <= 1.35e+154) tmp = Float64(0.5 * Float64(Float64(re * Float64(4.0 - (im ^ 4.0))) / Float64(2.0 - Float64(im * im)))); else tmp = t_0; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 115000.0], t$95$0, If[LessEqual[im, 8e+41], N[Log[1 + N[(Exp[re] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(0.5 * N[(N[(re * N[(4.0 - N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{if}\;im \leq 115000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 8 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(re\right)\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;0.5 \cdot \frac{re \cdot \left(4 - {im}^{4}\right)}{2 - im \cdot im}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < 115000 or 1.35000000000000003e154 < im Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 83.0%
Simplified83.0%
if 115000 < im < 8.00000000000000005e41Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 60.0%
Simplified60.0%
Applied egg-rr60.0%
if 8.00000000000000005e41 < im < 1.35000000000000003e154Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 4.5%
Simplified4.5%
Taylor expanded in re around 0 27.4%
*-commutative27.4%
unpow227.4%
Simplified27.4%
*-commutative27.4%
flip-+68.5%
associate-*l/71.9%
metadata-eval71.9%
pow271.9%
pow271.9%
pow-prod-up71.9%
metadata-eval71.9%
Applied egg-rr71.9%
Final simplification81.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (- 4.0 (pow im 4.0)))
(t_1 (* (* 0.5 (sin re)) (+ 2.0 (* im im))))
(t_2 (- 2.0 (* im im))))
(if (<= im 115000.0)
t_1
(if (<= im 6e+39)
(* 0.5 (/ (* t_0 (* re re)) (* re t_2)))
(if (<= im 1.35e+154) (* 0.5 (/ (* re t_0) t_2)) t_1)))))
double code(double re, double im) {
double t_0 = 4.0 - pow(im, 4.0);
double t_1 = (0.5 * sin(re)) * (2.0 + (im * im));
double t_2 = 2.0 - (im * im);
double tmp;
if (im <= 115000.0) {
tmp = t_1;
} else if (im <= 6e+39) {
tmp = 0.5 * ((t_0 * (re * re)) / (re * t_2));
} else if (im <= 1.35e+154) {
tmp = 0.5 * ((re * t_0) / t_2);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 4.0d0 - (im ** 4.0d0)
t_1 = (0.5d0 * sin(re)) * (2.0d0 + (im * im))
t_2 = 2.0d0 - (im * im)
if (im <= 115000.0d0) then
tmp = t_1
else if (im <= 6d+39) then
tmp = 0.5d0 * ((t_0 * (re * re)) / (re * t_2))
else if (im <= 1.35d+154) then
tmp = 0.5d0 * ((re * t_0) / t_2)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 4.0 - Math.pow(im, 4.0);
double t_1 = (0.5 * Math.sin(re)) * (2.0 + (im * im));
double t_2 = 2.0 - (im * im);
double tmp;
if (im <= 115000.0) {
tmp = t_1;
} else if (im <= 6e+39) {
tmp = 0.5 * ((t_0 * (re * re)) / (re * t_2));
} else if (im <= 1.35e+154) {
tmp = 0.5 * ((re * t_0) / t_2);
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 4.0 - math.pow(im, 4.0) t_1 = (0.5 * math.sin(re)) * (2.0 + (im * im)) t_2 = 2.0 - (im * im) tmp = 0 if im <= 115000.0: tmp = t_1 elif im <= 6e+39: tmp = 0.5 * ((t_0 * (re * re)) / (re * t_2)) elif im <= 1.35e+154: tmp = 0.5 * ((re * t_0) / t_2) else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(4.0 - (im ^ 4.0)) t_1 = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))) t_2 = Float64(2.0 - Float64(im * im)) tmp = 0.0 if (im <= 115000.0) tmp = t_1; elseif (im <= 6e+39) tmp = Float64(0.5 * Float64(Float64(t_0 * Float64(re * re)) / Float64(re * t_2))); elseif (im <= 1.35e+154) tmp = Float64(0.5 * Float64(Float64(re * t_0) / t_2)); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 4.0 - (im ^ 4.0); t_1 = (0.5 * sin(re)) * (2.0 + (im * im)); t_2 = 2.0 - (im * im); tmp = 0.0; if (im <= 115000.0) tmp = t_1; elseif (im <= 6e+39) tmp = 0.5 * ((t_0 * (re * re)) / (re * t_2)); elseif (im <= 1.35e+154) tmp = 0.5 * ((re * t_0) / t_2); else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(4.0 - N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 115000.0], t$95$1, If[LessEqual[im, 6e+39], N[(0.5 * N[(N[(t$95$0 * N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(re * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(0.5 * N[(N[(re * t$95$0), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 - {im}^{4}\\
t_1 := \left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
t_2 := 2 - im \cdot im\\
\mathbf{if}\;im \leq 115000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 6 \cdot 10^{+39}:\\
\;\;\;\;0.5 \cdot \frac{t_0 \cdot \left(re \cdot re\right)}{re \cdot t_2}\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;0.5 \cdot \frac{re \cdot t_0}{t_2}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < 115000 or 1.35000000000000003e154 < im Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 83.0%
Simplified83.0%
if 115000 < im < 5.9999999999999999e39Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 3.5%
Simplified3.5%
Taylor expanded in re around 0 3.0%
*-commutative3.0%
unpow23.0%
Simplified3.0%
distribute-lft-in3.0%
flip-+40.8%
Applied egg-rr40.8%
swap-sqr40.8%
metadata-eval40.8%
swap-sqr40.8%
associate-*r*40.8%
unpow340.8%
pow-plus40.8%
metadata-eval40.8%
distribute-lft-out--40.8%
distribute-lft-out--40.8%
Simplified40.8%
if 5.9999999999999999e39 < im < 1.35000000000000003e154Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 4.5%
Simplified4.5%
Taylor expanded in re around 0 27.4%
*-commutative27.4%
unpow227.4%
Simplified27.4%
*-commutative27.4%
flip-+68.5%
associate-*l/71.9%
metadata-eval71.9%
pow271.9%
pow271.9%
pow-prod-up71.9%
metadata-eval71.9%
Applied egg-rr71.9%
Final simplification80.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* 0.5 (sin re)) (+ 2.0 (* im im)))))
(if (<= im 115000.0)
t_0
(if (<= im 1.5e+80)
(+
(/ 0.25 (* re re))
(fma re (* re 0.016666666666666666) 0.08333333333333333))
(if (<= im 1.35e+154)
(* 0.5 (/ re (/ (- 2.0 (* im im)) (- 4.0 (pow im 4.0)))))
t_0)))))
double code(double re, double im) {
double t_0 = (0.5 * sin(re)) * (2.0 + (im * im));
double tmp;
if (im <= 115000.0) {
tmp = t_0;
} else if (im <= 1.5e+80) {
tmp = (0.25 / (re * re)) + fma(re, (re * 0.016666666666666666), 0.08333333333333333);
} else if (im <= 1.35e+154) {
tmp = 0.5 * (re / ((2.0 - (im * im)) / (4.0 - pow(im, 4.0))));
} else {
tmp = t_0;
}
return tmp;
}
function code(re, im) t_0 = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))) tmp = 0.0 if (im <= 115000.0) tmp = t_0; elseif (im <= 1.5e+80) tmp = Float64(Float64(0.25 / Float64(re * re)) + fma(re, Float64(re * 0.016666666666666666), 0.08333333333333333)); elseif (im <= 1.35e+154) tmp = Float64(0.5 * Float64(re / Float64(Float64(2.0 - Float64(im * im)) / Float64(4.0 - (im ^ 4.0))))); else tmp = t_0; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 115000.0], t$95$0, If[LessEqual[im, 1.5e+80], N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(re * N[(re * 0.016666666666666666), $MachinePrecision] + 0.08333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(0.5 * N[(re / N[(N[(2.0 - N[(im * im), $MachinePrecision]), $MachinePrecision] / N[(4.0 - N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{if}\;im \leq 115000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 1.5 \cdot 10^{+80}:\\
\;\;\;\;\frac{0.25}{re \cdot re} + \mathsf{fma}\left(re, re \cdot 0.016666666666666666, 0.08333333333333333\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;0.5 \cdot \frac{re}{\frac{2 - im \cdot im}{4 - {im}^{4}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if im < 115000 or 1.35000000000000003e154 < im Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 83.0%
Simplified83.0%
if 115000 < im < 1.49999999999999993e80Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr7.6%
Taylor expanded in re around 0 20.2%
+-commutative20.2%
associate-+l+20.2%
associate-*r/20.2%
metadata-eval20.2%
unpow220.2%
*-commutative20.2%
unpow220.2%
associate-*l*20.2%
fma-def20.2%
Simplified20.2%
if 1.49999999999999993e80 < im < 1.35000000000000003e154Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 5.2%
Simplified5.2%
Taylor expanded in re around 0 26.5%
*-commutative26.5%
unpow226.5%
Simplified26.5%
flip-+94.1%
associate-*r/94.1%
metadata-eval94.1%
pow294.1%
pow294.1%
pow-prod-up94.1%
metadata-eval94.1%
Applied egg-rr94.1%
associate-/l*94.1%
Simplified94.1%
Final simplification79.8%
(FPCore (re im) :precision binary64 (if (or (<= im 3250000.0) (not (<= im 1.35e+154))) (* (* 0.5 (sin re)) (+ 2.0 (* im im))) (* 0.5 (/ (* re (- 4.0 (pow im 4.0))) (- 2.0 (* im im))))))
double code(double re, double im) {
double tmp;
if ((im <= 3250000.0) || !(im <= 1.35e+154)) {
tmp = (0.5 * sin(re)) * (2.0 + (im * im));
} else {
tmp = 0.5 * ((re * (4.0 - pow(im, 4.0))) / (2.0 - (im * im)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((im <= 3250000.0d0) .or. (.not. (im <= 1.35d+154))) then
tmp = (0.5d0 * sin(re)) * (2.0d0 + (im * im))
else
tmp = 0.5d0 * ((re * (4.0d0 - (im ** 4.0d0))) / (2.0d0 - (im * im)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((im <= 3250000.0) || !(im <= 1.35e+154)) {
tmp = (0.5 * Math.sin(re)) * (2.0 + (im * im));
} else {
tmp = 0.5 * ((re * (4.0 - Math.pow(im, 4.0))) / (2.0 - (im * im)));
}
return tmp;
}
def code(re, im): tmp = 0 if (im <= 3250000.0) or not (im <= 1.35e+154): tmp = (0.5 * math.sin(re)) * (2.0 + (im * im)) else: tmp = 0.5 * ((re * (4.0 - math.pow(im, 4.0))) / (2.0 - (im * im))) return tmp
function code(re, im) tmp = 0.0 if ((im <= 3250000.0) || !(im <= 1.35e+154)) tmp = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * im))); else tmp = Float64(0.5 * Float64(Float64(re * Float64(4.0 - (im ^ 4.0))) / Float64(2.0 - Float64(im * im)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((im <= 3250000.0) || ~((im <= 1.35e+154))) tmp = (0.5 * sin(re)) * (2.0 + (im * im)); else tmp = 0.5 * ((re * (4.0 - (im ^ 4.0))) / (2.0 - (im * im))); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[im, 3250000.0], N[Not[LessEqual[im, 1.35e+154]], $MachinePrecision]], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(re * N[(4.0 - N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3250000 \lor \neg \left(im \leq 1.35 \cdot 10^{+154}\right):\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{re \cdot \left(4 - {im}^{4}\right)}{2 - im \cdot im}\\
\end{array}
\end{array}
if im < 3.25e6 or 1.35000000000000003e154 < im Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 83.0%
Simplified83.0%
if 3.25e6 < im < 1.35000000000000003e154Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 4.4%
Simplified4.4%
Taylor expanded in re around 0 23.7%
*-commutative23.7%
unpow223.7%
Simplified23.7%
*-commutative23.7%
flip-+58.6%
associate-*l/61.4%
metadata-eval61.4%
pow261.4%
pow261.4%
pow-prod-up61.4%
metadata-eval61.4%
Applied egg-rr61.4%
Final simplification80.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 2.0 (* im im))) (t_1 (* (* 0.5 (sin re)) t_0)))
(if (<= im 115000.0)
t_1
(if (<= im 2.9e+80)
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))
(if (<= im 1.35e+154) (* 0.5 (* re t_0)) t_1)))))
double code(double re, double im) {
double t_0 = 2.0 + (im * im);
double t_1 = (0.5 * sin(re)) * t_0;
double tmp;
if (im <= 115000.0) {
tmp = t_1;
} else if (im <= 2.9e+80) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 1.35e+154) {
tmp = 0.5 * (re * t_0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 2.0d0 + (im * im)
t_1 = (0.5d0 * sin(re)) * t_0
if (im <= 115000.0d0) then
tmp = t_1
else if (im <= 2.9d+80) then
tmp = 0.08333333333333333d0 + ((0.25d0 / (re * re)) + ((re * re) * 0.016666666666666666d0))
else if (im <= 1.35d+154) then
tmp = 0.5d0 * (re * t_0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 2.0 + (im * im);
double t_1 = (0.5 * Math.sin(re)) * t_0;
double tmp;
if (im <= 115000.0) {
tmp = t_1;
} else if (im <= 2.9e+80) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 1.35e+154) {
tmp = 0.5 * (re * t_0);
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = 2.0 + (im * im) t_1 = (0.5 * math.sin(re)) * t_0 tmp = 0 if im <= 115000.0: tmp = t_1 elif im <= 2.9e+80: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) elif im <= 1.35e+154: tmp = 0.5 * (re * t_0) else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(2.0 + Float64(im * im)) t_1 = Float64(Float64(0.5 * sin(re)) * t_0) tmp = 0.0 if (im <= 115000.0) tmp = t_1; elseif (im <= 2.9e+80) tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); elseif (im <= 1.35e+154) tmp = Float64(0.5 * Float64(re * t_0)); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = 2.0 + (im * im); t_1 = (0.5 * sin(re)) * t_0; tmp = 0.0; if (im <= 115000.0) tmp = t_1; elseif (im <= 2.9e+80) tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); elseif (im <= 1.35e+154) tmp = 0.5 * (re * t_0); else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[im, 115000.0], t$95$1, If[LessEqual[im, 2.9e+80], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(0.5 * N[(re * t$95$0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + im \cdot im\\
t_1 := \left(0.5 \cdot \sin re\right) \cdot t_0\\
\mathbf{if}\;im \leq 115000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 2.9 \cdot 10^{+80}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;0.5 \cdot \left(re \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < 115000 or 1.35000000000000003e154 < im Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 83.0%
Simplified83.0%
if 115000 < im < 2.89999999999999986e80Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr7.6%
Taylor expanded in re around 0 20.2%
associate-*r/20.2%
metadata-eval20.2%
unpow220.2%
*-commutative20.2%
unpow220.2%
Simplified20.2%
if 2.89999999999999986e80 < im < 1.35000000000000003e154Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 5.2%
Simplified5.2%
Taylor expanded in re around 0 26.5%
*-commutative26.5%
unpow226.5%
Simplified26.5%
Final simplification75.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 2.0 (* im im))) (t_1 (* (* 0.5 (sin re)) t_0)))
(if (<= im 115000.0)
t_1
(if (<= im 1.9e+80)
(+
(/ 0.25 (* re re))
(fma re (* re 0.016666666666666666) 0.08333333333333333))
(if (<= im 1.35e+154) (* 0.5 (* re t_0)) t_1)))))
double code(double re, double im) {
double t_0 = 2.0 + (im * im);
double t_1 = (0.5 * sin(re)) * t_0;
double tmp;
if (im <= 115000.0) {
tmp = t_1;
} else if (im <= 1.9e+80) {
tmp = (0.25 / (re * re)) + fma(re, (re * 0.016666666666666666), 0.08333333333333333);
} else if (im <= 1.35e+154) {
tmp = 0.5 * (re * t_0);
} else {
tmp = t_1;
}
return tmp;
}
function code(re, im) t_0 = Float64(2.0 + Float64(im * im)) t_1 = Float64(Float64(0.5 * sin(re)) * t_0) tmp = 0.0 if (im <= 115000.0) tmp = t_1; elseif (im <= 1.9e+80) tmp = Float64(Float64(0.25 / Float64(re * re)) + fma(re, Float64(re * 0.016666666666666666), 0.08333333333333333)); elseif (im <= 1.35e+154) tmp = Float64(0.5 * Float64(re * t_0)); else tmp = t_1; end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[im, 115000.0], t$95$1, If[LessEqual[im, 1.9e+80], N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(re * N[(re * 0.016666666666666666), $MachinePrecision] + 0.08333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(0.5 * N[(re * t$95$0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + im \cdot im\\
t_1 := \left(0.5 \cdot \sin re\right) \cdot t_0\\
\mathbf{if}\;im \leq 115000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 1.9 \cdot 10^{+80}:\\
\;\;\;\;\frac{0.25}{re \cdot re} + \mathsf{fma}\left(re, re \cdot 0.016666666666666666, 0.08333333333333333\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;0.5 \cdot \left(re \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if im < 115000 or 1.35000000000000003e154 < im Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 83.0%
Simplified83.0%
if 115000 < im < 1.89999999999999999e80Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr7.6%
Taylor expanded in re around 0 20.2%
+-commutative20.2%
associate-+l+20.2%
associate-*r/20.2%
metadata-eval20.2%
unpow220.2%
*-commutative20.2%
unpow220.2%
associate-*l*20.2%
fma-def20.2%
Simplified20.2%
if 1.89999999999999999e80 < im < 1.35000000000000003e154Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 5.2%
Simplified5.2%
Taylor expanded in re around 0 26.5%
*-commutative26.5%
unpow226.5%
Simplified26.5%
Final simplification75.3%
(FPCore (re im)
:precision binary64
(if (<= im 120000.0)
(sin re)
(if (<= im 2.9e+80)
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))
(if (<= im 3.8e+215)
(* 0.5 (* re (+ 2.0 (* im im))))
(* im (* 0.5 (* (sin re) im)))))))
double code(double re, double im) {
double tmp;
if (im <= 120000.0) {
tmp = sin(re);
} else if (im <= 2.9e+80) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 3.8e+215) {
tmp = 0.5 * (re * (2.0 + (im * im)));
} else {
tmp = im * (0.5 * (sin(re) * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 120000.0d0) then
tmp = sin(re)
else if (im <= 2.9d+80) then
tmp = 0.08333333333333333d0 + ((0.25d0 / (re * re)) + ((re * re) * 0.016666666666666666d0))
else if (im <= 3.8d+215) then
tmp = 0.5d0 * (re * (2.0d0 + (im * im)))
else
tmp = im * (0.5d0 * (sin(re) * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 120000.0) {
tmp = Math.sin(re);
} else if (im <= 2.9e+80) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else if (im <= 3.8e+215) {
tmp = 0.5 * (re * (2.0 + (im * im)));
} else {
tmp = im * (0.5 * (Math.sin(re) * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 120000.0: tmp = math.sin(re) elif im <= 2.9e+80: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) elif im <= 3.8e+215: tmp = 0.5 * (re * (2.0 + (im * im))) else: tmp = im * (0.5 * (math.sin(re) * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 120000.0) tmp = sin(re); elseif (im <= 2.9e+80) tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); elseif (im <= 3.8e+215) tmp = Float64(0.5 * Float64(re * Float64(2.0 + Float64(im * im)))); else tmp = Float64(im * Float64(0.5 * Float64(sin(re) * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 120000.0) tmp = sin(re); elseif (im <= 2.9e+80) tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); elseif (im <= 3.8e+215) tmp = 0.5 * (re * (2.0 + (im * im))); else tmp = im * (0.5 * (sin(re) * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 120000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.9e+80], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.8e+215], N[(0.5 * N[(re * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(0.5 * N[(N[Sin[re], $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 120000:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.9 \cdot 10^{+80}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\mathbf{elif}\;im \leq 3.8 \cdot 10^{+215}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(2 + im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(\sin re \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 1.2e5Initial program 99.5%
sub0-neg99.5%
Simplified99.5%
Taylor expanded in im around 0 62.2%
if 1.2e5 < im < 2.89999999999999986e80Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr7.6%
Taylor expanded in re around 0 20.2%
associate-*r/20.2%
metadata-eval20.2%
unpow220.2%
*-commutative20.2%
unpow220.2%
Simplified20.2%
if 2.89999999999999986e80 < im < 3.79999999999999968e215Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 44.5%
Simplified44.5%
Taylor expanded in re around 0 53.4%
*-commutative53.4%
unpow253.4%
Simplified53.4%
if 3.79999999999999968e215 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Simplified100.0%
Taylor expanded in im around inf 100.0%
associate-*r*100.0%
unpow2100.0%
associate-*r*94.5%
*-commutative94.5%
associate-*l*94.5%
*-commutative94.5%
Simplified94.5%
Final simplification60.7%
(FPCore (re im)
:precision binary64
(if (<= im 115000.0)
(sin re)
(if (<= im 2.9e+80)
(+
0.08333333333333333
(+ (/ 0.25 (* re re)) (* (* re re) 0.016666666666666666)))
(* 0.5 (* re (+ 2.0 (* im im)))))))
double code(double re, double im) {
double tmp;
if (im <= 115000.0) {
tmp = sin(re);
} else if (im <= 2.9e+80) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else {
tmp = 0.5 * (re * (2.0 + (im * im)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 115000.0d0) then
tmp = sin(re)
else if (im <= 2.9d+80) then
tmp = 0.08333333333333333d0 + ((0.25d0 / (re * re)) + ((re * re) * 0.016666666666666666d0))
else
tmp = 0.5d0 * (re * (2.0d0 + (im * im)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 115000.0) {
tmp = Math.sin(re);
} else if (im <= 2.9e+80) {
tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666));
} else {
tmp = 0.5 * (re * (2.0 + (im * im)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 115000.0: tmp = math.sin(re) elif im <= 2.9e+80: tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)) else: tmp = 0.5 * (re * (2.0 + (im * im))) return tmp
function code(re, im) tmp = 0.0 if (im <= 115000.0) tmp = sin(re); elseif (im <= 2.9e+80) tmp = Float64(0.08333333333333333 + Float64(Float64(0.25 / Float64(re * re)) + Float64(Float64(re * re) * 0.016666666666666666))); else tmp = Float64(0.5 * Float64(re * Float64(2.0 + Float64(im * im)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 115000.0) tmp = sin(re); elseif (im <= 2.9e+80) tmp = 0.08333333333333333 + ((0.25 / (re * re)) + ((re * re) * 0.016666666666666666)); else tmp = 0.5 * (re * (2.0 + (im * im))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 115000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.9e+80], N[(0.08333333333333333 + N[(N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 115000:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 2.9 \cdot 10^{+80}:\\
\;\;\;\;0.08333333333333333 + \left(\frac{0.25}{re \cdot re} + \left(re \cdot re\right) \cdot 0.016666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(2 + im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 115000Initial program 99.5%
sub0-neg99.5%
Simplified99.5%
Taylor expanded in im around 0 62.2%
if 115000 < im < 2.89999999999999986e80Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr7.6%
Taylor expanded in re around 0 20.2%
associate-*r/20.2%
metadata-eval20.2%
unpow220.2%
*-commutative20.2%
unpow220.2%
Simplified20.2%
if 2.89999999999999986e80 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 65.0%
Simplified65.0%
Taylor expanded in re around 0 57.6%
*-commutative57.6%
unpow257.6%
Simplified57.6%
Final simplification58.7%
(FPCore (re im) :precision binary64 (if (<= im 1.42) re (* 0.5 (* im (* re im)))))
double code(double re, double im) {
double tmp;
if (im <= 1.42) {
tmp = re;
} else {
tmp = 0.5 * (im * (re * im));
}
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) then
tmp = re
else
tmp = 0.5d0 * (im * (re * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.42) {
tmp = re;
} else {
tmp = 0.5 * (im * (re * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.42: tmp = re else: tmp = 0.5 * (im * (re * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.42) tmp = re; else tmp = Float64(0.5 * Float64(im * Float64(re * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.42) tmp = re; else tmp = 0.5 * (im * (re * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.42], re, N[(0.5 * N[(im * N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.42:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(re \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 1.4199999999999999Initial program 99.5%
sub0-neg99.5%
Simplified99.5%
Taylor expanded in re around 0 66.5%
Simplified66.5%
Taylor expanded in im around 0 37.5%
if 1.4199999999999999 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 48.4%
Simplified48.4%
Taylor expanded in re around 0 47.4%
*-commutative47.4%
unpow247.4%
Simplified47.4%
Taylor expanded in im around inf 47.4%
unpow247.4%
*-commutative47.4%
associate-*l*35.4%
Simplified35.4%
Final simplification37.0%
(FPCore (re im) :precision binary64 (if (<= im 1.42) re (* 0.5 (* re (* im im)))))
double code(double re, double im) {
double tmp;
if (im <= 1.42) {
tmp = re;
} else {
tmp = 0.5 * (re * (im * im));
}
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) then
tmp = re
else
tmp = 0.5d0 * (re * (im * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.42) {
tmp = re;
} else {
tmp = 0.5 * (re * (im * im));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.42: tmp = re else: tmp = 0.5 * (re * (im * im)) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.42) tmp = re; else tmp = Float64(0.5 * Float64(re * Float64(im * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.42) tmp = re; else tmp = 0.5 * (re * (im * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.42], re, N[(0.5 * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.42:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 1.4199999999999999Initial program 99.5%
sub0-neg99.5%
Simplified99.5%
Taylor expanded in re around 0 66.5%
Simplified66.5%
Taylor expanded in im around 0 37.5%
if 1.4199999999999999 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 48.4%
Simplified48.4%
Taylor expanded in re around 0 47.4%
*-commutative47.4%
unpow247.4%
Simplified47.4%
Taylor expanded in im around inf 47.4%
unpow247.4%
Simplified47.4%
Final simplification39.9%
(FPCore (re im) :precision binary64 (* 0.5 (* re (+ 2.0 (* im im)))))
double code(double re, double im) {
return 0.5 * (re * (2.0 + (im * im)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.5d0 * (re * (2.0d0 + (im * im)))
end function
public static double code(double re, double im) {
return 0.5 * (re * (2.0 + (im * im)));
}
def code(re, im): return 0.5 * (re * (2.0 + (im * im)))
function code(re, im) return Float64(0.5 * Float64(re * Float64(2.0 + Float64(im * im)))) end
function tmp = code(re, im) tmp = 0.5 * (re * (2.0 + (im * im))); end
code[re_, im_] := N[(0.5 * N[(re * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \left(re \cdot \left(2 + im \cdot im\right)\right)
\end{array}
Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 72.8%
Simplified72.8%
Taylor expanded in re around 0 53.1%
*-commutative53.1%
unpow253.1%
Simplified53.1%
Final simplification53.1%
(FPCore (re im) :precision binary64 (if (<= im 3700000.0) re (/ 0.25 (* re re))))
double code(double re, double im) {
double tmp;
if (im <= 3700000.0) {
tmp = re;
} else {
tmp = 0.25 / (re * re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 3700000.0d0) then
tmp = re
else
tmp = 0.25d0 / (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 3700000.0) {
tmp = re;
} else {
tmp = 0.25 / (re * re);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 3700000.0: tmp = re else: tmp = 0.25 / (re * re) return tmp
function code(re, im) tmp = 0.0 if (im <= 3700000.0) tmp = re; else tmp = Float64(0.25 / Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 3700000.0) tmp = re; else tmp = 0.25 / (re * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 3700000.0], re, N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3700000:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{re \cdot re}\\
\end{array}
\end{array}
if im < 3.7e6Initial program 99.5%
sub0-neg99.5%
Simplified99.5%
Taylor expanded in re around 0 66.1%
Simplified66.1%
Taylor expanded in im around 0 37.3%
if 3.7e6 < im Initial program 100.0%
sub0-neg100.0%
Simplified100.0%
Applied egg-rr8.1%
Taylor expanded in re around 0 8.0%
unpow28.0%
Simplified8.0%
Final simplification30.2%
(FPCore (re im) :precision binary64 1.9380669946781485e-10)
double code(double re, double im) {
return 1.9380669946781485e-10;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 1.9380669946781485d-10
end function
public static double code(double re, double im) {
return 1.9380669946781485e-10;
}
def code(re, im): return 1.9380669946781485e-10
function code(re, im) return 1.9380669946781485e-10 end
function tmp = code(re, im) tmp = 1.9380669946781485e-10; end
code[re_, im_] := 1.9380669946781485e-10
\begin{array}{l}
\\
1.9380669946781485 \cdot 10^{-10}
\end{array}
Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 87.0%
Simplified87.0%
Applied egg-rr3.4%
+-inverses3.4%
+-rgt-identity3.4%
associate-*l/3.4%
*-inverses3.4%
metadata-eval3.4%
Simplified3.4%
Final simplification3.4%
(FPCore (re im) :precision binary64 1.0)
double code(double re, double im) {
return 1.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 1.0d0
end function
public static double code(double re, double im) {
return 1.0;
}
def code(re, im): return 1.0
function code(re, im) return 1.0 end
function tmp = code(re, im) tmp = 1.0; end
code[re_, im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in im around 0 87.0%
Simplified87.0%
Applied egg-rr4.3%
*-inverses4.3%
Simplified4.3%
Final simplification4.3%
(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 99.6%
sub0-neg99.6%
Simplified99.6%
Taylor expanded in re around 0 69.6%
Simplified69.6%
Taylor expanded in im around 0 29.0%
Final simplification29.0%
herbie shell --seed 2023258
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))