
(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 12 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 (- 0.918938533204673 (- (* y 0.5) (* x (+ y -1.0)))))
double code(double x, double y) {
return 0.918938533204673 - ((y * 0.5) - (x * (y + -1.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.918938533204673d0 - ((y * 0.5d0) - (x * (y + (-1.0d0))))
end function
public static double code(double x, double y) {
return 0.918938533204673 - ((y * 0.5) - (x * (y + -1.0)));
}
def code(x, y): return 0.918938533204673 - ((y * 0.5) - (x * (y + -1.0)))
function code(x, y) return Float64(0.918938533204673 - Float64(Float64(y * 0.5) - Float64(x * Float64(y + -1.0)))) end
function tmp = code(x, y) tmp = 0.918938533204673 - ((y * 0.5) - (x * (y + -1.0))); end
code[x_, y_] := N[(0.918938533204673 - N[(N[(y * 0.5), $MachinePrecision] - N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.918938533204673 - \left(y \cdot 0.5 - x \cdot \left(y + -1\right)\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (+ y -1.0))))
(if (<= x -48000.0)
t_0
(if (<= x -9e-67)
(- 0.918938533204673 x)
(if (<= x 1.25e-188)
(* y -0.5)
(if (<= x 18500000000.0) (- 0.918938533204673 x) t_0))))))
double code(double x, double y) {
double t_0 = x * (y + -1.0);
double tmp;
if (x <= -48000.0) {
tmp = t_0;
} else if (x <= -9e-67) {
tmp = 0.918938533204673 - x;
} else if (x <= 1.25e-188) {
tmp = y * -0.5;
} else if (x <= 18500000000.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 = x * (y + (-1.0d0))
if (x <= (-48000.0d0)) then
tmp = t_0
else if (x <= (-9d-67)) then
tmp = 0.918938533204673d0 - x
else if (x <= 1.25d-188) then
tmp = y * (-0.5d0)
else if (x <= 18500000000.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 = x * (y + -1.0);
double tmp;
if (x <= -48000.0) {
tmp = t_0;
} else if (x <= -9e-67) {
tmp = 0.918938533204673 - x;
} else if (x <= 1.25e-188) {
tmp = y * -0.5;
} else if (x <= 18500000000.0) {
tmp = 0.918938533204673 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (y + -1.0) tmp = 0 if x <= -48000.0: tmp = t_0 elif x <= -9e-67: tmp = 0.918938533204673 - x elif x <= 1.25e-188: tmp = y * -0.5 elif x <= 18500000000.0: tmp = 0.918938533204673 - x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(y + -1.0)) tmp = 0.0 if (x <= -48000.0) tmp = t_0; elseif (x <= -9e-67) tmp = Float64(0.918938533204673 - x); elseif (x <= 1.25e-188) tmp = Float64(y * -0.5); elseif (x <= 18500000000.0) tmp = Float64(0.918938533204673 - x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (y + -1.0); tmp = 0.0; if (x <= -48000.0) tmp = t_0; elseif (x <= -9e-67) tmp = 0.918938533204673 - x; elseif (x <= 1.25e-188) tmp = y * -0.5; elseif (x <= 18500000000.0) tmp = 0.918938533204673 - x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -48000.0], t$95$0, If[LessEqual[x, -9e-67], N[(0.918938533204673 - x), $MachinePrecision], If[LessEqual[x, 1.25e-188], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, 18500000000.0], N[(0.918938533204673 - x), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y + -1\right)\\
\mathbf{if}\;x \leq -48000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-67}:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-188}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 18500000000:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -48000 or 1.85e10 < x Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6498.8%
Simplified98.8%
if -48000 < x < -9.00000000000000031e-67 or 1.25e-188 < x < 1.85e10Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in y around 0
--lowering--.f6466.3%
Simplified66.3%
if -9.00000000000000031e-67 < x < 1.25e-188Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6467.6%
Simplified67.6%
Taylor expanded in x around 0
Simplified67.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (+ x -0.5))))
(if (<= y -180000.0)
t_0
(if (<= y -5.6e-11)
(* x (+ y -1.0))
(if (<= y 1.4) (- 0.918938533204673 x) t_0)))))
double code(double x, double y) {
double t_0 = y * (x + -0.5);
double tmp;
if (y <= -180000.0) {
tmp = t_0;
} else if (y <= -5.6e-11) {
tmp = x * (y + -1.0);
} else if (y <= 1.4) {
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 <= (-180000.0d0)) then
tmp = t_0
else if (y <= (-5.6d-11)) then
tmp = x * (y + (-1.0d0))
else if (y <= 1.4d0) 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 <= -180000.0) {
tmp = t_0;
} else if (y <= -5.6e-11) {
tmp = x * (y + -1.0);
} else if (y <= 1.4) {
tmp = 0.918938533204673 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = y * (x + -0.5) tmp = 0 if y <= -180000.0: tmp = t_0 elif y <= -5.6e-11: tmp = x * (y + -1.0) elif y <= 1.4: 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 <= -180000.0) tmp = t_0; elseif (y <= -5.6e-11) tmp = Float64(x * Float64(y + -1.0)); elseif (y <= 1.4) 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 <= -180000.0) tmp = t_0; elseif (y <= -5.6e-11) tmp = x * (y + -1.0); elseif (y <= 1.4) 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, -180000.0], t$95$0, If[LessEqual[y, -5.6e-11], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4], 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 -180000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\mathbf{elif}\;y \leq 1.4:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.8e5 or 1.3999999999999999 < y Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6498.9%
Simplified98.9%
if -1.8e5 < y < -5.6e-11Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f6499.8%
Simplified99.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64100.0%
Simplified100.0%
if -5.6e-11 < y < 1.3999999999999999Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in y around 0
--lowering--.f6497.0%
Simplified97.0%
(FPCore (x y)
:precision binary64
(if (<= y -145000.0)
(* y -0.5)
(if (<= y 1.55)
(- 0.918938533204673 x)
(if (<= y 3.8e+208) (* x y) (* y -0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -145000.0) {
tmp = y * -0.5;
} else if (y <= 1.55) {
tmp = 0.918938533204673 - x;
} else if (y <= 3.8e+208) {
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 <= (-145000.0d0)) then
tmp = y * (-0.5d0)
else if (y <= 1.55d0) then
tmp = 0.918938533204673d0 - x
else if (y <= 3.8d+208) 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 <= -145000.0) {
tmp = y * -0.5;
} else if (y <= 1.55) {
tmp = 0.918938533204673 - x;
} else if (y <= 3.8e+208) {
tmp = x * y;
} else {
tmp = y * -0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -145000.0: tmp = y * -0.5 elif y <= 1.55: tmp = 0.918938533204673 - x elif y <= 3.8e+208: tmp = x * y else: tmp = y * -0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= -145000.0) tmp = Float64(y * -0.5); elseif (y <= 1.55) tmp = Float64(0.918938533204673 - x); elseif (y <= 3.8e+208) 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 <= -145000.0) tmp = y * -0.5; elseif (y <= 1.55) tmp = 0.918938533204673 - x; elseif (y <= 3.8e+208) tmp = x * y; else tmp = y * -0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -145000.0], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 1.55], N[(0.918938533204673 - x), $MachinePrecision], If[LessEqual[y, 3.8e+208], N[(x * y), $MachinePrecision], N[(y * -0.5), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -145000:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 1.55:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+208}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;y \cdot -0.5\\
\end{array}
\end{array}
if y < -145000 or 3.8000000000000002e208 < y Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6499.5%
Simplified99.5%
Taylor expanded in x around 0
Simplified61.1%
if -145000 < y < 1.55000000000000004Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in y around 0
--lowering--.f6492.4%
Simplified92.4%
if 1.55000000000000004 < y < 3.8000000000000002e208Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6497.7%
Simplified97.7%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6454.1%
Simplified54.1%
Final simplification74.7%
(FPCore (x y)
:precision binary64
(if (<= x -8.5e-8)
(* x y)
(if (<= x 1.85e-190)
(* y -0.5)
(if (<= x 0.72) 0.918938533204673 (* x y)))))
double code(double x, double y) {
double tmp;
if (x <= -8.5e-8) {
tmp = x * y;
} else if (x <= 1.85e-190) {
tmp = y * -0.5;
} else if (x <= 0.72) {
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 (x <= (-8.5d-8)) then
tmp = x * y
else if (x <= 1.85d-190) then
tmp = y * (-0.5d0)
else if (x <= 0.72d0) 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 (x <= -8.5e-8) {
tmp = x * y;
} else if (x <= 1.85e-190) {
tmp = y * -0.5;
} else if (x <= 0.72) {
tmp = 0.918938533204673;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8.5e-8: tmp = x * y elif x <= 1.85e-190: tmp = y * -0.5 elif x <= 0.72: tmp = 0.918938533204673 else: tmp = x * y return tmp
function code(x, y) tmp = 0.0 if (x <= -8.5e-8) tmp = Float64(x * y); elseif (x <= 1.85e-190) tmp = Float64(y * -0.5); elseif (x <= 0.72) tmp = 0.918938533204673; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -8.5e-8) tmp = x * y; elseif (x <= 1.85e-190) tmp = y * -0.5; elseif (x <= 0.72) tmp = 0.918938533204673; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -8.5e-8], N[(x * y), $MachinePrecision], If[LessEqual[x, 1.85e-190], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, 0.72], 0.918938533204673, N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-8}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-190}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 0.72:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -8.49999999999999935e-8 or 0.71999999999999997 < x Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6450.7%
Simplified50.7%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6450.0%
Simplified50.0%
if -8.49999999999999935e-8 < x < 1.8500000000000001e-190Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6465.2%
Simplified65.2%
Taylor expanded in x around 0
Simplified64.7%
if 1.8500000000000001e-190 < x < 0.71999999999999997Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
--lowering--.f6464.5%
Simplified64.5%
Taylor expanded in x around 0
Simplified64.0%
Final simplification57.4%
(FPCore (x y)
:precision binary64
(if (<= x -0.5)
(+ (- 0.918938533204673 x) (* x y))
(if (<= x 19000000000.0)
(+ (- 0.918938533204673 x) (* y -0.5))
(* x (+ y -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -0.5) {
tmp = (0.918938533204673 - x) + (x * y);
} else if (x <= 19000000000.0) {
tmp = (0.918938533204673 - x) + (y * -0.5);
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-0.5d0)) then
tmp = (0.918938533204673d0 - x) + (x * y)
else if (x <= 19000000000.0d0) then
tmp = (0.918938533204673d0 - x) + (y * (-0.5d0))
else
tmp = x * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.5) {
tmp = (0.918938533204673 - x) + (x * y);
} else if (x <= 19000000000.0) {
tmp = (0.918938533204673 - x) + (y * -0.5);
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.5: tmp = (0.918938533204673 - x) + (x * y) elif x <= 19000000000.0: tmp = (0.918938533204673 - x) + (y * -0.5) else: tmp = x * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -0.5) tmp = Float64(Float64(0.918938533204673 - x) + Float64(x * y)); elseif (x <= 19000000000.0) tmp = Float64(Float64(0.918938533204673 - x) + Float64(y * -0.5)); else tmp = Float64(x * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.5) tmp = (0.918938533204673 - x) + (x * y); elseif (x <= 19000000000.0) tmp = (0.918938533204673 - x) + (y * -0.5); else tmp = x * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.5], N[(N[(0.918938533204673 - x), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 19000000000.0], N[(N[(0.918938533204673 - x), $MachinePrecision] + N[(y * -0.5), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.5:\\
\;\;\;\;\left(0.918938533204673 - x\right) + x \cdot y\\
\mathbf{elif}\;x \leq 19000000000:\\
\;\;\;\;\left(0.918938533204673 - x\right) + y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < -0.5Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
Simplified98.3%
if -0.5 < x < 1.9e10Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
*-commutativeN/A
*-lowering-*.f6499.5%
Simplified99.5%
if 1.9e10 < x Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64100.0%
Simplified100.0%
Final simplification99.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (+ y -1.0))))
(if (<= x -38000.0)
t_0
(if (<= x 18500000000.0) (+ (- 0.918938533204673 x) (* y -0.5)) t_0))))
double code(double x, double y) {
double t_0 = x * (y + -1.0);
double tmp;
if (x <= -38000.0) {
tmp = t_0;
} else if (x <= 18500000000.0) {
tmp = (0.918938533204673 - x) + (y * -0.5);
} 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 = x * (y + (-1.0d0))
if (x <= (-38000.0d0)) then
tmp = t_0
else if (x <= 18500000000.0d0) then
tmp = (0.918938533204673d0 - x) + (y * (-0.5d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * (y + -1.0);
double tmp;
if (x <= -38000.0) {
tmp = t_0;
} else if (x <= 18500000000.0) {
tmp = (0.918938533204673 - x) + (y * -0.5);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (y + -1.0) tmp = 0 if x <= -38000.0: tmp = t_0 elif x <= 18500000000.0: tmp = (0.918938533204673 - x) + (y * -0.5) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(y + -1.0)) tmp = 0.0 if (x <= -38000.0) tmp = t_0; elseif (x <= 18500000000.0) tmp = Float64(Float64(0.918938533204673 - x) + Float64(y * -0.5)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (y + -1.0); tmp = 0.0; if (x <= -38000.0) tmp = t_0; elseif (x <= 18500000000.0) tmp = (0.918938533204673 - x) + (y * -0.5); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -38000.0], t$95$0, If[LessEqual[x, 18500000000.0], N[(N[(0.918938533204673 - x), $MachinePrecision] + N[(y * -0.5), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y + -1\right)\\
\mathbf{if}\;x \leq -38000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 18500000000:\\
\;\;\;\;\left(0.918938533204673 - x\right) + y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -38000 or 1.85e10 < x Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6498.8%
Simplified98.8%
if -38000 < x < 1.85e10Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
*-commutativeN/A
*-lowering-*.f6499.5%
Simplified99.5%
Final simplification99.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (+ y -1.0))))
(if (<= x -0.75)
t_0
(if (<= x 0.52) (+ 0.918938533204673 (* y -0.5)) t_0))))
double code(double x, double y) {
double t_0 = x * (y + -1.0);
double tmp;
if (x <= -0.75) {
tmp = t_0;
} else if (x <= 0.52) {
tmp = 0.918938533204673 + (y * -0.5);
} 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 = x * (y + (-1.0d0))
if (x <= (-0.75d0)) then
tmp = t_0
else if (x <= 0.52d0) then
tmp = 0.918938533204673d0 + (y * (-0.5d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * (y + -1.0);
double tmp;
if (x <= -0.75) {
tmp = t_0;
} else if (x <= 0.52) {
tmp = 0.918938533204673 + (y * -0.5);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (y + -1.0) tmp = 0 if x <= -0.75: tmp = t_0 elif x <= 0.52: tmp = 0.918938533204673 + (y * -0.5) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(y + -1.0)) tmp = 0.0 if (x <= -0.75) tmp = t_0; elseif (x <= 0.52) tmp = Float64(0.918938533204673 + Float64(y * -0.5)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (y + -1.0); tmp = 0.0; if (x <= -0.75) tmp = t_0; elseif (x <= 0.52) tmp = 0.918938533204673 + (y * -0.5); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.75], t$95$0, If[LessEqual[x, 0.52], N[(0.918938533204673 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y + -1\right)\\
\mathbf{if}\;x \leq -0.75:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 0.52:\\
\;\;\;\;0.918938533204673 + y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -0.75 or 0.52000000000000002 < x Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6497.9%
Simplified97.9%
if -0.75 < x < 0.52000000000000002Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
*-lowering-*.f6498.2%
Simplified98.2%
Final simplification98.1%
(FPCore (x y) :precision binary64 (if (<= y -0.75) (* y -0.5) (if (<= y 0.95) 0.918938533204673 (* y -0.5))))
double code(double x, double y) {
double tmp;
if (y <= -0.75) {
tmp = y * -0.5;
} else if (y <= 0.95) {
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.75d0)) then
tmp = y * (-0.5d0)
else if (y <= 0.95d0) 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.75) {
tmp = y * -0.5;
} else if (y <= 0.95) {
tmp = 0.918938533204673;
} else {
tmp = y * -0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -0.75: tmp = y * -0.5 elif y <= 0.95: tmp = 0.918938533204673 else: tmp = y * -0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= -0.75) tmp = Float64(y * -0.5); elseif (y <= 0.95) 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.75) tmp = y * -0.5; elseif (y <= 0.95) tmp = 0.918938533204673; else tmp = y * -0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -0.75], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 0.95], 0.918938533204673, N[(y * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.75:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 0.95:\\
\;\;\;\;0.918938533204673\\
\mathbf{else}:\\
\;\;\;\;y \cdot -0.5\\
\end{array}
\end{array}
if y < -0.75 or 0.94999999999999996 < y Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6496.2%
Simplified96.2%
Taylor expanded in x around 0
Simplified53.3%
if -0.75 < y < 0.94999999999999996Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
--lowering--.f6495.7%
Simplified95.7%
Taylor expanded in x around 0
Simplified50.3%
(FPCore (x y) :precision binary64 (+ 0.918938533204673 (- (* y (+ x -0.5)) x)))
double code(double x, double y) {
return 0.918938533204673 + ((y * (x + -0.5)) - x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.918938533204673d0 + ((y * (x + (-0.5d0))) - x)
end function
public static double code(double x, double y) {
return 0.918938533204673 + ((y * (x + -0.5)) - x);
}
def code(x, y): return 0.918938533204673 + ((y * (x + -0.5)) - x)
function code(x, y) return Float64(0.918938533204673 + Float64(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[(0.918938533204673 + N[(N[(y * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.918938533204673 + \left(y \cdot \left(x + -0.5\right) - x\right)
\end{array}
Initial program 100.0%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64100.0%
Applied egg-rr100.0%
Final simplification100.0%
(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%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.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%
sub-negN/A
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+r+N/A
*-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
--lowering--.f6445.8%
Simplified45.8%
Taylor expanded in x around 0
Simplified24.5%
herbie shell --seed 2024155
(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))