
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
return exp(re) * cos(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.cos(im);
}
def code(re, im): return math.exp(re) * math.cos(im)
function code(re, im) return Float64(exp(re) * cos(im)) end
function tmp = code(re, im) tmp = exp(re) * cos(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \cos im
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
return exp(re) * cos(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.cos(im);
}
def code(re, im): return math.exp(re) * math.cos(im)
function code(re, im) return Float64(exp(re) * cos(im)) end
function tmp = code(re, im) tmp = exp(re) * cos(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \cos im
\end{array}
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
return exp(re) * cos(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.cos(im);
}
def code(re, im): return math.exp(re) * math.cos(im)
function code(re, im) return Float64(exp(re) * cos(im)) end
function tmp = code(re, im) tmp = exp(re) * cos(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \cos im
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (re im) :precision binary64 (if (<= (exp re) 0.0) (exp re) (if (<= (exp re) 1.0) (* (cos im) (+ re 1.0)) (exp re))))
double code(double re, double im) {
double tmp;
if (exp(re) <= 0.0) {
tmp = exp(re);
} else if (exp(re) <= 1.0) {
tmp = cos(im) * (re + 1.0);
} else {
tmp = exp(re);
}
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.0d0) then
tmp = exp(re)
else if (exp(re) <= 1.0d0) then
tmp = cos(im) * (re + 1.0d0)
else
tmp = exp(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (Math.exp(re) <= 0.0) {
tmp = Math.exp(re);
} else if (Math.exp(re) <= 1.0) {
tmp = Math.cos(im) * (re + 1.0);
} else {
tmp = Math.exp(re);
}
return tmp;
}
def code(re, im): tmp = 0 if math.exp(re) <= 0.0: tmp = math.exp(re) elif math.exp(re) <= 1.0: tmp = math.cos(im) * (re + 1.0) else: tmp = math.exp(re) return tmp
function code(re, im) tmp = 0.0 if (exp(re) <= 0.0) tmp = exp(re); elseif (exp(re) <= 1.0) tmp = Float64(cos(im) * Float64(re + 1.0)); else tmp = exp(re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (exp(re) <= 0.0) tmp = exp(re); elseif (exp(re) <= 1.0) tmp = cos(im) * (re + 1.0); else tmp = exp(re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[Exp[re], $MachinePrecision], 0.0], N[Exp[re], $MachinePrecision], If[LessEqual[N[Exp[re], $MachinePrecision], 1.0], N[(N[Cos[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[Exp[re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \leq 0:\\
\;\;\;\;e^{re}\\
\mathbf{elif}\;e^{re} \leq 1:\\
\;\;\;\;\cos im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{re}\\
\end{array}
\end{array}
if (exp.f64 re) < 0.0 or 1 < (exp.f64 re) Initial program 100.0%
Taylor expanded in im around 0 91.4%
if 0.0 < (exp.f64 re) < 1Initial program 100.0%
Taylor expanded in re around 0 99.9%
+-commutative99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
Simplified99.9%
Final simplification95.4%
(FPCore (re im) :precision binary64 (if (<= (exp re) 0.999999999999999) (exp re) (if (<= (exp re) 1.0) (cos im) (exp re))))
double code(double re, double im) {
double tmp;
if (exp(re) <= 0.999999999999999) {
tmp = exp(re);
} else if (exp(re) <= 1.0) {
tmp = cos(im);
} else {
tmp = exp(re);
}
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.999999999999999d0) then
tmp = exp(re)
else if (exp(re) <= 1.0d0) then
tmp = cos(im)
else
tmp = exp(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (Math.exp(re) <= 0.999999999999999) {
tmp = Math.exp(re);
} else if (Math.exp(re) <= 1.0) {
tmp = Math.cos(im);
} else {
tmp = Math.exp(re);
}
return tmp;
}
def code(re, im): tmp = 0 if math.exp(re) <= 0.999999999999999: tmp = math.exp(re) elif math.exp(re) <= 1.0: tmp = math.cos(im) else: tmp = math.exp(re) return tmp
function code(re, im) tmp = 0.0 if (exp(re) <= 0.999999999999999) tmp = exp(re); elseif (exp(re) <= 1.0) tmp = cos(im); else tmp = exp(re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (exp(re) <= 0.999999999999999) tmp = exp(re); elseif (exp(re) <= 1.0) tmp = cos(im); else tmp = exp(re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[Exp[re], $MachinePrecision], 0.999999999999999], N[Exp[re], $MachinePrecision], If[LessEqual[N[Exp[re], $MachinePrecision], 1.0], N[Cos[im], $MachinePrecision], N[Exp[re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \leq 0.999999999999999:\\
\;\;\;\;e^{re}\\
\mathbf{elif}\;e^{re} \leq 1:\\
\;\;\;\;\cos im\\
\mathbf{else}:\\
\;\;\;\;e^{re}\\
\end{array}
\end{array}
if (exp.f64 re) < 0.999999999999999001 or 1 < (exp.f64 re) Initial program 100.0%
Taylor expanded in im around 0 91.1%
if 0.999999999999999001 < (exp.f64 re) < 1Initial program 100.0%
Taylor expanded in re around 0 100.0%
Final simplification95.1%
(FPCore (re im) :precision binary64 (if (or (<= re -0.0033) (and (not (<= re 2e-10)) (<= re 1.35e+154))) (exp re) (* (cos im) (+ (* 0.5 (* re re)) (+ re 1.0)))))
double code(double re, double im) {
double tmp;
if ((re <= -0.0033) || (!(re <= 2e-10) && (re <= 1.35e+154))) {
tmp = exp(re);
} else {
tmp = cos(im) * ((0.5 * (re * re)) + (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 <= (-0.0033d0)) .or. (.not. (re <= 2d-10)) .and. (re <= 1.35d+154)) then
tmp = exp(re)
else
tmp = cos(im) * ((0.5d0 * (re * re)) + (re + 1.0d0))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((re <= -0.0033) || (!(re <= 2e-10) && (re <= 1.35e+154))) {
tmp = Math.exp(re);
} else {
tmp = Math.cos(im) * ((0.5 * (re * re)) + (re + 1.0));
}
return tmp;
}
def code(re, im): tmp = 0 if (re <= -0.0033) or (not (re <= 2e-10) and (re <= 1.35e+154)): tmp = math.exp(re) else: tmp = math.cos(im) * ((0.5 * (re * re)) + (re + 1.0)) return tmp
function code(re, im) tmp = 0.0 if ((re <= -0.0033) || (!(re <= 2e-10) && (re <= 1.35e+154))) tmp = exp(re); else tmp = Float64(cos(im) * Float64(Float64(0.5 * Float64(re * re)) + Float64(re + 1.0))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((re <= -0.0033) || (~((re <= 2e-10)) && (re <= 1.35e+154))) tmp = exp(re); else tmp = cos(im) * ((0.5 * (re * re)) + (re + 1.0)); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[re, -0.0033], And[N[Not[LessEqual[re, 2e-10]], $MachinePrecision], LessEqual[re, 1.35e+154]]], N[Exp[re], $MachinePrecision], N[(N[Cos[im], $MachinePrecision] * N[(N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.0033 \lor \neg \left(re \leq 2 \cdot 10^{-10}\right) \land re \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;e^{re}\\
\mathbf{else}:\\
\;\;\;\;\cos im \cdot \left(0.5 \cdot \left(re \cdot re\right) + \left(re + 1\right)\right)\\
\end{array}
\end{array}
if re < -0.0033 or 2.00000000000000007e-10 < re < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in im around 0 93.9%
if -0.0033 < re < 2.00000000000000007e-10 or 1.35000000000000003e154 < re Initial program 100.0%
Taylor expanded in re around 0 100.0%
+-commutative100.0%
+-commutative100.0%
*-rgt-identity100.0%
distribute-lft-out100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Final simplification97.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ re (* re (* re 0.5)))))
(if (<= re -450.0)
(+ (+ 1.0 (* (* im im) (+ -0.5 (* re -0.5)))) -1.0)
(if (<= re 2e-10)
(cos im)
(if (<= re 1.5e+154)
(/ (- 1.0 (* t_0 t_0)) (- 1.0 t_0))
(* 0.5 (* re re)))))))
double code(double re, double im) {
double t_0 = re + (re * (re * 0.5));
double tmp;
if (re <= -450.0) {
tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0;
} else if (re <= 2e-10) {
tmp = cos(im);
} else if (re <= 1.5e+154) {
tmp = (1.0 - (t_0 * t_0)) / (1.0 - t_0);
} else {
tmp = 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 = re + (re * (re * 0.5d0))
if (re <= (-450.0d0)) then
tmp = (1.0d0 + ((im * im) * ((-0.5d0) + (re * (-0.5d0))))) + (-1.0d0)
else if (re <= 2d-10) then
tmp = cos(im)
else if (re <= 1.5d+154) then
tmp = (1.0d0 - (t_0 * t_0)) / (1.0d0 - t_0)
else
tmp = 0.5d0 * (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = re + (re * (re * 0.5));
double tmp;
if (re <= -450.0) {
tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0;
} else if (re <= 2e-10) {
tmp = Math.cos(im);
} else if (re <= 1.5e+154) {
tmp = (1.0 - (t_0 * t_0)) / (1.0 - t_0);
} else {
tmp = 0.5 * (re * re);
}
return tmp;
}
def code(re, im): t_0 = re + (re * (re * 0.5)) tmp = 0 if re <= -450.0: tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0 elif re <= 2e-10: tmp = math.cos(im) elif re <= 1.5e+154: tmp = (1.0 - (t_0 * t_0)) / (1.0 - t_0) else: tmp = 0.5 * (re * re) return tmp
function code(re, im) t_0 = Float64(re + Float64(re * Float64(re * 0.5))) tmp = 0.0 if (re <= -450.0) tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(re * -0.5)))) + -1.0); elseif (re <= 2e-10) tmp = cos(im); elseif (re <= 1.5e+154) tmp = Float64(Float64(1.0 - Float64(t_0 * t_0)) / Float64(1.0 - t_0)); else tmp = Float64(0.5 * Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) t_0 = re + (re * (re * 0.5)); tmp = 0.0; if (re <= -450.0) tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0; elseif (re <= 2e-10) tmp = cos(im); elseif (re <= 1.5e+154) tmp = (1.0 - (t_0 * t_0)) / (1.0 - t_0); else tmp = 0.5 * (re * re); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(re + N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -450.0], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[re, 2e-10], N[Cos[im], $MachinePrecision], If[LessEqual[re, 1.5e+154], N[(N[(1.0 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re + re \cdot \left(re \cdot 0.5\right)\\
\mathbf{if}\;re \leq -450:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + re \cdot -0.5\right)\right) + -1\\
\mathbf{elif}\;re \leq 2 \cdot 10^{-10}:\\
\;\;\;\;\cos im\\
\mathbf{elif}\;re \leq 1.5 \cdot 10^{+154}:\\
\;\;\;\;\frac{1 - t_0 \cdot t_0}{1 - t_0}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot re\right)\\
\end{array}
\end{array}
if re < -450Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 27.9%
unpow227.9%
unpow227.9%
distribute-lft-in27.9%
distribute-lft1-in28.3%
Simplified28.3%
expm1-log1p-u28.3%
expm1-udef32.3%
log1p-udef32.3%
add-exp-log32.3%
associate-*r*32.3%
*-commutative32.3%
+-commutative32.3%
distribute-lft-in32.3%
metadata-eval32.3%
Applied egg-rr32.3%
if -450 < re < 2.00000000000000007e-10Initial program 100.0%
Taylor expanded in re around 0 99.2%
if 2.00000000000000007e-10 < re < 1.50000000000000013e154Initial program 100.0%
Taylor expanded in re around 0 8.0%
+-commutative8.0%
+-commutative8.0%
*-rgt-identity8.0%
distribute-lft-out8.0%
*-commutative8.0%
associate-*l*8.0%
distribute-lft-out8.0%
*-commutative8.0%
unpow28.0%
Simplified8.0%
Taylor expanded in im around 0 7.1%
associate-+l+7.1%
flip-+42.0%
metadata-eval42.0%
*-commutative42.0%
associate-*l*42.0%
*-commutative42.0%
associate-*l*42.0%
*-commutative42.0%
associate-*l*42.0%
Applied egg-rr42.0%
if 1.50000000000000013e154 < re Initial program 100.0%
Taylor expanded in re around 0 100.0%
+-commutative100.0%
+-commutative100.0%
*-rgt-identity100.0%
distribute-lft-out100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around 0 81.5%
Taylor expanded in re around inf 81.5%
unpow281.5%
Simplified81.5%
Final simplification69.8%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ re (* re (* re 0.5)))))
(if (<= re -420.0)
(+ (+ 1.0 (* (* im im) (+ -0.5 (* re -0.5)))) -1.0)
(if (<= re 1.5e+154)
(/ (- 1.0 (* t_0 t_0)) (- 1.0 t_0))
(* 0.5 (* re re))))))
double code(double re, double im) {
double t_0 = re + (re * (re * 0.5));
double tmp;
if (re <= -420.0) {
tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0;
} else if (re <= 1.5e+154) {
tmp = (1.0 - (t_0 * t_0)) / (1.0 - t_0);
} else {
tmp = 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 = re + (re * (re * 0.5d0))
if (re <= (-420.0d0)) then
tmp = (1.0d0 + ((im * im) * ((-0.5d0) + (re * (-0.5d0))))) + (-1.0d0)
else if (re <= 1.5d+154) then
tmp = (1.0d0 - (t_0 * t_0)) / (1.0d0 - t_0)
else
tmp = 0.5d0 * (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = re + (re * (re * 0.5));
double tmp;
if (re <= -420.0) {
tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0;
} else if (re <= 1.5e+154) {
tmp = (1.0 - (t_0 * t_0)) / (1.0 - t_0);
} else {
tmp = 0.5 * (re * re);
}
return tmp;
}
def code(re, im): t_0 = re + (re * (re * 0.5)) tmp = 0 if re <= -420.0: tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0 elif re <= 1.5e+154: tmp = (1.0 - (t_0 * t_0)) / (1.0 - t_0) else: tmp = 0.5 * (re * re) return tmp
function code(re, im) t_0 = Float64(re + Float64(re * Float64(re * 0.5))) tmp = 0.0 if (re <= -420.0) tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(re * -0.5)))) + -1.0); elseif (re <= 1.5e+154) tmp = Float64(Float64(1.0 - Float64(t_0 * t_0)) / Float64(1.0 - t_0)); else tmp = Float64(0.5 * Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) t_0 = re + (re * (re * 0.5)); tmp = 0.0; if (re <= -420.0) tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0; elseif (re <= 1.5e+154) tmp = (1.0 - (t_0 * t_0)) / (1.0 - t_0); else tmp = 0.5 * (re * re); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(re + N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -420.0], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[re, 1.5e+154], N[(N[(1.0 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := re + re \cdot \left(re \cdot 0.5\right)\\
\mathbf{if}\;re \leq -420:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + re \cdot -0.5\right)\right) + -1\\
\mathbf{elif}\;re \leq 1.5 \cdot 10^{+154}:\\
\;\;\;\;\frac{1 - t_0 \cdot t_0}{1 - t_0}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot re\right)\\
\end{array}
\end{array}
if re < -420Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 27.9%
unpow227.9%
unpow227.9%
distribute-lft-in27.9%
distribute-lft1-in28.3%
Simplified28.3%
expm1-log1p-u28.3%
expm1-udef32.3%
log1p-udef32.3%
add-exp-log32.3%
associate-*r*32.3%
*-commutative32.3%
+-commutative32.3%
distribute-lft-in32.3%
metadata-eval32.3%
Applied egg-rr32.3%
if -420 < re < 1.50000000000000013e154Initial program 100.0%
Taylor expanded in re around 0 76.7%
+-commutative76.7%
+-commutative76.7%
*-rgt-identity76.7%
distribute-lft-out76.7%
*-commutative76.7%
associate-*l*76.7%
distribute-lft-out76.7%
*-commutative76.7%
unpow276.7%
Simplified76.7%
Taylor expanded in im around 0 43.1%
associate-+l+43.1%
flip-+51.9%
metadata-eval51.9%
*-commutative51.9%
associate-*l*51.9%
*-commutative51.9%
associate-*l*51.9%
*-commutative51.9%
associate-*l*51.9%
Applied egg-rr51.9%
if 1.50000000000000013e154 < re Initial program 100.0%
Taylor expanded in re around 0 100.0%
+-commutative100.0%
+-commutative100.0%
*-rgt-identity100.0%
distribute-lft-out100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around 0 81.5%
Taylor expanded in re around inf 81.5%
unpow281.5%
Simplified81.5%
Final simplification49.6%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (* re re))))
(if (<= re -410.0)
(+ (+ 1.0 (* (* im im) (+ -0.5 (* re -0.5)))) -1.0)
(if (<= re 1.15e+24)
(+ t_0 (+ re 1.0))
(if (<= re 5.5e+142)
(* -0.5 (/ (* (* im im) (- 1.0 (* re re))) (- 1.0 re)))
t_0)))))
double code(double re, double im) {
double t_0 = 0.5 * (re * re);
double tmp;
if (re <= -410.0) {
tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0;
} else if (re <= 1.15e+24) {
tmp = t_0 + (re + 1.0);
} else if (re <= 5.5e+142) {
tmp = -0.5 * (((im * im) * (1.0 - (re * re))) / (1.0 - re));
} 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 = 0.5d0 * (re * re)
if (re <= (-410.0d0)) then
tmp = (1.0d0 + ((im * im) * ((-0.5d0) + (re * (-0.5d0))))) + (-1.0d0)
else if (re <= 1.15d+24) then
tmp = t_0 + (re + 1.0d0)
else if (re <= 5.5d+142) then
tmp = (-0.5d0) * (((im * im) * (1.0d0 - (re * re))) / (1.0d0 - re))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 * (re * re);
double tmp;
if (re <= -410.0) {
tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0;
} else if (re <= 1.15e+24) {
tmp = t_0 + (re + 1.0);
} else if (re <= 5.5e+142) {
tmp = -0.5 * (((im * im) * (1.0 - (re * re))) / (1.0 - re));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = 0.5 * (re * re) tmp = 0 if re <= -410.0: tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0 elif re <= 1.15e+24: tmp = t_0 + (re + 1.0) elif re <= 5.5e+142: tmp = -0.5 * (((im * im) * (1.0 - (re * re))) / (1.0 - re)) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(0.5 * Float64(re * re)) tmp = 0.0 if (re <= -410.0) tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(re * -0.5)))) + -1.0); elseif (re <= 1.15e+24) tmp = Float64(t_0 + Float64(re + 1.0)); elseif (re <= 5.5e+142) tmp = Float64(-0.5 * Float64(Float64(Float64(im * im) * Float64(1.0 - Float64(re * re))) / Float64(1.0 - re))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * (re * re); tmp = 0.0; if (re <= -410.0) tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0; elseif (re <= 1.15e+24) tmp = t_0 + (re + 1.0); elseif (re <= 5.5e+142) tmp = -0.5 * (((im * im) * (1.0 - (re * re))) / (1.0 - re)); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -410.0], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[re, 1.15e+24], N[(t$95$0 + N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 5.5e+142], N[(-0.5 * N[(N[(N[(im * im), $MachinePrecision] * N[(1.0 - N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(re \cdot re\right)\\
\mathbf{if}\;re \leq -410:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + re \cdot -0.5\right)\right) + -1\\
\mathbf{elif}\;re \leq 1.15 \cdot 10^{+24}:\\
\;\;\;\;t_0 + \left(re + 1\right)\\
\mathbf{elif}\;re \leq 5.5 \cdot 10^{+142}:\\
\;\;\;\;-0.5 \cdot \frac{\left(im \cdot im\right) \cdot \left(1 - re \cdot re\right)}{1 - re}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if re < -410Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 27.9%
unpow227.9%
unpow227.9%
distribute-lft-in27.9%
distribute-lft1-in28.3%
Simplified28.3%
expm1-log1p-u28.3%
expm1-udef32.3%
log1p-udef32.3%
add-exp-log32.3%
associate-*r*32.3%
*-commutative32.3%
+-commutative32.3%
distribute-lft-in32.3%
metadata-eval32.3%
Applied egg-rr32.3%
if -410 < re < 1.15e24Initial program 100.0%
Taylor expanded in re around 0 97.7%
+-commutative97.7%
+-commutative97.7%
*-rgt-identity97.7%
distribute-lft-out97.7%
*-commutative97.7%
associate-*l*97.7%
distribute-lft-out97.7%
*-commutative97.7%
unpow297.7%
Simplified97.7%
Taylor expanded in im around 0 54.4%
if 1.15e24 < re < 5.50000000000000035e142Initial program 100.0%
Taylor expanded in im around 0 75.0%
unpow275.0%
Simplified75.0%
Taylor expanded in im around inf 18.8%
unpow218.8%
associate-*r*18.8%
*-commutative18.8%
associate-*r*18.8%
Simplified18.8%
Taylor expanded in re around 0 16.6%
unpow216.6%
unpow216.6%
distribute-lft-in16.6%
distribute-lft1-in16.6%
Simplified16.6%
+-commutative16.6%
flip-+16.6%
associate-*l/19.5%
metadata-eval19.5%
Applied egg-rr19.5%
if 5.50000000000000035e142 < re Initial program 100.0%
Taylor expanded in re around 0 88.4%
+-commutative88.4%
+-commutative88.4%
*-rgt-identity88.4%
distribute-lft-out88.4%
*-commutative88.4%
associate-*l*88.4%
distribute-lft-out88.4%
*-commutative88.4%
unpow288.4%
Simplified88.4%
Taylor expanded in im around 0 72.2%
Taylor expanded in re around inf 72.2%
unpow272.2%
Simplified72.2%
Final simplification46.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (+ (* 0.5 (* re re)) (+ re 1.0))))
(if (<= re -420.0)
(+ (+ 1.0 (* (* im im) (+ -0.5 (* re -0.5)))) -1.0)
(if (<= re 1.45e-34) t_0 (* t_0 (+ 1.0 (* (* im im) -0.5)))))))
double code(double re, double im) {
double t_0 = (0.5 * (re * re)) + (re + 1.0);
double tmp;
if (re <= -420.0) {
tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0;
} else if (re <= 1.45e-34) {
tmp = t_0;
} else {
tmp = t_0 * (1.0 + ((im * im) * -0.5));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = (0.5d0 * (re * re)) + (re + 1.0d0)
if (re <= (-420.0d0)) then
tmp = (1.0d0 + ((im * im) * ((-0.5d0) + (re * (-0.5d0))))) + (-1.0d0)
else if (re <= 1.45d-34) then
tmp = t_0
else
tmp = t_0 * (1.0d0 + ((im * im) * (-0.5d0)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (0.5 * (re * re)) + (re + 1.0);
double tmp;
if (re <= -420.0) {
tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0;
} else if (re <= 1.45e-34) {
tmp = t_0;
} else {
tmp = t_0 * (1.0 + ((im * im) * -0.5));
}
return tmp;
}
def code(re, im): t_0 = (0.5 * (re * re)) + (re + 1.0) tmp = 0 if re <= -420.0: tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0 elif re <= 1.45e-34: tmp = t_0 else: tmp = t_0 * (1.0 + ((im * im) * -0.5)) return tmp
function code(re, im) t_0 = Float64(Float64(0.5 * Float64(re * re)) + Float64(re + 1.0)) tmp = 0.0 if (re <= -420.0) tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(re * -0.5)))) + -1.0); elseif (re <= 1.45e-34) tmp = t_0; else tmp = Float64(t_0 * Float64(1.0 + Float64(Float64(im * im) * -0.5))); end return tmp end
function tmp_2 = code(re, im) t_0 = (0.5 * (re * re)) + (re + 1.0); tmp = 0.0; if (re <= -420.0) tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0; elseif (re <= 1.45e-34) tmp = t_0; else tmp = t_0 * (1.0 + ((im * im) * -0.5)); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(re + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -420.0], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[re, 1.45e-34], t$95$0, N[(t$95$0 * N[(1.0 + N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(re \cdot re\right) + \left(re + 1\right)\\
\mathbf{if}\;re \leq -420:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + re \cdot -0.5\right)\right) + -1\\
\mathbf{elif}\;re \leq 1.45 \cdot 10^{-34}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(1 + \left(im \cdot im\right) \cdot -0.5\right)\\
\end{array}
\end{array}
if re < -420Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 27.9%
unpow227.9%
unpow227.9%
distribute-lft-in27.9%
distribute-lft1-in28.3%
Simplified28.3%
expm1-log1p-u28.3%
expm1-udef32.3%
log1p-udef32.3%
add-exp-log32.3%
associate-*r*32.3%
*-commutative32.3%
+-commutative32.3%
distribute-lft-in32.3%
metadata-eval32.3%
Applied egg-rr32.3%
if -420 < re < 1.4500000000000001e-34Initial program 100.0%
Taylor expanded in re around 0 100.0%
+-commutative100.0%
+-commutative100.0%
*-rgt-identity100.0%
distribute-lft-out100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around 0 55.1%
if 1.4500000000000001e-34 < re Initial program 100.0%
Taylor expanded in re around 0 48.9%
+-commutative48.9%
+-commutative48.9%
*-rgt-identity48.9%
distribute-lft-out48.9%
*-commutative48.9%
associate-*l*48.9%
distribute-lft-out48.9%
*-commutative48.9%
unpow248.9%
Simplified48.9%
Taylor expanded in im around 0 46.5%
unpow278.0%
Simplified46.5%
Final simplification46.3%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (* re re))))
(if (<= re -520.0)
(* (* im im) -0.5)
(if (<= re 1.45e-34)
(+ t_0 (+ re 1.0))
(if (<= re 1.55e+143)
(+ (+ re 1.0) (* -0.5 (* (* im im) (+ re 1.0))))
t_0)))))
double code(double re, double im) {
double t_0 = 0.5 * (re * re);
double tmp;
if (re <= -520.0) {
tmp = (im * im) * -0.5;
} else if (re <= 1.45e-34) {
tmp = t_0 + (re + 1.0);
} else if (re <= 1.55e+143) {
tmp = (re + 1.0) + (-0.5 * ((im * 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 = 0.5d0 * (re * re)
if (re <= (-520.0d0)) then
tmp = (im * im) * (-0.5d0)
else if (re <= 1.45d-34) then
tmp = t_0 + (re + 1.0d0)
else if (re <= 1.55d+143) then
tmp = (re + 1.0d0) + ((-0.5d0) * ((im * 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 = 0.5 * (re * re);
double tmp;
if (re <= -520.0) {
tmp = (im * im) * -0.5;
} else if (re <= 1.45e-34) {
tmp = t_0 + (re + 1.0);
} else if (re <= 1.55e+143) {
tmp = (re + 1.0) + (-0.5 * ((im * im) * (re + 1.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = 0.5 * (re * re) tmp = 0 if re <= -520.0: tmp = (im * im) * -0.5 elif re <= 1.45e-34: tmp = t_0 + (re + 1.0) elif re <= 1.55e+143: tmp = (re + 1.0) + (-0.5 * ((im * im) * (re + 1.0))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(0.5 * Float64(re * re)) tmp = 0.0 if (re <= -520.0) tmp = Float64(Float64(im * im) * -0.5); elseif (re <= 1.45e-34) tmp = Float64(t_0 + Float64(re + 1.0)); elseif (re <= 1.55e+143) tmp = Float64(Float64(re + 1.0) + Float64(-0.5 * Float64(Float64(im * im) * Float64(re + 1.0)))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * (re * re); tmp = 0.0; if (re <= -520.0) tmp = (im * im) * -0.5; elseif (re <= 1.45e-34) tmp = t_0 + (re + 1.0); elseif (re <= 1.55e+143) tmp = (re + 1.0) + (-0.5 * ((im * im) * (re + 1.0))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -520.0], N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[re, 1.45e-34], N[(t$95$0 + N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.55e+143], N[(N[(re + 1.0), $MachinePrecision] + N[(-0.5 * N[(N[(im * im), $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(re \cdot re\right)\\
\mathbf{if}\;re \leq -520:\\
\;\;\;\;\left(im \cdot im\right) \cdot -0.5\\
\mathbf{elif}\;re \leq 1.45 \cdot 10^{-34}:\\
\;\;\;\;t_0 + \left(re + 1\right)\\
\mathbf{elif}\;re \leq 1.55 \cdot 10^{+143}:\\
\;\;\;\;\left(re + 1\right) + -0.5 \cdot \left(\left(im \cdot im\right) \cdot \left(re + 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if re < -520Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 28.8%
unpow228.8%
Simplified28.8%
if -520 < re < 1.4500000000000001e-34Initial program 100.0%
Taylor expanded in re around 0 100.0%
+-commutative100.0%
+-commutative100.0%
*-rgt-identity100.0%
distribute-lft-out100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around 0 55.1%
if 1.4500000000000001e-34 < re < 1.54999999999999995e143Initial program 100.0%
Taylor expanded in re around 0 18.0%
+-commutative18.0%
*-rgt-identity18.0%
distribute-lft-out18.0%
Simplified18.0%
Taylor expanded in im around 0 24.4%
associate-+r+24.4%
+-commutative24.4%
unpow224.4%
+-commutative24.4%
Simplified24.4%
if 1.54999999999999995e143 < re Initial program 100.0%
Taylor expanded in re around 0 88.4%
+-commutative88.4%
+-commutative88.4%
*-rgt-identity88.4%
distribute-lft-out88.4%
*-commutative88.4%
associate-*l*88.4%
distribute-lft-out88.4%
*-commutative88.4%
unpow288.4%
Simplified88.4%
Taylor expanded in im around 0 72.2%
Taylor expanded in re around inf 72.2%
unpow272.2%
Simplified72.2%
Final simplification44.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (* re re))))
(if (<= re -480.0)
(+ (+ 1.0 (* (* im im) (+ -0.5 (* re -0.5)))) -1.0)
(if (<= re 4.4e-35)
(+ t_0 (+ re 1.0))
(if (<= re 1.5e+143)
(+ (+ re 1.0) (* -0.5 (* (* im im) (+ re 1.0))))
t_0)))))
double code(double re, double im) {
double t_0 = 0.5 * (re * re);
double tmp;
if (re <= -480.0) {
tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0;
} else if (re <= 4.4e-35) {
tmp = t_0 + (re + 1.0);
} else if (re <= 1.5e+143) {
tmp = (re + 1.0) + (-0.5 * ((im * 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 = 0.5d0 * (re * re)
if (re <= (-480.0d0)) then
tmp = (1.0d0 + ((im * im) * ((-0.5d0) + (re * (-0.5d0))))) + (-1.0d0)
else if (re <= 4.4d-35) then
tmp = t_0 + (re + 1.0d0)
else if (re <= 1.5d+143) then
tmp = (re + 1.0d0) + ((-0.5d0) * ((im * 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 = 0.5 * (re * re);
double tmp;
if (re <= -480.0) {
tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0;
} else if (re <= 4.4e-35) {
tmp = t_0 + (re + 1.0);
} else if (re <= 1.5e+143) {
tmp = (re + 1.0) + (-0.5 * ((im * im) * (re + 1.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(re, im): t_0 = 0.5 * (re * re) tmp = 0 if re <= -480.0: tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0 elif re <= 4.4e-35: tmp = t_0 + (re + 1.0) elif re <= 1.5e+143: tmp = (re + 1.0) + (-0.5 * ((im * im) * (re + 1.0))) else: tmp = t_0 return tmp
function code(re, im) t_0 = Float64(0.5 * Float64(re * re)) tmp = 0.0 if (re <= -480.0) tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(re * -0.5)))) + -1.0); elseif (re <= 4.4e-35) tmp = Float64(t_0 + Float64(re + 1.0)); elseif (re <= 1.5e+143) tmp = Float64(Float64(re + 1.0) + Float64(-0.5 * Float64(Float64(im * im) * Float64(re + 1.0)))); else tmp = t_0; end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * (re * re); tmp = 0.0; if (re <= -480.0) tmp = (1.0 + ((im * im) * (-0.5 + (re * -0.5)))) + -1.0; elseif (re <= 4.4e-35) tmp = t_0 + (re + 1.0); elseif (re <= 1.5e+143) tmp = (re + 1.0) + (-0.5 * ((im * im) * (re + 1.0))); else tmp = t_0; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -480.0], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[re, 4.4e-35], N[(t$95$0 + N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.5e+143], N[(N[(re + 1.0), $MachinePrecision] + N[(-0.5 * N[(N[(im * im), $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(re \cdot re\right)\\
\mathbf{if}\;re \leq -480:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + re \cdot -0.5\right)\right) + -1\\
\mathbf{elif}\;re \leq 4.4 \cdot 10^{-35}:\\
\;\;\;\;t_0 + \left(re + 1\right)\\
\mathbf{elif}\;re \leq 1.5 \cdot 10^{+143}:\\
\;\;\;\;\left(re + 1\right) + -0.5 \cdot \left(\left(im \cdot im\right) \cdot \left(re + 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if re < -480Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 27.9%
unpow227.9%
unpow227.9%
distribute-lft-in27.9%
distribute-lft1-in28.3%
Simplified28.3%
expm1-log1p-u28.3%
expm1-udef32.3%
log1p-udef32.3%
add-exp-log32.3%
associate-*r*32.3%
*-commutative32.3%
+-commutative32.3%
distribute-lft-in32.3%
metadata-eval32.3%
Applied egg-rr32.3%
if -480 < re < 4.39999999999999987e-35Initial program 100.0%
Taylor expanded in re around 0 100.0%
+-commutative100.0%
+-commutative100.0%
*-rgt-identity100.0%
distribute-lft-out100.0%
*-commutative100.0%
associate-*l*100.0%
distribute-lft-out100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in im around 0 55.1%
if 4.39999999999999987e-35 < re < 1.5e143Initial program 100.0%
Taylor expanded in re around 0 18.0%
+-commutative18.0%
*-rgt-identity18.0%
distribute-lft-out18.0%
Simplified18.0%
Taylor expanded in im around 0 24.4%
associate-+r+24.4%
+-commutative24.4%
unpow224.4%
+-commutative24.4%
Simplified24.4%
if 1.5e143 < re Initial program 100.0%
Taylor expanded in re around 0 88.4%
+-commutative88.4%
+-commutative88.4%
*-rgt-identity88.4%
distribute-lft-out88.4%
*-commutative88.4%
associate-*l*88.4%
distribute-lft-out88.4%
*-commutative88.4%
unpow288.4%
Simplified88.4%
Taylor expanded in im around 0 72.2%
Taylor expanded in re around inf 72.2%
unpow272.2%
Simplified72.2%
Final simplification45.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) -0.5)))
(if (<= re -150.0)
t_0
(if (<= re 520.0)
(+ re 1.0)
(if (<= re 1.55e+143) (* re (+ 1.0 t_0)) (* 0.5 (* re re)))))))
double code(double re, double im) {
double t_0 = (im * im) * -0.5;
double tmp;
if (re <= -150.0) {
tmp = t_0;
} else if (re <= 520.0) {
tmp = re + 1.0;
} else if (re <= 1.55e+143) {
tmp = re * (1.0 + t_0);
} else {
tmp = 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 * im) * (-0.5d0)
if (re <= (-150.0d0)) then
tmp = t_0
else if (re <= 520.0d0) then
tmp = re + 1.0d0
else if (re <= 1.55d+143) then
tmp = re * (1.0d0 + t_0)
else
tmp = 0.5d0 * (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (im * im) * -0.5;
double tmp;
if (re <= -150.0) {
tmp = t_0;
} else if (re <= 520.0) {
tmp = re + 1.0;
} else if (re <= 1.55e+143) {
tmp = re * (1.0 + t_0);
} else {
tmp = 0.5 * (re * re);
}
return tmp;
}
def code(re, im): t_0 = (im * im) * -0.5 tmp = 0 if re <= -150.0: tmp = t_0 elif re <= 520.0: tmp = re + 1.0 elif re <= 1.55e+143: tmp = re * (1.0 + t_0) else: tmp = 0.5 * (re * re) return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * -0.5) tmp = 0.0 if (re <= -150.0) tmp = t_0; elseif (re <= 520.0) tmp = Float64(re + 1.0); elseif (re <= 1.55e+143) tmp = Float64(re * Float64(1.0 + t_0)); else tmp = Float64(0.5 * Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) t_0 = (im * im) * -0.5; tmp = 0.0; if (re <= -150.0) tmp = t_0; elseif (re <= 520.0) tmp = re + 1.0; elseif (re <= 1.55e+143) tmp = re * (1.0 + t_0); else tmp = 0.5 * (re * re); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[re, -150.0], t$95$0, If[LessEqual[re, 520.0], N[(re + 1.0), $MachinePrecision], If[LessEqual[re, 1.55e+143], N[(re * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(im \cdot im\right) \cdot -0.5\\
\mathbf{if}\;re \leq -150:\\
\;\;\;\;t_0\\
\mathbf{elif}\;re \leq 520:\\
\;\;\;\;re + 1\\
\mathbf{elif}\;re \leq 1.55 \cdot 10^{+143}:\\
\;\;\;\;re \cdot \left(1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot re\right)\\
\end{array}
\end{array}
if re < -150Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 28.8%
unpow228.8%
Simplified28.8%
if -150 < re < 520Initial program 100.0%
Taylor expanded in re around 0 99.2%
+-commutative99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
Simplified99.2%
Taylor expanded in im around 0 55.3%
+-commutative55.3%
Simplified55.3%
if 520 < re < 1.54999999999999995e143Initial program 100.0%
Taylor expanded in re around 0 3.8%
+-commutative3.8%
*-rgt-identity3.8%
distribute-lft-out3.8%
Simplified3.8%
Taylor expanded in im around 0 17.1%
associate-+r+17.1%
+-commutative17.1%
unpow217.1%
+-commutative17.1%
Simplified17.1%
Taylor expanded in re around inf 17.1%
*-commutative17.1%
unpow217.1%
Simplified17.1%
if 1.54999999999999995e143 < re Initial program 100.0%
Taylor expanded in re around 0 88.4%
+-commutative88.4%
+-commutative88.4%
*-rgt-identity88.4%
distribute-lft-out88.4%
*-commutative88.4%
associate-*l*88.4%
distribute-lft-out88.4%
*-commutative88.4%
unpow288.4%
Simplified88.4%
Taylor expanded in im around 0 72.2%
Taylor expanded in re around inf 72.2%
unpow272.2%
Simplified72.2%
Final simplification44.9%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) -0.5)) (t_1 (* 0.5 (* re re))))
(if (<= re -580.0)
t_0
(if (<= re 2.1e+23)
(+ t_1 (+ re 1.0))
(if (<= re 5.8e+142) (* re (+ 1.0 t_0)) t_1)))))
double code(double re, double im) {
double t_0 = (im * im) * -0.5;
double t_1 = 0.5 * (re * re);
double tmp;
if (re <= -580.0) {
tmp = t_0;
} else if (re <= 2.1e+23) {
tmp = t_1 + (re + 1.0);
} else if (re <= 5.8e+142) {
tmp = re * (1.0 + 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 = (im * im) * (-0.5d0)
t_1 = 0.5d0 * (re * re)
if (re <= (-580.0d0)) then
tmp = t_0
else if (re <= 2.1d+23) then
tmp = t_1 + (re + 1.0d0)
else if (re <= 5.8d+142) then
tmp = re * (1.0d0 + t_0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (im * im) * -0.5;
double t_1 = 0.5 * (re * re);
double tmp;
if (re <= -580.0) {
tmp = t_0;
} else if (re <= 2.1e+23) {
tmp = t_1 + (re + 1.0);
} else if (re <= 5.8e+142) {
tmp = re * (1.0 + t_0);
} else {
tmp = t_1;
}
return tmp;
}
def code(re, im): t_0 = (im * im) * -0.5 t_1 = 0.5 * (re * re) tmp = 0 if re <= -580.0: tmp = t_0 elif re <= 2.1e+23: tmp = t_1 + (re + 1.0) elif re <= 5.8e+142: tmp = re * (1.0 + t_0) else: tmp = t_1 return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * -0.5) t_1 = Float64(0.5 * Float64(re * re)) tmp = 0.0 if (re <= -580.0) tmp = t_0; elseif (re <= 2.1e+23) tmp = Float64(t_1 + Float64(re + 1.0)); elseif (re <= 5.8e+142) tmp = Float64(re * Float64(1.0 + t_0)); else tmp = t_1; end return tmp end
function tmp_2 = code(re, im) t_0 = (im * im) * -0.5; t_1 = 0.5 * (re * re); tmp = 0.0; if (re <= -580.0) tmp = t_0; elseif (re <= 2.1e+23) tmp = t_1 + (re + 1.0); elseif (re <= 5.8e+142) tmp = re * (1.0 + t_0); else tmp = t_1; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -580.0], t$95$0, If[LessEqual[re, 2.1e+23], N[(t$95$1 + N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 5.8e+142], N[(re * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(im \cdot im\right) \cdot -0.5\\
t_1 := 0.5 \cdot \left(re \cdot re\right)\\
\mathbf{if}\;re \leq -580:\\
\;\;\;\;t_0\\
\mathbf{elif}\;re \leq 2.1 \cdot 10^{+23}:\\
\;\;\;\;t_1 + \left(re + 1\right)\\
\mathbf{elif}\;re \leq 5.8 \cdot 10^{+142}:\\
\;\;\;\;re \cdot \left(1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if re < -580Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 28.8%
unpow228.8%
Simplified28.8%
if -580 < re < 2.1000000000000001e23Initial program 100.0%
Taylor expanded in re around 0 97.7%
+-commutative97.7%
+-commutative97.7%
*-rgt-identity97.7%
distribute-lft-out97.7%
*-commutative97.7%
associate-*l*97.7%
distribute-lft-out97.7%
*-commutative97.7%
unpow297.7%
Simplified97.7%
Taylor expanded in im around 0 54.4%
if 2.1000000000000001e23 < re < 5.80000000000000027e142Initial program 100.0%
Taylor expanded in re around 0 3.8%
+-commutative3.8%
*-rgt-identity3.8%
distribute-lft-out3.8%
Simplified3.8%
Taylor expanded in im around 0 18.0%
associate-+r+18.0%
+-commutative18.0%
unpow218.0%
+-commutative18.0%
Simplified18.0%
Taylor expanded in re around inf 18.0%
*-commutative18.0%
unpow218.0%
Simplified18.0%
if 5.80000000000000027e142 < re Initial program 100.0%
Taylor expanded in re around 0 88.4%
+-commutative88.4%
+-commutative88.4%
*-rgt-identity88.4%
distribute-lft-out88.4%
*-commutative88.4%
associate-*l*88.4%
distribute-lft-out88.4%
*-commutative88.4%
unpow288.4%
Simplified88.4%
Taylor expanded in im around 0 72.2%
Taylor expanded in re around inf 72.2%
unpow272.2%
Simplified72.2%
Final simplification44.9%
(FPCore (re im)
:precision binary64
(if (<= re -330.0)
(* (* im im) -0.5)
(if (<= re 1.6e+23)
(+ re 1.0)
(if (<= re 1.55e+143) (* -0.5 (* im (* re im))) (* 0.5 (* re re))))))
double code(double re, double im) {
double tmp;
if (re <= -330.0) {
tmp = (im * im) * -0.5;
} else if (re <= 1.6e+23) {
tmp = re + 1.0;
} else if (re <= 1.55e+143) {
tmp = -0.5 * (im * (re * im));
} else {
tmp = 0.5 * (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 <= (-330.0d0)) then
tmp = (im * im) * (-0.5d0)
else if (re <= 1.6d+23) then
tmp = re + 1.0d0
else if (re <= 1.55d+143) then
tmp = (-0.5d0) * (im * (re * im))
else
tmp = 0.5d0 * (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -330.0) {
tmp = (im * im) * -0.5;
} else if (re <= 1.6e+23) {
tmp = re + 1.0;
} else if (re <= 1.55e+143) {
tmp = -0.5 * (im * (re * im));
} else {
tmp = 0.5 * (re * re);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -330.0: tmp = (im * im) * -0.5 elif re <= 1.6e+23: tmp = re + 1.0 elif re <= 1.55e+143: tmp = -0.5 * (im * (re * im)) else: tmp = 0.5 * (re * re) return tmp
function code(re, im) tmp = 0.0 if (re <= -330.0) tmp = Float64(Float64(im * im) * -0.5); elseif (re <= 1.6e+23) tmp = Float64(re + 1.0); elseif (re <= 1.55e+143) tmp = Float64(-0.5 * Float64(im * Float64(re * im))); else tmp = Float64(0.5 * Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -330.0) tmp = (im * im) * -0.5; elseif (re <= 1.6e+23) tmp = re + 1.0; elseif (re <= 1.55e+143) tmp = -0.5 * (im * (re * im)); else tmp = 0.5 * (re * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -330.0], N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[re, 1.6e+23], N[(re + 1.0), $MachinePrecision], If[LessEqual[re, 1.55e+143], N[(-0.5 * N[(im * N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -330:\\
\;\;\;\;\left(im \cdot im\right) \cdot -0.5\\
\mathbf{elif}\;re \leq 1.6 \cdot 10^{+23}:\\
\;\;\;\;re + 1\\
\mathbf{elif}\;re \leq 1.55 \cdot 10^{+143}:\\
\;\;\;\;-0.5 \cdot \left(im \cdot \left(re \cdot im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot re\right)\\
\end{array}
\end{array}
if re < -330Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 28.8%
unpow228.8%
Simplified28.8%
if -330 < re < 1.6e23Initial program 100.0%
Taylor expanded in re around 0 97.6%
+-commutative97.6%
*-rgt-identity97.6%
distribute-lft-out97.6%
Simplified97.6%
Taylor expanded in im around 0 54.4%
+-commutative54.4%
Simplified54.4%
if 1.6e23 < re < 1.54999999999999995e143Initial program 100.0%
Taylor expanded in im around 0 75.0%
unpow275.0%
Simplified75.0%
Taylor expanded in im around inf 18.8%
unpow218.8%
associate-*r*18.8%
*-commutative18.8%
associate-*r*18.8%
Simplified18.8%
Taylor expanded in re around 0 16.6%
unpow216.6%
unpow216.6%
distribute-lft-in16.6%
distribute-lft1-in16.6%
Simplified16.6%
Taylor expanded in re around inf 16.6%
unpow216.6%
associate-*r*16.6%
Simplified16.6%
if 1.54999999999999995e143 < re Initial program 100.0%
Taylor expanded in re around 0 88.4%
+-commutative88.4%
+-commutative88.4%
*-rgt-identity88.4%
distribute-lft-out88.4%
*-commutative88.4%
associate-*l*88.4%
distribute-lft-out88.4%
*-commutative88.4%
unpow288.4%
Simplified88.4%
Taylor expanded in im around 0 72.2%
Taylor expanded in re around inf 72.2%
unpow272.2%
Simplified72.2%
Final simplification44.7%
(FPCore (re im)
:precision binary64
(if (<= re -34.0)
(* (* im im) -0.5)
(if (<= re 1.6e+23)
(+ re 1.0)
(if (<= re 9e+140) (* (* im im) (* re -0.5)) (* 0.5 (* re re))))))
double code(double re, double im) {
double tmp;
if (re <= -34.0) {
tmp = (im * im) * -0.5;
} else if (re <= 1.6e+23) {
tmp = re + 1.0;
} else if (re <= 9e+140) {
tmp = (im * im) * (re * -0.5);
} else {
tmp = 0.5 * (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 <= (-34.0d0)) then
tmp = (im * im) * (-0.5d0)
else if (re <= 1.6d+23) then
tmp = re + 1.0d0
else if (re <= 9d+140) then
tmp = (im * im) * (re * (-0.5d0))
else
tmp = 0.5d0 * (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -34.0) {
tmp = (im * im) * -0.5;
} else if (re <= 1.6e+23) {
tmp = re + 1.0;
} else if (re <= 9e+140) {
tmp = (im * im) * (re * -0.5);
} else {
tmp = 0.5 * (re * re);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -34.0: tmp = (im * im) * -0.5 elif re <= 1.6e+23: tmp = re + 1.0 elif re <= 9e+140: tmp = (im * im) * (re * -0.5) else: tmp = 0.5 * (re * re) return tmp
function code(re, im) tmp = 0.0 if (re <= -34.0) tmp = Float64(Float64(im * im) * -0.5); elseif (re <= 1.6e+23) tmp = Float64(re + 1.0); elseif (re <= 9e+140) tmp = Float64(Float64(im * im) * Float64(re * -0.5)); else tmp = Float64(0.5 * Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -34.0) tmp = (im * im) * -0.5; elseif (re <= 1.6e+23) tmp = re + 1.0; elseif (re <= 9e+140) tmp = (im * im) * (re * -0.5); else tmp = 0.5 * (re * re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -34.0], N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[re, 1.6e+23], N[(re + 1.0), $MachinePrecision], If[LessEqual[re, 9e+140], N[(N[(im * im), $MachinePrecision] * N[(re * -0.5), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -34:\\
\;\;\;\;\left(im \cdot im\right) \cdot -0.5\\
\mathbf{elif}\;re \leq 1.6 \cdot 10^{+23}:\\
\;\;\;\;re + 1\\
\mathbf{elif}\;re \leq 9 \cdot 10^{+140}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(re \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot re\right)\\
\end{array}
\end{array}
if re < -34Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 28.8%
unpow228.8%
Simplified28.8%
if -34 < re < 1.6e23Initial program 100.0%
Taylor expanded in re around 0 97.6%
+-commutative97.6%
*-rgt-identity97.6%
distribute-lft-out97.6%
Simplified97.6%
Taylor expanded in im around 0 54.4%
+-commutative54.4%
Simplified54.4%
if 1.6e23 < re < 9.0000000000000003e140Initial program 100.0%
Taylor expanded in re around 0 3.8%
+-commutative3.8%
*-rgt-identity3.8%
distribute-lft-out3.8%
Simplified3.8%
Taylor expanded in im around 0 18.0%
associate-+r+18.0%
+-commutative18.0%
unpow218.0%
+-commutative18.0%
Simplified18.0%
Taylor expanded in re around inf 18.0%
*-commutative18.0%
unpow218.0%
Simplified18.0%
Taylor expanded in im around inf 16.6%
unpow216.6%
*-commutative16.6%
*-commutative16.6%
associate-*r*16.6%
*-commutative16.6%
Simplified16.6%
if 9.0000000000000003e140 < re Initial program 100.0%
Taylor expanded in re around 0 88.4%
+-commutative88.4%
+-commutative88.4%
*-rgt-identity88.4%
distribute-lft-out88.4%
*-commutative88.4%
associate-*l*88.4%
distribute-lft-out88.4%
*-commutative88.4%
unpow288.4%
Simplified88.4%
Taylor expanded in im around 0 72.2%
Taylor expanded in re around inf 72.2%
unpow272.2%
Simplified72.2%
Final simplification44.7%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (* im im) -0.5)))
(if (<= re -260.0)
t_0
(if (<= re 2.7e+23)
(+ re 1.0)
(if (<= re 1.55e+143) (+ 1.0 t_0) (* 0.5 (* re re)))))))
double code(double re, double im) {
double t_0 = (im * im) * -0.5;
double tmp;
if (re <= -260.0) {
tmp = t_0;
} else if (re <= 2.7e+23) {
tmp = re + 1.0;
} else if (re <= 1.55e+143) {
tmp = 1.0 + t_0;
} else {
tmp = 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 * im) * (-0.5d0)
if (re <= (-260.0d0)) then
tmp = t_0
else if (re <= 2.7d+23) then
tmp = re + 1.0d0
else if (re <= 1.55d+143) then
tmp = 1.0d0 + t_0
else
tmp = 0.5d0 * (re * re)
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = (im * im) * -0.5;
double tmp;
if (re <= -260.0) {
tmp = t_0;
} else if (re <= 2.7e+23) {
tmp = re + 1.0;
} else if (re <= 1.55e+143) {
tmp = 1.0 + t_0;
} else {
tmp = 0.5 * (re * re);
}
return tmp;
}
def code(re, im): t_0 = (im * im) * -0.5 tmp = 0 if re <= -260.0: tmp = t_0 elif re <= 2.7e+23: tmp = re + 1.0 elif re <= 1.55e+143: tmp = 1.0 + t_0 else: tmp = 0.5 * (re * re) return tmp
function code(re, im) t_0 = Float64(Float64(im * im) * -0.5) tmp = 0.0 if (re <= -260.0) tmp = t_0; elseif (re <= 2.7e+23) tmp = Float64(re + 1.0); elseif (re <= 1.55e+143) tmp = Float64(1.0 + t_0); else tmp = Float64(0.5 * Float64(re * re)); end return tmp end
function tmp_2 = code(re, im) t_0 = (im * im) * -0.5; tmp = 0.0; if (re <= -260.0) tmp = t_0; elseif (re <= 2.7e+23) tmp = re + 1.0; elseif (re <= 1.55e+143) tmp = 1.0 + t_0; else tmp = 0.5 * (re * re); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[re, -260.0], t$95$0, If[LessEqual[re, 2.7e+23], N[(re + 1.0), $MachinePrecision], If[LessEqual[re, 1.55e+143], N[(1.0 + t$95$0), $MachinePrecision], N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(im \cdot im\right) \cdot -0.5\\
\mathbf{if}\;re \leq -260:\\
\;\;\;\;t_0\\
\mathbf{elif}\;re \leq 2.7 \cdot 10^{+23}:\\
\;\;\;\;re + 1\\
\mathbf{elif}\;re \leq 1.55 \cdot 10^{+143}:\\
\;\;\;\;1 + t_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot re\right)\\
\end{array}
\end{array}
if re < -260Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 28.8%
unpow228.8%
Simplified28.8%
if -260 < re < 2.6999999999999999e23Initial program 100.0%
Taylor expanded in re around 0 97.6%
+-commutative97.6%
*-rgt-identity97.6%
distribute-lft-out97.6%
Simplified97.6%
Taylor expanded in im around 0 54.4%
+-commutative54.4%
Simplified54.4%
if 2.6999999999999999e23 < re < 1.54999999999999995e143Initial program 100.0%
Taylor expanded in re around 0 3.8%
+-commutative3.8%
*-rgt-identity3.8%
distribute-lft-out3.8%
Simplified3.8%
Taylor expanded in im around 0 18.0%
associate-+r+18.0%
+-commutative18.0%
unpow218.0%
+-commutative18.0%
Simplified18.0%
Taylor expanded in re around 0 17.5%
unpow217.5%
Simplified17.5%
if 1.54999999999999995e143 < re Initial program 100.0%
Taylor expanded in re around 0 88.4%
+-commutative88.4%
+-commutative88.4%
*-rgt-identity88.4%
distribute-lft-out88.4%
*-commutative88.4%
associate-*l*88.4%
distribute-lft-out88.4%
*-commutative88.4%
unpow288.4%
Simplified88.4%
Taylor expanded in im around 0 72.2%
Taylor expanded in re around inf 72.2%
unpow272.2%
Simplified72.2%
Final simplification44.8%
(FPCore (re im) :precision binary64 (if (<= re -380.0) (* (* im im) -0.5) (if (<= re 3.4e+23) (+ re 1.0) (* -0.5 (* im (* re im))))))
double code(double re, double im) {
double tmp;
if (re <= -380.0) {
tmp = (im * im) * -0.5;
} else if (re <= 3.4e+23) {
tmp = re + 1.0;
} else {
tmp = -0.5 * (im * (re * im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-380.0d0)) then
tmp = (im * im) * (-0.5d0)
else if (re <= 3.4d+23) then
tmp = re + 1.0d0
else
tmp = (-0.5d0) * (im * (re * im))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -380.0) {
tmp = (im * im) * -0.5;
} else if (re <= 3.4e+23) {
tmp = re + 1.0;
} else {
tmp = -0.5 * (im * (re * im));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -380.0: tmp = (im * im) * -0.5 elif re <= 3.4e+23: tmp = re + 1.0 else: tmp = -0.5 * (im * (re * im)) return tmp
function code(re, im) tmp = 0.0 if (re <= -380.0) tmp = Float64(Float64(im * im) * -0.5); elseif (re <= 3.4e+23) tmp = Float64(re + 1.0); else tmp = Float64(-0.5 * Float64(im * Float64(re * im))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -380.0) tmp = (im * im) * -0.5; elseif (re <= 3.4e+23) tmp = re + 1.0; else tmp = -0.5 * (im * (re * im)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -380.0], N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[re, 3.4e+23], N[(re + 1.0), $MachinePrecision], N[(-0.5 * N[(im * N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -380:\\
\;\;\;\;\left(im \cdot im\right) \cdot -0.5\\
\mathbf{elif}\;re \leq 3.4 \cdot 10^{+23}:\\
\;\;\;\;re + 1\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(im \cdot \left(re \cdot im\right)\right)\\
\end{array}
\end{array}
if re < -380Initial program 100.0%
Taylor expanded in im around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in im around inf 78.9%
unpow278.9%
associate-*r*78.9%
*-commutative78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in re around 0 28.8%
unpow228.8%
Simplified28.8%
if -380 < re < 3.39999999999999992e23Initial program 100.0%
Taylor expanded in re around 0 97.6%
+-commutative97.6%
*-rgt-identity97.6%
distribute-lft-out97.6%
Simplified97.6%
Taylor expanded in im around 0 54.4%
+-commutative54.4%
Simplified54.4%
if 3.39999999999999992e23 < re Initial program 100.0%
Taylor expanded in im around 0 79.4%
unpow279.4%
Simplified79.4%
Taylor expanded in im around inf 17.5%
unpow217.5%
associate-*r*17.5%
*-commutative17.5%
associate-*r*17.5%
Simplified17.5%
Taylor expanded in re around 0 16.7%
unpow216.7%
unpow216.7%
distribute-lft-in16.7%
distribute-lft1-in16.7%
Simplified16.7%
Taylor expanded in re around inf 16.7%
unpow216.7%
associate-*r*16.6%
Simplified16.6%
Final simplification38.0%
(FPCore (re im) :precision binary64 (if (or (<= re -165.0) (not (<= re 1.3e+24))) (* (* im im) -0.5) (+ re 1.0)))
double code(double re, double im) {
double tmp;
if ((re <= -165.0) || !(re <= 1.3e+24)) {
tmp = (im * im) * -0.5;
} else {
tmp = 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 <= (-165.0d0)) .or. (.not. (re <= 1.3d+24))) then
tmp = (im * im) * (-0.5d0)
else
tmp = re + 1.0d0
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((re <= -165.0) || !(re <= 1.3e+24)) {
tmp = (im * im) * -0.5;
} else {
tmp = re + 1.0;
}
return tmp;
}
def code(re, im): tmp = 0 if (re <= -165.0) or not (re <= 1.3e+24): tmp = (im * im) * -0.5 else: tmp = re + 1.0 return tmp
function code(re, im) tmp = 0.0 if ((re <= -165.0) || !(re <= 1.3e+24)) tmp = Float64(Float64(im * im) * -0.5); else tmp = Float64(re + 1.0); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((re <= -165.0) || ~((re <= 1.3e+24))) tmp = (im * im) * -0.5; else tmp = re + 1.0; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[re, -165.0], N[Not[LessEqual[re, 1.3e+24]], $MachinePrecision]], N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision], N[(re + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -165 \lor \neg \left(re \leq 1.3 \cdot 10^{+24}\right):\\
\;\;\;\;\left(im \cdot im\right) \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;re + 1\\
\end{array}
\end{array}
if re < -165 or 1.2999999999999999e24 < re Initial program 100.0%
Taylor expanded in im around 0 79.1%
unpow279.1%
Simplified79.1%
Taylor expanded in im around inf 50.0%
unpow250.0%
associate-*r*50.0%
*-commutative50.0%
associate-*r*50.0%
Simplified50.0%
Taylor expanded in re around 0 21.7%
unpow221.7%
Simplified21.7%
if -165 < re < 1.2999999999999999e24Initial program 100.0%
Taylor expanded in re around 0 97.6%
+-commutative97.6%
*-rgt-identity97.6%
distribute-lft-out97.6%
Simplified97.6%
Taylor expanded in im around 0 54.4%
+-commutative54.4%
Simplified54.4%
Final simplification37.3%
(FPCore (re im) :precision binary64 (+ re 1.0))
double code(double re, double im) {
return re + 1.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re + 1.0d0
end function
public static double code(double re, double im) {
return re + 1.0;
}
def code(re, im): return re + 1.0
function code(re, im) return Float64(re + 1.0) end
function tmp = code(re, im) tmp = re + 1.0; end
code[re_, im_] := N[(re + 1.0), $MachinePrecision]
\begin{array}{l}
\\
re + 1
\end{array}
Initial program 100.0%
Taylor expanded in re around 0 48.4%
+-commutative48.4%
*-rgt-identity48.4%
distribute-lft-out48.4%
Simplified48.4%
Taylor expanded in im around 0 27.6%
+-commutative27.6%
Simplified27.6%
Final simplification27.6%
(FPCore (re im) :precision binary64 re)
double code(double re, double im) {
return re;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re
end function
public static double code(double re, double im) {
return re;
}
def code(re, im): return re
function code(re, im) return re end
function tmp = code(re, im) tmp = re; end
code[re_, im_] := re
\begin{array}{l}
\\
re
\end{array}
Initial program 100.0%
Taylor expanded in re around 0 48.4%
+-commutative48.4%
*-rgt-identity48.4%
distribute-lft-out48.4%
Simplified48.4%
Taylor expanded in im around 0 28.5%
associate-+r+28.5%
+-commutative28.5%
unpow228.5%
+-commutative28.5%
Simplified28.5%
Taylor expanded in re around inf 6.8%
*-commutative6.8%
unpow26.8%
Simplified6.8%
Taylor expanded in im around 0 3.4%
Final simplification3.4%
(FPCore (re im) :precision binary64 1.0)
double code(double re, double im) {
return 1.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 1.0d0
end function
public static double code(double re, double im) {
return 1.0;
}
def code(re, im): return 1.0
function code(re, im) return 1.0 end
function tmp = code(re, im) tmp = 1.0; end
code[re_, im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
Taylor expanded in re around 0 58.4%
+-commutative58.4%
+-commutative58.4%
*-rgt-identity58.4%
distribute-lft-out58.4%
*-commutative58.4%
associate-*l*58.4%
distribute-lft-out58.4%
*-commutative58.4%
unpow258.4%
Simplified58.4%
Taylor expanded in im around 0 35.7%
Taylor expanded in re around 0 27.2%
Final simplification27.2%
herbie shell --seed 2023222
(FPCore (re im)
:name "math.exp on complex, real part"
:precision binary64
(* (exp re) (cos im)))