
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im): return math.exp(re) * math.sin(im)
function code(re, im) return Float64(exp(re) * sin(im)) end
function tmp = code(re, im) tmp = exp(re) * sin(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \sin im
\end{array}
Initial program 100.0%
(FPCore (re im) :precision binary64 (let* ((t_0 (* (exp re) im))) (if (<= (exp re) 0.0) t_0 (if (<= (exp re) 1.000002) (sin im) t_0))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (exp(re) <= 0.0) {
tmp = t_0;
} else if (exp(re) <= 1.000002) {
tmp = sin(im);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = exp(re) * im
if (exp(re) <= 0.0d0) then
tmp = t_0
else if (exp(re) <= 1.000002d0) then
tmp = sin(im)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(re) * im;
double tmp;
if (Math.exp(re) <= 0.0) {
tmp = t_0;
} else if (Math.exp(re) <= 1.000002) {
tmp = Math.sin(im);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if math.exp(re) <= 0.0: tmp = t_0 elif math.exp(re) <= 1.000002: tmp = math.sin(im) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (exp(re) <= 0.0) tmp = t_0; elseif (exp(re) <= 1.000002) tmp = sin(im); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; tmp = 0.0; if (exp(re) <= 0.0) tmp = t_0; elseif (exp(re) <= 1.000002) tmp = sin(im); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[N[Exp[re], $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[Exp[re], $MachinePrecision], 1.000002], N[Sin[im], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;e^{re} \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;e^{re} \leq 1.000002:\\
\;\;\;\;\sin im\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (exp.f64 re) < 0.0 or 1.00000200000000006 < (exp.f64 re) Initial program 100.0%
Taylor expanded in im around 0
Simplified90.0%
if 0.0 < (exp.f64 re) < 1.00000200000000006Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6494.9%
Simplified94.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im))
(t_1
(*
(sin im)
(+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0))))
(if (<= re -0.118)
t_0
(if (<= re 0.0055) t_1 (if (<= re 1.02e+103) t_0 t_1)))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double t_1 = sin(im) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
double tmp;
if (re <= -0.118) {
tmp = t_0;
} else if (re <= 0.0055) {
tmp = t_1;
} else if (re <= 1.02e+103) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(re) * im
t_1 = sin(im) * ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0)
if (re <= (-0.118d0)) then
tmp = t_0
else if (re <= 0.0055d0) then
tmp = t_1
else if (re <= 1.02d+103) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(re) * im;
double t_1 = Math.sin(im) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
double tmp;
if (re <= -0.118) {
tmp = t_0;
} else if (re <= 0.0055) {
tmp = t_1;
} else if (re <= 1.02e+103) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im t_1 = math.sin(im) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) tmp = 0 if re <= -0.118: tmp = t_0 elif re <= 0.0055: tmp = t_1 elif re <= 1.02e+103: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(exp(re) * im) t_1 = Float64(sin(im) * Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0)) tmp = 0.0 if (re <= -0.118) tmp = t_0; elseif (re <= 0.0055) tmp = t_1; elseif (re <= 1.02e+103) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; t_1 = sin(im) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0); tmp = 0.0; if (re <= -0.118) tmp = t_0; elseif (re <= 0.0055) tmp = t_1; elseif (re <= 1.02e+103) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[im], $MachinePrecision] * N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.118], t$95$0, If[LessEqual[re, 0.0055], t$95$1, If[LessEqual[re, 1.02e+103], t$95$0, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
t_1 := \sin im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\
\mathbf{if}\;re \leq -0.118:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 0.0055:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if re < -0.11799999999999999 or 0.0054999999999999997 < re < 1.01999999999999991e103Initial program 100.0%
Taylor expanded in im around 0
Simplified96.3%
if -0.11799999999999999 < re < 0.0054999999999999997 or 1.01999999999999991e103 < re Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.2%
Simplified99.2%
Final simplification98.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im))
(t_1 (* (sin im) (- 1.0 (* re (- -1.0 (* re 0.5)))))))
(if (<= re -54.0)
t_0
(if (<= re 0.0055) t_1 (if (<= re 1.9e+154) t_0 t_1)))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double t_1 = sin(im) * (1.0 - (re * (-1.0 - (re * 0.5))));
double tmp;
if (re <= -54.0) {
tmp = t_0;
} else if (re <= 0.0055) {
tmp = t_1;
} else if (re <= 1.9e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(re) * im
t_1 = sin(im) * (1.0d0 - (re * ((-1.0d0) - (re * 0.5d0))))
if (re <= (-54.0d0)) then
tmp = t_0
else if (re <= 0.0055d0) then
tmp = t_1
else if (re <= 1.9d+154) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(re) * im;
double t_1 = Math.sin(im) * (1.0 - (re * (-1.0 - (re * 0.5))));
double tmp;
if (re <= -54.0) {
tmp = t_0;
} else if (re <= 0.0055) {
tmp = t_1;
} else if (re <= 1.9e+154) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im t_1 = math.sin(im) * (1.0 - (re * (-1.0 - (re * 0.5)))) tmp = 0 if re <= -54.0: tmp = t_0 elif re <= 0.0055: tmp = t_1 elif re <= 1.9e+154: tmp = t_0 else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(exp(re) * im) t_1 = Float64(sin(im) * Float64(1.0 - Float64(re * Float64(-1.0 - Float64(re * 0.5))))) tmp = 0.0 if (re <= -54.0) tmp = t_0; elseif (re <= 0.0055) tmp = t_1; elseif (re <= 1.9e+154) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; t_1 = sin(im) * (1.0 - (re * (-1.0 - (re * 0.5)))); tmp = 0.0; if (re <= -54.0) tmp = t_0; elseif (re <= 0.0055) tmp = t_1; elseif (re <= 1.9e+154) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[im], $MachinePrecision] * N[(1.0 - N[(re * N[(-1.0 - N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -54.0], t$95$0, If[LessEqual[re, 0.0055], t$95$1, If[LessEqual[re, 1.9e+154], t$95$0, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
t_1 := \sin im \cdot \left(1 - re \cdot \left(-1 - re \cdot 0.5\right)\right)\\
\mathbf{if}\;re \leq -54:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 0.0055:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;re \leq 1.9 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if re < -54 or 0.0054999999999999997 < re < 1.8999999999999999e154Initial program 100.0%
Taylor expanded in im around 0
Simplified95.6%
if -54 < re < 0.0054999999999999997 or 1.8999999999999999e154 < re Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6498.2%
Simplified98.2%
Final simplification97.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0))
(t_1 (* re (* t_0 -0.16666666666666666))))
(if (<= re -2.35e+165)
(/ (* im im) (+ im (* re (* im (- -1.0 (* re 0.5))))))
(if (<= re -5.6e+102)
(*
im
(*
(/ (- 1.0 (* re re)) (- 1.0 (* re (* re re))))
(+ (* re (+ re 1.0)) 1.0)))
(if (<= re -6.5e+20)
(* (+ -0.16666666666666666 t_1) (* im (* im im)))
(if (<= re 4.7e+14)
(sin im)
(if (<= re 1.02e+103)
(*
im
(+
(*
(* im im)
(+ -0.16666666666666666 (+ t_1 (/ (* re t_0) (* im im)))))
1.0))
(* im (* re (* 0.16666666666666666 (* re re)))))))))))
double code(double re, double im) {
double t_0 = (re * (0.5 + (re * 0.16666666666666666))) + 1.0;
double t_1 = re * (t_0 * -0.16666666666666666);
double tmp;
if (re <= -2.35e+165) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else if (re <= -5.6e+102) {
tmp = im * (((1.0 - (re * re)) / (1.0 - (re * (re * re)))) * ((re * (re + 1.0)) + 1.0));
} else if (re <= -6.5e+20) {
tmp = (-0.16666666666666666 + t_1) * (im * (im * im));
} else if (re <= 4.7e+14) {
tmp = sin(im);
} else if (re <= 1.02e+103) {
tmp = im * (((im * im) * (-0.16666666666666666 + (t_1 + ((re * t_0) / (im * im))))) + 1.0);
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0
t_1 = re * (t_0 * (-0.16666666666666666d0))
if (re <= (-2.35d+165)) then
tmp = (im * im) / (im + (re * (im * ((-1.0d0) - (re * 0.5d0)))))
else if (re <= (-5.6d+102)) then
tmp = im * (((1.0d0 - (re * re)) / (1.0d0 - (re * (re * re)))) * ((re * (re + 1.0d0)) + 1.0d0))
else if (re <= (-6.5d+20)) then
tmp = ((-0.16666666666666666d0) + t_1) * (im * (im * im))
else if (re <= 4.7d+14) then
tmp = sin(im)
else if (re <= 1.02d+103) then
tmp = im * (((im * im) * ((-0.16666666666666666d0) + (t_1 + ((re * t_0) / (im * im))))) + 1.0d0)
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (re * (0.5 + (re * 0.16666666666666666))) + 1.0;
double t_1 = re * (t_0 * -0.16666666666666666);
double tmp;
if (re <= -2.35e+165) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else if (re <= -5.6e+102) {
tmp = im * (((1.0 - (re * re)) / (1.0 - (re * (re * re)))) * ((re * (re + 1.0)) + 1.0));
} else if (re <= -6.5e+20) {
tmp = (-0.16666666666666666 + t_1) * (im * (im * im));
} else if (re <= 4.7e+14) {
tmp = Math.sin(im);
} else if (re <= 1.02e+103) {
tmp = im * (((im * im) * (-0.16666666666666666 + (t_1 + ((re * t_0) / (im * im))))) + 1.0);
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): t_0 = (re * (0.5 + (re * 0.16666666666666666))) + 1.0 t_1 = re * (t_0 * -0.16666666666666666) tmp = 0 if re <= -2.35e+165: tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))) elif re <= -5.6e+102: tmp = im * (((1.0 - (re * re)) / (1.0 - (re * (re * re)))) * ((re * (re + 1.0)) + 1.0)) elif re <= -6.5e+20: tmp = (-0.16666666666666666 + t_1) * (im * (im * im)) elif re <= 4.7e+14: tmp = math.sin(im) elif re <= 1.02e+103: tmp = im * (((im * im) * (-0.16666666666666666 + (t_1 + ((re * t_0) / (im * im))))) + 1.0) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) t_0 = Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0) t_1 = Float64(re * Float64(t_0 * -0.16666666666666666)) tmp = 0.0 if (re <= -2.35e+165) tmp = Float64(Float64(im * im) / Float64(im + Float64(re * Float64(im * Float64(-1.0 - Float64(re * 0.5)))))); elseif (re <= -5.6e+102) tmp = Float64(im * Float64(Float64(Float64(1.0 - Float64(re * re)) / Float64(1.0 - Float64(re * Float64(re * re)))) * Float64(Float64(re * Float64(re + 1.0)) + 1.0))); elseif (re <= -6.5e+20) tmp = Float64(Float64(-0.16666666666666666 + t_1) * Float64(im * Float64(im * im))); elseif (re <= 4.7e+14) tmp = sin(im); elseif (re <= 1.02e+103) tmp = Float64(im * Float64(Float64(Float64(im * im) * Float64(-0.16666666666666666 + Float64(t_1 + Float64(Float64(re * t_0) / Float64(im * im))))) + 1.0)); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) t_0 = (re * (0.5 + (re * 0.16666666666666666))) + 1.0; t_1 = re * (t_0 * -0.16666666666666666); tmp = 0.0; if (re <= -2.35e+165) tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))); elseif (re <= -5.6e+102) tmp = im * (((1.0 - (re * re)) / (1.0 - (re * (re * re)))) * ((re * (re + 1.0)) + 1.0)); elseif (re <= -6.5e+20) tmp = (-0.16666666666666666 + t_1) * (im * (im * im)); elseif (re <= 4.7e+14) tmp = sin(im); elseif (re <= 1.02e+103) tmp = im * (((im * im) * (-0.16666666666666666 + (t_1 + ((re * t_0) / (im * im))))) + 1.0); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(t$95$0 * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -2.35e+165], N[(N[(im * im), $MachinePrecision] / N[(im + N[(re * N[(im * N[(-1.0 - N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, -5.6e+102], N[(im * N[(N[(N[(1.0 - N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * N[(re + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, -6.5e+20], N[(N[(-0.16666666666666666 + t$95$1), $MachinePrecision] * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 4.7e+14], N[Sin[im], $MachinePrecision], If[LessEqual[re, 1.02e+103], N[(im * N[(N[(N[(im * im), $MachinePrecision] * N[(-0.16666666666666666 + N[(t$95$1 + N[(N[(re * t$95$0), $MachinePrecision] / N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\\
t_1 := re \cdot \left(t\_0 \cdot -0.16666666666666666\right)\\
\mathbf{if}\;re \leq -2.35 \cdot 10^{+165}:\\
\;\;\;\;\frac{im \cdot im}{im + re \cdot \left(im \cdot \left(-1 - re \cdot 0.5\right)\right)}\\
\mathbf{elif}\;re \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;im \cdot \left(\frac{1 - re \cdot re}{1 - re \cdot \left(re \cdot re\right)} \cdot \left(re \cdot \left(re + 1\right) + 1\right)\right)\\
\mathbf{elif}\;re \leq -6.5 \cdot 10^{+20}:\\
\;\;\;\;\left(-0.16666666666666666 + t\_1\right) \cdot \left(im \cdot \left(im \cdot im\right)\right)\\
\mathbf{elif}\;re \leq 4.7 \cdot 10^{+14}:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\
\;\;\;\;im \cdot \left(\left(im \cdot im\right) \cdot \left(-0.16666666666666666 + \left(t\_1 + \frac{re \cdot t\_0}{im \cdot im}\right)\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < -2.35000000000000008e165Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f641.7%
Simplified1.7%
+-commutativeN/A
flip-+N/A
/-lowering-/.f64N/A
Applied egg-rr0.5%
Taylor expanded in re around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6491.3%
Simplified91.3%
if -2.35000000000000008e165 < re < -5.60000000000000037e102Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f642.5%
Simplified2.5%
Taylor expanded in im around 0
Simplified2.1%
+-commutativeN/A
flip-+N/A
metadata-evalN/A
flip3--N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
cube-unmultN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
distribute-rgt-outN/A
+-commutativeN/A
flip-+N/A
metadata-evalN/A
un-div-invN/A
Applied egg-rr80.0%
if -5.60000000000000037e102 < re < -6.5e20Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f642.6%
Simplified2.6%
Taylor expanded in im around 0
+-commutativeN/A
associate-+r+N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified2.3%
Taylor expanded in im around inf
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
distribute-lft-inN/A
sum3-defineN/A
*-rgt-identityN/A
associate-*r*N/A
unpow2N/A
sum3-defineN/A
+-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified39.2%
if -6.5e20 < re < 4.7e14Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6491.1%
Simplified91.1%
if 4.7e14 < re < 1.01999999999999991e103Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f644.3%
Simplified4.3%
Taylor expanded in im around 0
+-commutativeN/A
associate-+r+N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified15.7%
Taylor expanded in im around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
Simplified60.2%
if 1.01999999999999991e103 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified76.9%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6467.3%
Simplified67.3%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.9%
Simplified76.9%
Final simplification82.3%
(FPCore (re im) :precision binary64 (let* ((t_0 (* (exp re) im))) (if (<= re -0.032) t_0 (if (<= re 0.0052) (* (sin im) (+ re 1.0)) t_0))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -0.032) {
tmp = t_0;
} else if (re <= 0.0052) {
tmp = sin(im) * (re + 1.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = exp(re) * im
if (re <= (-0.032d0)) then
tmp = t_0
else if (re <= 0.0052d0) then
tmp = sin(im) * (re + 1.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.exp(re) * im;
double tmp;
if (re <= -0.032) {
tmp = t_0;
} else if (re <= 0.0052) {
tmp = Math.sin(im) * (re + 1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -0.032: tmp = t_0 elif re <= 0.0052: tmp = math.sin(im) * (re + 1.0) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -0.032) tmp = t_0; elseif (re <= 0.0052) tmp = Float64(sin(im) * Float64(re + 1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = exp(re) * im; tmp = 0.0; if (re <= -0.032) tmp = t_0; elseif (re <= 0.0052) tmp = sin(im) * (re + 1.0); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -0.032], t$95$0, If[LessEqual[re, 0.0052], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -0.032:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 0.0052:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if re < -0.032000000000000001 or 0.0051999999999999998 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified89.9%
if -0.032000000000000001 < re < 0.0051999999999999998Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6497.4%
Simplified97.4%
Final simplification93.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)))
(if (<= re -2.35e+165)
(/ (* im im) (+ im (* re (* im (- -1.0 (* re 0.5))))))
(if (<= re -6.8e+101)
(*
im
(*
(/ (- 1.0 (* re re)) (- 1.0 (* re (* re re))))
(+ (* re (+ re 1.0)) 1.0)))
(if (<= re -6.5e+20)
(*
(+ -0.16666666666666666 (* re (* t_0 -0.16666666666666666)))
(* im (* im im)))
(* im (+ (* re t_0) 1.0)))))))
double code(double re, double im) {
double t_0 = (re * (0.5 + (re * 0.16666666666666666))) + 1.0;
double tmp;
if (re <= -2.35e+165) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else if (re <= -6.8e+101) {
tmp = im * (((1.0 - (re * re)) / (1.0 - (re * (re * re)))) * ((re * (re + 1.0)) + 1.0));
} else if (re <= -6.5e+20) {
tmp = (-0.16666666666666666 + (re * (t_0 * -0.16666666666666666))) * (im * (im * im));
} else {
tmp = im * ((re * t_0) + 1.0);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0
if (re <= (-2.35d+165)) then
tmp = (im * im) / (im + (re * (im * ((-1.0d0) - (re * 0.5d0)))))
else if (re <= (-6.8d+101)) then
tmp = im * (((1.0d0 - (re * re)) / (1.0d0 - (re * (re * re)))) * ((re * (re + 1.0d0)) + 1.0d0))
else if (re <= (-6.5d+20)) then
tmp = ((-0.16666666666666666d0) + (re * (t_0 * (-0.16666666666666666d0)))) * (im * (im * im))
else
tmp = im * ((re * t_0) + 1.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (re * (0.5 + (re * 0.16666666666666666))) + 1.0;
double tmp;
if (re <= -2.35e+165) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else if (re <= -6.8e+101) {
tmp = im * (((1.0 - (re * re)) / (1.0 - (re * (re * re)))) * ((re * (re + 1.0)) + 1.0));
} else if (re <= -6.5e+20) {
tmp = (-0.16666666666666666 + (re * (t_0 * -0.16666666666666666))) * (im * (im * im));
} else {
tmp = im * ((re * t_0) + 1.0);
}
return tmp;
}
def code(re, im): t_0 = (re * (0.5 + (re * 0.16666666666666666))) + 1.0 tmp = 0 if re <= -2.35e+165: tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))) elif re <= -6.8e+101: tmp = im * (((1.0 - (re * re)) / (1.0 - (re * (re * re)))) * ((re * (re + 1.0)) + 1.0)) elif re <= -6.5e+20: tmp = (-0.16666666666666666 + (re * (t_0 * -0.16666666666666666))) * (im * (im * im)) else: tmp = im * ((re * t_0) + 1.0) return tmp
function code(re, im) t_0 = Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0) tmp = 0.0 if (re <= -2.35e+165) tmp = Float64(Float64(im * im) / Float64(im + Float64(re * Float64(im * Float64(-1.0 - Float64(re * 0.5)))))); elseif (re <= -6.8e+101) tmp = Float64(im * Float64(Float64(Float64(1.0 - Float64(re * re)) / Float64(1.0 - Float64(re * Float64(re * re)))) * Float64(Float64(re * Float64(re + 1.0)) + 1.0))); elseif (re <= -6.5e+20) tmp = Float64(Float64(-0.16666666666666666 + Float64(re * Float64(t_0 * -0.16666666666666666))) * Float64(im * Float64(im * im))); else tmp = Float64(im * Float64(Float64(re * t_0) + 1.0)); end return tmp end
function tmp_2 = code(re, im) t_0 = (re * (0.5 + (re * 0.16666666666666666))) + 1.0; tmp = 0.0; if (re <= -2.35e+165) tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))); elseif (re <= -6.8e+101) tmp = im * (((1.0 - (re * re)) / (1.0 - (re * (re * re)))) * ((re * (re + 1.0)) + 1.0)); elseif (re <= -6.5e+20) tmp = (-0.16666666666666666 + (re * (t_0 * -0.16666666666666666))) * (im * (im * im)); else tmp = im * ((re * t_0) + 1.0); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[re, -2.35e+165], N[(N[(im * im), $MachinePrecision] / N[(im + N[(re * N[(im * N[(-1.0 - N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, -6.8e+101], N[(im * N[(N[(N[(1.0 - N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * N[(re + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, -6.5e+20], N[(N[(-0.16666666666666666 + N[(re * N[(t$95$0 * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(N[(re * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\\
\mathbf{if}\;re \leq -2.35 \cdot 10^{+165}:\\
\;\;\;\;\frac{im \cdot im}{im + re \cdot \left(im \cdot \left(-1 - re \cdot 0.5\right)\right)}\\
\mathbf{elif}\;re \leq -6.8 \cdot 10^{+101}:\\
\;\;\;\;im \cdot \left(\frac{1 - re \cdot re}{1 - re \cdot \left(re \cdot re\right)} \cdot \left(re \cdot \left(re + 1\right) + 1\right)\right)\\
\mathbf{elif}\;re \leq -6.5 \cdot 10^{+20}:\\
\;\;\;\;\left(-0.16666666666666666 + re \cdot \left(t\_0 \cdot -0.16666666666666666\right)\right) \cdot \left(im \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot t\_0 + 1\right)\\
\end{array}
\end{array}
if re < -2.35000000000000008e165Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f641.7%
Simplified1.7%
+-commutativeN/A
flip-+N/A
/-lowering-/.f64N/A
Applied egg-rr0.5%
Taylor expanded in re around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6491.3%
Simplified91.3%
if -2.35000000000000008e165 < re < -6.80000000000000034e101Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f642.5%
Simplified2.5%
Taylor expanded in im around 0
Simplified2.1%
+-commutativeN/A
flip-+N/A
metadata-evalN/A
flip3--N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
cube-unmultN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
distribute-rgt-outN/A
+-commutativeN/A
flip-+N/A
metadata-evalN/A
un-div-invN/A
Applied egg-rr80.0%
if -6.80000000000000034e101 < re < -6.5e20Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f642.6%
Simplified2.6%
Taylor expanded in im around 0
+-commutativeN/A
associate-+r+N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified2.3%
Taylor expanded in im around inf
*-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft1-inN/A
distribute-lft-inN/A
sum3-defineN/A
*-rgt-identityN/A
associate-*r*N/A
unpow2N/A
sum3-defineN/A
+-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified39.2%
if -6.5e20 < re Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6489.4%
Simplified89.4%
Taylor expanded in im around 0
Simplified46.8%
Final simplification52.1%
(FPCore (re im) :precision binary64 (if (<= re -1.6) (/ (* im im) (+ im (* re (* im (- -1.0 (* re 0.5)))))) (* im (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0))))
double code(double re, double im) {
double tmp;
if (re <= -1.6) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else {
tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-1.6d0)) then
tmp = (im * im) / (im + (re * (im * ((-1.0d0) - (re * 0.5d0)))))
else
tmp = im * ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -1.6) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else {
tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -1.6: tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))) else: tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) return tmp
function code(re, im) tmp = 0.0 if (re <= -1.6) tmp = Float64(Float64(im * im) / Float64(im + Float64(re * Float64(im * Float64(-1.0 - Float64(re * 0.5)))))); else tmp = Float64(im * Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -1.6) tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))); else tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -1.6], N[(N[(im * im), $MachinePrecision] / N[(im + N[(re * N[(im * N[(-1.0 - N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -1.6:\\
\;\;\;\;\frac{im \cdot im}{im + re \cdot \left(im \cdot \left(-1 - re \cdot 0.5\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\
\end{array}
\end{array}
if re < -1.6000000000000001Initial program 100.0%
Taylor expanded in im around 0
Simplified98.4%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f642.0%
Simplified2.0%
+-commutativeN/A
flip-+N/A
/-lowering-/.f64N/A
Applied egg-rr1.2%
Taylor expanded in re around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6452.5%
Simplified52.5%
if -1.6000000000000001 < re Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6490.7%
Simplified90.7%
Taylor expanded in im around 0
Simplified47.5%
Final simplification48.7%
(FPCore (re im)
:precision binary64
(if (<= re 9.5e+47)
(*
im
(+
(* im (* im (+ -0.16666666666666666 (* (* im im) 0.008333333333333333))))
1.0))
(* im (* re (* 0.16666666666666666 (* re re))))))
double code(double re, double im) {
double tmp;
if (re <= 9.5e+47) {
tmp = im * ((im * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333)))) + 1.0);
} else {
tmp = im * (re * (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 <= 9.5d+47) then
tmp = im * ((im * (im * ((-0.16666666666666666d0) + ((im * im) * 0.008333333333333333d0)))) + 1.0d0)
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 9.5e+47) {
tmp = im * ((im * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333)))) + 1.0);
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 9.5e+47: tmp = im * ((im * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333)))) + 1.0) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 9.5e+47) tmp = Float64(im * Float64(Float64(im * Float64(im * Float64(-0.16666666666666666 + Float64(Float64(im * im) * 0.008333333333333333)))) + 1.0)); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 9.5e+47) tmp = im * ((im * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333)))) + 1.0); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 9.5e+47], N[(im * N[(N[(im * N[(im * N[(-0.16666666666666666 + N[(N[(im * im), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 9.5 \cdot 10^{+47}:\\
\;\;\;\;im \cdot \left(im \cdot \left(im \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot 0.008333333333333333\right)\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < 9.50000000000000001e47Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6463.7%
Simplified63.7%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.7%
Simplified29.7%
if 9.50000000000000001e47 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified78.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6460.6%
Simplified60.6%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6468.6%
Simplified68.6%
Final simplification36.9%
(FPCore (re im) :precision binary64 (if (<= re 1.65e+53) (* (+ (* im (* im -0.16666666666666666)) 1.0) (* im (+ re 1.0))) (* im (* re (* 0.16666666666666666 (* re re))))))
double code(double re, double im) {
double tmp;
if (re <= 1.65e+53) {
tmp = ((im * (im * -0.16666666666666666)) + 1.0) * (im * (re + 1.0));
} else {
tmp = im * (re * (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.65d+53) then
tmp = ((im * (im * (-0.16666666666666666d0))) + 1.0d0) * (im * (re + 1.0d0))
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.65e+53) {
tmp = ((im * (im * -0.16666666666666666)) + 1.0) * (im * (re + 1.0));
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.65e+53: tmp = ((im * (im * -0.16666666666666666)) + 1.0) * (im * (re + 1.0)) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.65e+53) tmp = Float64(Float64(Float64(im * Float64(im * -0.16666666666666666)) + 1.0) * Float64(im * Float64(re + 1.0))); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.65e+53) tmp = ((im * (im * -0.16666666666666666)) + 1.0) * (im * (re + 1.0)); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.65e+53], N[(N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.65 \cdot 10^{+53}:\\
\;\;\;\;\left(im \cdot \left(im \cdot -0.16666666666666666\right) + 1\right) \cdot \left(im \cdot \left(re + 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < 1.6500000000000001e53Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6465.7%
Simplified65.7%
Taylor expanded in im around 0
+-commutativeN/A
associate-+r+N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified29.1%
*-commutativeN/A
flip3-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
metadata-evalN/A
unpow-prod-downN/A
*-lowering-*.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
metadata-evalN/A
distribute-rgt-out--N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6429.0%
Applied egg-rr29.0%
Taylor expanded in re around 0
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-rgt-identityN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6429.3%
Simplified29.3%
if 1.6500000000000001e53 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified80.4%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6461.9%
Simplified61.9%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.1%
Simplified70.1%
Final simplification36.6%
(FPCore (re im) :precision binary64 (if (<= re 1e+48) (* im (+ (* im (* im (* (* im im) 0.008333333333333333))) 1.0)) (* im (* re (* 0.16666666666666666 (* re re))))))
double code(double re, double im) {
double tmp;
if (re <= 1e+48) {
tmp = im * ((im * (im * ((im * im) * 0.008333333333333333))) + 1.0);
} else {
tmp = im * (re * (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 <= 1d+48) then
tmp = im * ((im * (im * ((im * im) * 0.008333333333333333d0))) + 1.0d0)
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1e+48) {
tmp = im * ((im * (im * ((im * im) * 0.008333333333333333))) + 1.0);
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1e+48: tmp = im * ((im * (im * ((im * im) * 0.008333333333333333))) + 1.0) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 1e+48) tmp = Float64(im * Float64(Float64(im * Float64(im * Float64(Float64(im * im) * 0.008333333333333333))) + 1.0)); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1e+48) tmp = im * ((im * (im * ((im * im) * 0.008333333333333333))) + 1.0); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1e+48], N[(im * N[(N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 10^{+48}:\\
\;\;\;\;im \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.008333333333333333\right)\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < 1.00000000000000004e48Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6463.7%
Simplified63.7%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.7%
Simplified29.7%
Taylor expanded in im around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.3%
Simplified29.3%
if 1.00000000000000004e48 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified78.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6460.6%
Simplified60.6%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6468.6%
Simplified68.6%
Final simplification36.5%
(FPCore (re im) :precision binary64 (* im (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0)))
double code(double re, double im) {
return im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = im * ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0)
end function
public static double code(double re, double im) {
return im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
}
def code(re, im): return im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0)
function code(re, im) return Float64(im * Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0)) end
function tmp = code(re, im) tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0); end
code[re_, im_] := N[(im * N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)
\end{array}
Initial program 100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6469.2%
Simplified69.2%
Taylor expanded in im around 0
Simplified36.5%
Final simplification36.5%
(FPCore (re im) :precision binary64 (if (<= re 1.2e+52) (* im (+ (* (* im im) -0.16666666666666666) 1.0)) (* im (* re (* 0.16666666666666666 (* re re))))))
double code(double re, double im) {
double tmp;
if (re <= 1.2e+52) {
tmp = im * (((im * im) * -0.16666666666666666) + 1.0);
} else {
tmp = im * (re * (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.2d+52) then
tmp = im * (((im * im) * (-0.16666666666666666d0)) + 1.0d0)
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 1.2e+52) {
tmp = im * (((im * im) * -0.16666666666666666) + 1.0);
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 1.2e+52: tmp = im * (((im * im) * -0.16666666666666666) + 1.0) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 1.2e+52) tmp = Float64(im * Float64(Float64(Float64(im * im) * -0.16666666666666666) + 1.0)); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 1.2e+52) tmp = im * (((im * im) * -0.16666666666666666) + 1.0); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 1.2e+52], N[(im * N[(N[(N[(im * im), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 1.2 \cdot 10^{+52}:\\
\;\;\;\;im \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < 1.2e52Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6463.4%
Simplified63.4%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.1%
Simplified29.1%
if 1.2e52 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified80.4%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6461.9%
Simplified61.9%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.1%
Simplified70.1%
Final simplification36.4%
(FPCore (re im) :precision binary64 (if (<= re 2.8) (* im (+ re 1.0)) (* im (* re (* 0.16666666666666666 (* re re))))))
double code(double re, double im) {
double tmp;
if (re <= 2.8) {
tmp = im * (re + 1.0);
} else {
tmp = im * (re * (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.8d0) then
tmp = im * (re + 1.0d0)
else
tmp = im * (re * (0.16666666666666666d0 * (re * re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.8) {
tmp = im * (re + 1.0);
} else {
tmp = im * (re * (0.16666666666666666 * (re * re)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.8: tmp = im * (re + 1.0) else: tmp = im * (re * (0.16666666666666666 * (re * re))) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.8) tmp = Float64(im * Float64(re + 1.0)); else tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.8) tmp = im * (re + 1.0); else tmp = im * (re * (0.16666666666666666 * (re * re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.8], N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.8:\\
\;\;\;\;im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
\end{array}
\end{array}
if re < 2.7999999999999998Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6467.8%
Simplified67.8%
Taylor expanded in im around 0
Simplified29.9%
if 2.7999999999999998 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified80.4%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6453.1%
Simplified53.1%
Taylor expanded in re around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.8%
Simplified59.8%
Final simplification36.4%
(FPCore (re im) :precision binary64 (if (<= re 2.7) (* im (+ re 1.0)) (* 0.5 (* im (* re re)))))
double code(double re, double im) {
double tmp;
if (re <= 2.7) {
tmp = im * (re + 1.0);
} else {
tmp = 0.5 * (im * (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.7d0) then
tmp = im * (re + 1.0d0)
else
tmp = 0.5d0 * (im * (re * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 2.7) {
tmp = im * (re + 1.0);
} else {
tmp = 0.5 * (im * (re * re));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 2.7: tmp = im * (re + 1.0) else: tmp = 0.5 * (im * (re * re)) return tmp
function code(re, im) tmp = 0.0 if (re <= 2.7) tmp = Float64(im * Float64(re + 1.0)); else tmp = Float64(0.5 * Float64(im * Float64(re * re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 2.7) tmp = im * (re + 1.0); else tmp = 0.5 * (im * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 2.7], N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(im * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 2.7:\\
\;\;\;\;im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < 2.7000000000000002Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6467.8%
Simplified67.8%
Taylor expanded in im around 0
Simplified29.9%
if 2.7000000000000002 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified80.4%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6437.8%
Simplified37.8%
Taylor expanded in re around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.2%
Simplified51.2%
Final simplification34.5%
(FPCore (re im) :precision binary64 (if (<= im 1.08e+80) im (* re im)))
double code(double re, double im) {
double tmp;
if (im <= 1.08e+80) {
tmp = im;
} else {
tmp = re * im;
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (im <= 1.08d+80) then
tmp = im
else
tmp = re * im
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (im <= 1.08e+80) {
tmp = im;
} else {
tmp = re * im;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 1.08e+80: tmp = im else: tmp = re * im return tmp
function code(re, im) tmp = 0.0 if (im <= 1.08e+80) tmp = im; else tmp = Float64(re * im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 1.08e+80) tmp = im; else tmp = re * im; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 1.08e+80], im, N[(re * im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.08 \cdot 10^{+80}:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;re \cdot im\\
\end{array}
\end{array}
if im < 1.08e80Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6451.0%
Simplified51.0%
Taylor expanded in im around 0
Simplified27.9%
if 1.08e80 < im Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6462.6%
Simplified62.6%
Taylor expanded in im around 0
Simplified11.5%
Taylor expanded in re around inf
Simplified13.0%
(FPCore (re im) :precision binary64 (* im (+ re 1.0)))
double code(double re, double im) {
return im * (re + 1.0);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = im * (re + 1.0d0)
end function
public static double code(double re, double im) {
return im * (re + 1.0);
}
def code(re, im): return im * (re + 1.0)
function code(re, im) return Float64(im * Float64(re + 1.0)) end
function tmp = code(re, im) tmp = im * (re + 1.0); end
code[re_, im_] := N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
im \cdot \left(re + 1\right)
\end{array}
Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6453.9%
Simplified53.9%
Taylor expanded in im around 0
Simplified27.4%
Final simplification27.4%
(FPCore (re im) :precision binary64 im)
double code(double re, double im) {
return im;
}
real(8) function code(re, im)
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 im end
function tmp = code(re, im) tmp = im; end
code[re_, im_] := im
\begin{array}{l}
\\
im
\end{array}
Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6452.5%
Simplified52.5%
Taylor expanded in im around 0
Simplified23.7%
herbie shell --seed 2024140
(FPCore (re im)
:name "math.exp on complex, imaginary part"
:precision binary64
(* (exp re) (sin im)))