
(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 (fma (- y 1.0) x (fma -0.5 y 0.918938533204673)))
double code(double x, double y) {
return fma((y - 1.0), x, fma(-0.5, y, 0.918938533204673));
}
function code(x, y) return fma(Float64(y - 1.0), x, fma(-0.5, y, 0.918938533204673)) end
code[x_, y_] := N[(N[(y - 1.0), $MachinePrecision] * x + N[(-0.5 * y + 0.918938533204673), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - 1, x, \mathsf{fma}\left(-0.5, y, 0.918938533204673\right)\right)
\end{array}
Initial program 100.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-eval100.0
Applied rewrites100.0%
(FPCore (x y)
:precision binary64
(if (<= x -8.5e+209)
(* x y)
(if (<= x -0.165)
(- 0.918938533204673 x)
(if (<= x 0.58)
(fma -0.5 y 0.918938533204673)
(if (<= x 7.2e+265) (* x y) (- x))))))
double code(double x, double y) {
double tmp;
if (x <= -8.5e+209) {
tmp = x * y;
} else if (x <= -0.165) {
tmp = 0.918938533204673 - x;
} else if (x <= 0.58) {
tmp = fma(-0.5, y, 0.918938533204673);
} else if (x <= 7.2e+265) {
tmp = x * y;
} else {
tmp = -x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -8.5e+209) tmp = Float64(x * y); elseif (x <= -0.165) tmp = Float64(0.918938533204673 - x); elseif (x <= 0.58) tmp = fma(-0.5, y, 0.918938533204673); elseif (x <= 7.2e+265) tmp = Float64(x * y); else tmp = Float64(-x); end return tmp end
code[x_, y_] := If[LessEqual[x, -8.5e+209], N[(x * y), $MachinePrecision], If[LessEqual[x, -0.165], N[(0.918938533204673 - x), $MachinePrecision], If[LessEqual[x, 0.58], N[(-0.5 * y + 0.918938533204673), $MachinePrecision], If[LessEqual[x, 7.2e+265], N[(x * y), $MachinePrecision], (-x)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+209}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -0.165:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{elif}\;x \leq 0.58:\\
\;\;\;\;\mathsf{fma}\left(-0.5, y, 0.918938533204673\right)\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+265}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < -8.50000000000000062e209 or 0.57999999999999996 < x < 7.20000000000000005e265Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6466.1
Applied rewrites66.1%
Taylor expanded in x around inf
Applied rewrites65.5%
if -8.50000000000000062e209 < x < -0.165000000000000008Initial program 100.0%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6458.7
Applied rewrites58.7%
if -0.165000000000000008 < x < 0.57999999999999996Initial program 100.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f6497.7
Applied rewrites97.7%
if 7.20000000000000005e265 < x Initial program 100.0%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6477.5
Applied rewrites77.5%
Taylor expanded in x around inf
Applied rewrites77.5%
(FPCore (x y)
:precision binary64
(if (<= y -1.8e+239)
(* x y)
(if (<= y -8e+169)
(* -0.5 y)
(if (<= y -230.0)
(* x y)
(if (<= y 1.85) (- 0.918938533204673 x) (* -0.5 y))))))
double code(double x, double y) {
double tmp;
if (y <= -1.8e+239) {
tmp = x * y;
} else if (y <= -8e+169) {
tmp = -0.5 * y;
} else if (y <= -230.0) {
tmp = x * y;
} else if (y <= 1.85) {
tmp = 0.918938533204673 - x;
} else {
tmp = -0.5 * y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.8d+239)) then
tmp = x * y
else if (y <= (-8d+169)) then
tmp = (-0.5d0) * y
else if (y <= (-230.0d0)) then
tmp = x * y
else if (y <= 1.85d0) then
tmp = 0.918938533204673d0 - x
else
tmp = (-0.5d0) * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.8e+239) {
tmp = x * y;
} else if (y <= -8e+169) {
tmp = -0.5 * y;
} else if (y <= -230.0) {
tmp = x * y;
} else if (y <= 1.85) {
tmp = 0.918938533204673 - x;
} else {
tmp = -0.5 * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.8e+239: tmp = x * y elif y <= -8e+169: tmp = -0.5 * y elif y <= -230.0: tmp = x * y elif y <= 1.85: tmp = 0.918938533204673 - x else: tmp = -0.5 * y return tmp
function code(x, y) tmp = 0.0 if (y <= -1.8e+239) tmp = Float64(x * y); elseif (y <= -8e+169) tmp = Float64(-0.5 * y); elseif (y <= -230.0) tmp = Float64(x * y); elseif (y <= 1.85) tmp = Float64(0.918938533204673 - x); else tmp = Float64(-0.5 * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.8e+239) tmp = x * y; elseif (y <= -8e+169) tmp = -0.5 * y; elseif (y <= -230.0) tmp = x * y; elseif (y <= 1.85) tmp = 0.918938533204673 - x; else tmp = -0.5 * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.8e+239], N[(x * y), $MachinePrecision], If[LessEqual[y, -8e+169], N[(-0.5 * y), $MachinePrecision], If[LessEqual[y, -230.0], N[(x * y), $MachinePrecision], If[LessEqual[y, 1.85], N[(0.918938533204673 - x), $MachinePrecision], N[(-0.5 * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+239}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+169}:\\
\;\;\;\;-0.5 \cdot y\\
\mathbf{elif}\;y \leq -230:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 1.85:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot y\\
\end{array}
\end{array}
if y < -1.8e239 or -7.99999999999999947e169 < y < -230Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6498.3
Applied rewrites98.3%
Taylor expanded in x around inf
Applied rewrites66.2%
if -1.8e239 < y < -7.99999999999999947e169 or 1.8500000000000001 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6498.9
Applied rewrites98.9%
Taylor expanded in x around 0
Applied rewrites65.2%
if -230 < y < 1.8500000000000001Initial program 100.0%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6496.5
Applied rewrites96.5%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 3.2e-23))) (fma (+ -0.5 x) y 0.918938533204673) (+ (fma -0.5 y (- x)) 0.918938533204673)))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 3.2e-23)) {
tmp = fma((-0.5 + x), y, 0.918938533204673);
} else {
tmp = fma(-0.5, y, -x) + 0.918938533204673;
}
return tmp;
}
function code(x, y) tmp = 0.0 if ((y <= -1.0) || !(y <= 3.2e-23)) tmp = fma(Float64(-0.5 + x), y, 0.918938533204673); else tmp = Float64(fma(-0.5, y, Float64(-x)) + 0.918938533204673); end return tmp end
code[x_, y_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 3.2e-23]], $MachinePrecision]], N[(N[(-0.5 + x), $MachinePrecision] * y + 0.918938533204673), $MachinePrecision], N[(N[(-0.5 * y + (-x)), $MachinePrecision] + 0.918938533204673), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 3.2 \cdot 10^{-23}\right):\\
\;\;\;\;\mathsf{fma}\left(-0.5 + x, y, 0.918938533204673\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, y, -x\right) + 0.918938533204673\\
\end{array}
\end{array}
if y < -1 or 3.19999999999999976e-23 < y Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites98.9%
if -1 < y < 3.19999999999999976e-23Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
associate-+l-N/A
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites99.5%
Final simplification99.2%
(FPCore (x y) :precision binary64 (if (or (<= x -39000.0) (not (<= x 4000000000.0))) (* (- y 1.0) x) (fma (+ -0.5 x) y 0.918938533204673)))
double code(double x, double y) {
double tmp;
if ((x <= -39000.0) || !(x <= 4000000000.0)) {
tmp = (y - 1.0) * x;
} else {
tmp = fma((-0.5 + x), y, 0.918938533204673);
}
return tmp;
}
function code(x, y) tmp = 0.0 if ((x <= -39000.0) || !(x <= 4000000000.0)) tmp = Float64(Float64(y - 1.0) * x); else tmp = fma(Float64(-0.5 + x), y, 0.918938533204673); end return tmp end
code[x_, y_] := If[Or[LessEqual[x, -39000.0], N[Not[LessEqual[x, 4000000000.0]], $MachinePrecision]], N[(N[(y - 1.0), $MachinePrecision] * x), $MachinePrecision], N[(N[(-0.5 + x), $MachinePrecision] * y + 0.918938533204673), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -39000 \lor \neg \left(x \leq 4000000000\right):\\
\;\;\;\;\left(y - 1\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5 + x, y, 0.918938533204673\right)\\
\end{array}
\end{array}
if x < -39000 or 4e9 < x Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites100.0%
Taylor expanded in x around -inf
Applied rewrites99.0%
if -39000 < x < 4e9Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites98.9%
Final simplification99.0%
(FPCore (x y) :precision binary64 (if (or (<= x -0.75) (not (<= x 0.58))) (* (- y 1.0) x) (fma -0.5 y 0.918938533204673)))
double code(double x, double y) {
double tmp;
if ((x <= -0.75) || !(x <= 0.58)) {
tmp = (y - 1.0) * x;
} else {
tmp = fma(-0.5, y, 0.918938533204673);
}
return tmp;
}
function code(x, y) tmp = 0.0 if ((x <= -0.75) || !(x <= 0.58)) tmp = Float64(Float64(y - 1.0) * x); else tmp = fma(-0.5, y, 0.918938533204673); end return tmp end
code[x_, y_] := If[Or[LessEqual[x, -0.75], N[Not[LessEqual[x, 0.58]], $MachinePrecision]], N[(N[(y - 1.0), $MachinePrecision] * x), $MachinePrecision], N[(-0.5 * y + 0.918938533204673), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.75 \lor \neg \left(x \leq 0.58\right):\\
\;\;\;\;\left(y - 1\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, y, 0.918938533204673\right)\\
\end{array}
\end{array}
if x < -0.75 or 0.57999999999999996 < x Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites100.0%
Taylor expanded in x around -inf
Applied rewrites98.8%
if -0.75 < x < 0.57999999999999996Initial program 100.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f6497.7
Applied rewrites97.7%
Final simplification98.2%
(FPCore (x y) :precision binary64 (if (or (<= y -230.0) (not (<= y 1.85))) (* x y) (- 0.918938533204673 x)))
double code(double x, double y) {
double tmp;
if ((y <= -230.0) || !(y <= 1.85)) {
tmp = x * y;
} 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 <= (-230.0d0)) .or. (.not. (y <= 1.85d0))) then
tmp = x * y
else
tmp = 0.918938533204673d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -230.0) || !(y <= 1.85)) {
tmp = x * y;
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -230.0) or not (y <= 1.85): tmp = x * y else: tmp = 0.918938533204673 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -230.0) || !(y <= 1.85)) tmp = Float64(x * y); else tmp = Float64(0.918938533204673 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -230.0) || ~((y <= 1.85))) tmp = x * y; else tmp = 0.918938533204673 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -230.0], N[Not[LessEqual[y, 1.85]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(0.918938533204673 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -230 \lor \neg \left(y \leq 1.85\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - x\\
\end{array}
\end{array}
if y < -230 or 1.8500000000000001 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6498.7
Applied rewrites98.7%
Taylor expanded in x around inf
Applied rewrites47.4%
if -230 < y < 1.8500000000000001Initial program 100.0%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6496.5
Applied rewrites96.5%
Final simplification72.4%
(FPCore (x y) :precision binary64 (if (or (<= x -0.0007) (not (<= x 4000000000.0))) (- x) 0.918938533204673))
double code(double x, double y) {
double tmp;
if ((x <= -0.0007) || !(x <= 4000000000.0)) {
tmp = -x;
} else {
tmp = 0.918938533204673;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-0.0007d0)) .or. (.not. (x <= 4000000000.0d0))) then
tmp = -x
else
tmp = 0.918938533204673d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -0.0007) || !(x <= 4000000000.0)) {
tmp = -x;
} else {
tmp = 0.918938533204673;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -0.0007) or not (x <= 4000000000.0): tmp = -x else: tmp = 0.918938533204673 return tmp
function code(x, y) tmp = 0.0 if ((x <= -0.0007) || !(x <= 4000000000.0)) tmp = Float64(-x); else tmp = 0.918938533204673; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -0.0007) || ~((x <= 4000000000.0))) tmp = -x; else tmp = 0.918938533204673; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -0.0007], N[Not[LessEqual[x, 4000000000.0]], $MachinePrecision]], (-x), 0.918938533204673]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0007 \lor \neg \left(x \leq 4000000000\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673\\
\end{array}
\end{array}
if x < -6.99999999999999993e-4 or 4e9 < x Initial program 100.0%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6448.0
Applied rewrites48.0%
Taylor expanded in x around inf
Applied rewrites47.1%
if -6.99999999999999993e-4 < x < 4e9Initial program 100.0%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6453.0
Applied rewrites53.0%
Taylor expanded in x around 0
Applied rewrites52.3%
Final simplification50.0%
(FPCore (x y) :precision binary64 (+ (fma (+ -0.5 x) y (- x)) 0.918938533204673))
double code(double x, double y) {
return fma((-0.5 + x), y, -x) + 0.918938533204673;
}
function code(x, y) return Float64(fma(Float64(-0.5 + x), y, Float64(-x)) + 0.918938533204673) end
code[x_, y_] := N[(N[(N[(-0.5 + x), $MachinePrecision] * y + (-x)), $MachinePrecision] + 0.918938533204673), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-0.5 + x, y, -x\right) + 0.918938533204673
\end{array}
Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
distribute-lft-out--N/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
associate-+l-N/A
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-out--N/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites100.0%
(FPCore (x y) :precision binary64 (fma (+ -0.5 x) y (- 0.918938533204673 x)))
double code(double x, double y) {
return fma((-0.5 + x), y, (0.918938533204673 - x));
}
function code(x, y) return fma(Float64(-0.5 + x), y, Float64(0.918938533204673 - x)) end
code[x_, y_] := N[(N[(-0.5 + x), $MachinePrecision] * y + N[(0.918938533204673 - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-0.5 + x, y, 0.918938533204673 - x\right)
\end{array}
Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites100.0%
(FPCore (x y) :precision binary64 (- 0.918938533204673 x))
double code(double x, double y) {
return 0.918938533204673 - x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.918938533204673d0 - x
end function
public static double code(double x, double y) {
return 0.918938533204673 - x;
}
def code(x, y): return 0.918938533204673 - x
function code(x, y) return Float64(0.918938533204673 - x) end
function tmp = code(x, y) tmp = 0.918938533204673 - x; end
code[x_, y_] := N[(0.918938533204673 - x), $MachinePrecision]
\begin{array}{l}
\\
0.918938533204673 - x
\end{array}
Initial program 100.0%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6450.8
Applied rewrites50.8%
(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%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in x around 0
Applied rewrites31.0%
herbie shell --seed 2024326
(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))