
(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 13 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 y (+ x -0.5) (- 0.918938533204673 x)))
double code(double x, double y) {
return fma(y, (x + -0.5), (0.918938533204673 - x));
}
function code(x, y) return fma(y, Float64(x + -0.5), Float64(0.918938533204673 - x)) end
code[x_, y_] := N[(y * N[(x + -0.5), $MachinePrecision] + N[(0.918938533204673 - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, x + -0.5, 0.918938533204673 - x\right)
\end{array}
Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
associate-+r+100.0%
associate-+l+100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(if (<= y -5e+45)
(* y -0.5)
(if (<= y -1.0)
(* y x)
(if (<= y -4.5e-68)
(- x)
(if (<= y -5e-87)
0.918938533204673
(if (<= y -2.3e-123)
(- x)
(if (<= y -1.45e-301)
0.918938533204673
(if (<= y 1.65e-150)
(- x)
(if (<= y 1.76)
0.918938533204673
(if (<= y 8.8e+220) (* y x) (* y -0.5)))))))))))
double code(double x, double y) {
double tmp;
if (y <= -5e+45) {
tmp = y * -0.5;
} else if (y <= -1.0) {
tmp = y * x;
} else if (y <= -4.5e-68) {
tmp = -x;
} else if (y <= -5e-87) {
tmp = 0.918938533204673;
} else if (y <= -2.3e-123) {
tmp = -x;
} else if (y <= -1.45e-301) {
tmp = 0.918938533204673;
} else if (y <= 1.65e-150) {
tmp = -x;
} else if (y <= 1.76) {
tmp = 0.918938533204673;
} else if (y <= 8.8e+220) {
tmp = y * x;
} else {
tmp = 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 (y <= (-5d+45)) then
tmp = y * (-0.5d0)
else if (y <= (-1.0d0)) then
tmp = y * x
else if (y <= (-4.5d-68)) then
tmp = -x
else if (y <= (-5d-87)) then
tmp = 0.918938533204673d0
else if (y <= (-2.3d-123)) then
tmp = -x
else if (y <= (-1.45d-301)) then
tmp = 0.918938533204673d0
else if (y <= 1.65d-150) then
tmp = -x
else if (y <= 1.76d0) then
tmp = 0.918938533204673d0
else if (y <= 8.8d+220) then
tmp = y * x
else
tmp = y * (-0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -5e+45) {
tmp = y * -0.5;
} else if (y <= -1.0) {
tmp = y * x;
} else if (y <= -4.5e-68) {
tmp = -x;
} else if (y <= -5e-87) {
tmp = 0.918938533204673;
} else if (y <= -2.3e-123) {
tmp = -x;
} else if (y <= -1.45e-301) {
tmp = 0.918938533204673;
} else if (y <= 1.65e-150) {
tmp = -x;
} else if (y <= 1.76) {
tmp = 0.918938533204673;
} else if (y <= 8.8e+220) {
tmp = y * x;
} else {
tmp = y * -0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -5e+45: tmp = y * -0.5 elif y <= -1.0: tmp = y * x elif y <= -4.5e-68: tmp = -x elif y <= -5e-87: tmp = 0.918938533204673 elif y <= -2.3e-123: tmp = -x elif y <= -1.45e-301: tmp = 0.918938533204673 elif y <= 1.65e-150: tmp = -x elif y <= 1.76: tmp = 0.918938533204673 elif y <= 8.8e+220: tmp = y * x else: tmp = y * -0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= -5e+45) tmp = Float64(y * -0.5); elseif (y <= -1.0) tmp = Float64(y * x); elseif (y <= -4.5e-68) tmp = Float64(-x); elseif (y <= -5e-87) tmp = 0.918938533204673; elseif (y <= -2.3e-123) tmp = Float64(-x); elseif (y <= -1.45e-301) tmp = 0.918938533204673; elseif (y <= 1.65e-150) tmp = Float64(-x); elseif (y <= 1.76) tmp = 0.918938533204673; elseif (y <= 8.8e+220) tmp = Float64(y * x); else tmp = Float64(y * -0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -5e+45) tmp = y * -0.5; elseif (y <= -1.0) tmp = y * x; elseif (y <= -4.5e-68) tmp = -x; elseif (y <= -5e-87) tmp = 0.918938533204673; elseif (y <= -2.3e-123) tmp = -x; elseif (y <= -1.45e-301) tmp = 0.918938533204673; elseif (y <= 1.65e-150) tmp = -x; elseif (y <= 1.76) tmp = 0.918938533204673; elseif (y <= 8.8e+220) tmp = y * x; else tmp = y * -0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -5e+45], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -1.0], N[(y * x), $MachinePrecision], If[LessEqual[y, -4.5e-68], (-x), If[LessEqual[y, -5e-87], 0.918938533204673, If[LessEqual[y, -2.3e-123], (-x), If[LessEqual[y, -1.45e-301], 0.918938533204673, If[LessEqual[y, 1.65e-150], (-x), If[LessEqual[y, 1.76], 0.918938533204673, If[LessEqual[y, 8.8e+220], N[(y * x), $MachinePrecision], N[(y * -0.5), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+45}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-68}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-87}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-123}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-301}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-150}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 1.76:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{+220}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot -0.5\\
\end{array}
\end{array}
if y < -5e45 or 8.79999999999999957e220 < y Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in x around 0 62.0%
*-commutative62.0%
Simplified62.0%
if -5e45 < y < -1 or 1.76000000000000001 < y < 8.79999999999999957e220Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt-neg-in99.9%
distribute-lft-out99.9%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 66.5%
Taylor expanded in y around inf 63.4%
if -1 < y < -4.49999999999999999e-68 or -5.00000000000000042e-87 < y < -2.29999999999999987e-123 or -1.44999999999999992e-301 < y < 1.6500000000000001e-150Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 63.1%
Taylor expanded in y around 0 62.9%
neg-mul-162.9%
Simplified62.9%
if -4.49999999999999999e-68 < y < -5.00000000000000042e-87 or -2.29999999999999987e-123 < y < -1.44999999999999992e-301 or 1.6500000000000001e-150 < y < 1.76000000000000001Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
associate-+r+100.0%
associate-+l+100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around inf 98.8%
Taylor expanded in x around 0 72.2%
Final simplification65.0%
(FPCore (x y)
:precision binary64
(if (<= y -31000000000000.0)
(* y -0.5)
(if (<= y -5.2e-56)
(- x)
(if (<= y -6.6e-87)
0.918938533204673
(if (<= y -1.35e-121)
(- x)
(if (<= y -3.95e-302)
0.918938533204673
(if (<= y 2.4e-151)
(- x)
(if (<= y 37000000.0) 0.918938533204673 (* y -0.5)))))))))
double code(double x, double y) {
double tmp;
if (y <= -31000000000000.0) {
tmp = y * -0.5;
} else if (y <= -5.2e-56) {
tmp = -x;
} else if (y <= -6.6e-87) {
tmp = 0.918938533204673;
} else if (y <= -1.35e-121) {
tmp = -x;
} else if (y <= -3.95e-302) {
tmp = 0.918938533204673;
} else if (y <= 2.4e-151) {
tmp = -x;
} else if (y <= 37000000.0) {
tmp = 0.918938533204673;
} else {
tmp = 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 (y <= (-31000000000000.0d0)) then
tmp = y * (-0.5d0)
else if (y <= (-5.2d-56)) then
tmp = -x
else if (y <= (-6.6d-87)) then
tmp = 0.918938533204673d0
else if (y <= (-1.35d-121)) then
tmp = -x
else if (y <= (-3.95d-302)) then
tmp = 0.918938533204673d0
else if (y <= 2.4d-151) then
tmp = -x
else if (y <= 37000000.0d0) then
tmp = 0.918938533204673d0
else
tmp = y * (-0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -31000000000000.0) {
tmp = y * -0.5;
} else if (y <= -5.2e-56) {
tmp = -x;
} else if (y <= -6.6e-87) {
tmp = 0.918938533204673;
} else if (y <= -1.35e-121) {
tmp = -x;
} else if (y <= -3.95e-302) {
tmp = 0.918938533204673;
} else if (y <= 2.4e-151) {
tmp = -x;
} else if (y <= 37000000.0) {
tmp = 0.918938533204673;
} else {
tmp = y * -0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -31000000000000.0: tmp = y * -0.5 elif y <= -5.2e-56: tmp = -x elif y <= -6.6e-87: tmp = 0.918938533204673 elif y <= -1.35e-121: tmp = -x elif y <= -3.95e-302: tmp = 0.918938533204673 elif y <= 2.4e-151: tmp = -x elif y <= 37000000.0: tmp = 0.918938533204673 else: tmp = y * -0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= -31000000000000.0) tmp = Float64(y * -0.5); elseif (y <= -5.2e-56) tmp = Float64(-x); elseif (y <= -6.6e-87) tmp = 0.918938533204673; elseif (y <= -1.35e-121) tmp = Float64(-x); elseif (y <= -3.95e-302) tmp = 0.918938533204673; elseif (y <= 2.4e-151) tmp = Float64(-x); elseif (y <= 37000000.0) tmp = 0.918938533204673; else tmp = Float64(y * -0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -31000000000000.0) tmp = y * -0.5; elseif (y <= -5.2e-56) tmp = -x; elseif (y <= -6.6e-87) tmp = 0.918938533204673; elseif (y <= -1.35e-121) tmp = -x; elseif (y <= -3.95e-302) tmp = 0.918938533204673; elseif (y <= 2.4e-151) tmp = -x; elseif (y <= 37000000.0) tmp = 0.918938533204673; else tmp = y * -0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -31000000000000.0], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -5.2e-56], (-x), If[LessEqual[y, -6.6e-87], 0.918938533204673, If[LessEqual[y, -1.35e-121], (-x), If[LessEqual[y, -3.95e-302], 0.918938533204673, If[LessEqual[y, 2.4e-151], (-x), If[LessEqual[y, 37000000.0], 0.918938533204673, N[(y * -0.5), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -31000000000000:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-56}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -6.6 \cdot 10^{-87}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-121}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -3.95 \cdot 10^{-302}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-151}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 37000000:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;y \cdot -0.5\\
\end{array}
\end{array}
if y < -3.1e13 or 3.7e7 < y Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.6%
Taylor expanded in x around 0 50.6%
*-commutative50.6%
Simplified50.6%
if -3.1e13 < y < -5.19999999999999994e-56 or -6.6000000000000001e-87 < y < -1.3500000000000001e-121 or -3.94999999999999988e-302 < y < 2.4e-151Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 66.1%
Taylor expanded in y around 0 57.9%
neg-mul-157.9%
Simplified57.9%
if -5.19999999999999994e-56 < y < -6.6000000000000001e-87 or -1.3500000000000001e-121 < y < -3.94999999999999988e-302 or 2.4e-151 < y < 3.7e7Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
associate-+r+100.0%
associate-+l+100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around inf 98.8%
Taylor expanded in x around 0 71.1%
Final simplification57.3%
(FPCore (x y) :precision binary64 (if (or (<= y -31000000000000.0) (not (<= y 4.2e-7))) (+ (* y x) (- 0.918938533204673 (* y 0.5))) (- (+ 0.918938533204673 (* y x)) x)))
double code(double x, double y) {
double tmp;
if ((y <= -31000000000000.0) || !(y <= 4.2e-7)) {
tmp = (y * x) + (0.918938533204673 - (y * 0.5));
} else {
tmp = (0.918938533204673 + (y * x)) - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-31000000000000.0d0)) .or. (.not. (y <= 4.2d-7))) then
tmp = (y * x) + (0.918938533204673d0 - (y * 0.5d0))
else
tmp = (0.918938533204673d0 + (y * x)) - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -31000000000000.0) || !(y <= 4.2e-7)) {
tmp = (y * x) + (0.918938533204673 - (y * 0.5));
} else {
tmp = (0.918938533204673 + (y * x)) - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -31000000000000.0) or not (y <= 4.2e-7): tmp = (y * x) + (0.918938533204673 - (y * 0.5)) else: tmp = (0.918938533204673 + (y * x)) - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -31000000000000.0) || !(y <= 4.2e-7)) tmp = Float64(Float64(y * x) + Float64(0.918938533204673 - Float64(y * 0.5))); else tmp = Float64(Float64(0.918938533204673 + Float64(y * x)) - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -31000000000000.0) || ~((y <= 4.2e-7))) tmp = (y * x) + (0.918938533204673 - (y * 0.5)); else tmp = (0.918938533204673 + (y * x)) - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -31000000000000.0], N[Not[LessEqual[y, 4.2e-7]], $MachinePrecision]], N[(N[(y * x), $MachinePrecision] + N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.918938533204673 + N[(y * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -31000000000000 \lor \neg \left(y \leq 4.2 \cdot 10^{-7}\right):\\
\;\;\;\;y \cdot x + \left(0.918938533204673 - y \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.918938533204673 + y \cdot x\right) - x\\
\end{array}
\end{array}
if y < -3.1e13 or 4.2e-7 < y Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.7%
if -3.1e13 < y < 4.2e-7Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
associate-+r+100.0%
associate-+l+100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around inf 99.5%
Final simplification99.6%
(FPCore (x y)
:precision binary64
(if (<= y -5.2e+45)
(* y -0.5)
(if (<= y -23.0)
(* y x)
(if (<= y 1.55)
(- 0.918938533204673 x)
(if (<= y 2.1e+221) (* y x) (* y -0.5))))))
double code(double x, double y) {
double tmp;
if (y <= -5.2e+45) {
tmp = y * -0.5;
} else if (y <= -23.0) {
tmp = y * x;
} else if (y <= 1.55) {
tmp = 0.918938533204673 - x;
} else if (y <= 2.1e+221) {
tmp = y * x;
} else {
tmp = 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 (y <= (-5.2d+45)) then
tmp = y * (-0.5d0)
else if (y <= (-23.0d0)) then
tmp = y * x
else if (y <= 1.55d0) then
tmp = 0.918938533204673d0 - x
else if (y <= 2.1d+221) then
tmp = y * x
else
tmp = y * (-0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -5.2e+45) {
tmp = y * -0.5;
} else if (y <= -23.0) {
tmp = y * x;
} else if (y <= 1.55) {
tmp = 0.918938533204673 - x;
} else if (y <= 2.1e+221) {
tmp = y * x;
} else {
tmp = y * -0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -5.2e+45: tmp = y * -0.5 elif y <= -23.0: tmp = y * x elif y <= 1.55: tmp = 0.918938533204673 - x elif y <= 2.1e+221: tmp = y * x else: tmp = y * -0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= -5.2e+45) tmp = Float64(y * -0.5); elseif (y <= -23.0) tmp = Float64(y * x); elseif (y <= 1.55) tmp = Float64(0.918938533204673 - x); elseif (y <= 2.1e+221) tmp = Float64(y * x); else tmp = Float64(y * -0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -5.2e+45) tmp = y * -0.5; elseif (y <= -23.0) tmp = y * x; elseif (y <= 1.55) tmp = 0.918938533204673 - x; elseif (y <= 2.1e+221) tmp = y * x; else tmp = y * -0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -5.2e+45], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -23.0], N[(y * x), $MachinePrecision], If[LessEqual[y, 1.55], N[(0.918938533204673 - x), $MachinePrecision], If[LessEqual[y, 2.1e+221], N[(y * x), $MachinePrecision], N[(y * -0.5), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+45}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -23:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 1.55:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+221}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot -0.5\\
\end{array}
\end{array}
if y < -5.20000000000000014e45 or 2.10000000000000002e221 < y Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in x around 0 62.0%
*-commutative62.0%
Simplified62.0%
if -5.20000000000000014e45 < y < -23 or 1.55000000000000004 < y < 2.10000000000000002e221Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt-neg-in99.9%
distribute-lft-out99.9%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 66.5%
Taylor expanded in y around inf 63.4%
if -23 < y < 1.55000000000000004Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 98.9%
neg-mul-198.9%
sub-neg98.9%
Simplified98.9%
Final simplification79.2%
(FPCore (x y) :precision binary64 (if (<= y -1.4) (* y (- x 0.5)) (if (<= y 1.35) (- 0.918938533204673 x) (- (* y x) (* y 0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -1.4) {
tmp = y * (x - 0.5);
} else if (y <= 1.35) {
tmp = 0.918938533204673 - x;
} else {
tmp = (y * x) - (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 (y <= (-1.4d0)) then
tmp = y * (x - 0.5d0)
else if (y <= 1.35d0) then
tmp = 0.918938533204673d0 - x
else
tmp = (y * x) - (y * 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.4) {
tmp = y * (x - 0.5);
} else if (y <= 1.35) {
tmp = 0.918938533204673 - x;
} else {
tmp = (y * x) - (y * 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.4: tmp = y * (x - 0.5) elif y <= 1.35: tmp = 0.918938533204673 - x else: tmp = (y * x) - (y * 0.5) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.4) tmp = Float64(y * Float64(x - 0.5)); elseif (y <= 1.35) tmp = Float64(0.918938533204673 - x); else tmp = Float64(Float64(y * x) - Float64(y * 0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.4) tmp = y * (x - 0.5); elseif (y <= 1.35) tmp = 0.918938533204673 - x; else tmp = (y * x) - (y * 0.5); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.4], N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35], N[(0.918938533204673 - x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4:\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\mathbf{elif}\;y \leq 1.35:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot x - y \cdot 0.5\\
\end{array}
\end{array}
if y < -1.3999999999999999Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 97.1%
if -1.3999999999999999 < y < 1.3500000000000001Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 98.9%
neg-mul-198.9%
sub-neg98.9%
Simplified98.9%
if 1.3500000000000001 < y Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 98.6%
distribute-lft-out--98.7%
Applied egg-rr98.7%
Final simplification98.3%
(FPCore (x y)
:precision binary64
(if (<= y -30000.0)
(* y (- x 0.5))
(if (<= y 3900000.0)
(- (+ 0.918938533204673 (* y -0.5)) x)
(- (* y x) (* y 0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -30000.0) {
tmp = y * (x - 0.5);
} else if (y <= 3900000.0) {
tmp = (0.918938533204673 + (y * -0.5)) - x;
} else {
tmp = (y * x) - (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 (y <= (-30000.0d0)) then
tmp = y * (x - 0.5d0)
else if (y <= 3900000.0d0) then
tmp = (0.918938533204673d0 + (y * (-0.5d0))) - x
else
tmp = (y * x) - (y * 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -30000.0) {
tmp = y * (x - 0.5);
} else if (y <= 3900000.0) {
tmp = (0.918938533204673 + (y * -0.5)) - x;
} else {
tmp = (y * x) - (y * 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -30000.0: tmp = y * (x - 0.5) elif y <= 3900000.0: tmp = (0.918938533204673 + (y * -0.5)) - x else: tmp = (y * x) - (y * 0.5) return tmp
function code(x, y) tmp = 0.0 if (y <= -30000.0) tmp = Float64(y * Float64(x - 0.5)); elseif (y <= 3900000.0) tmp = Float64(Float64(0.918938533204673 + Float64(y * -0.5)) - x); else tmp = Float64(Float64(y * x) - Float64(y * 0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -30000.0) tmp = y * (x - 0.5); elseif (y <= 3900000.0) tmp = (0.918938533204673 + (y * -0.5)) - x; else tmp = (y * x) - (y * 0.5); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -30000.0], N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3900000.0], N[(N[(0.918938533204673 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -30000:\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\mathbf{elif}\;y \leq 3900000:\\
\;\;\;\;\left(0.918938533204673 + y \cdot -0.5\right) - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot x - y \cdot 0.5\\
\end{array}
\end{array}
if y < -3e4Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 97.1%
if -3e4 < y < 3.9e6Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
associate-+r+100.0%
associate-+l+100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around 0 99.5%
*-commutative3.2%
Simplified99.5%
if 3.9e6 < y Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 98.6%
distribute-lft-out--98.7%
Applied egg-rr98.7%
Final simplification98.6%
(FPCore (x y)
:precision binary64
(if (<= y -31000000000000.0)
(* y (- x 0.5))
(if (<= y 59000000.0)
(- (+ 0.918938533204673 (* y x)) x)
(- (* y x) (* y 0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -31000000000000.0) {
tmp = y * (x - 0.5);
} else if (y <= 59000000.0) {
tmp = (0.918938533204673 + (y * x)) - x;
} else {
tmp = (y * x) - (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 (y <= (-31000000000000.0d0)) then
tmp = y * (x - 0.5d0)
else if (y <= 59000000.0d0) then
tmp = (0.918938533204673d0 + (y * x)) - x
else
tmp = (y * x) - (y * 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -31000000000000.0) {
tmp = y * (x - 0.5);
} else if (y <= 59000000.0) {
tmp = (0.918938533204673 + (y * x)) - x;
} else {
tmp = (y * x) - (y * 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -31000000000000.0: tmp = y * (x - 0.5) elif y <= 59000000.0: tmp = (0.918938533204673 + (y * x)) - x else: tmp = (y * x) - (y * 0.5) return tmp
function code(x, y) tmp = 0.0 if (y <= -31000000000000.0) tmp = Float64(y * Float64(x - 0.5)); elseif (y <= 59000000.0) tmp = Float64(Float64(0.918938533204673 + Float64(y * x)) - x); else tmp = Float64(Float64(y * x) - Float64(y * 0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -31000000000000.0) tmp = y * (x - 0.5); elseif (y <= 59000000.0) tmp = (0.918938533204673 + (y * x)) - x; else tmp = (y * x) - (y * 0.5); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -31000000000000.0], N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 59000000.0], N[(N[(0.918938533204673 + N[(y * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -31000000000000:\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\mathbf{elif}\;y \leq 59000000:\\
\;\;\;\;\left(0.918938533204673 + y \cdot x\right) - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot x - y \cdot 0.5\\
\end{array}
\end{array}
if y < -3.1e13Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.9%
if -3.1e13 < y < 5.9e7Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
associate-+r+100.0%
associate-+l+100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around inf 99.1%
if 5.9e7 < y Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.3%
distribute-lft-out--99.3%
Applied egg-rr99.3%
Final simplification99.4%
(FPCore (x y) :precision binary64 (+ 0.918938533204673 (- (* x (+ y -1.0)) (* y 0.5))))
double code(double x, double y) {
return 0.918938533204673 + ((x * (y + -1.0)) - (y * 0.5));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.918938533204673d0 + ((x * (y + (-1.0d0))) - (y * 0.5d0))
end function
public static double code(double x, double y) {
return 0.918938533204673 + ((x * (y + -1.0)) - (y * 0.5));
}
def code(x, y): return 0.918938533204673 + ((x * (y + -1.0)) - (y * 0.5))
function code(x, y) return Float64(0.918938533204673 + Float64(Float64(x * Float64(y + -1.0)) - Float64(y * 0.5))) end
function tmp = code(x, y) tmp = 0.918938533204673 + ((x * (y + -1.0)) - (y * 0.5)); end
code[x_, y_] := N[(0.918938533204673 + N[(N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.918938533204673 + \left(x \cdot \left(y + -1\right) - y \cdot 0.5\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (or (<= y -1.3) (not (<= y 1.05))) (* y (- x 0.5)) (- 0.918938533204673 x)))
double code(double x, double y) {
double tmp;
if ((y <= -1.3) || !(y <= 1.05)) {
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.3d0)) .or. (.not. (y <= 1.05d0))) 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.3) || !(y <= 1.05)) {
tmp = y * (x - 0.5);
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.3) or not (y <= 1.05): tmp = y * (x - 0.5) else: tmp = 0.918938533204673 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.3) || !(y <= 1.05)) 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.3) || ~((y <= 1.05))) tmp = y * (x - 0.5); else tmp = 0.918938533204673 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.3], N[Not[LessEqual[y, 1.05]], $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.3 \lor \neg \left(y \leq 1.05\right):\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - x\\
\end{array}
\end{array}
if y < -1.30000000000000004 or 1.05000000000000004 < y Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 97.8%
if -1.30000000000000004 < y < 1.05000000000000004Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 98.9%
neg-mul-198.9%
sub-neg98.9%
Simplified98.9%
Final simplification98.3%
(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%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
associate-+r+100.0%
associate-+l+100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (<= x -0.222) (- x) (if (<= x 0.7) 0.918938533204673 (- x))))
double code(double x, double y) {
double tmp;
if (x <= -0.222) {
tmp = -x;
} else if (x <= 0.7) {
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.222d0)) then
tmp = -x
else if (x <= 0.7d0) 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.222) {
tmp = -x;
} else if (x <= 0.7) {
tmp = 0.918938533204673;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.222: tmp = -x elif x <= 0.7: tmp = 0.918938533204673 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if (x <= -0.222) tmp = Float64(-x); elseif (x <= 0.7) tmp = 0.918938533204673; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.222) tmp = -x; elseif (x <= 0.7) tmp = 0.918938533204673; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.222], (-x), If[LessEqual[x, 0.7], 0.918938533204673, (-x)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.222:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq 0.7:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < -0.222000000000000003 or 0.69999999999999996 < x Initial program 100.0%
associate-+l-100.0%
fma-neg100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
fma-neg100.0%
sub-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 96.1%
Taylor expanded in y around 0 41.3%
neg-mul-141.3%
Simplified41.3%
if -0.222000000000000003 < x < 0.69999999999999996Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
associate-+r+100.0%
associate-+l+100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around inf 51.9%
Taylor expanded in x around 0 49.6%
Final simplification45.6%
(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%
sub-neg100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
associate-+r+100.0%
associate-+l+100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
cancel-sign-sub-inv100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around inf 73.6%
Taylor expanded in x around 0 27.0%
Final simplification27.0%
herbie shell --seed 2023257
(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))