
(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 -0.5)
(* x y)
(if (<= x -3.2e-219)
(* y -0.5)
(if (<= x -7.2e-247)
0.918938533204673
(if (<= x -1.18e-268)
(* y -0.5)
(if (<= x 1.25e-144)
0.918938533204673
(if (<= x 0.65) (* y -0.5) (- x))))))))
double code(double x, double y) {
double tmp;
if (x <= -0.5) {
tmp = x * y;
} else if (x <= -3.2e-219) {
tmp = y * -0.5;
} else if (x <= -7.2e-247) {
tmp = 0.918938533204673;
} else if (x <= -1.18e-268) {
tmp = y * -0.5;
} else if (x <= 1.25e-144) {
tmp = 0.918938533204673;
} else if (x <= 0.65) {
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 <= (-0.5d0)) then
tmp = x * y
else if (x <= (-3.2d-219)) then
tmp = y * (-0.5d0)
else if (x <= (-7.2d-247)) then
tmp = 0.918938533204673d0
else if (x <= (-1.18d-268)) then
tmp = y * (-0.5d0)
else if (x <= 1.25d-144) then
tmp = 0.918938533204673d0
else if (x <= 0.65d0) 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 <= -0.5) {
tmp = x * y;
} else if (x <= -3.2e-219) {
tmp = y * -0.5;
} else if (x <= -7.2e-247) {
tmp = 0.918938533204673;
} else if (x <= -1.18e-268) {
tmp = y * -0.5;
} else if (x <= 1.25e-144) {
tmp = 0.918938533204673;
} else if (x <= 0.65) {
tmp = y * -0.5;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.5: tmp = x * y elif x <= -3.2e-219: tmp = y * -0.5 elif x <= -7.2e-247: tmp = 0.918938533204673 elif x <= -1.18e-268: tmp = y * -0.5 elif x <= 1.25e-144: tmp = 0.918938533204673 elif x <= 0.65: tmp = y * -0.5 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if (x <= -0.5) tmp = Float64(x * y); elseif (x <= -3.2e-219) tmp = Float64(y * -0.5); elseif (x <= -7.2e-247) tmp = 0.918938533204673; elseif (x <= -1.18e-268) tmp = Float64(y * -0.5); elseif (x <= 1.25e-144) tmp = 0.918938533204673; elseif (x <= 0.65) tmp = Float64(y * -0.5); else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.5) tmp = x * y; elseif (x <= -3.2e-219) tmp = y * -0.5; elseif (x <= -7.2e-247) tmp = 0.918938533204673; elseif (x <= -1.18e-268) tmp = y * -0.5; elseif (x <= 1.25e-144) tmp = 0.918938533204673; elseif (x <= 0.65) tmp = y * -0.5; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.5], N[(x * y), $MachinePrecision], If[LessEqual[x, -3.2e-219], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, -7.2e-247], 0.918938533204673, If[LessEqual[x, -1.18e-268], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, 1.25e-144], 0.918938533204673, If[LessEqual[x, 0.65], N[(y * -0.5), $MachinePrecision], (-x)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.5:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-219}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-247}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;x \leq -1.18 \cdot 10^{-268}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-144}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;x \leq 0.65:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < -0.5Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 56.9%
Taylor expanded in x around inf 55.1%
*-commutative55.1%
Simplified55.1%
if -0.5 < x < -3.19999999999999998e-219 or -7.1999999999999994e-247 < x < -1.18e-268 or 1.2499999999999999e-144 < x < 0.650000000000000022Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 62.8%
Taylor expanded in x around 0 61.6%
*-commutative61.6%
Simplified61.6%
if -3.19999999999999998e-219 < x < -7.1999999999999994e-247 or -1.18e-268 < x < 1.2499999999999999e-144Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
flip--86.3%
frac-2neg86.3%
metadata-eval86.3%
swap-sqr86.3%
metadata-eval86.3%
*-commutative86.3%
associate-*l*86.3%
*-commutative86.3%
+-commutative86.3%
distribute-neg-in86.3%
distribute-rgt-neg-in86.3%
metadata-eval86.3%
metadata-eval86.3%
Applied egg-rr86.3%
Taylor expanded in y around 0 68.6%
if 0.650000000000000022 < 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%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in y around 0 63.3%
neg-mul-163.3%
Simplified63.3%
Final simplification62.2%
(FPCore (x y)
:precision binary64
(if (<= y -1.45e-8)
(* y -0.5)
(if (<= y -4.15e-277)
0.918938533204673
(if (<= y 3.6e-247)
(- x)
(if (<= y 1.3e-168)
0.918938533204673
(if (<= y 1.85) (- x) (* y -0.5)))))))
double code(double x, double y) {
double tmp;
if (y <= -1.45e-8) {
tmp = y * -0.5;
} else if (y <= -4.15e-277) {
tmp = 0.918938533204673;
} else if (y <= 3.6e-247) {
tmp = -x;
} else if (y <= 1.3e-168) {
tmp = 0.918938533204673;
} else if (y <= 1.85) {
tmp = -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 <= (-1.45d-8)) then
tmp = y * (-0.5d0)
else if (y <= (-4.15d-277)) then
tmp = 0.918938533204673d0
else if (y <= 3.6d-247) then
tmp = -x
else if (y <= 1.3d-168) then
tmp = 0.918938533204673d0
else if (y <= 1.85d0) then
tmp = -x
else
tmp = y * (-0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.45e-8) {
tmp = y * -0.5;
} else if (y <= -4.15e-277) {
tmp = 0.918938533204673;
} else if (y <= 3.6e-247) {
tmp = -x;
} else if (y <= 1.3e-168) {
tmp = 0.918938533204673;
} else if (y <= 1.85) {
tmp = -x;
} else {
tmp = y * -0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.45e-8: tmp = y * -0.5 elif y <= -4.15e-277: tmp = 0.918938533204673 elif y <= 3.6e-247: tmp = -x elif y <= 1.3e-168: tmp = 0.918938533204673 elif y <= 1.85: tmp = -x else: tmp = y * -0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= -1.45e-8) tmp = Float64(y * -0.5); elseif (y <= -4.15e-277) tmp = 0.918938533204673; elseif (y <= 3.6e-247) tmp = Float64(-x); elseif (y <= 1.3e-168) tmp = 0.918938533204673; elseif (y <= 1.85) tmp = Float64(-x); else tmp = Float64(y * -0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.45e-8) tmp = y * -0.5; elseif (y <= -4.15e-277) tmp = 0.918938533204673; elseif (y <= 3.6e-247) tmp = -x; elseif (y <= 1.3e-168) tmp = 0.918938533204673; elseif (y <= 1.85) tmp = -x; else tmp = y * -0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.45e-8], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -4.15e-277], 0.918938533204673, If[LessEqual[y, 3.6e-247], (-x), If[LessEqual[y, 1.3e-168], 0.918938533204673, If[LessEqual[y, 1.85], (-x), N[(y * -0.5), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-8}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -4.15 \cdot 10^{-277}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-247}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-168}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;y \leq 1.85:\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;y \cdot -0.5\\
\end{array}
\end{array}
if y < -1.4500000000000001e-8 or 1.8500000000000001 < y Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 95.4%
Taylor expanded in x around 0 56.7%
*-commutative56.7%
Simplified56.7%
if -1.4500000000000001e-8 < y < -4.14999999999999989e-277 or 3.5999999999999997e-247 < y < 1.3e-168Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 62.4%
flip--62.4%
frac-2neg62.4%
metadata-eval62.4%
swap-sqr62.4%
metadata-eval62.4%
*-commutative62.4%
associate-*l*62.4%
*-commutative62.4%
+-commutative62.4%
distribute-neg-in62.4%
distribute-rgt-neg-in62.4%
metadata-eval62.4%
metadata-eval62.4%
Applied egg-rr62.4%
Taylor expanded in y around 0 61.2%
if -4.14999999999999989e-277 < y < 3.5999999999999997e-247 or 1.3e-168 < y < 1.8500000000000001Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
distribute-lft-out--99.9%
cancel-sign-sub-inv99.9%
*-rgt-identity99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
associate-+r-99.9%
*-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
fma-udef99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
sub-neg99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in y around 0 64.8%
neg-mul-164.8%
Simplified64.8%
Final simplification59.8%
(FPCore (x y)
:precision binary64
(if (<= x -1350000.0)
(- (* y (- x 0.5)) x)
(if (<= x 4.4e-8)
(+ (* x y) (- 0.918938533204673 (* y 0.5)))
(- (* x (+ y -1.0)) -0.918938533204673))))
double code(double x, double y) {
double tmp;
if (x <= -1350000.0) {
tmp = (y * (x - 0.5)) - x;
} else if (x <= 4.4e-8) {
tmp = (x * y) + (0.918938533204673 - (y * 0.5));
} else {
tmp = (x * (y + -1.0)) - -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 <= (-1350000.0d0)) then
tmp = (y * (x - 0.5d0)) - x
else if (x <= 4.4d-8) then
tmp = (x * y) + (0.918938533204673d0 - (y * 0.5d0))
else
tmp = (x * (y + (-1.0d0))) - (-0.918938533204673d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1350000.0) {
tmp = (y * (x - 0.5)) - x;
} else if (x <= 4.4e-8) {
tmp = (x * y) + (0.918938533204673 - (y * 0.5));
} else {
tmp = (x * (y + -1.0)) - -0.918938533204673;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1350000.0: tmp = (y * (x - 0.5)) - x elif x <= 4.4e-8: tmp = (x * y) + (0.918938533204673 - (y * 0.5)) else: tmp = (x * (y + -1.0)) - -0.918938533204673 return tmp
function code(x, y) tmp = 0.0 if (x <= -1350000.0) tmp = Float64(Float64(y * Float64(x - 0.5)) - x); elseif (x <= 4.4e-8) tmp = Float64(Float64(x * y) + Float64(0.918938533204673 - Float64(y * 0.5))); else tmp = Float64(Float64(x * Float64(y + -1.0)) - -0.918938533204673); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1350000.0) tmp = (y * (x - 0.5)) - x; elseif (x <= 4.4e-8) tmp = (x * y) + (0.918938533204673 - (y * 0.5)); else tmp = (x * (y + -1.0)) - -0.918938533204673; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1350000.0], N[(N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 4.4e-8], N[(N[(x * y), $MachinePrecision] + N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision] - -0.918938533204673), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1350000:\\
\;\;\;\;y \cdot \left(x - 0.5\right) - x\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-8}:\\
\;\;\;\;x \cdot y + \left(0.918938533204673 - y \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right) - -0.918938533204673\\
\end{array}
\end{array}
if x < -1.35e6Initial 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%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 99.1%
if -1.35e6 < x < 4.3999999999999997e-8Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 99.6%
*-commutative99.6%
Simplified99.6%
if 4.3999999999999997e-8 < x Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 99.7%
Final simplification99.5%
(FPCore (x y) :precision binary64 (if (or (<= y -2.1e-11) (not (<= y 4.8e-20))) (+ 0.918938533204673 (* y (+ x -0.5))) (- 0.918938533204673 x)))
double code(double x, double y) {
double tmp;
if ((y <= -2.1e-11) || !(y <= 4.8e-20)) {
tmp = 0.918938533204673 + (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 <= (-2.1d-11)) .or. (.not. (y <= 4.8d-20))) then
tmp = 0.918938533204673d0 + (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 <= -2.1e-11) || !(y <= 4.8e-20)) {
tmp = 0.918938533204673 + (y * (x + -0.5));
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.1e-11) or not (y <= 4.8e-20): tmp = 0.918938533204673 + (y * (x + -0.5)) else: tmp = 0.918938533204673 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.1e-11) || !(y <= 4.8e-20)) tmp = Float64(0.918938533204673 + 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 <= -2.1e-11) || ~((y <= 4.8e-20))) tmp = 0.918938533204673 + (y * (x + -0.5)); else tmp = 0.918938533204673 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.1e-11], N[Not[LessEqual[y, 4.8e-20]], $MachinePrecision]], N[(0.918938533204673 + N[(y * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-11} \lor \neg \left(y \leq 4.8 \cdot 10^{-20}\right):\\
\;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - x\\
\end{array}
\end{array}
if y < -2.0999999999999999e-11 or 4.79999999999999986e-20 < y Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 97.2%
*-commutative97.2%
Simplified97.2%
associate--r-97.2%
sub-neg97.2%
distribute-rgt-neg-in97.2%
metadata-eval97.2%
distribute-lft-in97.2%
Applied egg-rr97.2%
if -2.0999999999999999e-11 < y < 4.79999999999999986e-20Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification98.5%
(FPCore (x y) :precision binary64 (if (or (<= x -6400000.0) (not (<= x 1.85e-8))) (- (* x (+ y -1.0)) -0.918938533204673) (+ 0.918938533204673 (* y (+ x -0.5)))))
double code(double x, double y) {
double tmp;
if ((x <= -6400000.0) || !(x <= 1.85e-8)) {
tmp = (x * (y + -1.0)) - -0.918938533204673;
} 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 <= (-6400000.0d0)) .or. (.not. (x <= 1.85d-8))) then
tmp = (x * (y + (-1.0d0))) - (-0.918938533204673d0)
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 <= -6400000.0) || !(x <= 1.85e-8)) {
tmp = (x * (y + -1.0)) - -0.918938533204673;
} else {
tmp = 0.918938533204673 + (y * (x + -0.5));
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -6400000.0) or not (x <= 1.85e-8): tmp = (x * (y + -1.0)) - -0.918938533204673 else: tmp = 0.918938533204673 + (y * (x + -0.5)) return tmp
function code(x, y) tmp = 0.0 if ((x <= -6400000.0) || !(x <= 1.85e-8)) tmp = Float64(Float64(x * Float64(y + -1.0)) - -0.918938533204673); 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 <= -6400000.0) || ~((x <= 1.85e-8))) tmp = (x * (y + -1.0)) - -0.918938533204673; else tmp = 0.918938533204673 + (y * (x + -0.5)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -6400000.0], N[Not[LessEqual[x, 1.85e-8]], $MachinePrecision]], N[(N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision] - -0.918938533204673), $MachinePrecision], N[(0.918938533204673 + N[(y * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6400000 \lor \neg \left(x \leq 1.85 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot \left(y + -1\right) - -0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\
\end{array}
\end{array}
if x < -6.4e6 or 1.85e-8 < x Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 99.3%
if -6.4e6 < x < 1.85e-8Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 99.6%
*-commutative99.6%
Simplified99.6%
associate--r-99.6%
sub-neg99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
distribute-lft-in99.6%
Applied egg-rr99.6%
Final simplification99.5%
(FPCore (x y)
:precision binary64
(if (<= x -1350000.0)
(- (* y (- x 0.5)) x)
(if (<= x 4.4e-8)
(+ 0.918938533204673 (* y (+ x -0.5)))
(- (* x (+ y -1.0)) -0.918938533204673))))
double code(double x, double y) {
double tmp;
if (x <= -1350000.0) {
tmp = (y * (x - 0.5)) - x;
} else if (x <= 4.4e-8) {
tmp = 0.918938533204673 + (y * (x + -0.5));
} else {
tmp = (x * (y + -1.0)) - -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 <= (-1350000.0d0)) then
tmp = (y * (x - 0.5d0)) - x
else if (x <= 4.4d-8) then
tmp = 0.918938533204673d0 + (y * (x + (-0.5d0)))
else
tmp = (x * (y + (-1.0d0))) - (-0.918938533204673d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1350000.0) {
tmp = (y * (x - 0.5)) - x;
} else if (x <= 4.4e-8) {
tmp = 0.918938533204673 + (y * (x + -0.5));
} else {
tmp = (x * (y + -1.0)) - -0.918938533204673;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1350000.0: tmp = (y * (x - 0.5)) - x elif x <= 4.4e-8: tmp = 0.918938533204673 + (y * (x + -0.5)) else: tmp = (x * (y + -1.0)) - -0.918938533204673 return tmp
function code(x, y) tmp = 0.0 if (x <= -1350000.0) tmp = Float64(Float64(y * Float64(x - 0.5)) - x); elseif (x <= 4.4e-8) tmp = Float64(0.918938533204673 + Float64(y * Float64(x + -0.5))); else tmp = Float64(Float64(x * Float64(y + -1.0)) - -0.918938533204673); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1350000.0) tmp = (y * (x - 0.5)) - x; elseif (x <= 4.4e-8) tmp = 0.918938533204673 + (y * (x + -0.5)); else tmp = (x * (y + -1.0)) - -0.918938533204673; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1350000.0], N[(N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 4.4e-8], N[(0.918938533204673 + N[(y * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision] - -0.918938533204673), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1350000:\\
\;\;\;\;y \cdot \left(x - 0.5\right) - x\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-8}:\\
\;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right) - -0.918938533204673\\
\end{array}
\end{array}
if x < -1.35e6Initial 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%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 99.1%
if -1.35e6 < x < 4.3999999999999997e-8Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 99.6%
*-commutative99.6%
Simplified99.6%
associate--r-99.6%
sub-neg99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
distribute-lft-in99.6%
Applied egg-rr99.6%
if 4.3999999999999997e-8 < x Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 99.7%
Final simplification99.5%
(FPCore (x y)
:precision binary64
(if (<= y -19.0)
(* y -0.5)
(if (<= y 1.85)
(- 0.918938533204673 x)
(if (<= y 1.25e+134) (* x y) (* y -0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -19.0) {
tmp = y * -0.5;
} else if (y <= 1.85) {
tmp = 0.918938533204673 - x;
} else if (y <= 1.25e+134) {
tmp = x * y;
} 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 <= (-19.0d0)) then
tmp = y * (-0.5d0)
else if (y <= 1.85d0) then
tmp = 0.918938533204673d0 - x
else if (y <= 1.25d+134) then
tmp = x * y
else
tmp = y * (-0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -19.0) {
tmp = y * -0.5;
} else if (y <= 1.85) {
tmp = 0.918938533204673 - x;
} else if (y <= 1.25e+134) {
tmp = x * y;
} else {
tmp = y * -0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -19.0: tmp = y * -0.5 elif y <= 1.85: tmp = 0.918938533204673 - x elif y <= 1.25e+134: tmp = x * y else: tmp = y * -0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= -19.0) tmp = Float64(y * -0.5); elseif (y <= 1.85) tmp = Float64(0.918938533204673 - x); elseif (y <= 1.25e+134) tmp = Float64(x * y); else tmp = Float64(y * -0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -19.0) tmp = y * -0.5; elseif (y <= 1.85) tmp = 0.918938533204673 - x; elseif (y <= 1.25e+134) tmp = x * y; else tmp = y * -0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -19.0], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 1.85], N[(0.918938533204673 - x), $MachinePrecision], If[LessEqual[y, 1.25e+134], N[(x * y), $MachinePrecision], N[(y * -0.5), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -19:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 1.85:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+134}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;y \cdot -0.5\\
\end{array}
\end{array}
if y < -19 or 1.24999999999999995e134 < y Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.7%
Taylor expanded in x around 0 64.3%
*-commutative64.3%
Simplified64.3%
if -19 < y < 1.8500000000000001Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 97.3%
neg-mul-197.3%
unsub-neg97.3%
Simplified97.3%
if 1.8500000000000001 < y < 1.24999999999999995e134Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 86.1%
Taylor expanded in x around inf 54.5%
*-commutative54.5%
Simplified54.5%
Final simplification80.3%
(FPCore (x y) :precision binary64 (if (or (<= y -1.45) (not (<= y 1.85))) (* y (- x 0.5)) (- 0.918938533204673 x)))
double code(double x, double y) {
double tmp;
if ((y <= -1.45) || !(y <= 1.85)) {
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.45d0)) .or. (.not. (y <= 1.85d0))) 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.45) || !(y <= 1.85)) {
tmp = y * (x - 0.5);
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.45) or not (y <= 1.85): tmp = y * (x - 0.5) else: tmp = 0.918938533204673 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.45) || !(y <= 1.85)) 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.45) || ~((y <= 1.85))) tmp = y * (x - 0.5); else tmp = 0.918938533204673 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.45], N[Not[LessEqual[y, 1.85]], $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.45 \lor \neg \left(y \leq 1.85\right):\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - x\\
\end{array}
\end{array}
if y < -1.44999999999999996 or 1.8500000000000001 < y Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 96.7%
if -1.44999999999999996 < y < 1.8500000000000001Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 97.3%
neg-mul-197.3%
unsub-neg97.3%
Simplified97.3%
Final simplification97.0%
(FPCore (x y) :precision binary64 (if (or (<= x -0.68) (not (<= x 0.52))) (* x (+ y -1.0)) (- 0.918938533204673 (* y 0.5))))
double code(double x, double y) {
double tmp;
if ((x <= -0.68) || !(x <= 0.52)) {
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.68d0)) .or. (.not. (x <= 0.52d0))) 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.68) || !(x <= 0.52)) {
tmp = x * (y + -1.0);
} else {
tmp = 0.918938533204673 - (y * 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -0.68) or not (x <= 0.52): tmp = x * (y + -1.0) else: tmp = 0.918938533204673 - (y * 0.5) return tmp
function code(x, y) tmp = 0.0 if ((x <= -0.68) || !(x <= 0.52)) 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.68) || ~((x <= 0.52))) 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.68], N[Not[LessEqual[x, 0.52]], $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.68 \lor \neg \left(x \leq 0.52\right):\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - y \cdot 0.5\\
\end{array}
\end{array}
if x < -0.680000000000000049 or 0.52000000000000002 < 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%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 96.8%
*-commutative96.8%
Simplified96.8%
sub-neg96.8%
neg-mul-196.8%
distribute-rgt-in96.8%
*-commutative96.8%
Applied egg-rr96.8%
if -0.680000000000000049 < x < 0.52000000000000002Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 97.9%
Final simplification97.4%
(FPCore (x y) :precision binary64 (if (<= x -0.75) (* x (+ y -1.0)) (if (<= x 0.62) (- 0.918938533204673 (* y 0.5)) (- (* x y) x))))
double code(double x, double y) {
double tmp;
if (x <= -0.75) {
tmp = x * (y + -1.0);
} else if (x <= 0.62) {
tmp = 0.918938533204673 - (y * 0.5);
} else {
tmp = (x * y) - 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.75d0)) then
tmp = x * (y + (-1.0d0))
else if (x <= 0.62d0) then
tmp = 0.918938533204673d0 - (y * 0.5d0)
else
tmp = (x * y) - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.75) {
tmp = x * (y + -1.0);
} else if (x <= 0.62) {
tmp = 0.918938533204673 - (y * 0.5);
} else {
tmp = (x * y) - x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.75: tmp = x * (y + -1.0) elif x <= 0.62: tmp = 0.918938533204673 - (y * 0.5) else: tmp = (x * y) - x return tmp
function code(x, y) tmp = 0.0 if (x <= -0.75) tmp = Float64(x * Float64(y + -1.0)); elseif (x <= 0.62) tmp = Float64(0.918938533204673 - Float64(y * 0.5)); else tmp = Float64(Float64(x * y) - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.75) tmp = x * (y + -1.0); elseif (x <= 0.62) tmp = 0.918938533204673 - (y * 0.5); else tmp = (x * y) - x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.75], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.62], N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.75:\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\mathbf{elif}\;x \leq 0.62:\\
\;\;\;\;0.918938533204673 - y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - x\\
\end{array}
\end{array}
if x < -0.75Initial 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%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 96.9%
*-commutative96.9%
Simplified96.9%
sub-neg96.9%
neg-mul-196.9%
distribute-rgt-in96.9%
*-commutative96.9%
Applied egg-rr96.9%
if -0.75 < x < 0.619999999999999996Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 97.9%
if 0.619999999999999996 < 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%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 96.8%
*-commutative96.8%
Simplified96.8%
Final simplification97.4%
(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%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (<= x -0.00355) (- x) (if (<= x 0.92) 0.918938533204673 (- x))))
double code(double x, double y) {
double tmp;
if (x <= -0.00355) {
tmp = -x;
} else if (x <= 0.92) {
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.00355d0)) then
tmp = -x
else if (x <= 0.92d0) 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.00355) {
tmp = -x;
} else if (x <= 0.92) {
tmp = 0.918938533204673;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.00355: tmp = -x elif x <= 0.92: tmp = 0.918938533204673 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if (x <= -0.00355) tmp = Float64(-x); elseif (x <= 0.92) tmp = 0.918938533204673; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.00355) tmp = -x; elseif (x <= 0.92) tmp = 0.918938533204673; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.00355], (-x), If[LessEqual[x, 0.92], 0.918938533204673, (-x)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00355:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq 0.92:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < -0.0035500000000000002 or 0.92000000000000004 < 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%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in y around 0 53.8%
neg-mul-153.8%
Simplified53.8%
if -0.0035500000000000002 < x < 0.92000000000000004Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.4%
flip--73.2%
frac-2neg73.2%
metadata-eval73.2%
swap-sqr73.2%
metadata-eval73.2%
*-commutative73.2%
associate-*l*73.2%
*-commutative73.2%
+-commutative73.2%
distribute-neg-in73.2%
distribute-rgt-neg-in73.2%
metadata-eval73.2%
metadata-eval73.2%
Applied egg-rr73.2%
Taylor expanded in y around 0 47.5%
Final simplification50.4%
(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%
associate-+l-100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 55.2%
flip--43.2%
frac-2neg43.2%
metadata-eval43.2%
swap-sqr43.2%
metadata-eval43.2%
*-commutative43.2%
associate-*l*43.2%
*-commutative43.2%
+-commutative43.2%
distribute-neg-in43.2%
distribute-rgt-neg-in43.2%
metadata-eval43.2%
metadata-eval43.2%
Applied egg-rr43.2%
Taylor expanded in y around 0 26.9%
Final simplification26.9%
herbie shell --seed 2023275
(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))