
(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
(if (<= (exp re) 0.99999995)
(* (exp re) im)
(if (<= (exp re) 1.0)
(* (sin im) (+ re 1.0))
(* (exp re) (* im (+ (* -0.16666666666666666 (* im im)) 1.0))))))
double code(double re, double im) {
double tmp;
if (exp(re) <= 0.99999995) {
tmp = exp(re) * im;
} else if (exp(re) <= 1.0) {
tmp = sin(im) * (re + 1.0);
} else {
tmp = exp(re) * (im * ((-0.16666666666666666 * (im * im)) + 1.0));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (exp(re) <= 0.99999995d0) then
tmp = exp(re) * im
else if (exp(re) <= 1.0d0) then
tmp = sin(im) * (re + 1.0d0)
else
tmp = exp(re) * (im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (Math.exp(re) <= 0.99999995) {
tmp = Math.exp(re) * im;
} else if (Math.exp(re) <= 1.0) {
tmp = Math.sin(im) * (re + 1.0);
} else {
tmp = Math.exp(re) * (im * ((-0.16666666666666666 * (im * im)) + 1.0));
}
return tmp;
}
def code(re, im): tmp = 0 if math.exp(re) <= 0.99999995: tmp = math.exp(re) * im elif math.exp(re) <= 1.0: tmp = math.sin(im) * (re + 1.0) else: tmp = math.exp(re) * (im * ((-0.16666666666666666 * (im * im)) + 1.0)) return tmp
function code(re, im) tmp = 0.0 if (exp(re) <= 0.99999995) tmp = Float64(exp(re) * im); elseif (exp(re) <= 1.0) tmp = Float64(sin(im) * Float64(re + 1.0)); else tmp = Float64(exp(re) * Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (exp(re) <= 0.99999995) tmp = exp(re) * im; elseif (exp(re) <= 1.0) tmp = sin(im) * (re + 1.0); else tmp = exp(re) * (im * ((-0.16666666666666666 * (im * im)) + 1.0)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[Exp[re], $MachinePrecision], 0.99999995], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[N[Exp[re], $MachinePrecision], 1.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Exp[re], $MachinePrecision] * N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \leq 0.99999995:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{elif}\;e^{re} \leq 1:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{re} \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right)\\
\end{array}
\end{array}
if (exp.f64 re) < 0.999999949999999971Initial program 100.0%
Taylor expanded in im around 0
Simplified99.8%
if 0.999999949999999971 < (exp.f64 re) < 1Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
if 1 < (exp.f64 re) Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6481.8%
Simplified81.8%
Final simplification95.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im)))
(if (<= re -8.5e-8)
t_0
(if (<= re 1.2e-20)
(* (sin im) (+ re 1.0))
(if (<= re 4.5e+89)
t_0
(*
(* im (+ (* -0.16666666666666666 (* im im)) 1.0))
(+
(* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0))
1.0)))))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -8.5e-8) {
tmp = t_0;
} else if (re <= 1.2e-20) {
tmp = sin(im) * (re + 1.0);
} else if (re <= 4.5e+89) {
tmp = t_0;
} else {
tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((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) :: t_0
real(8) :: tmp
t_0 = exp(re) * im
if (re <= (-8.5d-8)) then
tmp = t_0
else if (re <= 1.2d-20) then
tmp = sin(im) * (re + 1.0d0)
else if (re <= 4.5d+89) then
tmp = t_0
else
tmp = (im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)) * ((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 t_0 = Math.exp(re) * im;
double tmp;
if (re <= -8.5e-8) {
tmp = t_0;
} else if (re <= 1.2e-20) {
tmp = Math.sin(im) * (re + 1.0);
} else if (re <= 4.5e+89) {
tmp = t_0;
} else {
tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -8.5e-8: tmp = t_0 elif re <= 1.2e-20: tmp = math.sin(im) * (re + 1.0) elif re <= 4.5e+89: tmp = t_0 else: tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -8.5e-8) tmp = t_0; elseif (re <= 1.2e-20) tmp = Float64(sin(im) * Float64(re + 1.0)); elseif (re <= 4.5e+89) tmp = t_0; else tmp = Float64(Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)) * 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) t_0 = exp(re) * im; tmp = 0.0; if (re <= -8.5e-8) tmp = t_0; elseif (re <= 1.2e-20) tmp = sin(im) * (re + 1.0); elseif (re <= 4.5e+89) tmp = t_0; else tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -8.5e-8], t$95$0, If[LessEqual[re, 1.2e-20], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 4.5e+89], t$95$0, N[(N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $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]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -8.5 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 1.2 \cdot 10^{-20}:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\
\mathbf{elif}\;re \leq 4.5 \cdot 10^{+89}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \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 < -8.49999999999999935e-8 or 1.19999999999999996e-20 < re < 4.5e89Initial program 100.0%
Taylor expanded in im around 0
Simplified94.8%
if -8.49999999999999935e-8 < re < 1.19999999999999996e-20Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
if 4.5e89 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6477.1%
Simplified77.1%
Final simplification94.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (exp re) im)))
(if (<= re -1.8e-8)
t_0
(if (<= re 1.2e-20)
(sin im)
(if (<= re 8.4e+89)
t_0
(*
(* im (+ (* -0.16666666666666666 (* im im)) 1.0))
(+
(* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0))
1.0)))))))
double code(double re, double im) {
double t_0 = exp(re) * im;
double tmp;
if (re <= -1.8e-8) {
tmp = t_0;
} else if (re <= 1.2e-20) {
tmp = sin(im);
} else if (re <= 8.4e+89) {
tmp = t_0;
} else {
tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((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) :: t_0
real(8) :: tmp
t_0 = exp(re) * im
if (re <= (-1.8d-8)) then
tmp = t_0
else if (re <= 1.2d-20) then
tmp = sin(im)
else if (re <= 8.4d+89) then
tmp = t_0
else
tmp = (im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)) * ((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 t_0 = Math.exp(re) * im;
double tmp;
if (re <= -1.8e-8) {
tmp = t_0;
} else if (re <= 1.2e-20) {
tmp = Math.sin(im);
} else if (re <= 8.4e+89) {
tmp = t_0;
} else {
tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
}
return tmp;
}
def code(re, im): t_0 = math.exp(re) * im tmp = 0 if re <= -1.8e-8: tmp = t_0 elif re <= 1.2e-20: tmp = math.sin(im) elif re <= 8.4e+89: tmp = t_0 else: tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) return tmp
function code(re, im) t_0 = Float64(exp(re) * im) tmp = 0.0 if (re <= -1.8e-8) tmp = t_0; elseif (re <= 1.2e-20) tmp = sin(im); elseif (re <= 8.4e+89) tmp = t_0; else tmp = Float64(Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)) * 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) t_0 = exp(re) * im; tmp = 0.0; if (re <= -1.8e-8) tmp = t_0; elseif (re <= 1.2e-20) tmp = sin(im); elseif (re <= 8.4e+89) tmp = t_0; else tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -1.8e-8], t$95$0, If[LessEqual[re, 1.2e-20], N[Sin[im], $MachinePrecision], If[LessEqual[re, 8.4e+89], t$95$0, N[(N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $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]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;re \leq -1.8 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 1.2 \cdot 10^{-20}:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;re \leq 8.4 \cdot 10^{+89}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \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.79999999999999991e-8 or 1.19999999999999996e-20 < re < 8.39999999999999945e89Initial program 100.0%
Taylor expanded in im around 0
Simplified94.8%
if -1.79999999999999991e-8 < re < 1.19999999999999996e-20Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6499.7%
Simplified99.7%
if 8.39999999999999945e89 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6477.1%
Simplified77.1%
Final simplification93.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ 0.5 (* re 0.16666666666666666)))
(t_1 (* re t_0))
(t_2 (* im (+ (* -0.16666666666666666 (* im im)) 1.0))))
(if (<= re -8.5e-8)
(/ (* im im) (+ im (* re (* im (- -1.0 (* re 0.5))))))
(if (<= re 1.2e-20)
(sin im)
(if (<= re 8.4e+89)
(* t_2 (+ (/ (* re (- 1.0 (* re (* t_0 t_1)))) (- 1.0 t_1)) 1.0))
(* t_2 (+ (* re (+ t_1 1.0)) 1.0)))))))
double code(double re, double im) {
double t_0 = 0.5 + (re * 0.16666666666666666);
double t_1 = re * t_0;
double t_2 = im * ((-0.16666666666666666 * (im * im)) + 1.0);
double tmp;
if (re <= -8.5e-8) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else if (re <= 1.2e-20) {
tmp = sin(im);
} else if (re <= 8.4e+89) {
tmp = t_2 * (((re * (1.0 - (re * (t_0 * t_1)))) / (1.0 - t_1)) + 1.0);
} else {
tmp = t_2 * ((re * (t_1 + 1.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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 0.5d0 + (re * 0.16666666666666666d0)
t_1 = re * t_0
t_2 = im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)
if (re <= (-8.5d-8)) then
tmp = (im * im) / (im + (re * (im * ((-1.0d0) - (re * 0.5d0)))))
else if (re <= 1.2d-20) then
tmp = sin(im)
else if (re <= 8.4d+89) then
tmp = t_2 * (((re * (1.0d0 - (re * (t_0 * t_1)))) / (1.0d0 - t_1)) + 1.0d0)
else
tmp = t_2 * ((re * (t_1 + 1.0d0)) + 1.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 + (re * 0.16666666666666666);
double t_1 = re * t_0;
double t_2 = im * ((-0.16666666666666666 * (im * im)) + 1.0);
double tmp;
if (re <= -8.5e-8) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else if (re <= 1.2e-20) {
tmp = Math.sin(im);
} else if (re <= 8.4e+89) {
tmp = t_2 * (((re * (1.0 - (re * (t_0 * t_1)))) / (1.0 - t_1)) + 1.0);
} else {
tmp = t_2 * ((re * (t_1 + 1.0)) + 1.0);
}
return tmp;
}
def code(re, im): t_0 = 0.5 + (re * 0.16666666666666666) t_1 = re * t_0 t_2 = im * ((-0.16666666666666666 * (im * im)) + 1.0) tmp = 0 if re <= -8.5e-8: tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))) elif re <= 1.2e-20: tmp = math.sin(im) elif re <= 8.4e+89: tmp = t_2 * (((re * (1.0 - (re * (t_0 * t_1)))) / (1.0 - t_1)) + 1.0) else: tmp = t_2 * ((re * (t_1 + 1.0)) + 1.0) return tmp
function code(re, im) t_0 = Float64(0.5 + Float64(re * 0.16666666666666666)) t_1 = Float64(re * t_0) t_2 = Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)) tmp = 0.0 if (re <= -8.5e-8) tmp = Float64(Float64(im * im) / Float64(im + Float64(re * Float64(im * Float64(-1.0 - Float64(re * 0.5)))))); elseif (re <= 1.2e-20) tmp = sin(im); elseif (re <= 8.4e+89) tmp = Float64(t_2 * Float64(Float64(Float64(re * Float64(1.0 - Float64(re * Float64(t_0 * t_1)))) / Float64(1.0 - t_1)) + 1.0)); else tmp = Float64(t_2 * Float64(Float64(re * Float64(t_1 + 1.0)) + 1.0)); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 + (re * 0.16666666666666666); t_1 = re * t_0; t_2 = im * ((-0.16666666666666666 * (im * im)) + 1.0); tmp = 0.0; if (re <= -8.5e-8) tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))); elseif (re <= 1.2e-20) tmp = sin(im); elseif (re <= 8.4e+89) tmp = t_2 * (((re * (1.0 - (re * (t_0 * t_1)))) / (1.0 - t_1)) + 1.0); else tmp = t_2 * ((re * (t_1 + 1.0)) + 1.0); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -8.5e-8], 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, 1.2e-20], N[Sin[im], $MachinePrecision], If[LessEqual[re, 8.4e+89], N[(t$95$2 * N[(N[(N[(re * N[(1.0 - N[(re * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[(re * N[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 + re \cdot 0.16666666666666666\\
t_1 := re \cdot t\_0\\
t_2 := im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\\
\mathbf{if}\;re \leq -8.5 \cdot 10^{-8}:\\
\;\;\;\;\frac{im \cdot im}{im + re \cdot \left(im \cdot \left(-1 - re \cdot 0.5\right)\right)}\\
\mathbf{elif}\;re \leq 1.2 \cdot 10^{-20}:\\
\;\;\;\;\sin im\\
\mathbf{elif}\;re \leq 8.4 \cdot 10^{+89}:\\
\;\;\;\;t\_2 \cdot \left(\frac{re \cdot \left(1 - re \cdot \left(t\_0 \cdot t\_1\right)\right)}{1 - t\_1} + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(re \cdot \left(t\_1 + 1\right) + 1\right)\\
\end{array}
\end{array}
if re < -8.49999999999999935e-8Initial program 100.0%
Taylor expanded in im around 0
Simplified99.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f646.1%
Simplified6.1%
+-commutativeN/A
flip-+N/A
associate-*l*N/A
associate-*l*N/A
fmm-defN/A
/-lowering-/.f64N/A
Applied egg-rr7.6%
Taylor expanded in re around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6456.3%
Simplified56.3%
if -8.49999999999999935e-8 < re < 1.19999999999999996e-20Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6499.7%
Simplified99.7%
if 1.19999999999999996e-20 < re < 8.39999999999999945e89Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.7%
Simplified94.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6429.9%
Simplified29.9%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr65.3%
if 8.39999999999999945e89 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6477.1%
Simplified77.1%
Final simplification82.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (+ (* -0.16666666666666666 (* im im)) 1.0)))
(t_1 (+ 0.5 (* re 0.16666666666666666)))
(t_2 (* re t_1)))
(if (<= re -3.9)
(/ (* im im) (+ im (* re (* im (- -1.0 (* re 0.5))))))
(if (<= re 8.4e+89)
(* t_0 (+ (/ (* re (- 1.0 (* re (* t_1 t_2)))) (- 1.0 t_2)) 1.0))
(* t_0 (+ (* re (+ t_2 1.0)) 1.0))))))
double code(double re, double im) {
double t_0 = im * ((-0.16666666666666666 * (im * im)) + 1.0);
double t_1 = 0.5 + (re * 0.16666666666666666);
double t_2 = re * t_1;
double tmp;
if (re <= -3.9) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else if (re <= 8.4e+89) {
tmp = t_0 * (((re * (1.0 - (re * (t_1 * t_2)))) / (1.0 - t_2)) + 1.0);
} else {
tmp = t_0 * ((re * (t_2 + 1.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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)
t_1 = 0.5d0 + (re * 0.16666666666666666d0)
t_2 = re * t_1
if (re <= (-3.9d0)) then
tmp = (im * im) / (im + (re * (im * ((-1.0d0) - (re * 0.5d0)))))
else if (re <= 8.4d+89) then
tmp = t_0 * (((re * (1.0d0 - (re * (t_1 * t_2)))) / (1.0d0 - t_2)) + 1.0d0)
else
tmp = t_0 * ((re * (t_2 + 1.0d0)) + 1.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * ((-0.16666666666666666 * (im * im)) + 1.0);
double t_1 = 0.5 + (re * 0.16666666666666666);
double t_2 = re * t_1;
double tmp;
if (re <= -3.9) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else if (re <= 8.4e+89) {
tmp = t_0 * (((re * (1.0 - (re * (t_1 * t_2)))) / (1.0 - t_2)) + 1.0);
} else {
tmp = t_0 * ((re * (t_2 + 1.0)) + 1.0);
}
return tmp;
}
def code(re, im): t_0 = im * ((-0.16666666666666666 * (im * im)) + 1.0) t_1 = 0.5 + (re * 0.16666666666666666) t_2 = re * t_1 tmp = 0 if re <= -3.9: tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))) elif re <= 8.4e+89: tmp = t_0 * (((re * (1.0 - (re * (t_1 * t_2)))) / (1.0 - t_2)) + 1.0) else: tmp = t_0 * ((re * (t_2 + 1.0)) + 1.0) return tmp
function code(re, im) t_0 = Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)) t_1 = Float64(0.5 + Float64(re * 0.16666666666666666)) t_2 = Float64(re * t_1) tmp = 0.0 if (re <= -3.9) tmp = Float64(Float64(im * im) / Float64(im + Float64(re * Float64(im * Float64(-1.0 - Float64(re * 0.5)))))); elseif (re <= 8.4e+89) tmp = Float64(t_0 * Float64(Float64(Float64(re * Float64(1.0 - Float64(re * Float64(t_1 * t_2)))) / Float64(1.0 - t_2)) + 1.0)); else tmp = Float64(t_0 * Float64(Float64(re * Float64(t_2 + 1.0)) + 1.0)); end return tmp end
function tmp_2 = code(re, im) t_0 = im * ((-0.16666666666666666 * (im * im)) + 1.0); t_1 = 0.5 + (re * 0.16666666666666666); t_2 = re * t_1; tmp = 0.0; if (re <= -3.9) tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))); elseif (re <= 8.4e+89) tmp = t_0 * (((re * (1.0 - (re * (t_1 * t_2)))) / (1.0 - t_2)) + 1.0); else tmp = t_0 * ((re * (t_2 + 1.0)) + 1.0); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(re * t$95$1), $MachinePrecision]}, If[LessEqual[re, -3.9], 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, 8.4e+89], N[(t$95$0 * N[(N[(N[(re * N[(1.0 - N[(re * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - t$95$2), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(re * N[(t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\\
t_1 := 0.5 + re \cdot 0.16666666666666666\\
t_2 := re \cdot t\_1\\
\mathbf{if}\;re \leq -3.9:\\
\;\;\;\;\frac{im \cdot im}{im + re \cdot \left(im \cdot \left(-1 - re \cdot 0.5\right)\right)}\\
\mathbf{elif}\;re \leq 8.4 \cdot 10^{+89}:\\
\;\;\;\;t\_0 \cdot \left(\frac{re \cdot \left(1 - re \cdot \left(t\_1 \cdot t\_2\right)\right)}{1 - t\_2} + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(re \cdot \left(t\_2 + 1\right) + 1\right)\\
\end{array}
\end{array}
if re < -3.89999999999999991Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f642.2%
Simplified2.2%
+-commutativeN/A
flip-+N/A
associate-*l*N/A
associate-*l*N/A
fmm-defN/A
/-lowering-/.f64N/A
Applied egg-rr4.6%
Taylor expanded in re around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6456.3%
Simplified56.3%
if -3.89999999999999991 < re < 8.39999999999999945e89Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.3%
Simplified51.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6442.9%
Simplified42.9%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr47.4%
if 8.39999999999999945e89 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.1%
Simplified77.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6477.1%
Simplified77.1%
Final simplification55.0%
(FPCore (re im)
:precision binary64
(if (<= re -1.6)
(/ (* im im) (+ im (* re (* im (- -1.0 (* re 0.5))))))
(*
(* im (+ (* -0.16666666666666666 (* im im)) 1.0))
(+ (* 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 * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((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 * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)) * ((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 * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((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 * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((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(Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)) * 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 * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((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[(N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $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]]
\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}:\\
\;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \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
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f642.2%
Simplified2.2%
+-commutativeN/A
flip-+N/A
associate-*l*N/A
associate-*l*N/A
fmm-defN/A
/-lowering-/.f64N/A
Applied egg-rr4.6%
Taylor expanded in re around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6456.3%
Simplified56.3%
if -1.6000000000000001 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.6%
Simplified57.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6451.2%
Simplified51.2%
Final simplification52.3%
(FPCore (re im)
:precision binary64
(if (<= re -1.5)
(/ (* im im) (+ im (* re (* im (- -1.0 (* re 0.5))))))
(if (<= re 270.0)
(* im (+ (+ re 1.0) (* (+ 0.5 (* re 0.16666666666666666)) (* re re))))
(*
(* re (* re re))
(*
im
(* (+ (* -0.16666666666666666 (* im im)) 1.0) 0.16666666666666666))))))
double code(double re, double im) {
double tmp;
if (re <= -1.5) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else if (re <= 270.0) {
tmp = im * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re)));
} else {
tmp = (re * (re * re)) * (im * (((-0.16666666666666666 * (im * im)) + 1.0) * 0.16666666666666666));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-1.5d0)) then
tmp = (im * im) / (im + (re * (im * ((-1.0d0) - (re * 0.5d0)))))
else if (re <= 270.0d0) then
tmp = im * ((re + 1.0d0) + ((0.5d0 + (re * 0.16666666666666666d0)) * (re * re)))
else
tmp = (re * (re * re)) * (im * ((((-0.16666666666666666d0) * (im * im)) + 1.0d0) * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -1.5) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else if (re <= 270.0) {
tmp = im * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re)));
} else {
tmp = (re * (re * re)) * (im * (((-0.16666666666666666 * (im * im)) + 1.0) * 0.16666666666666666));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -1.5: tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))) elif re <= 270.0: tmp = im * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re))) else: tmp = (re * (re * re)) * (im * (((-0.16666666666666666 * (im * im)) + 1.0) * 0.16666666666666666)) return tmp
function code(re, im) tmp = 0.0 if (re <= -1.5) tmp = Float64(Float64(im * im) / Float64(im + Float64(re * Float64(im * Float64(-1.0 - Float64(re * 0.5)))))); elseif (re <= 270.0) tmp = Float64(im * Float64(Float64(re + 1.0) + Float64(Float64(0.5 + Float64(re * 0.16666666666666666)) * Float64(re * re)))); else tmp = Float64(Float64(re * Float64(re * re)) * Float64(im * Float64(Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0) * 0.16666666666666666))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -1.5) tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))); elseif (re <= 270.0) tmp = im * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re))); else tmp = (re * (re * re)) * (im * (((-0.16666666666666666 * (im * im)) + 1.0) * 0.16666666666666666)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -1.5], 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, 270.0], N[(im * N[(N[(re + 1.0), $MachinePrecision] + N[(N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(im * N[(N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -1.5:\\
\;\;\;\;\frac{im \cdot im}{im + re \cdot \left(im \cdot \left(-1 - re \cdot 0.5\right)\right)}\\
\mathbf{elif}\;re \leq 270:\\
\;\;\;\;im \cdot \left(\left(re + 1\right) + \left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot \left(\left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right) \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if re < -1.5Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f642.2%
Simplified2.2%
+-commutativeN/A
flip-+N/A
associate-*l*N/A
associate-*l*N/A
fmm-defN/A
/-lowering-/.f64N/A
Applied egg-rr4.6%
Taylor expanded in re around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6456.3%
Simplified56.3%
if -1.5 < re < 270Initial program 100.0%
Taylor expanded in im around 0
Simplified46.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6445.2%
Simplified45.2%
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6445.2%
Applied egg-rr45.2%
if 270 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6481.3%
Simplified81.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6463.2%
Simplified63.2%
Taylor expanded in re around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.2%
Simplified63.2%
Final simplification52.2%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.16666666666666666 (* im im))))
(if (<= re -75000000.0)
(* im t_0)
(if (<= re 105.0)
(* im (+ (+ re 1.0) (* (+ 0.5 (* re 0.16666666666666666)) (* re re))))
(* (* re (* re re)) (* im (* (+ t_0 1.0) 0.16666666666666666)))))))
double code(double re, double im) {
double t_0 = -0.16666666666666666 * (im * im);
double tmp;
if (re <= -75000000.0) {
tmp = im * t_0;
} else if (re <= 105.0) {
tmp = im * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re)));
} else {
tmp = (re * (re * re)) * (im * ((t_0 + 1.0) * 0.16666666666666666));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (-0.16666666666666666d0) * (im * im)
if (re <= (-75000000.0d0)) then
tmp = im * t_0
else if (re <= 105.0d0) then
tmp = im * ((re + 1.0d0) + ((0.5d0 + (re * 0.16666666666666666d0)) * (re * re)))
else
tmp = (re * (re * re)) * (im * ((t_0 + 1.0d0) * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = -0.16666666666666666 * (im * im);
double tmp;
if (re <= -75000000.0) {
tmp = im * t_0;
} else if (re <= 105.0) {
tmp = im * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re)));
} else {
tmp = (re * (re * re)) * (im * ((t_0 + 1.0) * 0.16666666666666666));
}
return tmp;
}
def code(re, im): t_0 = -0.16666666666666666 * (im * im) tmp = 0 if re <= -75000000.0: tmp = im * t_0 elif re <= 105.0: tmp = im * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re))) else: tmp = (re * (re * re)) * (im * ((t_0 + 1.0) * 0.16666666666666666)) return tmp
function code(re, im) t_0 = Float64(-0.16666666666666666 * Float64(im * im)) tmp = 0.0 if (re <= -75000000.0) tmp = Float64(im * t_0); elseif (re <= 105.0) tmp = Float64(im * Float64(Float64(re + 1.0) + Float64(Float64(0.5 + Float64(re * 0.16666666666666666)) * Float64(re * re)))); else tmp = Float64(Float64(re * Float64(re * re)) * Float64(im * Float64(Float64(t_0 + 1.0) * 0.16666666666666666))); end return tmp end
function tmp_2 = code(re, im) t_0 = -0.16666666666666666 * (im * im); tmp = 0.0; if (re <= -75000000.0) tmp = im * t_0; elseif (re <= 105.0) tmp = im * ((re + 1.0) + ((0.5 + (re * 0.16666666666666666)) * (re * re))); else tmp = (re * (re * re)) * (im * ((t_0 + 1.0) * 0.16666666666666666)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -75000000.0], N[(im * t$95$0), $MachinePrecision], If[LessEqual[re, 105.0], N[(im * N[(N[(re + 1.0), $MachinePrecision] + N[(N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(im * N[(N[(t$95$0 + 1.0), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.16666666666666666 \cdot \left(im \cdot im\right)\\
\mathbf{if}\;re \leq -75000000:\\
\;\;\;\;im \cdot t\_0\\
\mathbf{elif}\;re \leq 105:\\
\;\;\;\;im \cdot \left(\left(re + 1\right) + \left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot \left(\left(t\_0 + 1\right) \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if re < -7.5e7Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.3%
Simplified67.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f642.0%
Simplified2.0%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.6%
Simplified15.6%
Taylor expanded in re around 0
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.3%
Simplified36.3%
if -7.5e7 < re < 105Initial program 100.0%
Taylor expanded in im around 0
Simplified46.8%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6444.6%
Simplified44.6%
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6444.6%
Applied egg-rr44.6%
if 105 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6481.3%
Simplified81.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6463.2%
Simplified63.2%
Taylor expanded in re around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.2%
Simplified63.2%
Final simplification47.4%
(FPCore (re im)
:precision binary64
(if (<= re -190.0)
(/ (* im im) (+ im (* re (* im (- -1.0 (* re 0.5))))))
(*
(* im (+ (* -0.16666666666666666 (* im im)) 1.0))
(+ (* re (+ (* re 0.5) 1.0)) 1.0))))
double code(double re, double im) {
double tmp;
if (re <= -190.0) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else {
tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((re * ((re * 0.5) + 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 <= (-190.0d0)) then
tmp = (im * im) / (im + (re * (im * ((-1.0d0) - (re * 0.5d0)))))
else
tmp = (im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)) * ((re * ((re * 0.5d0) + 1.0d0)) + 1.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -190.0) {
tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5)))));
} else {
tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((re * ((re * 0.5) + 1.0)) + 1.0);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -190.0: tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))) else: tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((re * ((re * 0.5) + 1.0)) + 1.0) return tmp
function code(re, im) tmp = 0.0 if (re <= -190.0) tmp = Float64(Float64(im * im) / Float64(im + Float64(re * Float64(im * Float64(-1.0 - Float64(re * 0.5)))))); else tmp = Float64(Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)) * Float64(Float64(re * Float64(Float64(re * 0.5) + 1.0)) + 1.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -190.0) tmp = (im * im) / (im + (re * (im * (-1.0 - (re * 0.5))))); else tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * ((re * ((re * 0.5) + 1.0)) + 1.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -190.0], 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[(N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(re * N[(N[(re * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -190:\\
\;\;\;\;\frac{im \cdot im}{im + re \cdot \left(im \cdot \left(-1 - re \cdot 0.5\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right)\\
\end{array}
\end{array}
if re < -190Initial program 100.0%
Taylor expanded in im around 0
Simplified100.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f642.2%
Simplified2.2%
+-commutativeN/A
flip-+N/A
associate-*l*N/A
associate-*l*N/A
fmm-defN/A
/-lowering-/.f64N/A
Applied egg-rr4.6%
Taylor expanded in re around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6456.3%
Simplified56.3%
if -190 < re Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.6%
Simplified57.6%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6449.6%
Simplified49.6%
Final simplification51.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.16666666666666666 (* im im))))
(if (<= re -1.0)
(* im t_0)
(if (<= re 1.55e+191)
(* im (* (+ t_0 1.0) (+ re 1.0)))
(* im (+ (* re (+ (* re 0.5) 1.0)) 1.0))))))
double code(double re, double im) {
double t_0 = -0.16666666666666666 * (im * im);
double tmp;
if (re <= -1.0) {
tmp = im * t_0;
} else if (re <= 1.55e+191) {
tmp = im * ((t_0 + 1.0) * (re + 1.0));
} else {
tmp = im * ((re * ((re * 0.5) + 1.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 = (-0.16666666666666666d0) * (im * im)
if (re <= (-1.0d0)) then
tmp = im * t_0
else if (re <= 1.55d+191) then
tmp = im * ((t_0 + 1.0d0) * (re + 1.0d0))
else
tmp = im * ((re * ((re * 0.5d0) + 1.0d0)) + 1.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = -0.16666666666666666 * (im * im);
double tmp;
if (re <= -1.0) {
tmp = im * t_0;
} else if (re <= 1.55e+191) {
tmp = im * ((t_0 + 1.0) * (re + 1.0));
} else {
tmp = im * ((re * ((re * 0.5) + 1.0)) + 1.0);
}
return tmp;
}
def code(re, im): t_0 = -0.16666666666666666 * (im * im) tmp = 0 if re <= -1.0: tmp = im * t_0 elif re <= 1.55e+191: tmp = im * ((t_0 + 1.0) * (re + 1.0)) else: tmp = im * ((re * ((re * 0.5) + 1.0)) + 1.0) return tmp
function code(re, im) t_0 = Float64(-0.16666666666666666 * Float64(im * im)) tmp = 0.0 if (re <= -1.0) tmp = Float64(im * t_0); elseif (re <= 1.55e+191) tmp = Float64(im * Float64(Float64(t_0 + 1.0) * Float64(re + 1.0))); else tmp = Float64(im * Float64(Float64(re * Float64(Float64(re * 0.5) + 1.0)) + 1.0)); end return tmp end
function tmp_2 = code(re, im) t_0 = -0.16666666666666666 * (im * im); tmp = 0.0; if (re <= -1.0) tmp = im * t_0; elseif (re <= 1.55e+191) tmp = im * ((t_0 + 1.0) * (re + 1.0)); else tmp = im * ((re * ((re * 0.5) + 1.0)) + 1.0); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -1.0], N[(im * t$95$0), $MachinePrecision], If[LessEqual[re, 1.55e+191], N[(im * N[(N[(t$95$0 + 1.0), $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(N[(re * N[(N[(re * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.16666666666666666 \cdot \left(im \cdot im\right)\\
\mathbf{if}\;re \leq -1:\\
\;\;\;\;im \cdot t\_0\\
\mathbf{elif}\;re \leq 1.55 \cdot 10^{+191}:\\
\;\;\;\;im \cdot \left(\left(t\_0 + 1\right) \cdot \left(re + 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right)\\
\end{array}
\end{array}
if re < -1Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.7%
Simplified66.7%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f642.0%
Simplified2.0%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.1%
Simplified15.1%
Taylor expanded in re around 0
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.1%
Simplified35.1%
if -1 < re < 1.54999999999999999e191Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.8%
Simplified54.8%
Taylor expanded in re around 0
distribute-lft-outN/A
distribute-lft1-inN/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*r*N/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt1-inN/A
Simplified42.8%
if 1.54999999999999999e191 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified83.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6483.3%
Simplified83.3%
Final simplification45.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* im (* -0.16666666666666666 (* im im)))))
(if (<= re -75000000.0)
t_0
(if (<= re 40000000000.0)
(* im (+ re 1.0))
(if (<= re 1.55e+191) t_0 (* im (* 0.5 (* re re))))))))
double code(double re, double im) {
double t_0 = im * (-0.16666666666666666 * (im * im));
double tmp;
if (re <= -75000000.0) {
tmp = t_0;
} else if (re <= 40000000000.0) {
tmp = im * (re + 1.0);
} else if (re <= 1.55e+191) {
tmp = t_0;
} else {
tmp = im * (0.5 * (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) :: tmp
t_0 = im * ((-0.16666666666666666d0) * (im * im))
if (re <= (-75000000.0d0)) then
tmp = t_0
else if (re <= 40000000000.0d0) then
tmp = im * (re + 1.0d0)
else if (re <= 1.55d+191) then
tmp = t_0
else
tmp = im * (0.5d0 * (re * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = im * (-0.16666666666666666 * (im * im));
double tmp;
if (re <= -75000000.0) {
tmp = t_0;
} else if (re <= 40000000000.0) {
tmp = im * (re + 1.0);
} else if (re <= 1.55e+191) {
tmp = t_0;
} else {
tmp = im * (0.5 * (re * re));
}
return tmp;
}
def code(re, im): t_0 = im * (-0.16666666666666666 * (im * im)) tmp = 0 if re <= -75000000.0: tmp = t_0 elif re <= 40000000000.0: tmp = im * (re + 1.0) elif re <= 1.55e+191: tmp = t_0 else: tmp = im * (0.5 * (re * re)) return tmp
function code(re, im) t_0 = Float64(im * Float64(-0.16666666666666666 * Float64(im * im))) tmp = 0.0 if (re <= -75000000.0) tmp = t_0; elseif (re <= 40000000000.0) tmp = Float64(im * Float64(re + 1.0)); elseif (re <= 1.55e+191) tmp = t_0; else tmp = Float64(im * Float64(0.5 * Float64(re * re))); end return tmp end
function tmp_2 = code(re, im) t_0 = im * (-0.16666666666666666 * (im * im)); tmp = 0.0; if (re <= -75000000.0) tmp = t_0; elseif (re <= 40000000000.0) tmp = im * (re + 1.0); elseif (re <= 1.55e+191) tmp = t_0; else tmp = im * (0.5 * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -75000000.0], t$95$0, If[LessEqual[re, 40000000000.0], N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.55e+191], t$95$0, N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\\
\mathbf{if}\;re \leq -75000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 40000000000:\\
\;\;\;\;im \cdot \left(re + 1\right)\\
\mathbf{elif}\;re \leq 1.55 \cdot 10^{+191}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < -7.5e7 or 4e10 < re < 1.54999999999999999e191Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6475.0%
Simplified75.0%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6422.1%
Simplified22.1%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.0%
Simplified27.0%
Taylor expanded in re around 0
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6434.5%
Simplified34.5%
if -7.5e7 < re < 4e10Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6496.6%
Simplified96.6%
Taylor expanded in im around 0
Simplified43.9%
if 1.54999999999999999e191 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified83.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6452.3%
Simplified52.3%
Taylor expanded in re around inf
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Final simplification45.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.16666666666666666 (* im im))))
(if (<= re -59000.0)
(* im t_0)
(if (<= re 2.15e+105)
(* im (+ t_0 1.0))
(* im (* re (* re (* re 0.16666666666666666))))))))
double code(double re, double im) {
double t_0 = -0.16666666666666666 * (im * im);
double tmp;
if (re <= -59000.0) {
tmp = im * t_0;
} else if (re <= 2.15e+105) {
tmp = im * (t_0 + 1.0);
} else {
tmp = im * (re * (re * (re * 0.16666666666666666)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (-0.16666666666666666d0) * (im * im)
if (re <= (-59000.0d0)) then
tmp = im * t_0
else if (re <= 2.15d+105) then
tmp = im * (t_0 + 1.0d0)
else
tmp = im * (re * (re * (re * 0.16666666666666666d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = -0.16666666666666666 * (im * im);
double tmp;
if (re <= -59000.0) {
tmp = im * t_0;
} else if (re <= 2.15e+105) {
tmp = im * (t_0 + 1.0);
} else {
tmp = im * (re * (re * (re * 0.16666666666666666)));
}
return tmp;
}
def code(re, im): t_0 = -0.16666666666666666 * (im * im) tmp = 0 if re <= -59000.0: tmp = im * t_0 elif re <= 2.15e+105: tmp = im * (t_0 + 1.0) else: tmp = im * (re * (re * (re * 0.16666666666666666))) return tmp
function code(re, im) t_0 = Float64(-0.16666666666666666 * Float64(im * im)) tmp = 0.0 if (re <= -59000.0) tmp = Float64(im * t_0); elseif (re <= 2.15e+105) tmp = Float64(im * Float64(t_0 + 1.0)); else tmp = Float64(im * Float64(re * Float64(re * Float64(re * 0.16666666666666666)))); end return tmp end
function tmp_2 = code(re, im) t_0 = -0.16666666666666666 * (im * im); tmp = 0.0; if (re <= -59000.0) tmp = im * t_0; elseif (re <= 2.15e+105) tmp = im * (t_0 + 1.0); else tmp = im * (re * (re * (re * 0.16666666666666666))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -59000.0], N[(im * t$95$0), $MachinePrecision], If[LessEqual[re, 2.15e+105], N[(im * N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.16666666666666666 \cdot \left(im \cdot im\right)\\
\mathbf{if}\;re \leq -59000:\\
\;\;\;\;im \cdot t\_0\\
\mathbf{elif}\;re \leq 2.15 \cdot 10^{+105}:\\
\;\;\;\;im \cdot \left(t\_0 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if re < -59000Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.1%
Simplified66.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f641.9%
Simplified1.9%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.4%
Simplified15.4%
Taylor expanded in re around 0
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.6%
Simplified35.6%
if -59000 < re < 2.1500000000000001e105Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6485.4%
Simplified85.4%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6442.0%
Simplified42.0%
if 2.1500000000000001e105 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified68.9%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6468.9%
Simplified68.9%
Taylor expanded in re around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6468.9%
Simplified68.9%
Final simplification45.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* -0.16666666666666666 (* im im))))
(if (<= re -59000.0)
(* im t_0)
(if (<= re 1.55e+191) (* im (+ t_0 1.0)) (* im (* 0.5 (* re re)))))))
double code(double re, double im) {
double t_0 = -0.16666666666666666 * (im * im);
double tmp;
if (re <= -59000.0) {
tmp = im * t_0;
} else if (re <= 1.55e+191) {
tmp = im * (t_0 + 1.0);
} else {
tmp = im * (0.5 * (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) :: tmp
t_0 = (-0.16666666666666666d0) * (im * im)
if (re <= (-59000.0d0)) then
tmp = im * t_0
else if (re <= 1.55d+191) then
tmp = im * (t_0 + 1.0d0)
else
tmp = im * (0.5d0 * (re * re))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = -0.16666666666666666 * (im * im);
double tmp;
if (re <= -59000.0) {
tmp = im * t_0;
} else if (re <= 1.55e+191) {
tmp = im * (t_0 + 1.0);
} else {
tmp = im * (0.5 * (re * re));
}
return tmp;
}
def code(re, im): t_0 = -0.16666666666666666 * (im * im) tmp = 0 if re <= -59000.0: tmp = im * t_0 elif re <= 1.55e+191: tmp = im * (t_0 + 1.0) else: tmp = im * (0.5 * (re * re)) return tmp
function code(re, im) t_0 = Float64(-0.16666666666666666 * Float64(im * im)) tmp = 0.0 if (re <= -59000.0) tmp = Float64(im * t_0); elseif (re <= 1.55e+191) tmp = Float64(im * Float64(t_0 + 1.0)); else tmp = Float64(im * Float64(0.5 * Float64(re * re))); end return tmp end
function tmp_2 = code(re, im) t_0 = -0.16666666666666666 * (im * im); tmp = 0.0; if (re <= -59000.0) tmp = im * t_0; elseif (re <= 1.55e+191) tmp = im * (t_0 + 1.0); else tmp = im * (0.5 * (re * re)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -59000.0], N[(im * t$95$0), $MachinePrecision], If[LessEqual[re, 1.55e+191], N[(im * N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.16666666666666666 \cdot \left(im \cdot im\right)\\
\mathbf{if}\;re \leq -59000:\\
\;\;\;\;im \cdot t\_0\\
\mathbf{elif}\;re \leq 1.55 \cdot 10^{+191}:\\
\;\;\;\;im \cdot \left(t\_0 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\
\end{array}
\end{array}
if re < -59000Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.1%
Simplified66.1%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f641.9%
Simplified1.9%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.4%
Simplified15.4%
Taylor expanded in re around 0
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.6%
Simplified35.6%
if -59000 < re < 1.54999999999999999e191Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6478.1%
Simplified78.1%
Taylor expanded in im around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6441.4%
Simplified41.4%
if 1.54999999999999999e191 < re Initial program 100.0%
Taylor expanded in im around 0
Simplified83.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6452.3%
Simplified52.3%
Taylor expanded in re around inf
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Final simplification45.0%
(FPCore (re im) :precision binary64 (if (<= re -75000000.0) (* im (* -0.16666666666666666 (* im im))) (* im (+ re 1.0))))
double code(double re, double im) {
double tmp;
if (re <= -75000000.0) {
tmp = im * (-0.16666666666666666 * (im * im));
} else {
tmp = im * (re + 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 <= (-75000000.0d0)) then
tmp = im * ((-0.16666666666666666d0) * (im * im))
else
tmp = im * (re + 1.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -75000000.0) {
tmp = im * (-0.16666666666666666 * (im * im));
} else {
tmp = im * (re + 1.0);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -75000000.0: tmp = im * (-0.16666666666666666 * (im * im)) else: tmp = im * (re + 1.0) return tmp
function code(re, im) tmp = 0.0 if (re <= -75000000.0) tmp = Float64(im * Float64(-0.16666666666666666 * Float64(im * im))); else tmp = Float64(im * Float64(re + 1.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -75000000.0) tmp = im * (-0.16666666666666666 * (im * im)); else tmp = im * (re + 1.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -75000000.0], N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -75000000:\\
\;\;\;\;im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(re + 1\right)\\
\end{array}
\end{array}
if re < -7.5e7Initial program 100.0%
Taylor expanded in im around 0
+-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.3%
Simplified67.3%
Taylor expanded in re around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f642.0%
Simplified2.0%
Taylor expanded in im around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.6%
Simplified15.6%
Taylor expanded in re around 0
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.3%
Simplified36.3%
if -7.5e7 < re Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6467.8%
Simplified67.8%
Taylor expanded in im around 0
Simplified35.7%
Final simplification35.8%
(FPCore (re im) :precision binary64 (if (<= im 5e+44) im (* re im)))
double code(double re, double im) {
double tmp;
if (im <= 5e+44) {
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 <= 5d+44) 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 <= 5e+44) {
tmp = im;
} else {
tmp = re * im;
}
return tmp;
}
def code(re, im): tmp = 0 if im <= 5e+44: tmp = im else: tmp = re * im return tmp
function code(re, im) tmp = 0.0 if (im <= 5e+44) tmp = im; else tmp = Float64(re * im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (im <= 5e+44) tmp = im; else tmp = re * im; end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[im, 5e+44], im, N[(re * im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;im \leq 5 \cdot 10^{+44}:\\
\;\;\;\;im\\
\mathbf{else}:\\
\;\;\;\;re \cdot im\\
\end{array}
\end{array}
if im < 4.9999999999999996e44Initial program 100.0%
Taylor expanded in re around 0
sin-lowering-sin.f6453.0%
Simplified53.0%
Taylor expanded in im around 0
Simplified30.0%
if 4.9999999999999996e44 < im Initial program 100.0%
Taylor expanded in re around 0
+-commutativeN/A
+-lowering-+.f6455.1%
Simplified55.1%
Taylor expanded in im around 0
Simplified11.8%
Taylor expanded in re around inf
Simplified13.3%
(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.8%
Simplified53.8%
Taylor expanded in im around 0
Simplified28.6%
Final simplification28.6%
(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.f6453.1%
Simplified53.1%
Taylor expanded in im around 0
Simplified24.7%
herbie shell --seed 2024155
(FPCore (re im)
:name "math.exp on complex, imaginary part"
:precision binary64
(* (exp re) (sin im)))