
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp(-im) + exp(im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp(-im) + exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp(-im) + Math.exp(im));
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp(-im) + math.exp(im))
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) + exp(im))) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp(-im) + exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + e^{im}\right)
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp im) 1.0)))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp(im) + 1.0);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp(im) + 1.0d0)
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp(im) + 1.0);
}
def code(re, im): return (0.5 * math.sin(re)) * (math.exp(im) + 1.0)
function code(re, im) return Float64(Float64(0.5 * sin(re)) * Float64(exp(im) + 1.0)) end
function tmp = code(re, im) tmp = (0.5 * sin(re)) * (exp(im) + 1.0); end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[im], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{im} + 1\right)
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 76.1%
Final simplification76.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (sin re))))
(if (<= im 33.0)
(*
t_0
(+ (+ 1.0 (* im (+ (* 0.5 im) -1.0))) (+ 1.0 (* im (+ 1.0 (* 0.5 im))))))
(if (<= im 1e+103)
(* (+ (exp im) 1.0) (* 0.5 re))
(*
t_0
(+ 2.0 (* im (+ 1.0 (* im (+ 0.5 (* im 0.16666666666666666)))))))))))
double code(double re, double im) {
double t_0 = 0.5 * sin(re);
double tmp;
if (im <= 33.0) {
tmp = t_0 * ((1.0 + (im * ((0.5 * im) + -1.0))) + (1.0 + (im * (1.0 + (0.5 * im)))));
} else if (im <= 1e+103) {
tmp = (exp(im) + 1.0) * (0.5 * re);
} else {
tmp = t_0 * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666))))));
}
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)
if (im <= 33.0d0) then
tmp = t_0 * ((1.0d0 + (im * ((0.5d0 * im) + (-1.0d0)))) + (1.0d0 + (im * (1.0d0 + (0.5d0 * im)))))
else if (im <= 1d+103) then
tmp = (exp(im) + 1.0d0) * (0.5d0 * re)
else
tmp = t_0 * (2.0d0 + (im * (1.0d0 + (im * (0.5d0 + (im * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 * Math.sin(re);
double tmp;
if (im <= 33.0) {
tmp = t_0 * ((1.0 + (im * ((0.5 * im) + -1.0))) + (1.0 + (im * (1.0 + (0.5 * im)))));
} else if (im <= 1e+103) {
tmp = (Math.exp(im) + 1.0) * (0.5 * re);
} else {
tmp = t_0 * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666))))));
}
return tmp;
}
def code(re, im): t_0 = 0.5 * math.sin(re) tmp = 0 if im <= 33.0: tmp = t_0 * ((1.0 + (im * ((0.5 * im) + -1.0))) + (1.0 + (im * (1.0 + (0.5 * im))))) elif im <= 1e+103: tmp = (math.exp(im) + 1.0) * (0.5 * re) else: tmp = t_0 * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666)))))) return tmp
function code(re, im) t_0 = Float64(0.5 * sin(re)) tmp = 0.0 if (im <= 33.0) tmp = Float64(t_0 * Float64(Float64(1.0 + Float64(im * Float64(Float64(0.5 * im) + -1.0))) + Float64(1.0 + Float64(im * Float64(1.0 + Float64(0.5 * im)))))); elseif (im <= 1e+103) tmp = Float64(Float64(exp(im) + 1.0) * Float64(0.5 * re)); else tmp = Float64(t_0 * Float64(2.0 + Float64(im * Float64(1.0 + Float64(im * Float64(0.5 + Float64(im * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * sin(re); tmp = 0.0; if (im <= 33.0) tmp = t_0 * ((1.0 + (im * ((0.5 * im) + -1.0))) + (1.0 + (im * (1.0 + (0.5 * im))))); elseif (im <= 1e+103) tmp = (exp(im) + 1.0) * (0.5 * re); else tmp = t_0 * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 33.0], N[(t$95$0 * N[(N[(1.0 + N[(im * N[(N[(0.5 * im), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(im * N[(1.0 + N[(0.5 * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1e+103], N[(N[(N[Exp[im], $MachinePrecision] + 1.0), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 + N[(im * N[(1.0 + N[(im * N[(0.5 + N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \sin re\\
\mathbf{if}\;im \leq 33:\\
\;\;\;\;t\_0 \cdot \left(\left(1 + im \cdot \left(0.5 \cdot im + -1\right)\right) + \left(1 + im \cdot \left(1 + 0.5 \cdot im\right)\right)\right)\\
\mathbf{elif}\;im \leq 10^{+103}:\\
\;\;\;\;\left(e^{im} + 1\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 + im \cdot \left(1 + im \cdot \left(0.5 + im \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if im < 33Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 84.1%
Taylor expanded in im around 0 84.0%
Taylor expanded in im around 0 80.1%
*-commutative80.1%
Simplified80.1%
if 33 < im < 1e103Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 61.5%
associate-*r*61.5%
Simplified61.5%
if 1e103 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in im around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (sin re))))
(if (<= im 3.8)
(*
t_0
(+
(+ 1.0 (* im (+ (* im (+ 0.5 (* im -0.16666666666666666))) -1.0)))
(+ im 1.0)))
(if (<= im 1e+103)
(* (+ (exp im) 1.0) (* 0.5 re))
(*
t_0
(+ 2.0 (* im (+ 1.0 (* im (+ 0.5 (* im 0.16666666666666666)))))))))))
double code(double re, double im) {
double t_0 = 0.5 * sin(re);
double tmp;
if (im <= 3.8) {
tmp = t_0 * ((1.0 + (im * ((im * (0.5 + (im * -0.16666666666666666))) + -1.0))) + (im + 1.0));
} else if (im <= 1e+103) {
tmp = (exp(im) + 1.0) * (0.5 * re);
} else {
tmp = t_0 * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666))))));
}
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)
if (im <= 3.8d0) then
tmp = t_0 * ((1.0d0 + (im * ((im * (0.5d0 + (im * (-0.16666666666666666d0)))) + (-1.0d0)))) + (im + 1.0d0))
else if (im <= 1d+103) then
tmp = (exp(im) + 1.0d0) * (0.5d0 * re)
else
tmp = t_0 * (2.0d0 + (im * (1.0d0 + (im * (0.5d0 + (im * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 * Math.sin(re);
double tmp;
if (im <= 3.8) {
tmp = t_0 * ((1.0 + (im * ((im * (0.5 + (im * -0.16666666666666666))) + -1.0))) + (im + 1.0));
} else if (im <= 1e+103) {
tmp = (Math.exp(im) + 1.0) * (0.5 * re);
} else {
tmp = t_0 * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666))))));
}
return tmp;
}
def code(re, im): t_0 = 0.5 * math.sin(re) tmp = 0 if im <= 3.8: tmp = t_0 * ((1.0 + (im * ((im * (0.5 + (im * -0.16666666666666666))) + -1.0))) + (im + 1.0)) elif im <= 1e+103: tmp = (math.exp(im) + 1.0) * (0.5 * re) else: tmp = t_0 * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666)))))) return tmp
function code(re, im) t_0 = Float64(0.5 * sin(re)) tmp = 0.0 if (im <= 3.8) tmp = Float64(t_0 * Float64(Float64(1.0 + Float64(im * Float64(Float64(im * Float64(0.5 + Float64(im * -0.16666666666666666))) + -1.0))) + Float64(im + 1.0))); elseif (im <= 1e+103) tmp = Float64(Float64(exp(im) + 1.0) * Float64(0.5 * re)); else tmp = Float64(t_0 * Float64(2.0 + Float64(im * Float64(1.0 + Float64(im * Float64(0.5 + Float64(im * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * sin(re); tmp = 0.0; if (im <= 3.8) tmp = t_0 * ((1.0 + (im * ((im * (0.5 + (im * -0.16666666666666666))) + -1.0))) + (im + 1.0)); elseif (im <= 1e+103) tmp = (exp(im) + 1.0) * (0.5 * re); else tmp = t_0 * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 3.8], N[(t$95$0 * N[(N[(1.0 + N[(im * N[(N[(im * N[(0.5 + N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(im + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1e+103], N[(N[(N[Exp[im], $MachinePrecision] + 1.0), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 + N[(im * N[(1.0 + N[(im * N[(0.5 + N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \sin re\\
\mathbf{if}\;im \leq 3.8:\\
\;\;\;\;t\_0 \cdot \left(\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot -0.16666666666666666\right) + -1\right)\right) + \left(im + 1\right)\right)\\
\mathbf{elif}\;im \leq 10^{+103}:\\
\;\;\;\;\left(e^{im} + 1\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 + im \cdot \left(1 + im \cdot \left(0.5 + im \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if im < 3.7999999999999998Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 84.1%
Taylor expanded in im around 0 83.9%
if 3.7999999999999998 < im < 1e103Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 61.5%
associate-*r*61.5%
Simplified61.5%
if 1e103 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in im around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification84.0%
(FPCore (re im)
:precision binary64
(if (<= im 33.0)
(sin re)
(if (<= im 1e+103)
(* (+ (exp im) 1.0) (* 0.5 re))
(*
(* 0.5 (sin re))
(+ 2.0 (* im (+ 1.0 (* im (+ 0.5 (* im 0.16666666666666666))))))))))
double code(double re, double im) {
double tmp;
if (im <= 33.0) {
tmp = sin(re);
} else if (im <= 1e+103) {
tmp = (exp(im) + 1.0) * (0.5 * re);
} else {
tmp = (0.5 * sin(re)) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666))))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 33.0d0) then
tmp = sin(re)
else if (im <= 1d+103) then
tmp = (exp(im) + 1.0d0) * (0.5d0 * re)
else
tmp = (0.5d0 * sin(re)) * (2.0d0 + (im * (1.0d0 + (im * (0.5d0 + (im * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 33.0) {
tmp = Math.sin(re);
} else if (im <= 1e+103) {
tmp = (Math.exp(im) + 1.0) * (0.5 * re);
} else {
tmp = (0.5 * Math.sin(re)) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666))))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 33.0: tmp = math.sin(re) elif im <= 1e+103: tmp = (math.exp(im) + 1.0) * (0.5 * re) else: tmp = (0.5 * math.sin(re)) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666)))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 33.0) tmp = sin(re); elseif (im <= 1e+103) tmp = Float64(Float64(exp(im) + 1.0) * Float64(0.5 * re)); else tmp = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * Float64(1.0 + Float64(im * Float64(0.5 + Float64(im * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 33.0) tmp = sin(re); elseif (im <= 1e+103) tmp = (exp(im) + 1.0) * (0.5 * re); else tmp = (0.5 * sin(re)) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 33.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1e+103], N[(N[(N[Exp[im], $MachinePrecision] + 1.0), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * N[(1.0 + N[(im * N[(0.5 + N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 33:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 10^{+103}:\\
\;\;\;\;\left(e^{im} + 1\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot \left(1 + im \cdot \left(0.5 + im \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if im < 33Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 69.0%
if 33 < im < 1e103Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 61.5%
associate-*r*61.5%
Simplified61.5%
if 1e103 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in im around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification72.8%
(FPCore (re im)
:precision binary64
(if (<= im 33.0)
(sin re)
(if (<= im 1.9e+154)
(* (+ (exp im) 1.0) (* 0.5 re))
(* (* 0.5 (sin re)) (+ 2.0 (* im (+ 1.0 (* 0.5 im))))))))
double code(double re, double im) {
double tmp;
if (im <= 33.0) {
tmp = sin(re);
} else if (im <= 1.9e+154) {
tmp = (exp(im) + 1.0) * (0.5 * re);
} else {
tmp = (0.5 * sin(re)) * (2.0 + (im * (1.0 + (0.5 * im))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 33.0d0) then
tmp = sin(re)
else if (im <= 1.9d+154) then
tmp = (exp(im) + 1.0d0) * (0.5d0 * re)
else
tmp = (0.5d0 * sin(re)) * (2.0d0 + (im * (1.0d0 + (0.5d0 * im))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 33.0) {
tmp = Math.sin(re);
} else if (im <= 1.9e+154) {
tmp = (Math.exp(im) + 1.0) * (0.5 * re);
} else {
tmp = (0.5 * Math.sin(re)) * (2.0 + (im * (1.0 + (0.5 * im))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 33.0: tmp = math.sin(re) elif im <= 1.9e+154: tmp = (math.exp(im) + 1.0) * (0.5 * re) else: tmp = (0.5 * math.sin(re)) * (2.0 + (im * (1.0 + (0.5 * im)))) return tmp
function code(re, im) tmp = 0.0 if (im <= 33.0) tmp = sin(re); elseif (im <= 1.9e+154) tmp = Float64(Float64(exp(im) + 1.0) * Float64(0.5 * re)); else tmp = Float64(Float64(0.5 * sin(re)) * Float64(2.0 + Float64(im * Float64(1.0 + Float64(0.5 * im))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 33.0) tmp = sin(re); elseif (im <= 1.9e+154) tmp = (exp(im) + 1.0) * (0.5 * re); else tmp = (0.5 * sin(re)) * (2.0 + (im * (1.0 + (0.5 * im)))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 33.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.9e+154], N[(N[(N[Exp[im], $MachinePrecision] + 1.0), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(im * N[(1.0 + N[(0.5 * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 33:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 1.9 \cdot 10^{+154}:\\
\;\;\;\;\left(e^{im} + 1\right) \cdot \left(0.5 \cdot re\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(2 + im \cdot \left(1 + 0.5 \cdot im\right)\right)\\
\end{array}
\end{array}
if im < 33Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 69.0%
if 33 < im < 1.8999999999999999e154Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 57.6%
associate-*r*57.6%
Simplified57.6%
if 1.8999999999999999e154 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in im around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification71.2%
(FPCore (re im) :precision binary64 (if (<= im 33.0) (sin re) (* (+ (exp im) 1.0) (* 0.5 re))))
double code(double re, double im) {
double tmp;
if (im <= 33.0) {
tmp = sin(re);
} else {
tmp = (exp(im) + 1.0) * (0.5 * re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 33.0d0) then
tmp = sin(re)
else
tmp = (exp(im) + 1.0d0) * (0.5d0 * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 33.0) {
tmp = Math.sin(re);
} else {
tmp = (Math.exp(im) + 1.0) * (0.5 * re);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 33.0: tmp = math.sin(re) else: tmp = (math.exp(im) + 1.0) * (0.5 * re) return tmp
function code(re, im) tmp = 0.0 if (im <= 33.0) tmp = sin(re); else tmp = Float64(Float64(exp(im) + 1.0) * Float64(0.5 * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 33.0) tmp = sin(re); else tmp = (exp(im) + 1.0) * (0.5 * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 33.0], N[Sin[re], $MachinePrecision], N[(N[(N[Exp[im], $MachinePrecision] + 1.0), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 33:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;\left(e^{im} + 1\right) \cdot \left(0.5 \cdot re\right)\\
\end{array}
\end{array}
if im < 33Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 69.0%
if 33 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in re around 0 60.3%
associate-*r*60.3%
Simplified60.3%
Final simplification66.9%
(FPCore (re im)
:precision binary64
(if (<= im 2.4e+27)
(sin re)
(*
(* 0.5 re)
(+ 2.0 (* im (+ 1.0 (* im (+ 0.5 (* im 0.16666666666666666)))))))))
double code(double re, double im) {
double tmp;
if (im <= 2.4e+27) {
tmp = sin(re);
} else {
tmp = (0.5 * re) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666))))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 2.4d+27) then
tmp = sin(re)
else
tmp = (0.5d0 * re) * (2.0d0 + (im * (1.0d0 + (im * (0.5d0 + (im * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 2.4e+27) {
tmp = Math.sin(re);
} else {
tmp = (0.5 * re) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666))))));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 2.4e+27: tmp = math.sin(re) else: tmp = (0.5 * re) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666)))))) return tmp
function code(re, im) tmp = 0.0 if (im <= 2.4e+27) tmp = sin(re); else tmp = Float64(Float64(0.5 * re) * Float64(2.0 + Float64(im * Float64(1.0 + Float64(im * Float64(0.5 + Float64(im * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 2.4e+27) tmp = sin(re); else tmp = (0.5 * re) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 2.4e+27], N[Sin[re], $MachinePrecision], N[(N[(0.5 * re), $MachinePrecision] * N[(2.0 + N[(im * N[(1.0 + N[(im * N[(0.5 + N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 2.4 \cdot 10^{+27}:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(2 + im \cdot \left(1 + im \cdot \left(0.5 + im \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if im < 2.39999999999999998e27Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 67.4%
if 2.39999999999999998e27 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in im around 0 65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in re around 0 42.4%
(FPCore (re im)
:precision binary64
(if (<= re 1.06e+247)
(*
(* 0.5 re)
(+ 2.0 (* im (+ 1.0 (* im (+ 0.5 (* im 0.16666666666666666)))))))
(* re (+ 1.0 (* -0.16666666666666666 (* re re))))))
double code(double re, double im) {
double tmp;
if (re <= 1.06e+247) {
tmp = (0.5 * re) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666))))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (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 <= 1.06d+247) then
tmp = (0.5d0 * re) * (2.0d0 + (im * (1.0d0 + (im * (0.5d0 + (im * 0.16666666666666666d0))))))
else
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.06e+247) {
tmp = (0.5 * re) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666))))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.06e+247: tmp = (0.5 * re) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666)))))) else: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.06e+247) tmp = Float64(Float64(0.5 * re) * Float64(2.0 + Float64(im * Float64(1.0 + Float64(im * Float64(0.5 + Float64(im * 0.16666666666666666))))))); else tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.06e+247) tmp = (0.5 * re) * (2.0 + (im * (1.0 + (im * (0.5 + (im * 0.16666666666666666)))))); else tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.06e+247], N[(N[(0.5 * re), $MachinePrecision] * N[(2.0 + N[(im * N[(1.0 + N[(im * N[(0.5 + N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.06 \cdot 10^{+247}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(2 + im \cdot \left(1 + im \cdot \left(0.5 + im \cdot 0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 1.05999999999999995e247Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 76.6%
Taylor expanded in im around 0 66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in re around 0 40.6%
if 1.05999999999999995e247 < re Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 47.2%
Taylor expanded in re around 0 55.3%
*-commutative55.3%
Simplified55.3%
unpow255.3%
Applied egg-rr55.3%
Final simplification41.2%
(FPCore (re im) :precision binary64 (if (<= re 2.1e+90) (* (* 0.5 re) (+ 2.0 (* im (+ 1.0 (* 0.5 im))))) (* re (+ 1.0 (* -0.16666666666666666 (* re re))))))
double code(double re, double im) {
double tmp;
if (re <= 2.1e+90) {
tmp = (0.5 * re) * (2.0 + (im * (1.0 + (0.5 * im))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (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 <= 2.1d+90) then
tmp = (0.5d0 * re) * (2.0d0 + (im * (1.0d0 + (0.5d0 * im))))
else
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.1e+90) {
tmp = (0.5 * re) * (2.0 + (im * (1.0 + (0.5 * im))));
} else {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.1e+90: tmp = (0.5 * re) * (2.0 + (im * (1.0 + (0.5 * im)))) else: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.1e+90) tmp = Float64(Float64(0.5 * re) * Float64(2.0 + Float64(im * Float64(1.0 + Float64(0.5 * im))))); else tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.1e+90) tmp = (0.5 * re) * (2.0 + (im * (1.0 + (0.5 * im)))); else tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.1e+90], N[(N[(0.5 * re), $MachinePrecision] * N[(2.0 + N[(im * N[(1.0 + N[(0.5 * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.1 \cdot 10^{+90}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(2 + im \cdot \left(1 + 0.5 \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 2.09999999999999981e90Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 75.6%
Taylor expanded in im around 0 64.5%
*-commutative64.5%
Simplified64.5%
Taylor expanded in im around 0 70.2%
+-commutative70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in re around 0 46.3%
if 2.09999999999999981e90 < re Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 51.6%
Taylor expanded in re around 0 27.9%
*-commutative27.9%
Simplified27.9%
unpow227.9%
Applied egg-rr27.9%
Final simplification43.6%
(FPCore (re im) :precision binary64 (if (<= im 8.2e+250) (* re (+ 1.0 (* -0.16666666666666666 (* re re)))) (* (* 0.5 re) (+ im 2.0))))
double code(double re, double im) {
double tmp;
if (im <= 8.2e+250) {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
} else {
tmp = (0.5 * re) * (im + 2.0);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 8.2d+250) then
tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
else
tmp = (0.5d0 * re) * (im + 2.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 8.2e+250) {
tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
} else {
tmp = (0.5 * re) * (im + 2.0);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 8.2e+250: tmp = re * (1.0 + (-0.16666666666666666 * (re * re))) else: tmp = (0.5 * re) * (im + 2.0) return tmp
function code(re, im) tmp = 0.0 if (im <= 8.2e+250) tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re)))); else tmp = Float64(Float64(0.5 * re) * Float64(im + 2.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 8.2e+250) tmp = re * (1.0 + (-0.16666666666666666 * (re * re))); else tmp = (0.5 * re) * (im + 2.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 8.2e+250], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * re), $MachinePrecision] * N[(im + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 8.2 \cdot 10^{+250}:\\
\;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(im + 2\right)\\
\end{array}
\end{array}
if im < 8.19999999999999999e250Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 55.2%
Taylor expanded in re around 0 38.3%
*-commutative38.3%
Simplified38.3%
unpow238.3%
Applied egg-rr38.3%
if 8.19999999999999999e250 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in im around 0 7.5%
Taylor expanded in re around 0 43.3%
associate-*r*43.3%
+-commutative43.3%
*-commutative43.3%
Simplified43.3%
Final simplification38.5%
(FPCore (re im) :precision binary64 (* (* 0.5 re) (+ im 2.0)))
double code(double re, double im) {
return (0.5 * re) * (im + 2.0);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * re) * (im + 2.0d0)
end function
public static double code(double re, double im) {
return (0.5 * re) * (im + 2.0);
}
def code(re, im): return (0.5 * re) * (im + 2.0)
function code(re, im) return Float64(Float64(0.5 * re) * Float64(im + 2.0)) end
function tmp = code(re, im) tmp = (0.5 * re) * (im + 2.0); end
code[re_, im_] := N[(N[(0.5 * re), $MachinePrecision] * N[(im + 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot re\right) \cdot \left(im + 2\right)
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 76.1%
Taylor expanded in im around 0 52.1%
Taylor expanded in re around 0 33.8%
associate-*r*33.8%
+-commutative33.8%
*-commutative33.8%
Simplified33.8%
Final simplification33.8%
(FPCore (re im) :precision binary64 re)
double code(double re, double im) {
return re;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re
end function
public static double code(double re, double im) {
return re;
}
def code(re, im): return re
function code(re, im) return re end
function tmp = code(re, im) tmp = re; end
code[re_, im_] := re
\begin{array}{l}
\\
re
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 52.8%
Taylor expanded in re around 0 27.5%
(FPCore (re im) :precision binary64 -4.0)
double code(double re, double im) {
return -4.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = -4.0d0
end function
public static double code(double re, double im) {
return -4.0;
}
def code(re, im): return -4.0
function code(re, im) return -4.0 end
function tmp = code(re, im) tmp = -4.0; end
code[re_, im_] := -4.0
\begin{array}{l}
\\
-4
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in im around 0 72.7%
+-commutative72.7%
unpow272.7%
fma-define72.7%
Simplified72.7%
Applied egg-rr4.1%
Taylor expanded in re around 0 4.1%
herbie shell --seed 2024141
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))