
(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 (+ (- (* 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}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(if (<= x -2.2e-10)
(- (+ 0.918938533204673 (* x y)) x)
(if (<= x 1.25e-6)
(- 0.918938533204673 (* y 0.5))
(- (* x (+ y -1.0)) (* y 0.5)))))
double code(double x, double y) {
double tmp;
if (x <= -2.2e-10) {
tmp = (0.918938533204673 + (x * y)) - x;
} else if (x <= 1.25e-6) {
tmp = 0.918938533204673 - (y * 0.5);
} else {
tmp = (x * (y + -1.0)) - (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 <= (-2.2d-10)) then
tmp = (0.918938533204673d0 + (x * y)) - x
else if (x <= 1.25d-6) then
tmp = 0.918938533204673d0 - (y * 0.5d0)
else
tmp = (x * (y + (-1.0d0))) - (y * 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.2e-10) {
tmp = (0.918938533204673 + (x * y)) - x;
} else if (x <= 1.25e-6) {
tmp = 0.918938533204673 - (y * 0.5);
} else {
tmp = (x * (y + -1.0)) - (y * 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.2e-10: tmp = (0.918938533204673 + (x * y)) - x elif x <= 1.25e-6: tmp = 0.918938533204673 - (y * 0.5) else: tmp = (x * (y + -1.0)) - (y * 0.5) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.2e-10) tmp = Float64(Float64(0.918938533204673 + Float64(x * y)) - x); elseif (x <= 1.25e-6) tmp = Float64(0.918938533204673 - Float64(y * 0.5)); else tmp = Float64(Float64(x * Float64(y + -1.0)) - Float64(y * 0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.2e-10) tmp = (0.918938533204673 + (x * y)) - x; elseif (x <= 1.25e-6) tmp = 0.918938533204673 - (y * 0.5); else tmp = (x * (y + -1.0)) - (y * 0.5); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.2e-10], N[(N[(0.918938533204673 + N[(x * y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 1.25e-6], N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-10}:\\
\;\;\;\;\left(0.918938533204673 + x \cdot y\right) - x\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-6}:\\
\;\;\;\;0.918938533204673 - y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right) - y \cdot 0.5\\
\end{array}
\end{array}
if x < -2.1999999999999999e-10Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 97.2%
*-commutative97.2%
Simplified97.2%
if -2.1999999999999999e-10 < x < 1.2500000000000001e-6Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 99.5%
metadata-eval99.5%
cancel-sign-sub-inv99.5%
*-commutative99.5%
Simplified99.5%
if 1.2500000000000001e-6 < x Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.1%
*-commutative99.1%
Simplified99.1%
Final simplification98.8%
(FPCore (x y) :precision binary64 (if (<= y -25.0) (* y -0.5) (if (<= y -8.8e-250) (- x) (if (<= y 1.65) 0.918938533204673 (* x y)))))
double code(double x, double y) {
double tmp;
if (y <= -25.0) {
tmp = y * -0.5;
} else if (y <= -8.8e-250) {
tmp = -x;
} else if (y <= 1.65) {
tmp = 0.918938533204673;
} 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 <= (-25.0d0)) then
tmp = y * (-0.5d0)
else if (y <= (-8.8d-250)) then
tmp = -x
else if (y <= 1.65d0) then
tmp = 0.918938533204673d0
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -25.0) {
tmp = y * -0.5;
} else if (y <= -8.8e-250) {
tmp = -x;
} else if (y <= 1.65) {
tmp = 0.918938533204673;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -25.0: tmp = y * -0.5 elif y <= -8.8e-250: tmp = -x elif y <= 1.65: tmp = 0.918938533204673 else: tmp = x * y return tmp
function code(x, y) tmp = 0.0 if (y <= -25.0) tmp = Float64(y * -0.5); elseif (y <= -8.8e-250) tmp = Float64(-x); elseif (y <= 1.65) tmp = 0.918938533204673; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -25.0) tmp = y * -0.5; elseif (y <= -8.8e-250) tmp = -x; elseif (y <= 1.65) tmp = 0.918938533204673; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -25.0], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -8.8e-250], (-x), If[LessEqual[y, 1.65], 0.918938533204673, N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -25:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-250}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 1.65:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -25Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 98.0%
Taylor expanded in x around 0 61.3%
if -25 < y < -8.8e-250Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 65.1%
Taylor expanded in y around 0 62.9%
neg-mul-162.9%
Simplified62.9%
if -8.8e-250 < y < 1.6499999999999999Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 98.3%
Taylor expanded in x around 0 57.3%
if 1.6499999999999999 < y Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out99.9%
fma-neg99.9%
+-commutative99.9%
metadata-eval99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 97.3%
Taylor expanded in x around inf 58.6%
Final simplification59.4%
(FPCore (x y) :precision binary64 (if (<= y -0.85) (* y -0.5) (if (<= y -1.35e-249) (- x) (if (<= y 1.85) 0.918938533204673 (* y -0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -0.85) {
tmp = y * -0.5;
} else if (y <= -1.35e-249) {
tmp = -x;
} else if (y <= 1.85) {
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 <= (-0.85d0)) then
tmp = y * (-0.5d0)
else if (y <= (-1.35d-249)) then
tmp = -x
else if (y <= 1.85d0) 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 <= -0.85) {
tmp = y * -0.5;
} else if (y <= -1.35e-249) {
tmp = -x;
} else if (y <= 1.85) {
tmp = 0.918938533204673;
} else {
tmp = y * -0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -0.85: tmp = y * -0.5 elif y <= -1.35e-249: tmp = -x elif y <= 1.85: tmp = 0.918938533204673 else: tmp = y * -0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= -0.85) tmp = Float64(y * -0.5); elseif (y <= -1.35e-249) tmp = Float64(-x); elseif (y <= 1.85) tmp = 0.918938533204673; else tmp = Float64(y * -0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -0.85) tmp = y * -0.5; elseif (y <= -1.35e-249) tmp = -x; elseif (y <= 1.85) tmp = 0.918938533204673; else tmp = y * -0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -0.85], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -1.35e-249], (-x), If[LessEqual[y, 1.85], 0.918938533204673, N[(y * -0.5), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.85:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-249}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 1.85:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;y \cdot -0.5\\
\end{array}
\end{array}
if y < -0.849999999999999978 or 1.8500000000000001 < y Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 97.7%
Taylor expanded in x around 0 50.7%
if -0.849999999999999978 < y < -1.35e-249Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 65.1%
Taylor expanded in y around 0 62.9%
neg-mul-162.9%
Simplified62.9%
if -1.35e-249 < y < 1.8500000000000001Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 98.3%
Taylor expanded in x around 0 57.3%
(FPCore (x y)
:precision binary64
(if (<= y -3900000.0)
(* y (- x 0.5))
(if (<= y 3700000.0)
(- (+ 0.918938533204673 (* x y)) x)
(- (* x y) (* y 0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -3900000.0) {
tmp = y * (x - 0.5);
} else if (y <= 3700000.0) {
tmp = (0.918938533204673 + (x * y)) - x;
} else {
tmp = (x * y) - (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 <= (-3900000.0d0)) then
tmp = y * (x - 0.5d0)
else if (y <= 3700000.0d0) then
tmp = (0.918938533204673d0 + (x * y)) - x
else
tmp = (x * y) - (y * 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3900000.0) {
tmp = y * (x - 0.5);
} else if (y <= 3700000.0) {
tmp = (0.918938533204673 + (x * y)) - x;
} else {
tmp = (x * y) - (y * 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3900000.0: tmp = y * (x - 0.5) elif y <= 3700000.0: tmp = (0.918938533204673 + (x * y)) - x else: tmp = (x * y) - (y * 0.5) return tmp
function code(x, y) tmp = 0.0 if (y <= -3900000.0) tmp = Float64(y * Float64(x - 0.5)); elseif (y <= 3700000.0) tmp = Float64(Float64(0.918938533204673 + Float64(x * y)) - x); else tmp = Float64(Float64(x * y) - Float64(y * 0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3900000.0) tmp = y * (x - 0.5); elseif (y <= 3700000.0) tmp = (0.918938533204673 + (x * y)) - x; else tmp = (x * y) - (y * 0.5); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3900000.0], N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3700000.0], N[(N[(0.918938533204673 + N[(x * y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3900000:\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\mathbf{elif}\;y \leq 3700000:\\
\;\;\;\;\left(0.918938533204673 + x \cdot y\right) - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - y \cdot 0.5\\
\end{array}
\end{array}
if y < -3.9e6Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 98.0%
if -3.9e6 < y < 3.7e6Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 98.5%
*-commutative98.5%
Simplified98.5%
if 3.7e6 < y Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in y around inf 99.1%
Final simplification98.6%
(FPCore (x y)
:precision binary64
(if (<= y -90000.0)
(* y (- x 0.5))
(if (<= y 4100000.0)
(- (* x (+ y -1.0)) -0.918938533204673)
(- (* x y) (* y 0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -90000.0) {
tmp = y * (x - 0.5);
} else if (y <= 4100000.0) {
tmp = (x * (y + -1.0)) - -0.918938533204673;
} else {
tmp = (x * y) - (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 <= (-90000.0d0)) then
tmp = y * (x - 0.5d0)
else if (y <= 4100000.0d0) then
tmp = (x * (y + (-1.0d0))) - (-0.918938533204673d0)
else
tmp = (x * y) - (y * 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -90000.0) {
tmp = y * (x - 0.5);
} else if (y <= 4100000.0) {
tmp = (x * (y + -1.0)) - -0.918938533204673;
} else {
tmp = (x * y) - (y * 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -90000.0: tmp = y * (x - 0.5) elif y <= 4100000.0: tmp = (x * (y + -1.0)) - -0.918938533204673 else: tmp = (x * y) - (y * 0.5) return tmp
function code(x, y) tmp = 0.0 if (y <= -90000.0) tmp = Float64(y * Float64(x - 0.5)); elseif (y <= 4100000.0) tmp = Float64(Float64(x * Float64(y + -1.0)) - -0.918938533204673); else tmp = Float64(Float64(x * y) - Float64(y * 0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -90000.0) tmp = y * (x - 0.5); elseif (y <= 4100000.0) tmp = (x * (y + -1.0)) - -0.918938533204673; else tmp = (x * y) - (y * 0.5); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -90000.0], N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4100000.0], N[(N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision] - -0.918938533204673), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -90000:\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\mathbf{elif}\;y \leq 4100000:\\
\;\;\;\;x \cdot \left(y + -1\right) - -0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - y \cdot 0.5\\
\end{array}
\end{array}
if y < -9e4Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 98.0%
if -9e4 < y < 4.1e6Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 98.5%
if 4.1e6 < y Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in y around inf 99.1%
(FPCore (x y) :precision binary64 (if (<= y -1.4) (* y (- x 0.5)) (if (<= y 1.65) (- 0.918938533204673 x) (- (* x y) (* y 0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -1.4) {
tmp = y * (x - 0.5);
} else if (y <= 1.65) {
tmp = 0.918938533204673 - x;
} else {
tmp = (x * y) - (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.65d0) then
tmp = 0.918938533204673d0 - x
else
tmp = (x * y) - (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.65) {
tmp = 0.918938533204673 - x;
} else {
tmp = (x * y) - (y * 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.4: tmp = y * (x - 0.5) elif y <= 1.65: tmp = 0.918938533204673 - x else: tmp = (x * y) - (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.65) tmp = Float64(0.918938533204673 - x); else tmp = Float64(Float64(x * y) - 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.65) tmp = 0.918938533204673 - x; else tmp = (x * y) - (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.65], N[(0.918938533204673 - x), $MachinePrecision], N[(N[(x * y), $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.65:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - y \cdot 0.5\\
\end{array}
\end{array}
if y < -1.3999999999999999Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 98.0%
if -1.3999999999999999 < y < 1.6499999999999999Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 98.1%
if 1.6499999999999999 < y Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in y around inf 97.4%
(FPCore (x y) :precision binary64 (if (<= y -1.4) (* y (- x 0.5)) (if (<= y 1.8) (- 0.918938533204673 x) (* y (+ -1.0 (+ x 0.5))))))
double code(double x, double y) {
double tmp;
if (y <= -1.4) {
tmp = y * (x - 0.5);
} else if (y <= 1.8) {
tmp = 0.918938533204673 - x;
} else {
tmp = y * (-1.0 + (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 (y <= (-1.4d0)) then
tmp = y * (x - 0.5d0)
else if (y <= 1.8d0) then
tmp = 0.918938533204673d0 - x
else
tmp = y * ((-1.0d0) + (x + 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.8) {
tmp = 0.918938533204673 - x;
} else {
tmp = y * (-1.0 + (x + 0.5));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.4: tmp = y * (x - 0.5) elif y <= 1.8: tmp = 0.918938533204673 - x else: tmp = y * (-1.0 + (x + 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.8) tmp = Float64(0.918938533204673 - x); else tmp = Float64(y * Float64(-1.0 + Float64(x + 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.8) tmp = 0.918938533204673 - x; else tmp = y * (-1.0 + (x + 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.8], N[(0.918938533204673 - x), $MachinePrecision], N[(y * N[(-1.0 + N[(x + 0.5), $MachinePrecision]), $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.8:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-1 + \left(x + 0.5\right)\right)\\
\end{array}
\end{array}
if y < -1.3999999999999999Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 98.0%
if -1.3999999999999999 < y < 1.80000000000000004Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 98.1%
if 1.80000000000000004 < y Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out99.9%
fma-neg99.9%
+-commutative99.9%
metadata-eval99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 97.3%
sub-neg97.3%
metadata-eval97.3%
expm1-log1p-u73.7%
Applied egg-rr73.7%
expm1-undefine73.8%
sub-neg73.8%
log1p-undefine73.7%
rem-exp-log97.3%
+-commutative97.3%
associate-+r+97.4%
metadata-eval97.4%
+-commutative97.4%
metadata-eval97.4%
Simplified97.4%
Final simplification97.9%
(FPCore (x y) :precision binary64 (if (or (<= y -1.25) (not (<= y 1.7))) (* y (- x 0.5)) (- 0.918938533204673 x)))
double code(double x, double y) {
double tmp;
if ((y <= -1.25) || !(y <= 1.7)) {
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.25d0)) .or. (.not. (y <= 1.7d0))) 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.25) || !(y <= 1.7)) {
tmp = y * (x - 0.5);
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.25) or not (y <= 1.7): tmp = y * (x - 0.5) else: tmp = 0.918938533204673 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.25) || !(y <= 1.7)) 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.25) || ~((y <= 1.7))) tmp = y * (x - 0.5); else tmp = 0.918938533204673 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.25], N[Not[LessEqual[y, 1.7]], $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.25 \lor \neg \left(y \leq 1.7\right):\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - x\\
\end{array}
\end{array}
if y < -1.25 or 1.69999999999999996 < y Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 97.7%
if -1.25 < y < 1.69999999999999996Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 98.1%
Final simplification97.9%
(FPCore (x y) :precision binary64 (if (<= y -17.0) (* y -0.5) (if (<= y 4.6e-5) (- 0.918938533204673 x) (* x (+ y -1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -17.0) {
tmp = y * -0.5;
} else if (y <= 4.6e-5) {
tmp = 0.918938533204673 - x;
} 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 (y <= (-17.0d0)) then
tmp = y * (-0.5d0)
else if (y <= 4.6d-5) then
tmp = 0.918938533204673d0 - x
else
tmp = x * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -17.0) {
tmp = y * -0.5;
} else if (y <= 4.6e-5) {
tmp = 0.918938533204673 - x;
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -17.0: tmp = y * -0.5 elif y <= 4.6e-5: tmp = 0.918938533204673 - x else: tmp = x * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -17.0) tmp = Float64(y * -0.5); elseif (y <= 4.6e-5) tmp = Float64(0.918938533204673 - x); else tmp = Float64(x * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -17.0) tmp = y * -0.5; elseif (y <= 4.6e-5) tmp = 0.918938533204673 - x; else tmp = x * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -17.0], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 4.6e-5], N[(0.918938533204673 - x), $MachinePrecision], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -17:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-5}:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if y < -17Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 98.0%
Taylor expanded in x around 0 61.3%
if -17 < y < 4.6e-5Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 98.6%
if 4.6e-5 < y Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 60.4%
Final simplification80.7%
(FPCore (x y) :precision binary64 (if (<= y -140.0) (* y -0.5) (if (<= y 1.65) (- 0.918938533204673 x) (* x y))))
double code(double x, double y) {
double tmp;
if (y <= -140.0) {
tmp = y * -0.5;
} else if (y <= 1.65) {
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 <= (-140.0d0)) then
tmp = y * (-0.5d0)
else if (y <= 1.65d0) 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 <= -140.0) {
tmp = y * -0.5;
} else if (y <= 1.65) {
tmp = 0.918938533204673 - x;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -140.0: tmp = y * -0.5 elif y <= 1.65: tmp = 0.918938533204673 - x else: tmp = x * y return tmp
function code(x, y) tmp = 0.0 if (y <= -140.0) tmp = Float64(y * -0.5); elseif (y <= 1.65) 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 <= -140.0) tmp = y * -0.5; elseif (y <= 1.65) tmp = 0.918938533204673 - x; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -140.0], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 1.65], N[(0.918938533204673 - x), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -140:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 1.65:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -140Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 98.0%
Taylor expanded in x around 0 61.3%
if -140 < y < 1.6499999999999999Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 98.1%
if 1.6499999999999999 < y Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out99.9%
fma-neg99.9%
+-commutative99.9%
metadata-eval99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 97.3%
Taylor expanded in x around inf 58.6%
Final simplification80.2%
(FPCore (x y) :precision binary64 (if (or (<= x -0.92) (not (<= x 0.92))) (- x) 0.918938533204673))
double code(double x, double y) {
double tmp;
if ((x <= -0.92) || !(x <= 0.92)) {
tmp = -x;
} else {
tmp = 0.918938533204673;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-0.92d0)) .or. (.not. (x <= 0.92d0))) then
tmp = -x
else
tmp = 0.918938533204673d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -0.92) || !(x <= 0.92)) {
tmp = -x;
} else {
tmp = 0.918938533204673;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -0.92) or not (x <= 0.92): tmp = -x else: tmp = 0.918938533204673 return tmp
function code(x, y) tmp = 0.0 if ((x <= -0.92) || !(x <= 0.92)) tmp = Float64(-x); else tmp = 0.918938533204673; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -0.92) || ~((x <= 0.92))) tmp = -x; else tmp = 0.918938533204673; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -0.92], N[Not[LessEqual[x, 0.92]], $MachinePrecision]], (-x), 0.918938533204673]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.92 \lor \neg \left(x \leq 0.92\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673\\
\end{array}
\end{array}
if x < -0.92000000000000004 or 0.92000000000000004 < x Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 98.9%
Taylor expanded in y around 0 53.0%
neg-mul-153.0%
Simplified53.0%
if -0.92000000000000004 < x < 0.92000000000000004Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 53.2%
Taylor expanded in x around 0 52.0%
Final simplification52.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%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Final simplification100.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%
cancel-sign-sub-inv100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-+r+100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
distribute-lft-out100.0%
fma-neg100.0%
+-commutative100.0%
metadata-eval100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 53.6%
Taylor expanded in x around 0 28.6%
herbie shell --seed 2024116
(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))