
(FPCore (re im) :precision binary64 (* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im));
}
real(8) function code(re, im)
use fmin_fmax_functions
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * cos(re)) * (exp((0.0d0 - im)) - exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.cos(re)) * (Math.exp((0.0 - im)) - Math.exp(im));
}
def code(re, im): return (0.5 * math.cos(re)) * (math.exp((0.0 - im)) - math.exp(im))
function code(re, im) return Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - im)) - exp(im))) end
function tmp = code(re, im) tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)
Herbie found 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
return (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im));
}
real(8) function code(re, im)
use fmin_fmax_functions
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * cos(re)) * (exp((0.0d0 - im)) - exp(im))
end function
public static double code(double re, double im) {
return (0.5 * Math.cos(re)) * (Math.exp((0.0 - im)) - Math.exp(im));
}
def code(re, im): return (0.5 * math.cos(re)) * (math.exp((0.0 - im)) - math.exp(im))
function code(re, im) return Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - im)) - exp(im))) end
function tmp = code(re, im) tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im)); end
code[re_, im_] := N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)
(FPCore (re im) :precision binary64 (* (sinh (- im)) (cos re)))
double code(double re, double im) {
return sinh(-im) * cos(re);
}
real(8) function code(re, im)
use fmin_fmax_functions
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sinh(-im) * cos(re)
end function
public static double code(double re, double im) {
return Math.sinh(-im) * Math.cos(re);
}
def code(re, im): return math.sinh(-im) * math.cos(re)
function code(re, im) return Float64(sinh(Float64(-im)) * cos(re)) end
function tmp = code(re, im) tmp = sinh(-im) * cos(re); end
code[re_, im_] := N[(N[Sinh[(-im)], $MachinePrecision] * N[Cos[re], $MachinePrecision]), $MachinePrecision]
\sinh \left(-im\right) \cdot \cos re
Initial program 54.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
metadata-evalN/A
mult-flip-revN/A
lift--.f64N/A
lift-exp.f64N/A
lift-exp.f64N/A
--rgt-identityN/A
sub-negate-revN/A
lift--.f64N/A
sinh-defN/A
lower-*.f64N/A
lower-sinh.f6499.9%
lift--.f64N/A
sub0-negN/A
lower-neg.f6499.9%
Applied rewrites99.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (sinh (- (fabs im))))
(t_1
(*
(* 0.5 (cos re))
(- (exp (- 0.0 (fabs im))) (exp (fabs im))))))
(*
(copysign 1.0 im)
(if (<= t_1 -0.0005)
t_0
(if (<= t_1 1e-8)
(* (- (cos re)) (fabs im))
(* t_0 (+ 1.0 (* -0.5 (pow re 2.0)))))))))double code(double re, double im) {
double t_0 = sinh(-fabs(im));
double t_1 = (0.5 * cos(re)) * (exp((0.0 - fabs(im))) - exp(fabs(im)));
double tmp;
if (t_1 <= -0.0005) {
tmp = t_0;
} else if (t_1 <= 1e-8) {
tmp = -cos(re) * fabs(im);
} else {
tmp = t_0 * (1.0 + (-0.5 * pow(re, 2.0)));
}
return copysign(1.0, im) * tmp;
}
public static double code(double re, double im) {
double t_0 = Math.sinh(-Math.abs(im));
double t_1 = (0.5 * Math.cos(re)) * (Math.exp((0.0 - Math.abs(im))) - Math.exp(Math.abs(im)));
double tmp;
if (t_1 <= -0.0005) {
tmp = t_0;
} else if (t_1 <= 1e-8) {
tmp = -Math.cos(re) * Math.abs(im);
} else {
tmp = t_0 * (1.0 + (-0.5 * Math.pow(re, 2.0)));
}
return Math.copySign(1.0, im) * tmp;
}
def code(re, im): t_0 = math.sinh(-math.fabs(im)) t_1 = (0.5 * math.cos(re)) * (math.exp((0.0 - math.fabs(im))) - math.exp(math.fabs(im))) tmp = 0 if t_1 <= -0.0005: tmp = t_0 elif t_1 <= 1e-8: tmp = -math.cos(re) * math.fabs(im) else: tmp = t_0 * (1.0 + (-0.5 * math.pow(re, 2.0))) return math.copysign(1.0, im) * tmp
function code(re, im) t_0 = sinh(Float64(-abs(im))) t_1 = Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - abs(im))) - exp(abs(im)))) tmp = 0.0 if (t_1 <= -0.0005) tmp = t_0; elseif (t_1 <= 1e-8) tmp = Float64(Float64(-cos(re)) * abs(im)); else tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 * (re ^ 2.0)))); end return Float64(copysign(1.0, im) * tmp) end
function tmp_2 = code(re, im) t_0 = sinh(-abs(im)); t_1 = (0.5 * cos(re)) * (exp((0.0 - abs(im))) - exp(abs(im))); tmp = 0.0; if (t_1 <= -0.0005) tmp = t_0; elseif (t_1 <= 1e-8) tmp = -cos(re) * abs(im); else tmp = t_0 * (1.0 + (-0.5 * (re ^ 2.0))); end tmp_2 = (sign(im) * abs(1.0)) * tmp; end
code[re_, im_] := Block[{t$95$0 = N[Sinh[(-N[Abs[im], $MachinePrecision])], $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - N[Abs[im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Exp[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, -0.0005], t$95$0, If[LessEqual[t$95$1, 1e-8], N[((-N[Cos[re], $MachinePrecision]) * N[Abs[im], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 + N[(-0.5 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \sinh \left(-\left|im\right|\right)\\
t_1 := \left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - \left|im\right|} - e^{\left|im\right|}\right)\\
\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -0.0005:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 10^{-8}:\\
\;\;\;\;\left(-\cos re\right) \cdot \left|im\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(1 + -0.5 \cdot {re}^{2}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (cos.f64 re)) (-.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -5.0000000000000001e-4Initial program 54.0%
Taylor expanded in re around 0
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-exp.f6440.9%
Applied rewrites40.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
remove-double-negN/A
lift-neg.f64N/A
metadata-evalN/A
mult-flipN/A
sinh-defN/A
lift-sinh.f6465.7%
Applied rewrites65.7%
if -5.0000000000000001e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (cos.f64 re)) (-.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1e-8Initial program 54.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6452.3%
Applied rewrites52.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6452.3%
Applied rewrites52.3%
if 1e-8 < (*.f64 (*.f64 #s(literal 1/2 binary64) (cos.f64 re)) (-.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 54.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
metadata-evalN/A
mult-flip-revN/A
lift--.f64N/A
lift-exp.f64N/A
lift-exp.f64N/A
--rgt-identityN/A
sub-negate-revN/A
lift--.f64N/A
sinh-defN/A
lower-*.f64N/A
lower-sinh.f6499.9%
lift--.f64N/A
sub0-negN/A
lower-neg.f6499.9%
Applied rewrites99.9%
Taylor expanded in re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6463.6%
Applied rewrites63.6%
(FPCore (re im)
:precision binary64
(let* ((t_0
(*
(* 0.5 (cos re))
(- (exp (- 0.0 (fabs im))) (exp (fabs im))))))
(*
(copysign 1.0 im)
(if (<= t_0 -0.0005)
(sinh (- (fabs im)))
(if (<= t_0 1e-8)
(* (- (cos re)) (fabs im))
(* (- (* 0.5 (pow re 2.0)) 1.0) (fabs im)))))))double code(double re, double im) {
double t_0 = (0.5 * cos(re)) * (exp((0.0 - fabs(im))) - exp(fabs(im)));
double tmp;
if (t_0 <= -0.0005) {
tmp = sinh(-fabs(im));
} else if (t_0 <= 1e-8) {
tmp = -cos(re) * fabs(im);
} else {
tmp = ((0.5 * pow(re, 2.0)) - 1.0) * fabs(im);
}
return copysign(1.0, im) * tmp;
}
public static double code(double re, double im) {
double t_0 = (0.5 * Math.cos(re)) * (Math.exp((0.0 - Math.abs(im))) - Math.exp(Math.abs(im)));
double tmp;
if (t_0 <= -0.0005) {
tmp = Math.sinh(-Math.abs(im));
} else if (t_0 <= 1e-8) {
tmp = -Math.cos(re) * Math.abs(im);
} else {
tmp = ((0.5 * Math.pow(re, 2.0)) - 1.0) * Math.abs(im);
}
return Math.copySign(1.0, im) * tmp;
}
def code(re, im): t_0 = (0.5 * math.cos(re)) * (math.exp((0.0 - math.fabs(im))) - math.exp(math.fabs(im))) tmp = 0 if t_0 <= -0.0005: tmp = math.sinh(-math.fabs(im)) elif t_0 <= 1e-8: tmp = -math.cos(re) * math.fabs(im) else: tmp = ((0.5 * math.pow(re, 2.0)) - 1.0) * math.fabs(im) return math.copysign(1.0, im) * tmp
function code(re, im) t_0 = Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - abs(im))) - exp(abs(im)))) tmp = 0.0 if (t_0 <= -0.0005) tmp = sinh(Float64(-abs(im))); elseif (t_0 <= 1e-8) tmp = Float64(Float64(-cos(re)) * abs(im)); else tmp = Float64(Float64(Float64(0.5 * (re ^ 2.0)) - 1.0) * abs(im)); end return Float64(copysign(1.0, im) * tmp) end
function tmp_2 = code(re, im) t_0 = (0.5 * cos(re)) * (exp((0.0 - abs(im))) - exp(abs(im))); tmp = 0.0; if (t_0 <= -0.0005) tmp = sinh(-abs(im)); elseif (t_0 <= 1e-8) tmp = -cos(re) * abs(im); else tmp = ((0.5 * (re ^ 2.0)) - 1.0) * abs(im); end tmp_2 = (sign(im) * abs(1.0)) * tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - N[Abs[im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Exp[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$0, -0.0005], N[Sinh[(-N[Abs[im], $MachinePrecision])], $MachinePrecision], If[LessEqual[t$95$0, 1e-8], N[((-N[Cos[re], $MachinePrecision]) * N[Abs[im], $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - \left|im\right|} - e^{\left|im\right|}\right)\\
\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -0.0005:\\
\;\;\;\;\sinh \left(-\left|im\right|\right)\\
\mathbf{elif}\;t\_0 \leq 10^{-8}:\\
\;\;\;\;\left(-\cos re\right) \cdot \left|im\right|\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot {re}^{2} - 1\right) \cdot \left|im\right|\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (cos.f64 re)) (-.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -5.0000000000000001e-4Initial program 54.0%
Taylor expanded in re around 0
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-exp.f6440.9%
Applied rewrites40.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
remove-double-negN/A
lift-neg.f64N/A
metadata-evalN/A
mult-flipN/A
sinh-defN/A
lift-sinh.f6465.7%
Applied rewrites65.7%
if -5.0000000000000001e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (cos.f64 re)) (-.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1e-8Initial program 54.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6452.3%
Applied rewrites52.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6452.3%
Applied rewrites52.3%
if 1e-8 < (*.f64 (*.f64 #s(literal 1/2 binary64) (cos.f64 re)) (-.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 54.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6452.3%
Applied rewrites52.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6452.3%
Applied rewrites52.3%
Taylor expanded in re around 0
lower--.f64N/A
lower-*.f64N/A
lower-pow.f6436.8%
Applied rewrites36.8%
(FPCore (re im)
:precision binary64
(*
(copysign 1.0 im)
(if (<=
(* (* 0.5 (cos re)) (- (exp (- 0.0 (fabs im))) (exp (fabs im))))
0.0)
(sinh (- (fabs im)))
(* (- (* 0.5 (pow re 2.0)) 1.0) (fabs im)))))double code(double re, double im) {
double tmp;
if (((0.5 * cos(re)) * (exp((0.0 - fabs(im))) - exp(fabs(im)))) <= 0.0) {
tmp = sinh(-fabs(im));
} else {
tmp = ((0.5 * pow(re, 2.0)) - 1.0) * fabs(im);
}
return copysign(1.0, im) * tmp;
}
public static double code(double re, double im) {
double tmp;
if (((0.5 * Math.cos(re)) * (Math.exp((0.0 - Math.abs(im))) - Math.exp(Math.abs(im)))) <= 0.0) {
tmp = Math.sinh(-Math.abs(im));
} else {
tmp = ((0.5 * Math.pow(re, 2.0)) - 1.0) * Math.abs(im);
}
return Math.copySign(1.0, im) * tmp;
}
def code(re, im): tmp = 0 if ((0.5 * math.cos(re)) * (math.exp((0.0 - math.fabs(im))) - math.exp(math.fabs(im)))) <= 0.0: tmp = math.sinh(-math.fabs(im)) else: tmp = ((0.5 * math.pow(re, 2.0)) - 1.0) * math.fabs(im) return math.copysign(1.0, im) * tmp
function code(re, im) tmp = 0.0 if (Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - abs(im))) - exp(abs(im)))) <= 0.0) tmp = sinh(Float64(-abs(im))); else tmp = Float64(Float64(Float64(0.5 * (re ^ 2.0)) - 1.0) * abs(im)); end return Float64(copysign(1.0, im) * tmp) end
function tmp_2 = code(re, im) tmp = 0.0; if (((0.5 * cos(re)) * (exp((0.0 - abs(im))) - exp(abs(im)))) <= 0.0) tmp = sinh(-abs(im)); else tmp = ((0.5 * (re ^ 2.0)) - 1.0) * abs(im); end tmp_2 = (sign(im) * abs(1.0)) * tmp; end
code[re_, im_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - N[Abs[im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Exp[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[Sinh[(-N[Abs[im], $MachinePrecision])], $MachinePrecision], N[(N[(N[(0.5 * N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
\mathbf{if}\;\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - \left|im\right|} - e^{\left|im\right|}\right) \leq 0:\\
\;\;\;\;\sinh \left(-\left|im\right|\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot {re}^{2} - 1\right) \cdot \left|im\right|\\
\end{array}
if (*.f64 (*.f64 #s(literal 1/2 binary64) (cos.f64 re)) (-.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 0.0Initial program 54.0%
Taylor expanded in re around 0
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-exp.f6440.9%
Applied rewrites40.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
remove-double-negN/A
lift-neg.f64N/A
metadata-evalN/A
mult-flipN/A
sinh-defN/A
lift-sinh.f6465.7%
Applied rewrites65.7%
if 0.0 < (*.f64 (*.f64 #s(literal 1/2 binary64) (cos.f64 re)) (-.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) Initial program 54.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6452.3%
Applied rewrites52.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6452.3%
Applied rewrites52.3%
Taylor expanded in re around 0
lower--.f64N/A
lower-*.f64N/A
lower-pow.f6436.8%
Applied rewrites36.8%
(FPCore (re im) :precision binary64 (sinh (- im)))
double code(double re, double im) {
return sinh(-im);
}
real(8) function code(re, im)
use fmin_fmax_functions
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sinh(-im)
end function
public static double code(double re, double im) {
return Math.sinh(-im);
}
def code(re, im): return math.sinh(-im)
function code(re, im) return sinh(Float64(-im)) end
function tmp = code(re, im) tmp = sinh(-im); end
code[re_, im_] := N[Sinh[(-im)], $MachinePrecision]
\sinh \left(-im\right)
Initial program 54.0%
Taylor expanded in re around 0
lower-*.f64N/A
lower--.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-exp.f6440.9%
Applied rewrites40.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
remove-double-negN/A
lift-neg.f64N/A
metadata-evalN/A
mult-flipN/A
sinh-defN/A
lift-sinh.f6465.7%
Applied rewrites65.7%
(FPCore (re im) :precision binary64 (- im))
double code(double re, double im) {
return -im;
}
real(8) function code(re, im)
use fmin_fmax_functions
real(8), intent (in) :: re
real(8), intent (in) :: im
code = -im
end function
public static double code(double re, double im) {
return -im;
}
def code(re, im): return -im
function code(re, im) return Float64(-im) end
function tmp = code(re, im) tmp = -im; end
code[re_, im_] := (-im)
-im
Initial program 54.0%
Taylor expanded in im around 0
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6452.3%
Applied rewrites52.3%
Taylor expanded in re around 0
Applied rewrites30.1%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6430.1%
Applied rewrites30.1%
herbie shell --seed 2025313 -o setup:search
(FPCore (re im)
:name "math.sin on complex, imaginary part"
:precision binary64
(* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im))))