
(FPCore (x y) :precision binary64 (+ (- (* x (- y 1.0)) (* y 0.5)) 0.918938533204673))
double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x * (y - 1.0d0)) - (y * 0.5d0)) + 0.918938533204673d0
end function
public static double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
def code(x, y): return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673
function code(x, y) return Float64(Float64(Float64(x * Float64(y - 1.0)) - Float64(y * 0.5)) + 0.918938533204673) end
function tmp = code(x, y) tmp = ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673; end
code[x_, y_] := N[(N[(N[(x * N[(y - 1.0), $MachinePrecision]), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision] + 0.918938533204673), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ (- (* x (- y 1.0)) (* y 0.5)) 0.918938533204673))
double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x * (y - 1.0d0)) - (y * 0.5d0)) + 0.918938533204673d0
end function
public static double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
def code(x, y): return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673
function code(x, y) return Float64(Float64(Float64(x * Float64(y - 1.0)) - Float64(y * 0.5)) + 0.918938533204673) end
function tmp = code(x, y) tmp = ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673; end
code[x_, y_] := N[(N[(N[(x * N[(y - 1.0), $MachinePrecision]), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision] + 0.918938533204673), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673
\end{array}
(FPCore (x y) :precision binary64 (+ (fma x (+ y -1.0) (* y -0.5)) 0.918938533204673))
double code(double x, double y) {
return fma(x, (y + -1.0), (y * -0.5)) + 0.918938533204673;
}
function code(x, y) return Float64(fma(x, Float64(y + -1.0), Float64(y * -0.5)) + 0.918938533204673) end
code[x_, y_] := N[(N[(x * N[(y + -1.0), $MachinePrecision] + N[(y * -0.5), $MachinePrecision]), $MachinePrecision] + 0.918938533204673), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y + -1, y \cdot -0.5\right) + 0.918938533204673
\end{array}
Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(if (<= y -4.6e+149)
(* y -0.5)
(if (<= y -2.9e+41)
(* x y)
(if (<= y -1250000.0)
(* y -0.5)
(if (<= y -6.2e-191)
(- x)
(if (<= y -2.3e-230)
0.918938533204673
(if (<= y -1e-286)
(- x)
(if (<= y 5.9e-282)
0.918938533204673
(if (<= y 1.0) (- x) (* x y))))))))))
double code(double x, double y) {
double tmp;
if (y <= -4.6e+149) {
tmp = y * -0.5;
} else if (y <= -2.9e+41) {
tmp = x * y;
} else if (y <= -1250000.0) {
tmp = y * -0.5;
} else if (y <= -6.2e-191) {
tmp = -x;
} else if (y <= -2.3e-230) {
tmp = 0.918938533204673;
} else if (y <= -1e-286) {
tmp = -x;
} else if (y <= 5.9e-282) {
tmp = 0.918938533204673;
} else if (y <= 1.0) {
tmp = -x;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-4.6d+149)) then
tmp = y * (-0.5d0)
else if (y <= (-2.9d+41)) then
tmp = x * y
else if (y <= (-1250000.0d0)) then
tmp = y * (-0.5d0)
else if (y <= (-6.2d-191)) then
tmp = -x
else if (y <= (-2.3d-230)) then
tmp = 0.918938533204673d0
else if (y <= (-1d-286)) then
tmp = -x
else if (y <= 5.9d-282) then
tmp = 0.918938533204673d0
else if (y <= 1.0d0) then
tmp = -x
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -4.6e+149) {
tmp = y * -0.5;
} else if (y <= -2.9e+41) {
tmp = x * y;
} else if (y <= -1250000.0) {
tmp = y * -0.5;
} else if (y <= -6.2e-191) {
tmp = -x;
} else if (y <= -2.3e-230) {
tmp = 0.918938533204673;
} else if (y <= -1e-286) {
tmp = -x;
} else if (y <= 5.9e-282) {
tmp = 0.918938533204673;
} else if (y <= 1.0) {
tmp = -x;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -4.6e+149: tmp = y * -0.5 elif y <= -2.9e+41: tmp = x * y elif y <= -1250000.0: tmp = y * -0.5 elif y <= -6.2e-191: tmp = -x elif y <= -2.3e-230: tmp = 0.918938533204673 elif y <= -1e-286: tmp = -x elif y <= 5.9e-282: tmp = 0.918938533204673 elif y <= 1.0: tmp = -x else: tmp = x * y return tmp
function code(x, y) tmp = 0.0 if (y <= -4.6e+149) tmp = Float64(y * -0.5); elseif (y <= -2.9e+41) tmp = Float64(x * y); elseif (y <= -1250000.0) tmp = Float64(y * -0.5); elseif (y <= -6.2e-191) tmp = Float64(-x); elseif (y <= -2.3e-230) tmp = 0.918938533204673; elseif (y <= -1e-286) tmp = Float64(-x); elseif (y <= 5.9e-282) tmp = 0.918938533204673; elseif (y <= 1.0) tmp = Float64(-x); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -4.6e+149) tmp = y * -0.5; elseif (y <= -2.9e+41) tmp = x * y; elseif (y <= -1250000.0) tmp = y * -0.5; elseif (y <= -6.2e-191) tmp = -x; elseif (y <= -2.3e-230) tmp = 0.918938533204673; elseif (y <= -1e-286) tmp = -x; elseif (y <= 5.9e-282) tmp = 0.918938533204673; elseif (y <= 1.0) tmp = -x; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -4.6e+149], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -2.9e+41], N[(x * y), $MachinePrecision], If[LessEqual[y, -1250000.0], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -6.2e-191], (-x), If[LessEqual[y, -2.3e-230], 0.918938533204673, If[LessEqual[y, -1e-286], (-x), If[LessEqual[y, 5.9e-282], 0.918938533204673, If[LessEqual[y, 1.0], (-x), N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+149}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{+41}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -1250000:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-191}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-230}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-286}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 5.9 \cdot 10^{-282}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -4.5999999999999997e149 or -2.89999999999999988e41 < y < -1.25e6Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around 0 60.0%
*-commutative60.0%
Simplified60.0%
if -4.5999999999999997e149 < y < -2.89999999999999988e41 or 1 < y Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 62.9%
Taylor expanded in y around inf 62.2%
if -1.25e6 < y < -6.2000000000000004e-191 or -2.2999999999999998e-230 < y < -1.00000000000000005e-286 or 5.8999999999999997e-282 < y < 1Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 61.9%
Taylor expanded in y around 0 59.6%
neg-mul-159.6%
Simplified59.6%
if -6.2000000000000004e-191 < y < -2.2999999999999998e-230 or -1.00000000000000005e-286 < y < 5.8999999999999997e-282Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
*-commutative100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
*-commutative100.0%
prod-diff100.0%
*-commutative100.0%
fma-neg100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
metadata-eval100.0%
*-commutative100.0%
fma-udef100.0%
metadata-eval100.0%
*-commutative100.0%
add-sqr-sqrt36.4%
sqrt-unprod100.0%
swap-sqr100.0%
metadata-eval100.0%
metadata-eval100.0%
swap-sqr100.0%
sqrt-unprod63.6%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
fma-udef100.0%
distribute-rgt-out100.0%
neg-mul-1100.0%
+-commutative100.0%
*-commutative100.0%
associate-+r+100.0%
*-commutative100.0%
distribute-lft-in100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
fma-udef100.0%
*-commutative100.0%
distribute-lft-out100.0%
metadata-eval100.0%
*-commutative100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in y around -inf 78.0%
mul-1-neg78.0%
*-commutative78.0%
distribute-rgt-neg-in78.0%
sub-neg78.0%
metadata-eval78.0%
mul-1-neg78.0%
unsub-neg78.0%
Simplified78.0%
Taylor expanded in y around 0 78.0%
Final simplification62.1%
(FPCore (x y)
:precision binary64
(if (<= x -640000000.0)
(- x)
(if (<= x -3.7e-65)
(* y -0.5)
(if (<= x -4.7e-292)
0.918938533204673
(if (<= x 3.15e-273)
(* y -0.5)
(if (<= x 1.8e-129)
0.918938533204673
(if (<= x 0.9) (* y -0.5) (- x))))))))
double code(double x, double y) {
double tmp;
if (x <= -640000000.0) {
tmp = -x;
} else if (x <= -3.7e-65) {
tmp = y * -0.5;
} else if (x <= -4.7e-292) {
tmp = 0.918938533204673;
} else if (x <= 3.15e-273) {
tmp = y * -0.5;
} else if (x <= 1.8e-129) {
tmp = 0.918938533204673;
} else if (x <= 0.9) {
tmp = y * -0.5;
} else {
tmp = -x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-640000000.0d0)) then
tmp = -x
else if (x <= (-3.7d-65)) then
tmp = y * (-0.5d0)
else if (x <= (-4.7d-292)) then
tmp = 0.918938533204673d0
else if (x <= 3.15d-273) then
tmp = y * (-0.5d0)
else if (x <= 1.8d-129) then
tmp = 0.918938533204673d0
else if (x <= 0.9d0) then
tmp = y * (-0.5d0)
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -640000000.0) {
tmp = -x;
} else if (x <= -3.7e-65) {
tmp = y * -0.5;
} else if (x <= -4.7e-292) {
tmp = 0.918938533204673;
} else if (x <= 3.15e-273) {
tmp = y * -0.5;
} else if (x <= 1.8e-129) {
tmp = 0.918938533204673;
} else if (x <= 0.9) {
tmp = y * -0.5;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -640000000.0: tmp = -x elif x <= -3.7e-65: tmp = y * -0.5 elif x <= -4.7e-292: tmp = 0.918938533204673 elif x <= 3.15e-273: tmp = y * -0.5 elif x <= 1.8e-129: tmp = 0.918938533204673 elif x <= 0.9: tmp = y * -0.5 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if (x <= -640000000.0) tmp = Float64(-x); elseif (x <= -3.7e-65) tmp = Float64(y * -0.5); elseif (x <= -4.7e-292) tmp = 0.918938533204673; elseif (x <= 3.15e-273) tmp = Float64(y * -0.5); elseif (x <= 1.8e-129) tmp = 0.918938533204673; elseif (x <= 0.9) tmp = Float64(y * -0.5); else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -640000000.0) tmp = -x; elseif (x <= -3.7e-65) tmp = y * -0.5; elseif (x <= -4.7e-292) tmp = 0.918938533204673; elseif (x <= 3.15e-273) tmp = y * -0.5; elseif (x <= 1.8e-129) tmp = 0.918938533204673; elseif (x <= 0.9) tmp = y * -0.5; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -640000000.0], (-x), If[LessEqual[x, -3.7e-65], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, -4.7e-292], 0.918938533204673, If[LessEqual[x, 3.15e-273], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, 1.8e-129], 0.918938533204673, If[LessEqual[x, 0.9], N[(y * -0.5), $MachinePrecision], (-x)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -640000000:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-65}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq -4.7 \cdot 10^{-292}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;x \leq 3.15 \cdot 10^{-273}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-129}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;x \leq 0.9:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < -6.4e8 or 0.900000000000000022 < x Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 99.5%
Taylor expanded in y around 0 51.5%
neg-mul-151.5%
Simplified51.5%
if -6.4e8 < x < -3.7e-65 or -4.70000000000000002e-292 < x < 3.14999999999999989e-273 or 1.8e-129 < x < 0.900000000000000022Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 98.6%
Taylor expanded in y around inf 72.0%
Taylor expanded in x around 0 63.9%
*-commutative63.9%
Simplified63.9%
if -3.7e-65 < x < -4.70000000000000002e-292 or 3.14999999999999989e-273 < x < 1.8e-129Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
*-commutative100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
*-commutative100.0%
prod-diff100.0%
*-commutative100.0%
fma-neg100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
metadata-eval100.0%
*-commutative100.0%
fma-udef100.0%
metadata-eval100.0%
*-commutative100.0%
add-sqr-sqrt47.8%
sqrt-unprod76.9%
swap-sqr76.9%
metadata-eval76.9%
metadata-eval76.9%
swap-sqr76.9%
sqrt-unprod34.7%
add-sqr-sqrt69.6%
Applied egg-rr69.6%
fma-udef69.6%
distribute-rgt-out69.6%
neg-mul-169.6%
+-commutative69.6%
*-commutative69.6%
associate-+r+69.6%
*-commutative69.6%
distribute-lft-in69.6%
+-commutative69.6%
sub-neg69.6%
metadata-eval69.6%
sub-neg69.6%
sub-neg69.6%
metadata-eval69.6%
+-commutative69.6%
fma-udef69.6%
*-commutative69.6%
distribute-lft-out69.6%
metadata-eval69.6%
*-commutative69.6%
neg-mul-169.6%
Simplified69.6%
Taylor expanded in y around -inf 69.6%
mul-1-neg69.6%
*-commutative69.6%
distribute-rgt-neg-in69.6%
sub-neg69.6%
metadata-eval69.6%
mul-1-neg69.6%
unsub-neg69.6%
Simplified69.6%
Taylor expanded in y around 0 64.6%
Final simplification57.5%
(FPCore (x y)
:precision binary64
(if (<= x -640000000.0)
(+ 0.918938533204673 (- (* x y) x))
(if (<= x 0.55)
(+ (* x y) (- 0.918938533204673 (* y 0.5)))
(+ 0.918938533204673 (* x (+ y -1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -640000000.0) {
tmp = 0.918938533204673 + ((x * y) - x);
} else if (x <= 0.55) {
tmp = (x * y) + (0.918938533204673 - (y * 0.5));
} else {
tmp = 0.918938533204673 + (x * (y + -1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-640000000.0d0)) then
tmp = 0.918938533204673d0 + ((x * y) - x)
else if (x <= 0.55d0) then
tmp = (x * y) + (0.918938533204673d0 - (y * 0.5d0))
else
tmp = 0.918938533204673d0 + (x * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -640000000.0) {
tmp = 0.918938533204673 + ((x * y) - x);
} else if (x <= 0.55) {
tmp = (x * y) + (0.918938533204673 - (y * 0.5));
} else {
tmp = 0.918938533204673 + (x * (y + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -640000000.0: tmp = 0.918938533204673 + ((x * y) - x) elif x <= 0.55: tmp = (x * y) + (0.918938533204673 - (y * 0.5)) else: tmp = 0.918938533204673 + (x * (y + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -640000000.0) tmp = Float64(0.918938533204673 + Float64(Float64(x * y) - x)); elseif (x <= 0.55) tmp = Float64(Float64(x * y) + Float64(0.918938533204673 - Float64(y * 0.5))); else tmp = Float64(0.918938533204673 + Float64(x * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -640000000.0) tmp = 0.918938533204673 + ((x * y) - x); elseif (x <= 0.55) tmp = (x * y) + (0.918938533204673 - (y * 0.5)); else tmp = 0.918938533204673 + (x * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -640000000.0], N[(0.918938533204673 + N[(N[(x * y), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.55], N[(N[(x * y), $MachinePrecision] + N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 + N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -640000000:\\
\;\;\;\;0.918938533204673 + \left(x \cdot y - x\right)\\
\mathbf{elif}\;x \leq 0.55:\\
\;\;\;\;x \cdot y + \left(0.918938533204673 - y \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 + x \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < -6.4e8Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
sub-neg100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
neg-mul-1100.0%
fma-neg100.0%
Simplified100.0%
if -6.4e8 < x < 0.55000000000000004Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.4%
if 0.55000000000000004 < x Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 99.7%
Final simplification99.6%
(FPCore (x y)
:precision binary64
(if (<= y -2.45e+144)
(* y -0.5)
(if (<= y -5e+46)
(* x y)
(if (<= y -1150000.0)
(* y -0.5)
(if (<= y 1.0) (- 0.918938533204673 x) (* x y))))))
double code(double x, double y) {
double tmp;
if (y <= -2.45e+144) {
tmp = y * -0.5;
} else if (y <= -5e+46) {
tmp = x * y;
} else if (y <= -1150000.0) {
tmp = y * -0.5;
} else if (y <= 1.0) {
tmp = 0.918938533204673 - x;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-2.45d+144)) then
tmp = y * (-0.5d0)
else if (y <= (-5d+46)) then
tmp = x * y
else if (y <= (-1150000.0d0)) then
tmp = y * (-0.5d0)
else if (y <= 1.0d0) then
tmp = 0.918938533204673d0 - x
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.45e+144) {
tmp = y * -0.5;
} else if (y <= -5e+46) {
tmp = x * y;
} else if (y <= -1150000.0) {
tmp = y * -0.5;
} else if (y <= 1.0) {
tmp = 0.918938533204673 - x;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.45e+144: tmp = y * -0.5 elif y <= -5e+46: tmp = x * y elif y <= -1150000.0: tmp = y * -0.5 elif y <= 1.0: tmp = 0.918938533204673 - x else: tmp = x * y return tmp
function code(x, y) tmp = 0.0 if (y <= -2.45e+144) tmp = Float64(y * -0.5); elseif (y <= -5e+46) tmp = Float64(x * y); elseif (y <= -1150000.0) tmp = Float64(y * -0.5); elseif (y <= 1.0) tmp = Float64(0.918938533204673 - x); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.45e+144) tmp = y * -0.5; elseif (y <= -5e+46) tmp = x * y; elseif (y <= -1150000.0) tmp = y * -0.5; elseif (y <= 1.0) tmp = 0.918938533204673 - x; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.45e+144], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -5e+46], N[(x * y), $MachinePrecision], If[LessEqual[y, -1150000.0], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 1.0], N[(0.918938533204673 - x), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.45 \cdot 10^{+144}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -5 \cdot 10^{+46}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -1150000:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -2.45e144 or -5.0000000000000002e46 < y < -1.15e6Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around 0 60.0%
*-commutative60.0%
Simplified60.0%
if -2.45e144 < y < -5.0000000000000002e46 or 1 < y Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 62.9%
Taylor expanded in y around inf 62.2%
if -1.15e6 < y < 1Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 96.6%
neg-mul-196.6%
sub-neg96.6%
Simplified96.6%
Final simplification79.6%
(FPCore (x y) :precision binary64 (if (or (<= x -1450000000.0) (not (<= x 0.85))) (+ 0.918938533204673 (* x (+ y -1.0))) (+ 0.918938533204673 (* y (- x 0.5)))))
double code(double x, double y) {
double tmp;
if ((x <= -1450000000.0) || !(x <= 0.85)) {
tmp = 0.918938533204673 + (x * (y + -1.0));
} else {
tmp = 0.918938533204673 + (y * (x - 0.5));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-1450000000.0d0)) .or. (.not. (x <= 0.85d0))) then
tmp = 0.918938533204673d0 + (x * (y + (-1.0d0)))
else
tmp = 0.918938533204673d0 + (y * (x - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -1450000000.0) || !(x <= 0.85)) {
tmp = 0.918938533204673 + (x * (y + -1.0));
} else {
tmp = 0.918938533204673 + (y * (x - 0.5));
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -1450000000.0) or not (x <= 0.85): tmp = 0.918938533204673 + (x * (y + -1.0)) else: tmp = 0.918938533204673 + (y * (x - 0.5)) return tmp
function code(x, y) tmp = 0.0 if ((x <= -1450000000.0) || !(x <= 0.85)) tmp = Float64(0.918938533204673 + Float64(x * Float64(y + -1.0))); else tmp = Float64(0.918938533204673 + Float64(y * Float64(x - 0.5))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -1450000000.0) || ~((x <= 0.85))) tmp = 0.918938533204673 + (x * (y + -1.0)); else tmp = 0.918938533204673 + (y * (x - 0.5)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -1450000000.0], N[Not[LessEqual[x, 0.85]], $MachinePrecision]], N[(0.918938533204673 + N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 + N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1450000000 \lor \neg \left(x \leq 0.85\right):\\
\;\;\;\;0.918938533204673 + x \cdot \left(y + -1\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 + y \cdot \left(x - 0.5\right)\\
\end{array}
\end{array}
if x < -1.45e9 or 0.849999999999999978 < x Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 99.8%
if -1.45e9 < x < 0.849999999999999978Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.4%
Final simplification99.6%
(FPCore (x y)
:precision binary64
(if (<= x -16500000000.0)
(- (* x y) x)
(if (<= x 180000.0)
(+ 0.918938533204673 (* y (- x 0.5)))
(* x (+ y -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -16500000000.0) {
tmp = (x * y) - x;
} else if (x <= 180000.0) {
tmp = 0.918938533204673 + (y * (x - 0.5));
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-16500000000.0d0)) then
tmp = (x * y) - x
else if (x <= 180000.0d0) then
tmp = 0.918938533204673d0 + (y * (x - 0.5d0))
else
tmp = x * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -16500000000.0) {
tmp = (x * y) - x;
} else if (x <= 180000.0) {
tmp = 0.918938533204673 + (y * (x - 0.5));
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -16500000000.0: tmp = (x * y) - x elif x <= 180000.0: tmp = 0.918938533204673 + (y * (x - 0.5)) else: tmp = x * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -16500000000.0) tmp = Float64(Float64(x * y) - x); elseif (x <= 180000.0) tmp = Float64(0.918938533204673 + Float64(y * Float64(x - 0.5))); else tmp = Float64(x * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -16500000000.0) tmp = (x * y) - x; elseif (x <= 180000.0) tmp = 0.918938533204673 + (y * (x - 0.5)); else tmp = x * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -16500000000.0], N[(N[(x * y), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 180000.0], N[(0.918938533204673 + N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -16500000000:\\
\;\;\;\;x \cdot y - x\\
\mathbf{elif}\;x \leq 180000:\\
\;\;\;\;0.918938533204673 + y \cdot \left(x - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < -1.65e10Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 99.9%
Taylor expanded in y around 0 99.9%
neg-mul-199.9%
unsub-neg99.9%
*-commutative99.9%
Simplified99.9%
if -1.65e10 < x < 1.8e5Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.4%
if 1.8e5 < x Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 99.2%
Final simplification99.5%
(FPCore (x y)
:precision binary64
(if (<= x -640000000.0)
(+ 0.918938533204673 (- (* x y) x))
(if (<= x 0.00084)
(+ 0.918938533204673 (* y (- x 0.5)))
(+ 0.918938533204673 (* x (+ y -1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -640000000.0) {
tmp = 0.918938533204673 + ((x * y) - x);
} else if (x <= 0.00084) {
tmp = 0.918938533204673 + (y * (x - 0.5));
} else {
tmp = 0.918938533204673 + (x * (y + -1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-640000000.0d0)) then
tmp = 0.918938533204673d0 + ((x * y) - x)
else if (x <= 0.00084d0) then
tmp = 0.918938533204673d0 + (y * (x - 0.5d0))
else
tmp = 0.918938533204673d0 + (x * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -640000000.0) {
tmp = 0.918938533204673 + ((x * y) - x);
} else if (x <= 0.00084) {
tmp = 0.918938533204673 + (y * (x - 0.5));
} else {
tmp = 0.918938533204673 + (x * (y + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -640000000.0: tmp = 0.918938533204673 + ((x * y) - x) elif x <= 0.00084: tmp = 0.918938533204673 + (y * (x - 0.5)) else: tmp = 0.918938533204673 + (x * (y + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -640000000.0) tmp = Float64(0.918938533204673 + Float64(Float64(x * y) - x)); elseif (x <= 0.00084) tmp = Float64(0.918938533204673 + Float64(y * Float64(x - 0.5))); else tmp = Float64(0.918938533204673 + Float64(x * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -640000000.0) tmp = 0.918938533204673 + ((x * y) - x); elseif (x <= 0.00084) tmp = 0.918938533204673 + (y * (x - 0.5)); else tmp = 0.918938533204673 + (x * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -640000000.0], N[(0.918938533204673 + N[(N[(x * y), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00084], N[(0.918938533204673 + N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 + N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -640000000:\\
\;\;\;\;0.918938533204673 + \left(x \cdot y - x\right)\\
\mathbf{elif}\;x \leq 0.00084:\\
\;\;\;\;0.918938533204673 + y \cdot \left(x - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 + x \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < -6.4e8Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
sub-neg100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
neg-mul-1100.0%
fma-neg100.0%
Simplified100.0%
if -6.4e8 < x < 8.4000000000000003e-4Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.4%
if 8.4000000000000003e-4 < x Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 99.7%
Final simplification99.6%
(FPCore (x y) :precision binary64 (if (or (<= y -1.22) (not (<= y 1.0))) (* y (- x 0.5)) (- 0.918938533204673 x)))
double code(double x, double y) {
double tmp;
if ((y <= -1.22) || !(y <= 1.0)) {
tmp = y * (x - 0.5);
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-1.22d0)) .or. (.not. (y <= 1.0d0))) then
tmp = y * (x - 0.5d0)
else
tmp = 0.918938533204673d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.22) || !(y <= 1.0)) {
tmp = y * (x - 0.5);
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.22) or not (y <= 1.0): tmp = y * (x - 0.5) else: tmp = 0.918938533204673 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.22) || !(y <= 1.0)) tmp = Float64(y * Float64(x - 0.5)); else tmp = Float64(0.918938533204673 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.22) || ~((y <= 1.0))) tmp = y * (x - 0.5); else tmp = 0.918938533204673 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.22], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - x\\
\end{array}
\end{array}
if y < -1.21999999999999997 or 1 < y Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.1%
Taylor expanded in y around inf 98.5%
if -1.21999999999999997 < y < 1Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 97.3%
neg-mul-197.3%
sub-neg97.3%
Simplified97.3%
Final simplification97.9%
(FPCore (x y) :precision binary64 (if (or (<= x -0.66) (not (<= x 0.9))) (* x (+ y -1.0)) (- 0.918938533204673 (* y 0.5))))
double code(double x, double y) {
double tmp;
if ((x <= -0.66) || !(x <= 0.9)) {
tmp = x * (y + -1.0);
} else {
tmp = 0.918938533204673 - (y * 0.5);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-0.66d0)) .or. (.not. (x <= 0.9d0))) then
tmp = x * (y + (-1.0d0))
else
tmp = 0.918938533204673d0 - (y * 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -0.66) || !(x <= 0.9)) {
tmp = x * (y + -1.0);
} else {
tmp = 0.918938533204673 - (y * 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -0.66) or not (x <= 0.9): tmp = x * (y + -1.0) else: tmp = 0.918938533204673 - (y * 0.5) return tmp
function code(x, y) tmp = 0.0 if ((x <= -0.66) || !(x <= 0.9)) tmp = Float64(x * Float64(y + -1.0)); else tmp = Float64(0.918938533204673 - Float64(y * 0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -0.66) || ~((x <= 0.9))) tmp = x * (y + -1.0); else tmp = 0.918938533204673 - (y * 0.5); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -0.66], N[Not[LessEqual[x, 0.9]], $MachinePrecision]], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.66 \lor \neg \left(x \leq 0.9\right):\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - y \cdot 0.5\\
\end{array}
\end{array}
if x < -0.660000000000000031 or 0.900000000000000022 < x Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 98.6%
if -0.660000000000000031 < x < 0.900000000000000022Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 98.3%
Final simplification98.5%
(FPCore (x y) :precision binary64 (if (<= x -0.72) (- (* x y) x) (if (<= x 0.9) (- 0.918938533204673 (* y 0.5)) (* x (+ y -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -0.72) {
tmp = (x * y) - x;
} else if (x <= 0.9) {
tmp = 0.918938533204673 - (y * 0.5);
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-0.72d0)) then
tmp = (x * y) - x
else if (x <= 0.9d0) then
tmp = 0.918938533204673d0 - (y * 0.5d0)
else
tmp = x * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.72) {
tmp = (x * y) - x;
} else if (x <= 0.9) {
tmp = 0.918938533204673 - (y * 0.5);
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.72: tmp = (x * y) - x elif x <= 0.9: tmp = 0.918938533204673 - (y * 0.5) else: tmp = x * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -0.72) tmp = Float64(Float64(x * y) - x); elseif (x <= 0.9) tmp = Float64(0.918938533204673 - Float64(y * 0.5)); else tmp = Float64(x * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.72) tmp = (x * y) - x; elseif (x <= 0.9) tmp = 0.918938533204673 - (y * 0.5); else tmp = x * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.72], N[(N[(x * y), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 0.9], N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.72:\\
\;\;\;\;x \cdot y - x\\
\mathbf{elif}\;x \leq 0.9:\\
\;\;\;\;0.918938533204673 - y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < -0.71999999999999997Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 98.1%
Taylor expanded in y around 0 98.1%
neg-mul-198.1%
unsub-neg98.1%
*-commutative98.1%
Simplified98.1%
if -0.71999999999999997 < x < 0.900000000000000022Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 98.3%
if 0.900000000000000022 < x Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 99.2%
Final simplification98.5%
(FPCore (x y) :precision binary64 (- (+ 0.918938533204673 (* y (+ x -0.5))) x))
double code(double x, double y) {
return (0.918938533204673 + (y * (x + -0.5))) - x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (0.918938533204673d0 + (y * (x + (-0.5d0)))) - x
end function
public static double code(double x, double y) {
return (0.918938533204673 + (y * (x + -0.5))) - x;
}
def code(x, y): return (0.918938533204673 + (y * (x + -0.5))) - x
function code(x, y) return Float64(Float64(0.918938533204673 + Float64(y * Float64(x + -0.5))) - x) end
function tmp = code(x, y) tmp = (0.918938533204673 + (y * (x + -0.5))) - x; end
code[x_, y_] := N[(N[(0.918938533204673 + N[(y * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\left(0.918938533204673 + y \cdot \left(x + -0.5\right)\right) - x
\end{array}
Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (<= x -0.91) (- x) (if (<= x 1.25e-15) 0.918938533204673 (- x))))
double code(double x, double y) {
double tmp;
if (x <= -0.91) {
tmp = -x;
} else if (x <= 1.25e-15) {
tmp = 0.918938533204673;
} else {
tmp = -x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-0.91d0)) then
tmp = -x
else if (x <= 1.25d-15) then
tmp = 0.918938533204673d0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.91) {
tmp = -x;
} else if (x <= 1.25e-15) {
tmp = 0.918938533204673;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.91: tmp = -x elif x <= 1.25e-15: tmp = 0.918938533204673 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if (x <= -0.91) tmp = Float64(-x); elseif (x <= 1.25e-15) tmp = 0.918938533204673; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.91) tmp = -x; elseif (x <= 1.25e-15) tmp = 0.918938533204673; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.91], (-x), If[LessEqual[x, 1.25e-15], 0.918938533204673, (-x)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.91:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-15}:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < -0.910000000000000031 or 1.25e-15 < x Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
distribute-lft-out--100.0%
cancel-sign-sub-inv100.0%
*-rgt-identity100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
associate-+r-100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
fma-udef100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 97.9%
Taylor expanded in y around 0 50.2%
neg-mul-150.2%
Simplified50.2%
if -0.910000000000000031 < x < 1.25e-15Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
*-commutative100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
*-commutative100.0%
prod-diff100.0%
*-commutative100.0%
fma-neg100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
metadata-eval100.0%
*-commutative100.0%
fma-udef100.0%
metadata-eval100.0%
*-commutative100.0%
add-sqr-sqrt45.9%
sqrt-unprod66.1%
swap-sqr66.1%
metadata-eval66.1%
metadata-eval66.1%
swap-sqr66.1%
sqrt-unprod30.6%
add-sqr-sqrt59.4%
Applied egg-rr59.4%
fma-udef59.4%
distribute-rgt-out59.4%
neg-mul-159.4%
+-commutative59.4%
*-commutative59.4%
associate-+r+59.4%
*-commutative59.4%
distribute-lft-in59.4%
+-commutative59.4%
sub-neg59.4%
metadata-eval59.4%
sub-neg59.4%
sub-neg59.4%
metadata-eval59.4%
+-commutative59.4%
fma-udef59.4%
*-commutative59.4%
distribute-lft-out59.4%
metadata-eval59.4%
*-commutative59.4%
neg-mul-159.4%
Simplified59.4%
Taylor expanded in y around -inf 58.8%
mul-1-neg58.8%
*-commutative58.8%
distribute-rgt-neg-in58.8%
sub-neg58.8%
metadata-eval58.8%
mul-1-neg58.8%
unsub-neg58.8%
Simplified58.8%
Taylor expanded in y around 0 51.9%
Final simplification51.0%
(FPCore (x y) :precision binary64 0.918938533204673)
double code(double x, double y) {
return 0.918938533204673;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.918938533204673d0
end function
public static double code(double x, double y) {
return 0.918938533204673;
}
def code(x, y): return 0.918938533204673
function code(x, y) return 0.918938533204673 end
function tmp = code(x, y) tmp = 0.918938533204673; end
code[x_, y_] := 0.918938533204673
\begin{array}{l}
\\
0.918938533204673
\end{array}
Initial program 100.0%
fma-neg100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
*-commutative100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
*-commutative100.0%
prod-diff100.0%
*-commutative100.0%
fma-neg100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
metadata-eval100.0%
*-commutative100.0%
fma-udef100.0%
metadata-eval100.0%
*-commutative100.0%
add-sqr-sqrt48.3%
sqrt-unprod76.0%
swap-sqr76.0%
metadata-eval76.0%
metadata-eval76.0%
swap-sqr76.0%
sqrt-unprod40.6%
add-sqr-sqrt80.8%
Applied egg-rr80.8%
fma-udef80.8%
distribute-rgt-out80.8%
neg-mul-180.8%
+-commutative80.8%
*-commutative80.8%
associate-+r+80.8%
*-commutative80.8%
distribute-lft-in80.8%
+-commutative80.8%
sub-neg80.8%
metadata-eval80.8%
sub-neg80.8%
sub-neg80.8%
metadata-eval80.8%
+-commutative80.8%
fma-udef80.8%
*-commutative80.8%
distribute-lft-out80.8%
metadata-eval80.8%
*-commutative80.8%
neg-mul-180.8%
Simplified80.8%
Taylor expanded in y around -inf 53.5%
mul-1-neg53.5%
*-commutative53.5%
distribute-rgt-neg-in53.5%
sub-neg53.5%
metadata-eval53.5%
mul-1-neg53.5%
unsub-neg53.5%
Simplified53.5%
Taylor expanded in y around 0 24.9%
Final simplification24.9%
herbie shell --seed 2023268
(FPCore (x y)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (* x (- y 1.0)) (* y 0.5)) 0.918938533204673))