
(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 15 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%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (re im)
:precision binary64
(if (<= im 9e+14)
(sin re)
(if (<= im 7.2e+46)
(log (/ -2.0 (exp re)))
(if (<= im 6.2e+78)
(* (* 0.5 re) (pow im 2.0))
(if (<= im 1.15e+144)
(pow (* (sin re) -2.0) -2.0)
(* (* 0.5 (sin re)) (pow im 2.0)))))))
double code(double re, double im) {
double tmp;
if (im <= 9e+14) {
tmp = sin(re);
} else if (im <= 7.2e+46) {
tmp = log((-2.0 / exp(re)));
} else if (im <= 6.2e+78) {
tmp = (0.5 * re) * pow(im, 2.0);
} else if (im <= 1.15e+144) {
tmp = pow((sin(re) * -2.0), -2.0);
} else {
tmp = (0.5 * sin(re)) * pow(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 <= 9d+14) then
tmp = sin(re)
else if (im <= 7.2d+46) then
tmp = log(((-2.0d0) / exp(re)))
else if (im <= 6.2d+78) then
tmp = (0.5d0 * re) * (im ** 2.0d0)
else if (im <= 1.15d+144) then
tmp = (sin(re) * (-2.0d0)) ** (-2.0d0)
else
tmp = (0.5d0 * sin(re)) * (im ** 2.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 9e+14) {
tmp = Math.sin(re);
} else if (im <= 7.2e+46) {
tmp = Math.log((-2.0 / Math.exp(re)));
} else if (im <= 6.2e+78) {
tmp = (0.5 * re) * Math.pow(im, 2.0);
} else if (im <= 1.15e+144) {
tmp = Math.pow((Math.sin(re) * -2.0), -2.0);
} else {
tmp = (0.5 * Math.sin(re)) * Math.pow(im, 2.0);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 9e+14: tmp = math.sin(re) elif im <= 7.2e+46: tmp = math.log((-2.0 / math.exp(re))) elif im <= 6.2e+78: tmp = (0.5 * re) * math.pow(im, 2.0) elif im <= 1.15e+144: tmp = math.pow((math.sin(re) * -2.0), -2.0) else: tmp = (0.5 * math.sin(re)) * math.pow(im, 2.0) return tmp
function code(re, im) tmp = 0.0 if (im <= 9e+14) tmp = sin(re); elseif (im <= 7.2e+46) tmp = log(Float64(-2.0 / exp(re))); elseif (im <= 6.2e+78) tmp = Float64(Float64(0.5 * re) * (im ^ 2.0)); elseif (im <= 1.15e+144) tmp = Float64(sin(re) * -2.0) ^ -2.0; else tmp = Float64(Float64(0.5 * sin(re)) * (im ^ 2.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 9e+14) tmp = sin(re); elseif (im <= 7.2e+46) tmp = log((-2.0 / exp(re))); elseif (im <= 6.2e+78) tmp = (0.5 * re) * (im ^ 2.0); elseif (im <= 1.15e+144) tmp = (sin(re) * -2.0) ^ -2.0; else tmp = (0.5 * sin(re)) * (im ^ 2.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 9e+14], N[Sin[re], $MachinePrecision], If[LessEqual[im, 7.2e+46], N[Log[N[(-2.0 / N[Exp[re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 6.2e+78], N[(N[(0.5 * re), $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.15e+144], N[Power[N[(N[Sin[re], $MachinePrecision] * -2.0), $MachinePrecision], -2.0], $MachinePrecision], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 9 \cdot 10^{+14}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 7.2 \cdot 10^{+46}:\\
\;\;\;\;\log \left(\frac{-2}{e^{re}}\right)\\
\mathbf{elif}\;im \leq 6.2 \cdot 10^{+78}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot {im}^{2}\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+144}:\\
\;\;\;\;{\left(\sin re \cdot -2\right)}^{-2}\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot {im}^{2}\\
\end{array}
\end{array}
if im < 9e14Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.1%
if 9e14 < im < 7.1999999999999997e46Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr2.1%
Taylor expanded in re around 0 1.5%
Applied egg-rr20.0%
if 7.1999999999999997e46 < im < 6.2e78Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 3.9%
Simplified3.9%
Taylor expanded in re around 0 75.7%
*-commutative75.7%
associate-*l*75.7%
+-commutative75.7%
unpow275.7%
fma-udef75.7%
Simplified75.7%
Taylor expanded in im around inf 75.7%
*-commutative75.7%
associate-*l*75.7%
Simplified75.7%
if 6.2e78 < im < 1.1500000000000001e144Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr44.3%
if 1.1500000000000001e144 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 96.9%
Taylor expanded in im around inf 96.9%
associate-*r*96.9%
*-commutative96.9%
associate-*l*96.9%
Simplified96.9%
Final simplification67.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (sin re))))
(if (<= im 9e+14)
(* t_0 (fma im im 2.0))
(if (<= im 4e+43)
(log (/ -2.0 (exp re)))
(if (<= im 1.1e+79)
(* (* 0.5 re) (pow im 2.0))
(if (<= im 1.15e+144)
(pow (* (sin re) -2.0) -2.0)
(* t_0 (pow im 2.0))))))))
double code(double re, double im) {
double t_0 = 0.5 * sin(re);
double tmp;
if (im <= 9e+14) {
tmp = t_0 * fma(im, im, 2.0);
} else if (im <= 4e+43) {
tmp = log((-2.0 / exp(re)));
} else if (im <= 1.1e+79) {
tmp = (0.5 * re) * pow(im, 2.0);
} else if (im <= 1.15e+144) {
tmp = pow((sin(re) * -2.0), -2.0);
} else {
tmp = t_0 * pow(im, 2.0);
}
return tmp;
}
function code(re, im) t_0 = Float64(0.5 * sin(re)) tmp = 0.0 if (im <= 9e+14) tmp = Float64(t_0 * fma(im, im, 2.0)); elseif (im <= 4e+43) tmp = log(Float64(-2.0 / exp(re))); elseif (im <= 1.1e+79) tmp = Float64(Float64(0.5 * re) * (im ^ 2.0)); elseif (im <= 1.15e+144) tmp = Float64(sin(re) * -2.0) ^ -2.0; else tmp = Float64(t_0 * (im ^ 2.0)); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 9e+14], N[(t$95$0 * N[(im * im + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4e+43], N[Log[N[(-2.0 / N[Exp[re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 1.1e+79], N[(N[(0.5 * re), $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.15e+144], N[Power[N[(N[Sin[re], $MachinePrecision] * -2.0), $MachinePrecision], -2.0], $MachinePrecision], N[(t$95$0 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \sin re\\
\mathbf{if}\;im \leq 9 \cdot 10^{+14}:\\
\;\;\;\;t_0 \cdot \mathsf{fma}\left(im, im, 2\right)\\
\mathbf{elif}\;im \leq 4 \cdot 10^{+43}:\\
\;\;\;\;\log \left(\frac{-2}{e^{re}}\right)\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+79}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot {im}^{2}\\
\mathbf{elif}\;im \leq 1.15 \cdot 10^{+144}:\\
\;\;\;\;{\left(\sin re \cdot -2\right)}^{-2}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {im}^{2}\\
\end{array}
\end{array}
if im < 9e14Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 85.0%
Simplified85.0%
if 9e14 < im < 4.00000000000000006e43Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr2.1%
Taylor expanded in re around 0 1.5%
Applied egg-rr20.0%
if 4.00000000000000006e43 < im < 1.0999999999999999e79Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 3.9%
Simplified3.9%
Taylor expanded in re around 0 75.7%
*-commutative75.7%
associate-*l*75.7%
+-commutative75.7%
unpow275.7%
fma-udef75.7%
Simplified75.7%
Taylor expanded in im around inf 75.7%
*-commutative75.7%
associate-*l*75.7%
Simplified75.7%
if 1.0999999999999999e79 < im < 1.1500000000000001e144Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr44.3%
if 1.1500000000000001e144 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 96.9%
Taylor expanded in im around inf 96.9%
associate-*r*96.9%
*-commutative96.9%
associate-*l*96.9%
Simplified96.9%
Final simplification82.5%
(FPCore (re im)
:precision binary64
(if (<= im 9e+14)
(sin re)
(if (<= im 8.2e+46)
(log (/ -2.0 (exp re)))
(if (<= im 5e+78)
(* (* 0.5 re) (pow im 2.0))
(if (<= im 6.8e+141)
(pow (* (sin re) -2.0) -2.0)
(* re (* 0.5 (fma im im 2.0))))))))
double code(double re, double im) {
double tmp;
if (im <= 9e+14) {
tmp = sin(re);
} else if (im <= 8.2e+46) {
tmp = log((-2.0 / exp(re)));
} else if (im <= 5e+78) {
tmp = (0.5 * re) * pow(im, 2.0);
} else if (im <= 6.8e+141) {
tmp = pow((sin(re) * -2.0), -2.0);
} else {
tmp = re * (0.5 * fma(im, im, 2.0));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (im <= 9e+14) tmp = sin(re); elseif (im <= 8.2e+46) tmp = log(Float64(-2.0 / exp(re))); elseif (im <= 5e+78) tmp = Float64(Float64(0.5 * re) * (im ^ 2.0)); elseif (im <= 6.8e+141) tmp = Float64(sin(re) * -2.0) ^ -2.0; else tmp = Float64(re * Float64(0.5 * fma(im, im, 2.0))); end return tmp end
code[re_, im_] := If[LessEqual[im, 9e+14], N[Sin[re], $MachinePrecision], If[LessEqual[im, 8.2e+46], N[Log[N[(-2.0 / N[Exp[re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 5e+78], N[(N[(0.5 * re), $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 6.8e+141], N[Power[N[(N[Sin[re], $MachinePrecision] * -2.0), $MachinePrecision], -2.0], $MachinePrecision], N[(re * N[(0.5 * N[(im * im + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 9 \cdot 10^{+14}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 8.2 \cdot 10^{+46}:\\
\;\;\;\;\log \left(\frac{-2}{e^{re}}\right)\\
\mathbf{elif}\;im \leq 5 \cdot 10^{+78}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot {im}^{2}\\
\mathbf{elif}\;im \leq 6.8 \cdot 10^{+141}:\\
\;\;\;\;{\left(\sin re \cdot -2\right)}^{-2}\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)\\
\end{array}
\end{array}
if im < 9e14Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.1%
if 9e14 < im < 8.19999999999999999e46Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr2.1%
Taylor expanded in re around 0 1.5%
Applied egg-rr20.0%
if 8.19999999999999999e46 < im < 4.99999999999999984e78Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 3.9%
Simplified3.9%
Taylor expanded in re around 0 75.7%
*-commutative75.7%
associate-*l*75.7%
+-commutative75.7%
unpow275.7%
fma-udef75.7%
Simplified75.7%
Taylor expanded in im around inf 75.7%
*-commutative75.7%
associate-*l*75.7%
Simplified75.7%
if 4.99999999999999984e78 < im < 6.7999999999999996e141Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr44.3%
if 6.7999999999999996e141 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 96.9%
Simplified96.9%
Taylor expanded in re around 0 69.0%
*-commutative69.0%
associate-*l*69.0%
+-commutative69.0%
unpow269.0%
fma-udef69.0%
Simplified69.0%
Final simplification64.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (sin re))))
(if (<= im 0.0095)
(* t_0 (fma im im 2.0))
(if (<= im 1.35e+154)
(* (* 0.5 re) (+ (exp (- im)) (exp im)))
(* t_0 (pow im 2.0))))))
double code(double re, double im) {
double t_0 = 0.5 * sin(re);
double tmp;
if (im <= 0.0095) {
tmp = t_0 * fma(im, im, 2.0);
} else if (im <= 1.35e+154) {
tmp = (0.5 * re) * (exp(-im) + exp(im));
} else {
tmp = t_0 * pow(im, 2.0);
}
return tmp;
}
function code(re, im) t_0 = Float64(0.5 * sin(re)) tmp = 0.0 if (im <= 0.0095) tmp = Float64(t_0 * fma(im, im, 2.0)); elseif (im <= 1.35e+154) tmp = Float64(Float64(0.5 * re) * Float64(exp(Float64(-im)) + exp(im))); else tmp = Float64(t_0 * (im ^ 2.0)); end return tmp end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.0095], N[(t$95$0 * N[(im * im + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(N[(0.5 * re), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \sin re\\
\mathbf{if}\;im \leq 0.0095:\\
\;\;\;\;t_0 \cdot \mathsf{fma}\left(im, im, 2\right)\\
\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(e^{-im} + e^{im}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {im}^{2}\\
\end{array}
\end{array}
if im < 0.00949999999999999976Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 86.6%
Simplified86.6%
if 0.00949999999999999976 < im < 1.35000000000000003e154Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in re around 0 71.9%
Simplified71.9%
if 1.35000000000000003e154 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 100.0%
Taylor expanded in im around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification86.2%
(FPCore (re im)
:precision binary64
(if (<= im 9e+14)
(sin re)
(if (<= im 7.2e+46)
(log (/ -2.0 (exp re)))
(if (<= im 5e+78)
(* (* 0.5 re) (pow im 2.0))
(if (<= im 1.1e+142)
(+ 0.08333333333333333 (/ 0.25 (pow re 2.0)))
(* re (* 0.5 (fma im im 2.0))))))))
double code(double re, double im) {
double tmp;
if (im <= 9e+14) {
tmp = sin(re);
} else if (im <= 7.2e+46) {
tmp = log((-2.0 / exp(re)));
} else if (im <= 5e+78) {
tmp = (0.5 * re) * pow(im, 2.0);
} else if (im <= 1.1e+142) {
tmp = 0.08333333333333333 + (0.25 / pow(re, 2.0));
} else {
tmp = re * (0.5 * fma(im, im, 2.0));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (im <= 9e+14) tmp = sin(re); elseif (im <= 7.2e+46) tmp = log(Float64(-2.0 / exp(re))); elseif (im <= 5e+78) tmp = Float64(Float64(0.5 * re) * (im ^ 2.0)); elseif (im <= 1.1e+142) tmp = Float64(0.08333333333333333 + Float64(0.25 / (re ^ 2.0))); else tmp = Float64(re * Float64(0.5 * fma(im, im, 2.0))); end return tmp end
code[re_, im_] := If[LessEqual[im, 9e+14], N[Sin[re], $MachinePrecision], If[LessEqual[im, 7.2e+46], N[Log[N[(-2.0 / N[Exp[re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 5e+78], N[(N[(0.5 * re), $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.1e+142], N[(0.08333333333333333 + N[(0.25 / N[Power[re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(0.5 * N[(im * im + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 9 \cdot 10^{+14}:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 7.2 \cdot 10^{+46}:\\
\;\;\;\;\log \left(\frac{-2}{e^{re}}\right)\\
\mathbf{elif}\;im \leq 5 \cdot 10^{+78}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot {im}^{2}\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+142}:\\
\;\;\;\;0.08333333333333333 + \frac{0.25}{{re}^{2}}\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)\\
\end{array}
\end{array}
if im < 9e14Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.1%
if 9e14 < im < 7.1999999999999997e46Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr2.1%
Taylor expanded in re around 0 1.5%
Applied egg-rr20.0%
if 7.1999999999999997e46 < im < 4.99999999999999984e78Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 3.9%
Simplified3.9%
Taylor expanded in re around 0 75.7%
*-commutative75.7%
associate-*l*75.7%
+-commutative75.7%
unpow275.7%
fma-udef75.7%
Simplified75.7%
Taylor expanded in im around inf 75.7%
*-commutative75.7%
associate-*l*75.7%
Simplified75.7%
if 4.99999999999999984e78 < im < 1.09999999999999993e142Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr44.3%
Taylor expanded in re around 0 44.3%
associate-*r/44.3%
metadata-eval44.3%
Simplified44.3%
if 1.09999999999999993e142 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 96.9%
Simplified96.9%
Taylor expanded in re around 0 69.0%
*-commutative69.0%
associate-*l*69.0%
+-commutative69.0%
unpow269.0%
fma-udef69.0%
Simplified69.0%
Final simplification64.7%
(FPCore (re im) :precision binary64 (if (<= im 1.45e-28) (sin re) (+ re (* 0.5 (* re (pow im 2.0))))))
double code(double re, double im) {
double tmp;
if (im <= 1.45e-28) {
tmp = sin(re);
} else {
tmp = re + (0.5 * (re * pow(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 <= 1.45d-28) then
tmp = sin(re)
else
tmp = re + (0.5d0 * (re * (im ** 2.0d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.45e-28) {
tmp = Math.sin(re);
} else {
tmp = re + (0.5 * (re * Math.pow(im, 2.0)));
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.45e-28: tmp = math.sin(re) else: tmp = re + (0.5 * (re * math.pow(im, 2.0))) return tmp
function code(re, im) tmp = 0.0 if (im <= 1.45e-28) tmp = sin(re); else tmp = Float64(re + Float64(0.5 * Float64(re * (im ^ 2.0)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.45e-28) tmp = sin(re); else tmp = re + (0.5 * (re * (im ^ 2.0))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.45e-28], N[Sin[re], $MachinePrecision], N[(re + N[(0.5 * N[(re * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.45 \cdot 10^{-28}:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;re + 0.5 \cdot \left(re \cdot {im}^{2}\right)\\
\end{array}
\end{array}
if im < 1.45000000000000006e-28Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.7%
if 1.45000000000000006e-28 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 52.9%
Simplified52.9%
Taylor expanded in re around 0 48.5%
*-commutative48.5%
associate-*l*48.5%
+-commutative48.5%
unpow248.5%
fma-udef48.5%
Simplified48.5%
Taylor expanded in im around 0 48.5%
Final simplification62.1%
(FPCore (re im) :precision binary64 (if (<= im 1.45e-28) (sin re) (* re (* 0.5 (fma im im 2.0)))))
double code(double re, double im) {
double tmp;
if (im <= 1.45e-28) {
tmp = sin(re);
} else {
tmp = re * (0.5 * fma(im, im, 2.0));
}
return tmp;
}
function code(re, im) tmp = 0.0 if (im <= 1.45e-28) tmp = sin(re); else tmp = Float64(re * Float64(0.5 * fma(im, im, 2.0))); end return tmp end
code[re_, im_] := If[LessEqual[im, 1.45e-28], N[Sin[re], $MachinePrecision], N[(re * N[(0.5 * N[(im * im + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.45 \cdot 10^{-28}:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)\\
\end{array}
\end{array}
if im < 1.45000000000000006e-28Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 66.7%
if 1.45000000000000006e-28 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 52.9%
Simplified52.9%
Taylor expanded in re around 0 48.5%
*-commutative48.5%
associate-*l*48.5%
+-commutative48.5%
unpow248.5%
fma-udef48.5%
Simplified48.5%
Final simplification62.1%
(FPCore (re im) :precision binary64 (if (<= im 3.3e+42) (sin re) (* (* 0.5 re) (pow im 2.0))))
double code(double re, double im) {
double tmp;
if (im <= 3.3e+42) {
tmp = sin(re);
} else {
tmp = (0.5 * re) * pow(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 <= 3.3d+42) then
tmp = sin(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 <= 3.3e+42) {
tmp = Math.sin(re);
} else {
tmp = (0.5 * re) * Math.pow(im, 2.0);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 3.3e+42: tmp = math.sin(re) else: tmp = (0.5 * re) * math.pow(im, 2.0) return tmp
function code(re, im) tmp = 0.0 if (im <= 3.3e+42) tmp = sin(re); else tmp = Float64(Float64(0.5 * re) * (im ^ 2.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 3.3e+42) tmp = sin(re); else tmp = (0.5 * re) * (im ^ 2.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 3.3e+42], N[Sin[re], $MachinePrecision], N[(N[(0.5 * re), $MachinePrecision] * N[Power[im, 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 3.3 \cdot 10^{+42}:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot {im}^{2}\\
\end{array}
\end{array}
if im < 3.2999999999999999e42Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 64.6%
if 3.2999999999999999e42 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 56.8%
Simplified56.8%
Taylor expanded in re around 0 51.8%
*-commutative51.8%
associate-*l*51.8%
+-commutative51.8%
unpow251.8%
fma-udef51.8%
Simplified51.8%
Taylor expanded in im around inf 51.8%
*-commutative51.8%
associate-*l*51.8%
Simplified51.8%
Final simplification62.1%
(FPCore (re im) :precision binary64 (if (<= im 880.0) (sin re) (pow re -2.0)))
double code(double re, double im) {
double tmp;
if (im <= 880.0) {
tmp = sin(re);
} else {
tmp = pow(re, -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 <= 880.0d0) then
tmp = sin(re)
else
tmp = re ** (-2.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 880.0) {
tmp = Math.sin(re);
} else {
tmp = Math.pow(re, -2.0);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 880.0: tmp = math.sin(re) else: tmp = math.pow(re, -2.0) return tmp
function code(re, im) tmp = 0.0 if (im <= 880.0) tmp = sin(re); else tmp = re ^ -2.0; end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 880.0) tmp = sin(re); else tmp = re ^ -2.0; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 880.0], N[Sin[re], $MachinePrecision], N[Power[re, -2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 880:\\
\;\;\;\;\sin re\\
\mathbf{else}:\\
\;\;\;\;{re}^{-2}\\
\end{array}
\end{array}
if im < 880Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 67.1%
if 880 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr20.2%
Taylor expanded in re around 0 20.0%
Applied egg-rr20.0%
Final simplification56.3%
(FPCore (re im)
:precision binary64
(if (<= im 310.0)
(sin re)
(if (or (<= im 4.2e+157) (not (<= im 3.2e+295)))
(+ 0.08333333333333333 (* re re))
(/
(- (* (* re -2.0) (* re -2.0)) 0.00043402777777777775)
(- (* re -2.0) -0.020833333333333332)))))
double code(double re, double im) {
double tmp;
if (im <= 310.0) {
tmp = sin(re);
} else if ((im <= 4.2e+157) || !(im <= 3.2e+295)) {
tmp = 0.08333333333333333 + (re * re);
} else {
tmp = (((re * -2.0) * (re * -2.0)) - 0.00043402777777777775) / ((re * -2.0) - -0.020833333333333332);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 310.0d0) then
tmp = sin(re)
else if ((im <= 4.2d+157) .or. (.not. (im <= 3.2d+295))) then
tmp = 0.08333333333333333d0 + (re * re)
else
tmp = (((re * (-2.0d0)) * (re * (-2.0d0))) - 0.00043402777777777775d0) / ((re * (-2.0d0)) - (-0.020833333333333332d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 310.0) {
tmp = Math.sin(re);
} else if ((im <= 4.2e+157) || !(im <= 3.2e+295)) {
tmp = 0.08333333333333333 + (re * re);
} else {
tmp = (((re * -2.0) * (re * -2.0)) - 0.00043402777777777775) / ((re * -2.0) - -0.020833333333333332);
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 310.0: tmp = math.sin(re) elif (im <= 4.2e+157) or not (im <= 3.2e+295): tmp = 0.08333333333333333 + (re * re) else: tmp = (((re * -2.0) * (re * -2.0)) - 0.00043402777777777775) / ((re * -2.0) - -0.020833333333333332) return tmp
function code(re, im) tmp = 0.0 if (im <= 310.0) tmp = sin(re); elseif ((im <= 4.2e+157) || !(im <= 3.2e+295)) tmp = Float64(0.08333333333333333 + Float64(re * re)); else tmp = Float64(Float64(Float64(Float64(re * -2.0) * Float64(re * -2.0)) - 0.00043402777777777775) / Float64(Float64(re * -2.0) - -0.020833333333333332)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 310.0) tmp = sin(re); elseif ((im <= 4.2e+157) || ~((im <= 3.2e+295))) tmp = 0.08333333333333333 + (re * re); else tmp = (((re * -2.0) * (re * -2.0)) - 0.00043402777777777775) / ((re * -2.0) - -0.020833333333333332); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 310.0], N[Sin[re], $MachinePrecision], If[Or[LessEqual[im, 4.2e+157], N[Not[LessEqual[im, 3.2e+295]], $MachinePrecision]], N[(0.08333333333333333 + N[(re * re), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(re * -2.0), $MachinePrecision] * N[(re * -2.0), $MachinePrecision]), $MachinePrecision] - 0.00043402777777777775), $MachinePrecision] / N[(N[(re * -2.0), $MachinePrecision] - -0.020833333333333332), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 310:\\
\;\;\;\;\sin re\\
\mathbf{elif}\;im \leq 4.2 \cdot 10^{+157} \lor \neg \left(im \leq 3.2 \cdot 10^{+295}\right):\\
\;\;\;\;0.08333333333333333 + re \cdot re\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(re \cdot -2\right) \cdot \left(re \cdot -2\right) - 0.00043402777777777775}{re \cdot -2 - -0.020833333333333332}\\
\end{array}
\end{array}
if im < 310Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 67.1%
if 310 < im < 4.2e157 or 3.20000000000000021e295 < im Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr24.9%
Taylor expanded in re around 0 24.9%
associate-*r/24.9%
metadata-eval24.9%
Simplified24.9%
Applied egg-rr16.4%
if 4.2e157 < im < 3.20000000000000021e295Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr13.7%
Taylor expanded in re around 0 13.7%
associate-*r/13.7%
metadata-eval13.7%
Simplified13.7%
Applied egg-rr2.2%
fma-udef2.2%
*-commutative2.2%
fma-def2.2%
Simplified2.2%
fma-udef2.2%
flip-+9.8%
metadata-eval9.8%
Applied egg-rr9.8%
Final simplification54.8%
(FPCore (re im) :precision binary64 (if (<= re 2.9e+135) re (* re re)))
double code(double re, double im) {
double tmp;
if (re <= 2.9e+135) {
tmp = re;
} else {
tmp = 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.9d+135) then
tmp = re
else
tmp = re * re
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.9e+135) {
tmp = re;
} else {
tmp = re * re;
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.9e+135: tmp = re else: tmp = re * re return tmp
function code(re, im) tmp = 0.0 if (re <= 2.9e+135) tmp = re; else tmp = Float64(re * re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.9e+135) tmp = re; else tmp = re * re; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.9e+135], re, N[(re * re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.9 \cdot 10^{+135}:\\
\;\;\;\;re\\
\mathbf{else}:\\
\;\;\;\;re \cdot re\\
\end{array}
\end{array}
if re < 2.8999999999999999e135Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 78.4%
Simplified78.4%
Taylor expanded in re around 0 58.7%
*-commutative58.7%
associate-*l*58.7%
+-commutative58.7%
unpow258.7%
fma-udef58.7%
Simplified58.7%
Taylor expanded in im around 0 37.4%
if 2.8999999999999999e135 < re Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr5.2%
Taylor expanded in re around 0 2.2%
Applied egg-rr29.6%
Final simplification36.4%
(FPCore (re im) :precision binary64 -1.0212765957446808)
double code(double re, double im) {
return -1.0212765957446808;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = -1.0212765957446808d0
end function
public static double code(double re, double im) {
return -1.0212765957446808;
}
def code(re, im): return -1.0212765957446808
function code(re, im) return -1.0212765957446808 end
function tmp = code(re, im) tmp = -1.0212765957446808; end
code[re_, im_] := -1.0212765957446808
\begin{array}{l}
\\
-1.0212765957446808
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr10.7%
Taylor expanded in re around 0 10.7%
associate-*r/10.7%
metadata-eval10.7%
Simplified10.7%
Applied egg-rr4.7%
*-commutative4.7%
distribute-rgt1-in4.7%
metadata-eval4.7%
Simplified4.7%
Taylor expanded in re around inf 4.6%
Final simplification4.6%
(FPCore (re im) :precision binary64 0.08333333333333333)
double code(double re, double im) {
return 0.08333333333333333;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.08333333333333333d0
end function
public static double code(double re, double im) {
return 0.08333333333333333;
}
def code(re, im): return 0.08333333333333333
function code(re, im) return 0.08333333333333333 end
function tmp = code(re, im) tmp = 0.08333333333333333; end
code[re_, im_] := 0.08333333333333333
\begin{array}{l}
\\
0.08333333333333333
\end{array}
Initial program 100.0%
distribute-rgt-in100.0%
cancel-sign-sub100.0%
distribute-rgt-out--100.0%
sub-neg100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Applied egg-rr10.7%
Taylor expanded in re around 0 10.7%
associate-*r/10.7%
metadata-eval10.7%
Simplified10.7%
Taylor expanded in re around inf 3.9%
Final simplification3.9%
(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%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in im around 0 77.8%
Simplified77.8%
Taylor expanded in re around 0 55.4%
*-commutative55.4%
associate-*l*55.4%
+-commutative55.4%
unpow255.4%
fma-udef55.4%
Simplified55.4%
Taylor expanded in im around 0 33.1%
Final simplification33.1%
herbie shell --seed 2023333
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))