
(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 9 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 (or (<= (exp re) 0.2) (not (<= (exp re) 1.0))) (exp re) (cos im)))
double code(double re, double im) {
double tmp;
if ((exp(re) <= 0.2) || !(exp(re) <= 1.0)) {
tmp = exp(re);
} else {
tmp = cos(im);
}
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.2d0) .or. (.not. (exp(re) <= 1.0d0))) then
tmp = exp(re)
else
tmp = cos(im)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((Math.exp(re) <= 0.2) || !(Math.exp(re) <= 1.0)) {
tmp = Math.exp(re);
} else {
tmp = Math.cos(im);
}
return tmp;
}
def code(re, im): tmp = 0 if (math.exp(re) <= 0.2) or not (math.exp(re) <= 1.0): tmp = math.exp(re) else: tmp = math.cos(im) return tmp
function code(re, im) tmp = 0.0 if ((exp(re) <= 0.2) || !(exp(re) <= 1.0)) tmp = exp(re); else tmp = cos(im); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((exp(re) <= 0.2) || ~((exp(re) <= 1.0))) tmp = exp(re); else tmp = cos(im); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[N[Exp[re], $MachinePrecision], 0.2], N[Not[LessEqual[N[Exp[re], $MachinePrecision], 1.0]], $MachinePrecision]], N[Exp[re], $MachinePrecision], N[Cos[im], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \leq 0.2 \lor \neg \left(e^{re} \leq 1\right):\\
\;\;\;\;e^{re}\\
\mathbf{else}:\\
\;\;\;\;\cos im\\
\end{array}
\end{array}
if (exp.f64 re) < 0.20000000000000001 or 1 < (exp.f64 re) Initial program 100.0%
Taylor expanded in im around 0 89.2%
if 0.20000000000000001 < (exp.f64 re) < 1Initial program 100.0%
Taylor expanded in re around 0 99.9%
Final simplification94.1%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* (cos im) (+ re 1.0))))
(if (<= re -5e-5)
(exp re)
(if (<= re 5.6e-11)
t_0
(if (<= re 1.6e+154) (exp re) (/ (* re t_0) re))))))
double code(double re, double im) {
double t_0 = cos(im) * (re + 1.0);
double tmp;
if (re <= -5e-5) {
tmp = exp(re);
} else if (re <= 5.6e-11) {
tmp = t_0;
} else if (re <= 1.6e+154) {
tmp = exp(re);
} else {
tmp = (re * t_0) / 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 = cos(im) * (re + 1.0d0)
if (re <= (-5d-5)) then
tmp = exp(re)
else if (re <= 5.6d-11) then
tmp = t_0
else if (re <= 1.6d+154) then
tmp = exp(re)
else
tmp = (re * t_0) / re
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = Math.cos(im) * (re + 1.0);
double tmp;
if (re <= -5e-5) {
tmp = Math.exp(re);
} else if (re <= 5.6e-11) {
tmp = t_0;
} else if (re <= 1.6e+154) {
tmp = Math.exp(re);
} else {
tmp = (re * t_0) / re;
}
return tmp;
}
def code(re, im): t_0 = math.cos(im) * (re + 1.0) tmp = 0 if re <= -5e-5: tmp = math.exp(re) elif re <= 5.6e-11: tmp = t_0 elif re <= 1.6e+154: tmp = math.exp(re) else: tmp = (re * t_0) / re return tmp
function code(re, im) t_0 = Float64(cos(im) * Float64(re + 1.0)) tmp = 0.0 if (re <= -5e-5) tmp = exp(re); elseif (re <= 5.6e-11) tmp = t_0; elseif (re <= 1.6e+154) tmp = exp(re); else tmp = Float64(Float64(re * t_0) / re); end return tmp end
function tmp_2 = code(re, im) t_0 = cos(im) * (re + 1.0); tmp = 0.0; if (re <= -5e-5) tmp = exp(re); elseif (re <= 5.6e-11) tmp = t_0; elseif (re <= 1.6e+154) tmp = exp(re); else tmp = (re * t_0) / re; end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(N[Cos[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -5e-5], N[Exp[re], $MachinePrecision], If[LessEqual[re, 5.6e-11], t$95$0, If[LessEqual[re, 1.6e+154], N[Exp[re], $MachinePrecision], N[(N[(re * t$95$0), $MachinePrecision] / re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos im \cdot \left(re + 1\right)\\
\mathbf{if}\;re \leq -5 \cdot 10^{-5}:\\
\;\;\;\;e^{re}\\
\mathbf{elif}\;re \leq 5.6 \cdot 10^{-11}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;re \leq 1.6 \cdot 10^{+154}:\\
\;\;\;\;e^{re}\\
\mathbf{else}:\\
\;\;\;\;\frac{re \cdot t\_0}{re}\\
\end{array}
\end{array}
if re < -5.00000000000000024e-5 or 5.6e-11 < re < 1.6e154Initial program 100.0%
Taylor expanded in im around 0 94.3%
if -5.00000000000000024e-5 < re < 5.6e-11Initial program 100.0%
Taylor expanded in re around 0 100.0%
distribute-rgt1-in100.0%
Simplified100.0%
if 1.6e154 < re Initial program 100.0%
Taylor expanded in re around 0 7.2%
distribute-rgt1-in7.2%
Simplified7.2%
Taylor expanded in re around inf 7.2%
Taylor expanded in re around 0 7.2%
distribute-rgt1-in7.2%
associate-/l*7.2%
Simplified7.2%
*-commutative7.2%
associate-*r/7.2%
associate-*l/100.0%
Applied egg-rr100.0%
Final simplification97.7%
(FPCore (re im) :precision binary64 (if (or (<= re -6e-6) (not (<= re 5.6e-11))) (exp re) (* (cos im) (+ re 1.0))))
double code(double re, double im) {
double tmp;
if ((re <= -6e-6) || !(re <= 5.6e-11)) {
tmp = exp(re);
} else {
tmp = cos(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 <= (-6d-6)) .or. (.not. (re <= 5.6d-11))) then
tmp = exp(re)
else
tmp = cos(im) * (re + 1.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((re <= -6e-6) || !(re <= 5.6e-11)) {
tmp = Math.exp(re);
} else {
tmp = Math.cos(im) * (re + 1.0);
}
return tmp;
}
def code(re, im): tmp = 0 if (re <= -6e-6) or not (re <= 5.6e-11): tmp = math.exp(re) else: tmp = math.cos(im) * (re + 1.0) return tmp
function code(re, im) tmp = 0.0 if ((re <= -6e-6) || !(re <= 5.6e-11)) tmp = exp(re); else tmp = Float64(cos(im) * Float64(re + 1.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((re <= -6e-6) || ~((re <= 5.6e-11))) tmp = exp(re); else tmp = cos(im) * (re + 1.0); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[re, -6e-6], N[Not[LessEqual[re, 5.6e-11]], $MachinePrecision]], N[Exp[re], $MachinePrecision], N[(N[Cos[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -6 \cdot 10^{-6} \lor \neg \left(re \leq 5.6 \cdot 10^{-11}\right):\\
\;\;\;\;e^{re}\\
\mathbf{else}:\\
\;\;\;\;\cos im \cdot \left(re + 1\right)\\
\end{array}
\end{array}
if re < -6.0000000000000002e-6 or 5.6e-11 < re Initial program 100.0%
Taylor expanded in im around 0 89.2%
if -6.0000000000000002e-6 < re < 5.6e-11Initial program 100.0%
Taylor expanded in re around 0 100.0%
distribute-rgt1-in100.0%
Simplified100.0%
Final simplification94.1%
(FPCore (re im) :precision binary64 (if (<= re -380.0) (* (* im im) (+ -0.5 (* re -0.5))) (if (<= re 2.9e-11) (cos im) (* (+ 1.0 (* (* im im) -0.5)) (+ re 1.0)))))
double code(double re, double im) {
double tmp;
if (re <= -380.0) {
tmp = (im * im) * (-0.5 + (re * -0.5));
} else if (re <= 2.9e-11) {
tmp = cos(im);
} else {
tmp = (1.0 + ((im * im) * -0.5)) * (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 <= (-380.0d0)) then
tmp = (im * im) * ((-0.5d0) + (re * (-0.5d0)))
else if (re <= 2.9d-11) then
tmp = cos(im)
else
tmp = (1.0d0 + ((im * im) * (-0.5d0))) * (re + 1.0d0)
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 + (re * -0.5));
} else if (re <= 2.9e-11) {
tmp = Math.cos(im);
} else {
tmp = (1.0 + ((im * im) * -0.5)) * (re + 1.0);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -380.0: tmp = (im * im) * (-0.5 + (re * -0.5)) elif re <= 2.9e-11: tmp = math.cos(im) else: tmp = (1.0 + ((im * im) * -0.5)) * (re + 1.0) return tmp
function code(re, im) tmp = 0.0 if (re <= -380.0) tmp = Float64(Float64(im * im) * Float64(-0.5 + Float64(re * -0.5))); elseif (re <= 2.9e-11) tmp = cos(im); else tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * -0.5)) * Float64(re + 1.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -380.0) tmp = (im * im) * (-0.5 + (re * -0.5)); elseif (re <= 2.9e-11) tmp = cos(im); else tmp = (1.0 + ((im * im) * -0.5)) * (re + 1.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -380.0], N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2.9e-11], N[Cos[im], $MachinePrecision], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -380:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(-0.5 + re \cdot -0.5\right)\\
\mathbf{elif}\;re \leq 2.9 \cdot 10^{-11}:\\
\;\;\;\;\cos im\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot -0.5\right) \cdot \left(re + 1\right)\\
\end{array}
\end{array}
if re < -380Initial program 100.0%
Taylor expanded in re around 0 2.3%
distribute-rgt1-in2.3%
Simplified2.3%
Taylor expanded in im around 0 2.0%
associate-+r+2.0%
associate-*r*2.0%
distribute-rgt1-in2.0%
Simplified2.0%
Taylor expanded in im around inf 24.2%
+-commutative24.2%
associate-*l*24.2%
*-commutative24.2%
associate-*r*24.2%
*-commutative24.2%
distribute-rgt1-in24.2%
Simplified24.2%
unpow224.2%
Applied egg-rr24.2%
if -380 < re < 2.9e-11Initial program 100.0%
Taylor expanded in re around 0 99.2%
if 2.9e-11 < re Initial program 100.0%
Taylor expanded in re around 0 7.3%
distribute-rgt1-in7.3%
Simplified7.3%
Taylor expanded in im around 0 17.5%
associate-+r+17.5%
associate-*r*17.5%
distribute-rgt1-in17.5%
Simplified17.5%
unpow213.2%
Applied egg-rr17.5%
Final simplification56.8%
(FPCore (re im) :precision binary64 (if (<= re -4.6e-15) (* (* im im) (+ -0.5 (* re -0.5))) (if (<= re 8.7e+21) (+ re 1.0) (* (+ 1.0 (* (* im im) -0.5)) (+ re 1.0)))))
double code(double re, double im) {
double tmp;
if (re <= -4.6e-15) {
tmp = (im * im) * (-0.5 + (re * -0.5));
} else if (re <= 8.7e+21) {
tmp = re + 1.0;
} else {
tmp = (1.0 + ((im * im) * -0.5)) * (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 <= (-4.6d-15)) then
tmp = (im * im) * ((-0.5d0) + (re * (-0.5d0)))
else if (re <= 8.7d+21) then
tmp = re + 1.0d0
else
tmp = (1.0d0 + ((im * im) * (-0.5d0))) * (re + 1.0d0)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -4.6e-15) {
tmp = (im * im) * (-0.5 + (re * -0.5));
} else if (re <= 8.7e+21) {
tmp = re + 1.0;
} else {
tmp = (1.0 + ((im * im) * -0.5)) * (re + 1.0);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -4.6e-15: tmp = (im * im) * (-0.5 + (re * -0.5)) elif re <= 8.7e+21: tmp = re + 1.0 else: tmp = (1.0 + ((im * im) * -0.5)) * (re + 1.0) return tmp
function code(re, im) tmp = 0.0 if (re <= -4.6e-15) tmp = Float64(Float64(im * im) * Float64(-0.5 + Float64(re * -0.5))); elseif (re <= 8.7e+21) tmp = Float64(re + 1.0); else tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * -0.5)) * Float64(re + 1.0)); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -4.6e-15) tmp = (im * im) * (-0.5 + (re * -0.5)); elseif (re <= 8.7e+21) tmp = re + 1.0; else tmp = (1.0 + ((im * im) * -0.5)) * (re + 1.0); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -4.6e-15], N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 8.7e+21], N[(re + 1.0), $MachinePrecision], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -4.6 \cdot 10^{-15}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(-0.5 + re \cdot -0.5\right)\\
\mathbf{elif}\;re \leq 8.7 \cdot 10^{+21}:\\
\;\;\;\;re + 1\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(im \cdot im\right) \cdot -0.5\right) \cdot \left(re + 1\right)\\
\end{array}
\end{array}
if re < -4.59999999999999981e-15Initial program 100.0%
Taylor expanded in re around 0 3.8%
distribute-rgt1-in3.8%
Simplified3.8%
Taylor expanded in im around 0 2.0%
associate-+r+2.0%
associate-*r*2.0%
distribute-rgt1-in2.0%
Simplified2.0%
Taylor expanded in im around inf 23.6%
+-commutative23.6%
associate-*l*23.6%
*-commutative23.6%
associate-*r*23.6%
*-commutative23.6%
distribute-rgt1-in23.6%
Simplified23.6%
unpow223.6%
Applied egg-rr23.6%
if -4.59999999999999981e-15 < re < 8.7e21Initial program 100.0%
Taylor expanded in re around 0 92.1%
distribute-rgt1-in92.1%
Simplified92.1%
Taylor expanded in im around 0 49.3%
if 8.7e21 < re Initial program 100.0%
Taylor expanded in re around 0 5.7%
distribute-rgt1-in5.7%
Simplified5.7%
Taylor expanded in im around 0 18.1%
associate-+r+18.1%
associate-*r*18.1%
distribute-rgt1-in18.1%
Simplified18.1%
unpow215.5%
Applied egg-rr18.1%
Final simplification35.1%
(FPCore (re im) :precision binary64 (if (or (<= re -4.6e-15) (not (<= re 1.8e+93))) (* (* im im) (+ -0.5 (* re -0.5))) (+ re 1.0)))
double code(double re, double im) {
double tmp;
if ((re <= -4.6e-15) || !(re <= 1.8e+93)) {
tmp = (im * im) * (-0.5 + (re * -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 <= (-4.6d-15)) .or. (.not. (re <= 1.8d+93))) then
tmp = (im * im) * ((-0.5d0) + (re * (-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 <= -4.6e-15) || !(re <= 1.8e+93)) {
tmp = (im * im) * (-0.5 + (re * -0.5));
} else {
tmp = re + 1.0;
}
return tmp;
}
def code(re, im): tmp = 0 if (re <= -4.6e-15) or not (re <= 1.8e+93): tmp = (im * im) * (-0.5 + (re * -0.5)) else: tmp = re + 1.0 return tmp
function code(re, im) tmp = 0.0 if ((re <= -4.6e-15) || !(re <= 1.8e+93)) tmp = Float64(Float64(im * im) * Float64(-0.5 + Float64(re * -0.5))); else tmp = Float64(re + 1.0); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((re <= -4.6e-15) || ~((re <= 1.8e+93))) tmp = (im * im) * (-0.5 + (re * -0.5)); else tmp = re + 1.0; end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[re, -4.6e-15], N[Not[LessEqual[re, 1.8e+93]], $MachinePrecision]], N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -4.6 \cdot 10^{-15} \lor \neg \left(re \leq 1.8 \cdot 10^{+93}\right):\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(-0.5 + re \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;re + 1\\
\end{array}
\end{array}
if re < -4.59999999999999981e-15 or 1.8e93 < re Initial program 100.0%
Taylor expanded in re around 0 4.9%
distribute-rgt1-in4.9%
Simplified4.9%
Taylor expanded in im around 0 10.6%
associate-+r+10.6%
associate-*r*10.6%
distribute-rgt1-in10.6%
Simplified10.6%
Taylor expanded in im around inf 21.4%
+-commutative21.4%
associate-*l*21.4%
*-commutative21.4%
associate-*r*21.4%
*-commutative21.4%
distribute-rgt1-in21.4%
Simplified21.4%
unpow221.4%
Applied egg-rr21.4%
if -4.59999999999999981e-15 < re < 1.8e93Initial program 100.0%
Taylor expanded in re around 0 84.5%
distribute-rgt1-in84.5%
Simplified84.5%
Taylor expanded in im around 0 45.4%
Final simplification34.5%
(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%
distribute-rgt1-in48.4%
Simplified48.4%
Taylor expanded in im around 0 26.3%
Final simplification26.3%
(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 48.4%
distribute-rgt1-in48.4%
Simplified48.4%
Taylor expanded in re around inf 48.3%
Taylor expanded in im around 0 26.2%
Taylor expanded in re around 0 25.9%
Final simplification25.9%
herbie shell --seed 2024095
(FPCore (re im)
:name "math.exp on complex, real part"
:precision binary64
(* (exp re) (cos im)))