(FPCore im_sqr (re im) :precision binary64 (+ (* re im) (* im re)))
(FPCore im_sqr (re im) :precision binary64 (* (* re 2.0) im))
double im_sqr(double re, double im) {
return (re * im) + (im * re);
}
double im_sqr(double re, double im) {
return (re * 2.0) * im;
}
real(8) function im_sqr(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
im_sqr = (re * im) + (im * re)
end function
real(8) function im_sqr(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
im_sqr = (re * 2.0d0) * im
end function
public static double im_sqr(double re, double im) {
return (re * im) + (im * re);
}
public static double im_sqr(double re, double im) {
return (re * 2.0) * im;
}
def im_sqr(re, im): return (re * im) + (im * re)
def im_sqr(re, im): return (re * 2.0) * im
function im_sqr(re, im) return Float64(Float64(re * im) + Float64(im * re)) end
function im_sqr(re, im) return Float64(Float64(re * 2.0) * im) end
function tmp = im_sqr(re, im) tmp = (re * im) + (im * re); end
function tmp = im_sqr(re, im) tmp = (re * 2.0) * im; end
im$95$sqr[re_, im_] := N[(N[(re * im), $MachinePrecision] + N[(im * re), $MachinePrecision]), $MachinePrecision]
im$95$sqr[re_, im_] := N[(N[(re * 2.0), $MachinePrecision] * im), $MachinePrecision]
re \cdot im + im \cdot re
\left(re \cdot 2\right) \cdot im
Results
Initial program 0.0
Simplified0.0
[Start]0.0 | \[ re \cdot im + im \cdot re
\] |
|---|---|
rational.json-simplify-2 [<=]0.0 | \[ re \cdot im + \color{blue}{re \cdot im}
\] |
Applied egg-rr0.0
Final simplification0.0
herbie shell --seed 2023053
(FPCore im_sqr (re im)
:name "math.square on complex, imaginary part"
:precision binary64
(+ (* re im) (* im re)))