
(FPCore (x y z) :precision binary64 (- (+ (- x (* (+ y 0.5) (log y))) y) z))
double code(double x, double y, double z) {
return ((x - ((y + 0.5) * log(y))) + y) - z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x - ((y + 0.5d0) * log(y))) + y) - z
end function
public static double code(double x, double y, double z) {
return ((x - ((y + 0.5) * Math.log(y))) + y) - z;
}
def code(x, y, z): return ((x - ((y + 0.5) * math.log(y))) + y) - z
function code(x, y, z) return Float64(Float64(Float64(x - Float64(Float64(y + 0.5) * log(y))) + y) - z) end
function tmp = code(x, y, z) tmp = ((x - ((y + 0.5) * log(y))) + y) - z; end
code[x_, y_, z_] := N[(N[(N[(x - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (- (+ (- x (* (+ y 0.5) (log y))) y) z))
double code(double x, double y, double z) {
return ((x - ((y + 0.5) * log(y))) + y) - z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x - ((y + 0.5d0) * log(y))) + y) - z
end function
public static double code(double x, double y, double z) {
return ((x - ((y + 0.5) * Math.log(y))) + y) - z;
}
def code(x, y, z): return ((x - ((y + 0.5) * math.log(y))) + y) - z
function code(x, y, z) return Float64(Float64(Float64(x - Float64(Float64(y + 0.5) * log(y))) + y) - z) end
function tmp = code(x, y, z) tmp = ((x - ((y + 0.5) * log(y))) + y) - z; end
code[x_, y_, z_] := N[(N[(N[(x - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\end{array}
(FPCore (x y z) :precision binary64 (- (- (- (+ x y) (* (log y) y)) (* 0.5 (log y))) z))
double code(double x, double y, double z) {
return (((x + y) - (log(y) * y)) - (0.5 * log(y))) - z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((x + y) - (log(y) * y)) - (0.5d0 * log(y))) - z
end function
public static double code(double x, double y, double z) {
return (((x + y) - (Math.log(y) * y)) - (0.5 * Math.log(y))) - z;
}
def code(x, y, z): return (((x + y) - (math.log(y) * y)) - (0.5 * math.log(y))) - z
function code(x, y, z) return Float64(Float64(Float64(Float64(x + y) - Float64(log(y) * y)) - Float64(0.5 * log(y))) - z) end
function tmp = code(x, y, z) tmp = (((x + y) - (log(y) * y)) - (0.5 * log(y))) - z; end
code[x_, y_, z_] := N[(N[(N[(N[(x + y), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) - \log y \cdot y\right) - 0.5 \cdot \log y\right) - z
\end{array}
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (+ (/ 1.0 (/ 1.0 x)) y) z))
(t_1 (+ (- x (* (+ 0.5 y) (log y))) y)))
(if (<= t_1 -5e+203)
(- y (* (log y) y))
(if (<= t_1 -1.5e+49)
t_0
(if (<= t_1 -5e+32)
(* (- 1.0 (log y)) y)
(if (<= t_1 500.0) (- (* -0.5 (log y)) z) t_0))))))
double code(double x, double y, double z) {
double t_0 = ((1.0 / (1.0 / x)) + y) - z;
double t_1 = (x - ((0.5 + y) * log(y))) + y;
double tmp;
if (t_1 <= -5e+203) {
tmp = y - (log(y) * y);
} else if (t_1 <= -1.5e+49) {
tmp = t_0;
} else if (t_1 <= -5e+32) {
tmp = (1.0 - log(y)) * y;
} else if (t_1 <= 500.0) {
tmp = (-0.5 * log(y)) - z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((1.0d0 / (1.0d0 / x)) + y) - z
t_1 = (x - ((0.5d0 + y) * log(y))) + y
if (t_1 <= (-5d+203)) then
tmp = y - (log(y) * y)
else if (t_1 <= (-1.5d+49)) then
tmp = t_0
else if (t_1 <= (-5d+32)) then
tmp = (1.0d0 - log(y)) * y
else if (t_1 <= 500.0d0) then
tmp = ((-0.5d0) * log(y)) - z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((1.0 / (1.0 / x)) + y) - z;
double t_1 = (x - ((0.5 + y) * Math.log(y))) + y;
double tmp;
if (t_1 <= -5e+203) {
tmp = y - (Math.log(y) * y);
} else if (t_1 <= -1.5e+49) {
tmp = t_0;
} else if (t_1 <= -5e+32) {
tmp = (1.0 - Math.log(y)) * y;
} else if (t_1 <= 500.0) {
tmp = (-0.5 * Math.log(y)) - z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((1.0 / (1.0 / x)) + y) - z t_1 = (x - ((0.5 + y) * math.log(y))) + y tmp = 0 if t_1 <= -5e+203: tmp = y - (math.log(y) * y) elif t_1 <= -1.5e+49: tmp = t_0 elif t_1 <= -5e+32: tmp = (1.0 - math.log(y)) * y elif t_1 <= 500.0: tmp = (-0.5 * math.log(y)) - z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(1.0 / Float64(1.0 / x)) + y) - z) t_1 = Float64(Float64(x - Float64(Float64(0.5 + y) * log(y))) + y) tmp = 0.0 if (t_1 <= -5e+203) tmp = Float64(y - Float64(log(y) * y)); elseif (t_1 <= -1.5e+49) tmp = t_0; elseif (t_1 <= -5e+32) tmp = Float64(Float64(1.0 - log(y)) * y); elseif (t_1 <= 500.0) tmp = Float64(Float64(-0.5 * log(y)) - z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((1.0 / (1.0 / x)) + y) - z; t_1 = (x - ((0.5 + y) * log(y))) + y; tmp = 0.0; if (t_1 <= -5e+203) tmp = y - (log(y) * y); elseif (t_1 <= -1.5e+49) tmp = t_0; elseif (t_1 <= -5e+32) tmp = (1.0 - log(y)) * y; elseif (t_1 <= 500.0) tmp = (-0.5 * log(y)) - z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x - N[(N[(0.5 + y), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+203], N[(y - N[(N[Log[y], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1.5e+49], t$95$0, If[LessEqual[t$95$1, -5e+32], N[(N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 500.0], N[(N[(-0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{1}{\frac{1}{x}} + y\right) - z\\
t_1 := \left(x - \left(0.5 + y\right) \cdot \log y\right) + y\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+203}:\\
\;\;\;\;y - \log y \cdot y\\
\mathbf{elif}\;t\_1 \leq -1.5 \cdot 10^{+49}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+32}:\\
\;\;\;\;\left(1 - \log y\right) \cdot y\\
\mathbf{elif}\;t\_1 \leq 500:\\
\;\;\;\;-0.5 \cdot \log y - z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < -4.99999999999999994e203Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
distribute-rgt-inN/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-log.f6465.2
Applied rewrites65.2%
Taylor expanded in y around inf
Applied rewrites55.1%
if -4.99999999999999994e203 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < -1.5000000000000001e49 or 500 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) Initial program 99.9%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.8
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6482.2
Applied rewrites82.2%
if -1.5000000000000001e49 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < -4.9999999999999997e32Initial program 99.6%
Taylor expanded in y around inf
*-commutativeN/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6488.4
Applied rewrites88.4%
if -4.9999999999999997e32 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < 500Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6496.3
Applied rewrites96.3%
Taylor expanded in x around 0
Applied rewrites94.9%
Final simplification77.3%
(FPCore (x y z)
:precision binary64
(if (<= y 15.2)
(- (fma -0.5 (log y) x) z)
(if (<= y 1.4e+76)
(fma (- -0.5 y) (log y) (+ x y))
(- y (fma (+ 0.5 y) (log y) z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 15.2) {
tmp = fma(-0.5, log(y), x) - z;
} else if (y <= 1.4e+76) {
tmp = fma((-0.5 - y), log(y), (x + y));
} else {
tmp = y - fma((0.5 + y), log(y), z);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 15.2) tmp = Float64(fma(-0.5, log(y), x) - z); elseif (y <= 1.4e+76) tmp = fma(Float64(-0.5 - y), log(y), Float64(x + y)); else tmp = Float64(y - fma(Float64(0.5 + y), log(y), z)); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 15.2], N[(N[(-0.5 * N[Log[y], $MachinePrecision] + x), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 1.4e+76], N[(N[(-0.5 - y), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(y - N[(N[(0.5 + y), $MachinePrecision] * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 15.2:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(-0.5 - y, \log y, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;y - \mathsf{fma}\left(0.5 + y, \log y, z\right)\\
\end{array}
\end{array}
if y < 15.199999999999999Initial program 100.0%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-log.f64100.0
Applied rewrites100.0%
if 15.199999999999999 < y < 1.3999999999999999e76Initial program 99.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6485.6
Applied rewrites85.6%
if 1.3999999999999999e76 < y Initial program 99.7%
Taylor expanded in x around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-log.f6484.5
Applied rewrites84.5%
Final simplification92.8%
(FPCore (x y z)
:precision binary64
(if (<= y 2.4e+26)
(- (fma -0.5 (log y) x) z)
(if (<= y 1.4e+76)
(fma (- y) (log y) (+ x y))
(- y (fma (+ 0.5 y) (log y) z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.4e+26) {
tmp = fma(-0.5, log(y), x) - z;
} else if (y <= 1.4e+76) {
tmp = fma(-y, log(y), (x + y));
} else {
tmp = y - fma((0.5 + y), log(y), z);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 2.4e+26) tmp = Float64(fma(-0.5, log(y), x) - z); elseif (y <= 1.4e+76) tmp = fma(Float64(-y), log(y), Float64(x + y)); else tmp = Float64(y - fma(Float64(0.5 + y), log(y), z)); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 2.4e+26], N[(N[(-0.5 * N[Log[y], $MachinePrecision] + x), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 1.4e+76], N[((-y) * N[Log[y], $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(y - N[(N[(0.5 + y), $MachinePrecision] * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(-y, \log y, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;y - \mathsf{fma}\left(0.5 + y, \log y, z\right)\\
\end{array}
\end{array}
if y < 2.40000000000000005e26Initial program 100.0%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-log.f6498.2
Applied rewrites98.2%
if 2.40000000000000005e26 < y < 1.3999999999999999e76Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6455.3
Applied rewrites55.3%
Taylor expanded in z around 0
distribute-rgt-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6491.1
Applied rewrites91.1%
Taylor expanded in y around inf
Applied rewrites91.1%
if 1.3999999999999999e76 < y Initial program 99.7%
Taylor expanded in x around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-log.f6484.5
Applied rewrites84.5%
Final simplification92.7%
(FPCore (x y z)
:precision binary64
(if (<= y 2.4e+26)
(- (fma -0.5 (log y) x) z)
(if (<= y 1.4e+76)
(fma (- y) (log y) (+ x y))
(- (* (- 1.0 (log y)) y) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.4e+26) {
tmp = fma(-0.5, log(y), x) - z;
} else if (y <= 1.4e+76) {
tmp = fma(-y, log(y), (x + y));
} else {
tmp = ((1.0 - log(y)) * y) - z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 2.4e+26) tmp = Float64(fma(-0.5, log(y), x) - z); elseif (y <= 1.4e+76) tmp = fma(Float64(-y), log(y), Float64(x + y)); else tmp = Float64(Float64(Float64(1.0 - log(y)) * y) - z); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 2.4e+26], N[(N[(-0.5 * N[Log[y], $MachinePrecision] + x), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 1.4e+76], N[((-y) * N[Log[y], $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(-y, \log y, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \log y\right) \cdot y - z\\
\end{array}
\end{array}
if y < 2.40000000000000005e26Initial program 100.0%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-log.f6498.2
Applied rewrites98.2%
if 2.40000000000000005e26 < y < 1.3999999999999999e76Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6455.3
Applied rewrites55.3%
Taylor expanded in z around 0
distribute-rgt-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6491.1
Applied rewrites91.1%
Taylor expanded in y around inf
Applied rewrites91.1%
if 1.3999999999999999e76 < y Initial program 99.7%
Taylor expanded in y around inf
*-commutativeN/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6484.5
Applied rewrites84.5%
Final simplification92.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (+ (/ 1.0 (/ 1.0 x)) y) z)))
(if (<= x -550000000.0)
t_0
(if (<= x 1.2e-68) (fma (- -0.5 y) (log y) y) t_0))))
double code(double x, double y, double z) {
double t_0 = ((1.0 / (1.0 / x)) + y) - z;
double tmp;
if (x <= -550000000.0) {
tmp = t_0;
} else if (x <= 1.2e-68) {
tmp = fma((-0.5 - y), log(y), y);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(1.0 / Float64(1.0 / x)) + y) - z) tmp = 0.0 if (x <= -550000000.0) tmp = t_0; elseif (x <= 1.2e-68) tmp = fma(Float64(-0.5 - y), log(y), y); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -550000000.0], t$95$0, If[LessEqual[x, 1.2e-68], N[(N[(-0.5 - y), $MachinePrecision] * N[Log[y], $MachinePrecision] + y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{1}{\frac{1}{x}} + y\right) - z\\
\mathbf{if}\;x \leq -550000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-68}:\\
\;\;\;\;\mathsf{fma}\left(-0.5 - y, \log y, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -5.5e8 or 1.19999999999999996e-68 < x Initial program 99.9%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.7
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around inf
lower-/.f6480.6
Applied rewrites80.6%
if -5.5e8 < x < 1.19999999999999996e-68Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
distribute-rgt-inN/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-log.f6499.8
Applied rewrites99.8%
Taylor expanded in z around 0
Applied rewrites68.6%
(FPCore (x y z) :precision binary64 (let* ((t_0 (fma (/ x z) z (- z)))) (if (<= z -545000000000.0) t_0 (if (<= z 205.0) (fma -0.5 (log y) x) t_0))))
double code(double x, double y, double z) {
double t_0 = fma((x / z), z, -z);
double tmp;
if (z <= -545000000000.0) {
tmp = t_0;
} else if (z <= 205.0) {
tmp = fma(-0.5, log(y), x);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = fma(Float64(x / z), z, Float64(-z)) tmp = 0.0 if (z <= -545000000000.0) tmp = t_0; elseif (z <= 205.0) tmp = fma(-0.5, log(y), x); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x / z), $MachinePrecision] * z + (-z)), $MachinePrecision]}, If[LessEqual[z, -545000000000.0], t$95$0, If[LessEqual[z, 205.0], N[(-0.5 * N[Log[y], $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{x}{z}, z, -z\right)\\
\mathbf{if}\;z \leq -545000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 205:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.45e11 or 205 < z Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in z around -inf
associate-*r*N/A
mul-1-negN/A
+-commutativeN/A
div-subN/A
distribute-rgt-inN/A
div-subN/A
distribute-lft-inN/A
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites75.2%
if -5.45e11 < z < 205Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6469.7
Applied rewrites69.7%
Taylor expanded in z around 0
distribute-rgt-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6499.1
Applied rewrites99.1%
Taylor expanded in y around 0
Applied rewrites69.1%
(FPCore (x y z) :precision binary64 (if (<= y 2.4e+26) (- (fma -0.5 (log y) x) z) (fma (- y) (log y) (+ x y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.4e+26) {
tmp = fma(-0.5, log(y), x) - z;
} else {
tmp = fma(-y, log(y), (x + y));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 2.4e+26) tmp = Float64(fma(-0.5, log(y), x) - z); else tmp = fma(Float64(-y), log(y), Float64(x + y)); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 2.4e+26], N[(N[(-0.5 * N[Log[y], $MachinePrecision] + x), $MachinePrecision] - z), $MachinePrecision], N[((-y) * N[Log[y], $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, \log y, x + y\right)\\
\end{array}
\end{array}
if y < 2.40000000000000005e26Initial program 100.0%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-log.f6498.2
Applied rewrites98.2%
if 2.40000000000000005e26 < y Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6440.6
Applied rewrites40.6%
Taylor expanded in z around 0
distribute-rgt-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6481.2
Applied rewrites81.2%
Taylor expanded in y around inf
Applied rewrites81.2%
Final simplification90.7%
(FPCore (x y z) :precision binary64 (- (+ (- x (* (+ 0.5 y) (log y))) y) z))
double code(double x, double y, double z) {
return ((x - ((0.5 + y) * log(y))) + y) - z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x - ((0.5d0 + y) * log(y))) + y) - z
end function
public static double code(double x, double y, double z) {
return ((x - ((0.5 + y) * Math.log(y))) + y) - z;
}
def code(x, y, z): return ((x - ((0.5 + y) * math.log(y))) + y) - z
function code(x, y, z) return Float64(Float64(Float64(x - Float64(Float64(0.5 + y) * log(y))) + y) - z) end
function tmp = code(x, y, z) tmp = ((x - ((0.5 + y) * log(y))) + y) - z; end
code[x_, y_, z_] := N[(N[(N[(x - N[(N[(0.5 + y), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(0.5 + y\right) \cdot \log y\right) + y\right) - z
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= y 4.4e+205) (- (fma -0.5 (log y) x) z) (- y (* (log y) y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 4.4e+205) {
tmp = fma(-0.5, log(y), x) - z;
} else {
tmp = y - (log(y) * y);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 4.4e+205) tmp = Float64(fma(-0.5, log(y), x) - z); else tmp = Float64(y - Float64(log(y) * y)); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 4.4e+205], N[(N[(-0.5 * N[Log[y], $MachinePrecision] + x), $MachinePrecision] - z), $MachinePrecision], N[(y - N[(N[Log[y], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.4 \cdot 10^{+205}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\
\mathbf{else}:\\
\;\;\;\;y - \log y \cdot y\\
\end{array}
\end{array}
if y < 4.3999999999999997e205Initial program 99.9%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-log.f6486.9
Applied rewrites86.9%
if 4.3999999999999997e205 < y Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.6
Applied rewrites99.6%
Taylor expanded in x around 0
distribute-rgt-inN/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-log.f6493.4
Applied rewrites93.4%
Taylor expanded in y around inf
Applied rewrites82.4%
(FPCore (x y z) :precision binary64 (if (<= y 4.4e+205) (- (+ (/ 1.0 (/ 1.0 x)) y) z) (- y (* (log y) y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 4.4e+205) {
tmp = ((1.0 / (1.0 / x)) + y) - z;
} else {
tmp = y - (log(y) * y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 4.4d+205) then
tmp = ((1.0d0 / (1.0d0 / x)) + y) - z
else
tmp = y - (log(y) * y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 4.4e+205) {
tmp = ((1.0 / (1.0 / x)) + y) - z;
} else {
tmp = y - (Math.log(y) * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 4.4e+205: tmp = ((1.0 / (1.0 / x)) + y) - z else: tmp = y - (math.log(y) * y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 4.4e+205) tmp = Float64(Float64(Float64(1.0 / Float64(1.0 / x)) + y) - z); else tmp = Float64(y - Float64(log(y) * y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 4.4e+205) tmp = ((1.0 / (1.0 / x)) + y) - z; else tmp = y - (log(y) * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 4.4e+205], N[(N[(N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision], N[(y - N[(N[Log[y], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.4 \cdot 10^{+205}:\\
\;\;\;\;\left(\frac{1}{\frac{1}{x}} + y\right) - z\\
\mathbf{else}:\\
\;\;\;\;y - \log y \cdot y\\
\end{array}
\end{array}
if y < 4.3999999999999997e205Initial program 99.9%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.7
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around inf
lower-/.f6469.9
Applied rewrites69.9%
if 4.3999999999999997e205 < y Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.6
Applied rewrites99.6%
Taylor expanded in x around 0
distribute-rgt-inN/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-log.f6493.4
Applied rewrites93.4%
Taylor expanded in y around inf
Applied rewrites82.4%
(FPCore (x y z) :precision binary64 (if (<= y 4.4e+205) (- (+ (/ 1.0 (/ 1.0 x)) y) z) (* (- 1.0 (log y)) y)))
double code(double x, double y, double z) {
double tmp;
if (y <= 4.4e+205) {
tmp = ((1.0 / (1.0 / x)) + y) - z;
} else {
tmp = (1.0 - log(y)) * y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 4.4d+205) then
tmp = ((1.0d0 / (1.0d0 / x)) + y) - z
else
tmp = (1.0d0 - log(y)) * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 4.4e+205) {
tmp = ((1.0 / (1.0 / x)) + y) - z;
} else {
tmp = (1.0 - Math.log(y)) * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 4.4e+205: tmp = ((1.0 / (1.0 / x)) + y) - z else: tmp = (1.0 - math.log(y)) * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= 4.4e+205) tmp = Float64(Float64(Float64(1.0 / Float64(1.0 / x)) + y) - z); else tmp = Float64(Float64(1.0 - log(y)) * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 4.4e+205) tmp = ((1.0 / (1.0 / x)) + y) - z; else tmp = (1.0 - log(y)) * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 4.4e+205], N[(N[(N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision], N[(N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.4 \cdot 10^{+205}:\\
\;\;\;\;\left(\frac{1}{\frac{1}{x}} + y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \log y\right) \cdot y\\
\end{array}
\end{array}
if y < 4.3999999999999997e205Initial program 99.9%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.7
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around inf
lower-/.f6469.9
Applied rewrites69.9%
if 4.3999999999999997e205 < y Initial program 99.6%
Taylor expanded in y around inf
*-commutativeN/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6482.3
Applied rewrites82.3%
(FPCore (x y z) :precision binary64 (let* ((t_0 (fma (/ x z) z (- z)))) (if (<= z -2.9e-188) t_0 (if (<= z 3.9e-7) (/ 1.0 (/ 1.0 x)) t_0))))
double code(double x, double y, double z) {
double t_0 = fma((x / z), z, -z);
double tmp;
if (z <= -2.9e-188) {
tmp = t_0;
} else if (z <= 3.9e-7) {
tmp = 1.0 / (1.0 / x);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = fma(Float64(x / z), z, Float64(-z)) tmp = 0.0 if (z <= -2.9e-188) tmp = t_0; elseif (z <= 3.9e-7) tmp = Float64(1.0 / Float64(1.0 / x)); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x / z), $MachinePrecision] * z + (-z)), $MachinePrecision]}, If[LessEqual[z, -2.9e-188], t$95$0, If[LessEqual[z, 3.9e-7], N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{x}{z}, z, -z\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-188}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\frac{1}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.9000000000000001e-188 or 3.90000000000000025e-7 < z Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in z around -inf
associate-*r*N/A
mul-1-negN/A
+-commutativeN/A
div-subN/A
distribute-rgt-inN/A
div-subN/A
distribute-lft-inN/A
Applied rewrites95.5%
Taylor expanded in x around inf
Applied rewrites67.5%
if -2.9000000000000001e-188 < z < 3.90000000000000025e-7Initial program 99.8%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.5
lift--.f64N/A
lift-+.f64N/A
Applied rewrites99.5%
Taylor expanded in x around inf
lower-/.f6443.0
Applied rewrites43.0%
(FPCore (x y z) :precision binary64 (- (+ (/ 1.0 (/ 1.0 x)) y) z))
double code(double x, double y, double z) {
return ((1.0 / (1.0 / x)) + y) - z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((1.0d0 / (1.0d0 / x)) + y) - z
end function
public static double code(double x, double y, double z) {
return ((1.0 / (1.0 / x)) + y) - z;
}
def code(x, y, z): return ((1.0 / (1.0 / x)) + y) - z
function code(x, y, z) return Float64(Float64(Float64(1.0 / Float64(1.0 / x)) + y) - z) end
function tmp = code(x, y, z) tmp = ((1.0 / (1.0 / x)) + y) - z; end
code[x_, y_, z_] := N[(N[(N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{1}{\frac{1}{x}} + y\right) - z
\end{array}
Initial program 99.8%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.7
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in x around inf
lower-/.f6458.7
Applied rewrites58.7%
(FPCore (x y z) :precision binary64 (fma (/ x z) z (- z)))
double code(double x, double y, double z) {
return fma((x / z), z, -z);
}
function code(x, y, z) return fma(Float64(x / z), z, Float64(-z)) end
code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] * z + (-z)), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{x}{z}, z, -z\right)
\end{array}
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-lft-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in z around -inf
associate-*r*N/A
mul-1-negN/A
+-commutativeN/A
div-subN/A
distribute-rgt-inN/A
div-subN/A
distribute-lft-inN/A
Applied rewrites84.5%
Taylor expanded in x around inf
Applied rewrites52.2%
(FPCore (x y z) :precision binary64 (- z))
double code(double x, double y, double z) {
return -z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = -z
end function
public static double code(double x, double y, double z) {
return -z;
}
def code(x, y, z): return -z
function code(x, y, z) return Float64(-z) end
function tmp = code(x, y, z) tmp = -z; end
code[x_, y_, z_] := (-z)
\begin{array}{l}
\\
-z
\end{array}
Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6429.4
Applied rewrites29.4%
(FPCore (x y z) :precision binary64 z)
double code(double x, double y, double z) {
return z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z
end function
public static double code(double x, double y, double z) {
return z;
}
def code(x, y, z): return z
function code(x, y, z) return z end
function tmp = code(x, y, z) tmp = z; end
code[x_, y_, z_] := z
\begin{array}{l}
\\
z
\end{array}
Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6429.4
Applied rewrites29.4%
Applied rewrites11.0%
Applied rewrites2.4%
(FPCore (x y z) :precision binary64 (- (- (+ y x) z) (* (+ y 0.5) (log y))))
double code(double x, double y, double z) {
return ((y + x) - z) - ((y + 0.5) * log(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((y + x) - z) - ((y + 0.5d0) * log(y))
end function
public static double code(double x, double y, double z) {
return ((y + x) - z) - ((y + 0.5) * Math.log(y));
}
def code(x, y, z): return ((y + x) - z) - ((y + 0.5) * math.log(y))
function code(x, y, z) return Float64(Float64(Float64(y + x) - z) - Float64(Float64(y + 0.5) * log(y))) end
function tmp = code(x, y, z) tmp = ((y + x) - z) - ((y + 0.5) * log(y)); end
code[x_, y_, z_] := N[(N[(N[(y + x), $MachinePrecision] - z), $MachinePrecision] - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(y + x\right) - z\right) - \left(y + 0.5\right) \cdot \log y
\end{array}
herbie shell --seed 2024277
(FPCore (x y z)
:name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
:precision binary64
:alt
(! :herbie-platform default (- (- (+ y x) z) (* (+ y 1/2) (log y))))
(- (+ (- x (* (+ y 0.5) (log y))) y) z))