
(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 8 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 (+ (* y (+ x -0.5)) (- 0.918938533204673 x)))
double code(double x, double y) {
return (y * (x + -0.5)) + (0.918938533204673 - x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y * (x + (-0.5d0))) + (0.918938533204673d0 - x)
end function
public static double code(double x, double y) {
return (y * (x + -0.5)) + (0.918938533204673 - x);
}
def code(x, y): return (y * (x + -0.5)) + (0.918938533204673 - x)
function code(x, y) return Float64(Float64(y * Float64(x + -0.5)) + Float64(0.918938533204673 - x)) end
function tmp = code(x, y) tmp = (y * (x + -0.5)) + (0.918938533204673 - x); end
code[x_, y_] := N[(N[(y * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] + N[(0.918938533204673 - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(x + -0.5\right) + \left(0.918938533204673 - x\right)
\end{array}
Initial program 100.0%
Simplified0
(FPCore (x y)
:precision binary64
(if (<= x -9.4e+181)
(- x)
(if (<= x -0.98)
(* y x)
(if (<= x -7e-109)
0.918938533204673
(if (<= x -1.75e-299)
(* y -0.5)
(if (<= x 1.6e-119)
0.918938533204673
(if (<= x 3.4e-34)
(* y -0.5)
(if (<= x 0.92) 0.918938533204673 (- x)))))))))
double code(double x, double y) {
double tmp;
if (x <= -9.4e+181) {
tmp = -x;
} else if (x <= -0.98) {
tmp = y * x;
} else if (x <= -7e-109) {
tmp = 0.918938533204673;
} else if (x <= -1.75e-299) {
tmp = y * -0.5;
} else if (x <= 1.6e-119) {
tmp = 0.918938533204673;
} else if (x <= 3.4e-34) {
tmp = y * -0.5;
} 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 <= (-9.4d+181)) then
tmp = -x
else if (x <= (-0.98d0)) then
tmp = y * x
else if (x <= (-7d-109)) then
tmp = 0.918938533204673d0
else if (x <= (-1.75d-299)) then
tmp = y * (-0.5d0)
else if (x <= 1.6d-119) then
tmp = 0.918938533204673d0
else if (x <= 3.4d-34) then
tmp = y * (-0.5d0)
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 <= -9.4e+181) {
tmp = -x;
} else if (x <= -0.98) {
tmp = y * x;
} else if (x <= -7e-109) {
tmp = 0.918938533204673;
} else if (x <= -1.75e-299) {
tmp = y * -0.5;
} else if (x <= 1.6e-119) {
tmp = 0.918938533204673;
} else if (x <= 3.4e-34) {
tmp = y * -0.5;
} else if (x <= 0.92) {
tmp = 0.918938533204673;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -9.4e+181: tmp = -x elif x <= -0.98: tmp = y * x elif x <= -7e-109: tmp = 0.918938533204673 elif x <= -1.75e-299: tmp = y * -0.5 elif x <= 1.6e-119: tmp = 0.918938533204673 elif x <= 3.4e-34: tmp = y * -0.5 elif x <= 0.92: tmp = 0.918938533204673 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if (x <= -9.4e+181) tmp = Float64(-x); elseif (x <= -0.98) tmp = Float64(y * x); elseif (x <= -7e-109) tmp = 0.918938533204673; elseif (x <= -1.75e-299) tmp = Float64(y * -0.5); elseif (x <= 1.6e-119) tmp = 0.918938533204673; elseif (x <= 3.4e-34) tmp = Float64(y * -0.5); 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 <= -9.4e+181) tmp = -x; elseif (x <= -0.98) tmp = y * x; elseif (x <= -7e-109) tmp = 0.918938533204673; elseif (x <= -1.75e-299) tmp = y * -0.5; elseif (x <= 1.6e-119) tmp = 0.918938533204673; elseif (x <= 3.4e-34) tmp = y * -0.5; elseif (x <= 0.92) tmp = 0.918938533204673; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -9.4e+181], (-x), If[LessEqual[x, -0.98], N[(y * x), $MachinePrecision], If[LessEqual[x, -7e-109], 0.918938533204673, If[LessEqual[x, -1.75e-299], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, 1.6e-119], 0.918938533204673, If[LessEqual[x, 3.4e-34], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, 0.92], 0.918938533204673, (-x)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.4 \cdot 10^{+181}:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq -0.98:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-109}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-299}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-119}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-34}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 0.92:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < -9.40000000000000055e181 or 0.92000000000000004 < x Initial program 100.0%
Simplified0
Applied egg-rr0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -9.40000000000000055e181 < x < -0.97999999999999998Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -0.97999999999999998 < x < -7e-109 or -1.74999999999999995e-299 < x < 1.59999999999999997e-119 or 3.4000000000000001e-34 < x < 0.92000000000000004Initial program 100.0%
Simplified0
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -7e-109 < x < -1.74999999999999995e-299 or 1.59999999999999997e-119 < x < 3.4000000000000001e-34Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y)
:precision binary64
(if (<= x -1600.0)
(- x)
(if (<= x -5e-102)
0.918938533204673
(if (<= x -3.4e-300)
(* y -0.5)
(if (<= x 2.5e-118)
0.918938533204673
(if (<= x 5e-35)
(* y -0.5)
(if (<= x 0.92) 0.918938533204673 (- x))))))))
double code(double x, double y) {
double tmp;
if (x <= -1600.0) {
tmp = -x;
} else if (x <= -5e-102) {
tmp = 0.918938533204673;
} else if (x <= -3.4e-300) {
tmp = y * -0.5;
} else if (x <= 2.5e-118) {
tmp = 0.918938533204673;
} else if (x <= 5e-35) {
tmp = y * -0.5;
} 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 <= (-1600.0d0)) then
tmp = -x
else if (x <= (-5d-102)) then
tmp = 0.918938533204673d0
else if (x <= (-3.4d-300)) then
tmp = y * (-0.5d0)
else if (x <= 2.5d-118) then
tmp = 0.918938533204673d0
else if (x <= 5d-35) then
tmp = y * (-0.5d0)
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 <= -1600.0) {
tmp = -x;
} else if (x <= -5e-102) {
tmp = 0.918938533204673;
} else if (x <= -3.4e-300) {
tmp = y * -0.5;
} else if (x <= 2.5e-118) {
tmp = 0.918938533204673;
} else if (x <= 5e-35) {
tmp = y * -0.5;
} else if (x <= 0.92) {
tmp = 0.918938533204673;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1600.0: tmp = -x elif x <= -5e-102: tmp = 0.918938533204673 elif x <= -3.4e-300: tmp = y * -0.5 elif x <= 2.5e-118: tmp = 0.918938533204673 elif x <= 5e-35: tmp = y * -0.5 elif x <= 0.92: tmp = 0.918938533204673 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if (x <= -1600.0) tmp = Float64(-x); elseif (x <= -5e-102) tmp = 0.918938533204673; elseif (x <= -3.4e-300) tmp = Float64(y * -0.5); elseif (x <= 2.5e-118) tmp = 0.918938533204673; elseif (x <= 5e-35) tmp = Float64(y * -0.5); 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 <= -1600.0) tmp = -x; elseif (x <= -5e-102) tmp = 0.918938533204673; elseif (x <= -3.4e-300) tmp = y * -0.5; elseif (x <= 2.5e-118) tmp = 0.918938533204673; elseif (x <= 5e-35) tmp = y * -0.5; elseif (x <= 0.92) tmp = 0.918938533204673; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1600.0], (-x), If[LessEqual[x, -5e-102], 0.918938533204673, If[LessEqual[x, -3.4e-300], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, 2.5e-118], 0.918938533204673, If[LessEqual[x, 5e-35], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, 0.92], 0.918938533204673, (-x)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1600:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-102}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-300}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-118}:\\
\;\;\;\;0.918938533204673\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-35}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 0.92:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < -1600 or 0.92000000000000004 < x Initial program 100.0%
Simplified0
Applied egg-rr0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -1600 < x < -5.00000000000000026e-102 or -3.40000000000000018e-300 < x < 2.50000000000000007e-118 or 4.99999999999999964e-35 < x < 0.92000000000000004Initial program 100.0%
Simplified0
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -5.00000000000000026e-102 < x < -3.40000000000000018e-300 or 2.50000000000000007e-118 < x < 4.99999999999999964e-35Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y)
:precision binary64
(if (<= y -2.85e+289)
(* y -0.5)
(if (<= y -4.4e+194)
(* y x)
(if (<= y -8000.0)
(* y -0.5)
(if (<= y 4e-18) (- 0.918938533204673 x) (* x (+ y -1.0)))))))
double code(double x, double y) {
double tmp;
if (y <= -2.85e+289) {
tmp = y * -0.5;
} else if (y <= -4.4e+194) {
tmp = y * x;
} else if (y <= -8000.0) {
tmp = y * -0.5;
} else if (y <= 4e-18) {
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 <= (-2.85d+289)) then
tmp = y * (-0.5d0)
else if (y <= (-4.4d+194)) then
tmp = y * x
else if (y <= (-8000.0d0)) then
tmp = y * (-0.5d0)
else if (y <= 4d-18) 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 <= -2.85e+289) {
tmp = y * -0.5;
} else if (y <= -4.4e+194) {
tmp = y * x;
} else if (y <= -8000.0) {
tmp = y * -0.5;
} else if (y <= 4e-18) {
tmp = 0.918938533204673 - x;
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.85e+289: tmp = y * -0.5 elif y <= -4.4e+194: tmp = y * x elif y <= -8000.0: tmp = y * -0.5 elif y <= 4e-18: tmp = 0.918938533204673 - x else: tmp = x * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.85e+289) tmp = Float64(y * -0.5); elseif (y <= -4.4e+194) tmp = Float64(y * x); elseif (y <= -8000.0) tmp = Float64(y * -0.5); elseif (y <= 4e-18) 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 <= -2.85e+289) tmp = y * -0.5; elseif (y <= -4.4e+194) tmp = y * x; elseif (y <= -8000.0) tmp = y * -0.5; elseif (y <= 4e-18) tmp = 0.918938533204673 - x; else tmp = x * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.85e+289], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -4.4e+194], N[(y * x), $MachinePrecision], If[LessEqual[y, -8000.0], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 4e-18], N[(0.918938533204673 - x), $MachinePrecision], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.85 \cdot 10^{+289}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{+194}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq -8000:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-18}:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if y < -2.8499999999999999e289 or -4.4000000000000002e194 < y < -8e3Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -2.8499999999999999e289 < y < -4.4000000000000002e194Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -8e3 < y < 4.0000000000000003e-18Initial program 100.0%
Simplified0
Taylor expanded in y around 0 0
Simplified0
if 4.0000000000000003e-18 < y Initial program 99.9%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y)
:precision binary64
(if (<= y -1.02e+290)
(* y -0.5)
(if (<= y -1.22e+195)
(* y x)
(if (<= y -8000.0)
(* y -0.5)
(if (<= y 1.0) (- 0.918938533204673 x) (* y x))))))
double code(double x, double y) {
double tmp;
if (y <= -1.02e+290) {
tmp = y * -0.5;
} else if (y <= -1.22e+195) {
tmp = y * x;
} else if (y <= -8000.0) {
tmp = y * -0.5;
} else if (y <= 1.0) {
tmp = 0.918938533204673 - x;
} else {
tmp = y * 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.02d+290)) then
tmp = y * (-0.5d0)
else if (y <= (-1.22d+195)) then
tmp = y * x
else if (y <= (-8000.0d0)) then
tmp = y * (-0.5d0)
else if (y <= 1.0d0) then
tmp = 0.918938533204673d0 - x
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.02e+290) {
tmp = y * -0.5;
} else if (y <= -1.22e+195) {
tmp = y * x;
} else if (y <= -8000.0) {
tmp = y * -0.5;
} else if (y <= 1.0) {
tmp = 0.918938533204673 - x;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.02e+290: tmp = y * -0.5 elif y <= -1.22e+195: tmp = y * x elif y <= -8000.0: tmp = y * -0.5 elif y <= 1.0: tmp = 0.918938533204673 - x else: tmp = y * x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.02e+290) tmp = Float64(y * -0.5); elseif (y <= -1.22e+195) tmp = Float64(y * x); elseif (y <= -8000.0) tmp = Float64(y * -0.5); elseif (y <= 1.0) tmp = Float64(0.918938533204673 - x); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.02e+290) tmp = y * -0.5; elseif (y <= -1.22e+195) tmp = y * x; elseif (y <= -8000.0) tmp = y * -0.5; elseif (y <= 1.0) tmp = 0.918938533204673 - x; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.02e+290], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -1.22e+195], N[(y * x), $MachinePrecision], If[LessEqual[y, -8000.0], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 1.0], N[(0.918938533204673 - x), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+290}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -1.22 \cdot 10^{+195}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq -8000:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if y < -1.02e290 or -1.2200000000000001e195 < y < -8e3Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -1.02e290 < y < -1.2200000000000001e195 or 1 < y Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -8e3 < y < 1Initial program 100.0%
Simplified0
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y) :precision binary64 (let* ((t_0 (* y (- x 0.5)))) (if (<= y -1.35) t_0 (if (<= y 1.0) (- 0.918938533204673 x) t_0))))
double code(double x, double y) {
double t_0 = y * (x - 0.5);
double tmp;
if (y <= -1.35) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = 0.918938533204673 - x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y * (x - 0.5d0)
if (y <= (-1.35d0)) then
tmp = t_0
else if (y <= 1.0d0) then
tmp = 0.918938533204673d0 - x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * (x - 0.5);
double tmp;
if (y <= -1.35) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = 0.918938533204673 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = y * (x - 0.5) tmp = 0 if y <= -1.35: tmp = t_0 elif y <= 1.0: tmp = 0.918938533204673 - x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(y * Float64(x - 0.5)) tmp = 0.0 if (y <= -1.35) tmp = t_0; elseif (y <= 1.0) tmp = Float64(0.918938533204673 - x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = y * (x - 0.5); tmp = 0.0; if (y <= -1.35) tmp = t_0; elseif (y <= 1.0) tmp = 0.918938533204673 - x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35], t$95$0, If[LessEqual[y, 1.0], N[(0.918938533204673 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(x - 0.5\right)\\
\mathbf{if}\;y \leq -1.35:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.3500000000000001 or 1 < y Initial program 100.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if -1.3500000000000001 < y < 1Initial program 100.0%
Simplified0
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y) :precision binary64 (if (<= x -1600.0) (- x) (if (<= x 0.92) 0.918938533204673 (- x))))
double code(double x, double y) {
double tmp;
if (x <= -1600.0) {
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 <= (-1600.0d0)) 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 <= -1600.0) {
tmp = -x;
} else if (x <= 0.92) {
tmp = 0.918938533204673;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1600.0: tmp = -x elif x <= 0.92: tmp = 0.918938533204673 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if (x <= -1600.0) 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 <= -1600.0) tmp = -x; elseif (x <= 0.92) tmp = 0.918938533204673; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1600.0], (-x), If[LessEqual[x, 0.92], 0.918938533204673, (-x)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1600:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq 0.92:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < -1600 or 0.92000000000000004 < x Initial program 100.0%
Simplified0
Applied egg-rr0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -1600 < x < 0.92000000000000004Initial program 100.0%
Simplified0
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(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%
Simplified0
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
herbie shell --seed 2024110
(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))