
(FPCore (re im) :precision binary64 (* 0.5 (sqrt (* 2.0 (- (sqrt (+ (* re re) (* im im))) re)))))
double code(double re, double im) {
return 0.5 * sqrt((2.0 * (sqrt(((re * re) + (im * im))) - re)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.5d0 * sqrt((2.0d0 * (sqrt(((re * re) + (im * im))) - re)))
end function
public static double code(double re, double im) {
return 0.5 * Math.sqrt((2.0 * (Math.sqrt(((re * re) + (im * im))) - re)));
}
def code(re, im): return 0.5 * math.sqrt((2.0 * (math.sqrt(((re * re) + (im * im))) - re)))
function code(re, im) return Float64(0.5 * sqrt(Float64(2.0 * Float64(sqrt(Float64(Float64(re * re) + Float64(im * im))) - re)))) end
function tmp = code(re, im) tmp = 0.5 * sqrt((2.0 * (sqrt(((re * re) + (im * im))) - re))); end
code[re_, im_] := N[(0.5 * N[Sqrt[N[(2.0 * N[(N[Sqrt[N[(N[(re * re), $MachinePrecision] + N[(im * im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \sqrt{2 \cdot \left(\sqrt{re \cdot re + im \cdot im} - re\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 5 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* 0.5 (sqrt (* 2.0 (- (sqrt (+ (* re re) (* im im))) re)))))
double code(double re, double im) {
return 0.5 * sqrt((2.0 * (sqrt(((re * re) + (im * im))) - re)));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.5d0 * sqrt((2.0d0 * (sqrt(((re * re) + (im * im))) - re)))
end function
public static double code(double re, double im) {
return 0.5 * Math.sqrt((2.0 * (Math.sqrt(((re * re) + (im * im))) - re)));
}
def code(re, im): return 0.5 * math.sqrt((2.0 * (math.sqrt(((re * re) + (im * im))) - re)))
function code(re, im) return Float64(0.5 * sqrt(Float64(2.0 * Float64(sqrt(Float64(Float64(re * re) + Float64(im * im))) - re)))) end
function tmp = code(re, im) tmp = 0.5 * sqrt((2.0 * (sqrt(((re * re) + (im * im))) - re))); end
code[re_, im_] := N[(0.5 * N[Sqrt[N[(2.0 * N[(N[Sqrt[N[(N[(re * re), $MachinePrecision] + N[(im * im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \sqrt{2 \cdot \left(\sqrt{re \cdot re + im \cdot im} - re\right)}
\end{array}
(FPCore (re im) :precision binary64 (if (<= (sqrt (* 2.0 (- (sqrt (+ (* re re) (* im im))) re))) 0.0) (* 0.5 (/ im (sqrt re))) (* 0.5 (sqrt (* 2.0 (- (hypot re im) re))))))
double code(double re, double im) {
double tmp;
if (sqrt((2.0 * (sqrt(((re * re) + (im * im))) - re))) <= 0.0) {
tmp = 0.5 * (im / sqrt(re));
} else {
tmp = 0.5 * sqrt((2.0 * (hypot(re, im) - re)));
}
return tmp;
}
public static double code(double re, double im) {
double tmp;
if (Math.sqrt((2.0 * (Math.sqrt(((re * re) + (im * im))) - re))) <= 0.0) {
tmp = 0.5 * (im / Math.sqrt(re));
} else {
tmp = 0.5 * Math.sqrt((2.0 * (Math.hypot(re, im) - re)));
}
return tmp;
}
def code(re, im): tmp = 0 if math.sqrt((2.0 * (math.sqrt(((re * re) + (im * im))) - re))) <= 0.0: tmp = 0.5 * (im / math.sqrt(re)) else: tmp = 0.5 * math.sqrt((2.0 * (math.hypot(re, im) - re))) return tmp
function code(re, im) tmp = 0.0 if (sqrt(Float64(2.0 * Float64(sqrt(Float64(Float64(re * re) + Float64(im * im))) - re))) <= 0.0) tmp = Float64(0.5 * Float64(im / sqrt(re))); else tmp = Float64(0.5 * sqrt(Float64(2.0 * Float64(hypot(re, im) - re)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (sqrt((2.0 * (sqrt(((re * re) + (im * im))) - re))) <= 0.0) tmp = 0.5 * (im / sqrt(re)); else tmp = 0.5 * sqrt((2.0 * (hypot(re, im) - re))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[Sqrt[N[(2.0 * N[(N[Sqrt[N[(N[(re * re), $MachinePrecision] + N[(im * im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 0.0], N[(0.5 * N[(im / N[Sqrt[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(2.0 * N[(N[Sqrt[re ^ 2 + im ^ 2], $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sqrt{2 \cdot \left(\sqrt{re \cdot re + im \cdot im} - re\right)} \leq 0:\\
\;\;\;\;0.5 \cdot \frac{im}{\sqrt{re}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{2 \cdot \left(\mathsf{hypot}\left(re, im\right) - re\right)}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 2 (-.f64 (sqrt.f64 (+.f64 (*.f64 re re) (*.f64 im im))) re))) < 0.0Initial program 10.8%
Taylor expanded in re around inf 57.1%
unpow257.1%
Simplified57.1%
Taylor expanded in im around 0 99.6%
*-commutative99.6%
rem-exp-log91.1%
unpow1/291.1%
exp-to-pow91.0%
*-commutative91.0%
log-pow91.0%
exp-to-pow91.0%
log-rec91.0%
distribute-lft-neg-out91.0%
exp-neg91.0%
log-rec91.0%
exp-to-pow91.0%
unpow1/291.0%
exp-sum90.6%
sub-neg90.6%
log-div91.3%
rem-exp-log99.7%
Simplified99.7%
if 0.0 < (sqrt.f64 (*.f64 2 (-.f64 (sqrt.f64 (+.f64 (*.f64 re re) (*.f64 im im))) re))) Initial program 43.6%
sqr-neg43.6%
sqr-neg43.6%
hypot-def87.3%
Simplified87.3%
Final simplification89.2%
(FPCore (re im)
:precision binary64
(if (<= re -1.15e+72)
(* 0.5 (sqrt (* 2.0 (* re -2.0))))
(if (or (<= re 1.35e-47) (and (not (<= re 1.6e+92)) (<= re 3.8e+138)))
(* 0.5 (sqrt (* 2.0 (- im re))))
(* 0.5 (/ im (sqrt re))))))
double code(double re, double im) {
double tmp;
if (re <= -1.15e+72) {
tmp = 0.5 * sqrt((2.0 * (re * -2.0)));
} else if ((re <= 1.35e-47) || (!(re <= 1.6e+92) && (re <= 3.8e+138))) {
tmp = 0.5 * sqrt((2.0 * (im - re)));
} else {
tmp = 0.5 * (im / sqrt(re));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-1.15d+72)) then
tmp = 0.5d0 * sqrt((2.0d0 * (re * (-2.0d0))))
else if ((re <= 1.35d-47) .or. (.not. (re <= 1.6d+92)) .and. (re <= 3.8d+138)) then
tmp = 0.5d0 * sqrt((2.0d0 * (im - re)))
else
tmp = 0.5d0 * (im / sqrt(re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -1.15e+72) {
tmp = 0.5 * Math.sqrt((2.0 * (re * -2.0)));
} else if ((re <= 1.35e-47) || (!(re <= 1.6e+92) && (re <= 3.8e+138))) {
tmp = 0.5 * Math.sqrt((2.0 * (im - re)));
} else {
tmp = 0.5 * (im / Math.sqrt(re));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -1.15e+72: tmp = 0.5 * math.sqrt((2.0 * (re * -2.0))) elif (re <= 1.35e-47) or (not (re <= 1.6e+92) and (re <= 3.8e+138)): tmp = 0.5 * math.sqrt((2.0 * (im - re))) else: tmp = 0.5 * (im / math.sqrt(re)) return tmp
function code(re, im) tmp = 0.0 if (re <= -1.15e+72) tmp = Float64(0.5 * sqrt(Float64(2.0 * Float64(re * -2.0)))); elseif ((re <= 1.35e-47) || (!(re <= 1.6e+92) && (re <= 3.8e+138))) tmp = Float64(0.5 * sqrt(Float64(2.0 * Float64(im - re)))); else tmp = Float64(0.5 * Float64(im / sqrt(re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -1.15e+72) tmp = 0.5 * sqrt((2.0 * (re * -2.0))); elseif ((re <= 1.35e-47) || (~((re <= 1.6e+92)) && (re <= 3.8e+138))) tmp = 0.5 * sqrt((2.0 * (im - re))); else tmp = 0.5 * (im / sqrt(re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -1.15e+72], N[(0.5 * N[Sqrt[N[(2.0 * N[(re * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.35e-47], And[N[Not[LessEqual[re, 1.6e+92]], $MachinePrecision], LessEqual[re, 3.8e+138]]], N[(0.5 * N[Sqrt[N[(2.0 * N[(im - re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(im / N[Sqrt[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -1.15 \cdot 10^{+72}:\\
\;\;\;\;0.5 \cdot \sqrt{2 \cdot \left(re \cdot -2\right)}\\
\mathbf{elif}\;re \leq 1.35 \cdot 10^{-47} \lor \neg \left(re \leq 1.6 \cdot 10^{+92}\right) \land re \leq 3.8 \cdot 10^{+138}:\\
\;\;\;\;0.5 \cdot \sqrt{2 \cdot \left(im - re\right)}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{im}{\sqrt{re}}\\
\end{array}
\end{array}
if re < -1.15e72Initial program 30.0%
Taylor expanded in re around -inf 91.0%
*-commutative91.0%
Simplified91.0%
if -1.15e72 < re < 1.3499999999999999e-47 or 1.60000000000000013e92 < re < 3.80000000000000012e138Initial program 55.4%
Taylor expanded in re around 0 77.9%
if 1.3499999999999999e-47 < re < 1.60000000000000013e92 or 3.80000000000000012e138 < re Initial program 11.8%
Taylor expanded in re around inf 50.3%
unpow250.3%
Simplified50.3%
Taylor expanded in im around 0 81.2%
*-commutative81.2%
rem-exp-log75.8%
unpow1/275.8%
exp-to-pow75.0%
*-commutative75.0%
log-pow75.0%
exp-to-pow75.0%
log-rec75.0%
distribute-lft-neg-out75.0%
exp-neg75.0%
log-rec75.0%
exp-to-pow75.0%
unpow1/275.0%
exp-sum74.6%
sub-neg74.6%
log-div75.1%
rem-exp-log81.2%
Simplified81.2%
Final simplification81.0%
(FPCore (re im)
:precision binary64
(let* ((t_0 (* 0.5 (sqrt (* 2.0 (- im re))))))
(if (<= re -7.2e+68)
(* 0.5 (sqrt (* 2.0 (* re -2.0))))
(if (<= re 3.2e-47)
t_0
(if (<= re 2.4e+97)
(* 0.5 (/ im (sqrt re)))
(if (<= re 3.8e+138) t_0 (* 0.5 (* im (sqrt (/ 1.0 re))))))))))
double code(double re, double im) {
double t_0 = 0.5 * sqrt((2.0 * (im - re)));
double tmp;
if (re <= -7.2e+68) {
tmp = 0.5 * sqrt((2.0 * (re * -2.0)));
} else if (re <= 3.2e-47) {
tmp = t_0;
} else if (re <= 2.4e+97) {
tmp = 0.5 * (im / sqrt(re));
} else if (re <= 3.8e+138) {
tmp = t_0;
} else {
tmp = 0.5 * (im * sqrt((1.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 = 0.5d0 * sqrt((2.0d0 * (im - re)))
if (re <= (-7.2d+68)) then
tmp = 0.5d0 * sqrt((2.0d0 * (re * (-2.0d0))))
else if (re <= 3.2d-47) then
tmp = t_0
else if (re <= 2.4d+97) then
tmp = 0.5d0 * (im / sqrt(re))
else if (re <= 3.8d+138) then
tmp = t_0
else
tmp = 0.5d0 * (im * sqrt((1.0d0 / re)))
end if
code = tmp
end function
public static double code(double re, double im) {
double t_0 = 0.5 * Math.sqrt((2.0 * (im - re)));
double tmp;
if (re <= -7.2e+68) {
tmp = 0.5 * Math.sqrt((2.0 * (re * -2.0)));
} else if (re <= 3.2e-47) {
tmp = t_0;
} else if (re <= 2.4e+97) {
tmp = 0.5 * (im / Math.sqrt(re));
} else if (re <= 3.8e+138) {
tmp = t_0;
} else {
tmp = 0.5 * (im * Math.sqrt((1.0 / re)));
}
return tmp;
}
def code(re, im): t_0 = 0.5 * math.sqrt((2.0 * (im - re))) tmp = 0 if re <= -7.2e+68: tmp = 0.5 * math.sqrt((2.0 * (re * -2.0))) elif re <= 3.2e-47: tmp = t_0 elif re <= 2.4e+97: tmp = 0.5 * (im / math.sqrt(re)) elif re <= 3.8e+138: tmp = t_0 else: tmp = 0.5 * (im * math.sqrt((1.0 / re))) return tmp
function code(re, im) t_0 = Float64(0.5 * sqrt(Float64(2.0 * Float64(im - re)))) tmp = 0.0 if (re <= -7.2e+68) tmp = Float64(0.5 * sqrt(Float64(2.0 * Float64(re * -2.0)))); elseif (re <= 3.2e-47) tmp = t_0; elseif (re <= 2.4e+97) tmp = Float64(0.5 * Float64(im / sqrt(re))); elseif (re <= 3.8e+138) tmp = t_0; else tmp = Float64(0.5 * Float64(im * sqrt(Float64(1.0 / re)))); end return tmp end
function tmp_2 = code(re, im) t_0 = 0.5 * sqrt((2.0 * (im - re))); tmp = 0.0; if (re <= -7.2e+68) tmp = 0.5 * sqrt((2.0 * (re * -2.0))); elseif (re <= 3.2e-47) tmp = t_0; elseif (re <= 2.4e+97) tmp = 0.5 * (im / sqrt(re)); elseif (re <= 3.8e+138) tmp = t_0; else tmp = 0.5 * (im * sqrt((1.0 / re))); end tmp_2 = tmp; end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[Sqrt[N[(2.0 * N[(im - re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -7.2e+68], N[(0.5 * N[Sqrt[N[(2.0 * N[(re * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 3.2e-47], t$95$0, If[LessEqual[re, 2.4e+97], N[(0.5 * N[(im / N[Sqrt[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 3.8e+138], t$95$0, N[(0.5 * N[(im * N[Sqrt[N[(1.0 / re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \sqrt{2 \cdot \left(im - re\right)}\\
\mathbf{if}\;re \leq -7.2 \cdot 10^{+68}:\\
\;\;\;\;0.5 \cdot \sqrt{2 \cdot \left(re \cdot -2\right)}\\
\mathbf{elif}\;re \leq 3.2 \cdot 10^{-47}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;re \leq 2.4 \cdot 10^{+97}:\\
\;\;\;\;0.5 \cdot \frac{im}{\sqrt{re}}\\
\mathbf{elif}\;re \leq 3.8 \cdot 10^{+138}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(im \cdot \sqrt{\frac{1}{re}}\right)\\
\end{array}
\end{array}
if re < -7.1999999999999998e68Initial program 30.0%
Taylor expanded in re around -inf 91.0%
*-commutative91.0%
Simplified91.0%
if -7.1999999999999998e68 < re < 3.1999999999999999e-47 or 2.4e97 < re < 3.80000000000000012e138Initial program 55.4%
Taylor expanded in re around 0 77.9%
if 3.1999999999999999e-47 < re < 2.4e97Initial program 21.9%
Taylor expanded in re around inf 43.7%
unpow243.7%
Simplified43.7%
Taylor expanded in im around 0 71.2%
*-commutative71.2%
rem-exp-log65.3%
unpow1/265.3%
exp-to-pow65.3%
*-commutative65.3%
log-pow65.3%
exp-to-pow65.3%
log-rec65.3%
distribute-lft-neg-out65.3%
exp-neg65.3%
log-rec65.3%
exp-to-pow65.3%
unpow1/265.3%
exp-sum65.1%
sub-neg65.1%
log-div65.7%
rem-exp-log71.3%
Simplified71.3%
if 3.80000000000000012e138 < re Initial program 2.5%
*-commutative2.5%
hypot-udef31.6%
*-commutative31.6%
add-cbrt-cube24.2%
add-sqr-sqrt24.3%
pow124.3%
pow1/224.3%
pow-prod-up24.3%
metadata-eval24.3%
Applied egg-rr24.3%
Taylor expanded in im around 0 90.4%
Final simplification81.0%
(FPCore (re im) :precision binary64 (if (<= re -5e-310) (* 0.5 (sqrt (* 2.0 (* re -2.0)))) (* 0.5 (/ im (sqrt re)))))
double code(double re, double im) {
double tmp;
if (re <= -5e-310) {
tmp = 0.5 * sqrt((2.0 * (re * -2.0)));
} else {
tmp = 0.5 * (im / sqrt(re));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-5d-310)) then
tmp = 0.5d0 * sqrt((2.0d0 * (re * (-2.0d0))))
else
tmp = 0.5d0 * (im / sqrt(re))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -5e-310) {
tmp = 0.5 * Math.sqrt((2.0 * (re * -2.0)));
} else {
tmp = 0.5 * (im / Math.sqrt(re));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -5e-310: tmp = 0.5 * math.sqrt((2.0 * (re * -2.0))) else: tmp = 0.5 * (im / math.sqrt(re)) return tmp
function code(re, im) tmp = 0.0 if (re <= -5e-310) tmp = Float64(0.5 * sqrt(Float64(2.0 * Float64(re * -2.0)))); else tmp = Float64(0.5 * Float64(im / sqrt(re))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -5e-310) tmp = 0.5 * sqrt((2.0 * (re * -2.0))); else tmp = 0.5 * (im / sqrt(re)); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -5e-310], N[(0.5 * N[Sqrt[N[(2.0 * N[(re * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(im / N[Sqrt[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -5 \cdot 10^{-310}:\\
\;\;\;\;0.5 \cdot \sqrt{2 \cdot \left(re \cdot -2\right)}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{im}{\sqrt{re}}\\
\end{array}
\end{array}
if re < -4.999999999999985e-310Initial program 53.4%
Taylor expanded in re around -inf 52.8%
*-commutative52.8%
Simplified52.8%
if -4.999999999999985e-310 < re Initial program 26.8%
Taylor expanded in re around inf 32.1%
unpow232.1%
Simplified32.1%
Taylor expanded in im around 0 55.4%
*-commutative55.4%
rem-exp-log51.6%
unpow1/251.6%
exp-to-pow51.2%
*-commutative51.2%
log-pow51.2%
exp-to-pow51.2%
log-rec51.2%
distribute-lft-neg-out51.2%
exp-neg51.2%
log-rec51.2%
exp-to-pow51.2%
unpow1/251.2%
exp-sum51.0%
sub-neg51.0%
log-div51.3%
rem-exp-log55.4%
Simplified55.4%
Final simplification54.3%
(FPCore (re im) :precision binary64 (* 0.5 (/ im (sqrt re))))
double code(double re, double im) {
return 0.5 * (im / sqrt(re));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 0.5d0 * (im / sqrt(re))
end function
public static double code(double re, double im) {
return 0.5 * (im / Math.sqrt(re));
}
def code(re, im): return 0.5 * (im / math.sqrt(re))
function code(re, im) return Float64(0.5 * Float64(im / sqrt(re))) end
function tmp = code(re, im) tmp = 0.5 * (im / sqrt(re)); end
code[re_, im_] := N[(0.5 * N[(im / N[Sqrt[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \frac{im}{\sqrt{re}}
\end{array}
Initial program 38.6%
Taylor expanded in re around inf 18.5%
unpow218.5%
Simplified18.5%
Taylor expanded in im around 0 30.9%
*-commutative30.9%
rem-exp-log28.8%
unpow1/228.8%
exp-to-pow28.6%
*-commutative28.6%
log-pow28.6%
exp-to-pow28.6%
log-rec28.6%
distribute-lft-neg-out28.6%
exp-neg28.6%
log-rec28.6%
exp-to-pow28.6%
unpow1/228.6%
exp-sum28.5%
sub-neg28.5%
log-div28.7%
rem-exp-log31.0%
Simplified31.0%
Final simplification31.0%
herbie shell --seed 2023274
(FPCore (re im)
:name "math.sqrt on complex, imaginary part, im greater than 0 branch"
:precision binary64
:pre (> im 0.0)
(* 0.5 (sqrt (* 2.0 (- (sqrt (+ (* re re) (* im im))) re)))))