
(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 14 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 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(x - Float64(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[(x - N[(N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \left(\left(y + 0.5\right) \cdot \log y - y\right)\right) - z
\end{array}
Initial program 99.8%
Applied egg-rr0
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* y (- 1.0 (log y))) z)))
(if (<= x -4.8e+69)
(* (+ y (- x z)) (/ (+ y (+ z x)) (+ z x)))
(if (<= x -1.3e-147)
t_0
(if (<= x -1.9e-202)
(- (* (log y) -0.5) z)
(if (<= x 4.8e+95) t_0 (- x z)))))))
double code(double x, double y, double z) {
double t_0 = (y * (1.0 - log(y))) - z;
double tmp;
if (x <= -4.8e+69) {
tmp = (y + (x - z)) * ((y + (z + x)) / (z + x));
} else if (x <= -1.3e-147) {
tmp = t_0;
} else if (x <= -1.9e-202) {
tmp = (log(y) * -0.5) - z;
} else if (x <= 4.8e+95) {
tmp = t_0;
} else {
tmp = x - z;
}
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) :: tmp
t_0 = (y * (1.0d0 - log(y))) - z
if (x <= (-4.8d+69)) then
tmp = (y + (x - z)) * ((y + (z + x)) / (z + x))
else if (x <= (-1.3d-147)) then
tmp = t_0
else if (x <= (-1.9d-202)) then
tmp = (log(y) * (-0.5d0)) - z
else if (x <= 4.8d+95) then
tmp = t_0
else
tmp = x - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y * (1.0 - Math.log(y))) - z;
double tmp;
if (x <= -4.8e+69) {
tmp = (y + (x - z)) * ((y + (z + x)) / (z + x));
} else if (x <= -1.3e-147) {
tmp = t_0;
} else if (x <= -1.9e-202) {
tmp = (Math.log(y) * -0.5) - z;
} else if (x <= 4.8e+95) {
tmp = t_0;
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): t_0 = (y * (1.0 - math.log(y))) - z tmp = 0 if x <= -4.8e+69: tmp = (y + (x - z)) * ((y + (z + x)) / (z + x)) elif x <= -1.3e-147: tmp = t_0 elif x <= -1.9e-202: tmp = (math.log(y) * -0.5) - z elif x <= 4.8e+95: tmp = t_0 else: tmp = x - z return tmp
function code(x, y, z) t_0 = Float64(Float64(y * Float64(1.0 - log(y))) - z) tmp = 0.0 if (x <= -4.8e+69) tmp = Float64(Float64(y + Float64(x - z)) * Float64(Float64(y + Float64(z + x)) / Float64(z + x))); elseif (x <= -1.3e-147) tmp = t_0; elseif (x <= -1.9e-202) tmp = Float64(Float64(log(y) * -0.5) - z); elseif (x <= 4.8e+95) tmp = t_0; else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y * (1.0 - log(y))) - z; tmp = 0.0; if (x <= -4.8e+69) tmp = (y + (x - z)) * ((y + (z + x)) / (z + x)); elseif (x <= -1.3e-147) tmp = t_0; elseif (x <= -1.9e-202) tmp = (log(y) * -0.5) - z; elseif (x <= 4.8e+95) tmp = t_0; else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -4.8e+69], N[(N[(y + N[(x - z), $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(z + x), $MachinePrecision]), $MachinePrecision] / N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.3e-147], t$95$0, If[LessEqual[x, -1.9e-202], N[(N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 4.8e+95], t$95$0, N[(x - z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(1 - \log y\right) - z\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+69}:\\
\;\;\;\;\left(y + \left(x - z\right)\right) \cdot \frac{y + \left(z + x\right)}{z + x}\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-147}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-202}:\\
\;\;\;\;\log y \cdot -0.5 - z\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+95}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if x < -4.8000000000000003e69Initial program 100.0%
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Taylor expanded in y around 0 0
Simplified0
Applied egg-rr0
if -4.8000000000000003e69 < x < -1.2999999999999999e-147 or -1.90000000000000007e-202 < x < 4.8000000000000001e95Initial program 99.7%
Taylor expanded in y around inf 0
Simplified0
if -1.2999999999999999e-147 < x < -1.90000000000000007e-202Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
if 4.8000000000000001e95 < x Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z)
:precision binary64
(if (<= z -96.0)
(* (+ y (- x z)) (/ (+ y (+ z x)) (+ z x)))
(if (<= z 5.5e-42)
(+ x (* (log y) -0.5))
(if (<= z 2.65e+45) (* y (- 1.0 (log y))) (- x z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -96.0) {
tmp = (y + (x - z)) * ((y + (z + x)) / (z + x));
} else if (z <= 5.5e-42) {
tmp = x + (log(y) * -0.5);
} else if (z <= 2.65e+45) {
tmp = y * (1.0 - log(y));
} else {
tmp = x - z;
}
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 (z <= (-96.0d0)) then
tmp = (y + (x - z)) * ((y + (z + x)) / (z + x))
else if (z <= 5.5d-42) then
tmp = x + (log(y) * (-0.5d0))
else if (z <= 2.65d+45) then
tmp = y * (1.0d0 - log(y))
else
tmp = x - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -96.0) {
tmp = (y + (x - z)) * ((y + (z + x)) / (z + x));
} else if (z <= 5.5e-42) {
tmp = x + (Math.log(y) * -0.5);
} else if (z <= 2.65e+45) {
tmp = y * (1.0 - Math.log(y));
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -96.0: tmp = (y + (x - z)) * ((y + (z + x)) / (z + x)) elif z <= 5.5e-42: tmp = x + (math.log(y) * -0.5) elif z <= 2.65e+45: tmp = y * (1.0 - math.log(y)) else: tmp = x - z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -96.0) tmp = Float64(Float64(y + Float64(x - z)) * Float64(Float64(y + Float64(z + x)) / Float64(z + x))); elseif (z <= 5.5e-42) tmp = Float64(x + Float64(log(y) * -0.5)); elseif (z <= 2.65e+45) tmp = Float64(y * Float64(1.0 - log(y))); else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -96.0) tmp = (y + (x - z)) * ((y + (z + x)) / (z + x)); elseif (z <= 5.5e-42) tmp = x + (log(y) * -0.5); elseif (z <= 2.65e+45) tmp = y * (1.0 - log(y)); else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -96.0], N[(N[(y + N[(x - z), $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(z + x), $MachinePrecision]), $MachinePrecision] / N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-42], N[(x + N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.65e+45], N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -96:\\
\;\;\;\;\left(y + \left(x - z\right)\right) \cdot \frac{y + \left(z + x\right)}{z + x}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-42}:\\
\;\;\;\;x + \log y \cdot -0.5\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{+45}:\\
\;\;\;\;y \cdot \left(1 - \log y\right)\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -96Initial program 99.8%
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Taylor expanded in y around 0 0
Simplified0
Applied egg-rr0
if -96 < z < 5.5e-42Initial program 99.8%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in z around 0 0
Simplified0
if 5.5e-42 < z < 2.64999999999999996e45Initial program 99.5%
Taylor expanded in y around inf 0
Simplified0
if 2.64999999999999996e45 < z Initial program 100.0%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= z -8.6e+69) (* (+ y (- x z)) (/ (+ y (+ z x)) (+ z x))) (if (<= z 1.65e+139) (+ x (- y (* (log y) (+ y 0.5)))) (- x z))))
double code(double x, double y, double z) {
double tmp;
if (z <= -8.6e+69) {
tmp = (y + (x - z)) * ((y + (z + x)) / (z + x));
} else if (z <= 1.65e+139) {
tmp = x + (y - (log(y) * (y + 0.5)));
} else {
tmp = x - z;
}
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 (z <= (-8.6d+69)) then
tmp = (y + (x - z)) * ((y + (z + x)) / (z + x))
else if (z <= 1.65d+139) then
tmp = x + (y - (log(y) * (y + 0.5d0)))
else
tmp = x - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -8.6e+69) {
tmp = (y + (x - z)) * ((y + (z + x)) / (z + x));
} else if (z <= 1.65e+139) {
tmp = x + (y - (Math.log(y) * (y + 0.5)));
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -8.6e+69: tmp = (y + (x - z)) * ((y + (z + x)) / (z + x)) elif z <= 1.65e+139: tmp = x + (y - (math.log(y) * (y + 0.5))) else: tmp = x - z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -8.6e+69) tmp = Float64(Float64(y + Float64(x - z)) * Float64(Float64(y + Float64(z + x)) / Float64(z + x))); elseif (z <= 1.65e+139) tmp = Float64(x + Float64(y - Float64(log(y) * Float64(y + 0.5)))); else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -8.6e+69) tmp = (y + (x - z)) * ((y + (z + x)) / (z + x)); elseif (z <= 1.65e+139) tmp = x + (y - (log(y) * (y + 0.5))); else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -8.6e+69], N[(N[(y + N[(x - z), $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(z + x), $MachinePrecision]), $MachinePrecision] / N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+139], N[(x + N[(y - N[(N[Log[y], $MachinePrecision] * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+69}:\\
\;\;\;\;\left(y + \left(x - z\right)\right) \cdot \frac{y + \left(z + x\right)}{z + x}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+139}:\\
\;\;\;\;x + \left(y - \log y \cdot \left(y + 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -8.59999999999999986e69Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Taylor expanded in y around 0 0
Simplified0
Applied egg-rr0
if -8.59999999999999986e69 < z < 1.6500000000000001e139Initial program 99.7%
Applied egg-rr0
Applied egg-rr0
Taylor expanded in z around 0 0
Simplified0
if 1.6500000000000001e139 < z Initial program 100.0%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= y 8.5e-7) (- (- x (* 0.5 (log y))) z) (- (- x (- (* y (log y)) y)) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= 8.5e-7) {
tmp = (x - (0.5 * log(y))) - z;
} else {
tmp = (x - ((y * log(y)) - y)) - z;
}
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 <= 8.5d-7) then
tmp = (x - (0.5d0 * log(y))) - z
else
tmp = (x - ((y * log(y)) - y)) - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 8.5e-7) {
tmp = (x - (0.5 * Math.log(y))) - z;
} else {
tmp = (x - ((y * Math.log(y)) - y)) - z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 8.5e-7: tmp = (x - (0.5 * math.log(y))) - z else: tmp = (x - ((y * math.log(y)) - y)) - z return tmp
function code(x, y, z) tmp = 0.0 if (y <= 8.5e-7) tmp = Float64(Float64(x - Float64(0.5 * log(y))) - z); else tmp = Float64(Float64(x - Float64(Float64(y * log(y)) - y)) - z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 8.5e-7) tmp = (x - (0.5 * log(y))) - z; else tmp = (x - ((y * log(y)) - y)) - z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 8.5e-7], N[(N[(x - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(x - N[(N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;\left(x - 0.5 \cdot \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(x - \left(y \cdot \log y - y\right)\right) - z\\
\end{array}
\end{array}
if y < 8.50000000000000014e-7Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
if 8.50000000000000014e-7 < y Initial program 99.6%
Applied egg-rr0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= y 8.5e-7) (- (- x (* 0.5 (log y))) z) (- (+ (- x (* y (log y))) y) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= 8.5e-7) {
tmp = (x - (0.5 * log(y))) - z;
} else {
tmp = ((x - (y * log(y))) + y) - z;
}
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 <= 8.5d-7) then
tmp = (x - (0.5d0 * log(y))) - z
else
tmp = ((x - (y * log(y))) + y) - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 8.5e-7) {
tmp = (x - (0.5 * Math.log(y))) - z;
} else {
tmp = ((x - (y * Math.log(y))) + y) - z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 8.5e-7: tmp = (x - (0.5 * math.log(y))) - z else: tmp = ((x - (y * math.log(y))) + y) - z return tmp
function code(x, y, z) tmp = 0.0 if (y <= 8.5e-7) tmp = Float64(Float64(x - Float64(0.5 * log(y))) - z); else tmp = Float64(Float64(Float64(x - Float64(y * log(y))) + y) - z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 8.5e-7) tmp = (x - (0.5 * log(y))) - z; else tmp = ((x - (y * log(y))) + y) - z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 8.5e-7], N[(N[(x - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[(x - N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;\left(x - 0.5 \cdot \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x - y \cdot \log y\right) + y\right) - z\\
\end{array}
\end{array}
if y < 8.50000000000000014e-7Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
if 8.50000000000000014e-7 < y Initial program 99.6%
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= y 2.05e+54) (- (- x (* 0.5 (log y))) z) (- (* y (- 1.0 (log y))) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.05e+54) {
tmp = (x - (0.5 * log(y))) - z;
} else {
tmp = (y * (1.0 - log(y))) - z;
}
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 <= 2.05d+54) then
tmp = (x - (0.5d0 * log(y))) - z
else
tmp = (y * (1.0d0 - log(y))) - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2.05e+54) {
tmp = (x - (0.5 * Math.log(y))) - z;
} else {
tmp = (y * (1.0 - Math.log(y))) - z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2.05e+54: tmp = (x - (0.5 * math.log(y))) - z else: tmp = (y * (1.0 - math.log(y))) - z return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2.05e+54) tmp = Float64(Float64(x - Float64(0.5 * log(y))) - z); else tmp = Float64(Float64(y * Float64(1.0 - log(y))) - z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 2.05e+54) tmp = (x - (0.5 * log(y))) - z; else tmp = (y * (1.0 - log(y))) - z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2.05e+54], N[(N[(x - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.05 \cdot 10^{+54}:\\
\;\;\;\;\left(x - 0.5 \cdot \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \log y\right) - z\\
\end{array}
\end{array}
if y < 2.04999999999999984e54Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
if 2.04999999999999984e54 < y Initial program 99.6%
Taylor expanded in y around inf 0
Simplified0
(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}
Initial program 99.8%
(FPCore (x y z) :precision binary64 (if (<= y 1.35e+122) (- (+ x y) z) (* y (- 1.0 (log y)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.35e+122) {
tmp = (x + y) - z;
} else {
tmp = y * (1.0 - log(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 <= 1.35d+122) then
tmp = (x + y) - z
else
tmp = y * (1.0d0 - log(y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1.35e+122) {
tmp = (x + y) - z;
} else {
tmp = y * (1.0 - Math.log(y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.35e+122: tmp = (x + y) - z else: tmp = y * (1.0 - math.log(y)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.35e+122) tmp = Float64(Float64(x + y) - z); else tmp = Float64(y * Float64(1.0 - log(y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.35e+122) tmp = (x + y) - z; else tmp = y * (1.0 - log(y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.35e+122], N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision], N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.35 \cdot 10^{+122}:\\
\;\;\;\;\left(x + y\right) - z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \log y\right)\\
\end{array}
\end{array}
if y < 1.3499999999999999e122Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
if 1.3499999999999999e122 < y Initial program 99.5%
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (* (+ y (- x z)) (/ (+ y (+ z x)) (+ z x))))
double code(double x, double y, double z) {
return (y + (x - z)) * ((y + (z + x)) / (z + x));
}
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 + (z + x)) / (z + x))
end function
public static double code(double x, double y, double z) {
return (y + (x - z)) * ((y + (z + x)) / (z + x));
}
def code(x, y, z): return (y + (x - z)) * ((y + (z + x)) / (z + x))
function code(x, y, z) return Float64(Float64(y + Float64(x - z)) * Float64(Float64(y + Float64(z + x)) / Float64(z + x))) end
function tmp = code(x, y, z) tmp = (y + (x - z)) * ((y + (z + x)) / (z + x)); end
code[x_, y_, z_] := N[(N[(y + N[(x - z), $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(z + x), $MachinePrecision]), $MachinePrecision] / N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y + \left(x - z\right)\right) \cdot \frac{y + \left(z + x\right)}{z + x}
\end{array}
Initial program 99.8%
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Taylor expanded in y around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z) :precision binary64 (if (<= x -6.8e+69) x (if (<= x 1.35e+68) (- z) (+ y x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -6.8e+69) {
tmp = x;
} else if (x <= 1.35e+68) {
tmp = -z;
} else {
tmp = y + x;
}
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 (x <= (-6.8d+69)) then
tmp = x
else if (x <= 1.35d+68) then
tmp = -z
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -6.8e+69) {
tmp = x;
} else if (x <= 1.35e+68) {
tmp = -z;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -6.8e+69: tmp = x elif x <= 1.35e+68: tmp = -z else: tmp = y + x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -6.8e+69) tmp = x; elseif (x <= 1.35e+68) tmp = Float64(-z); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -6.8e+69) tmp = x; elseif (x <= 1.35e+68) tmp = -z; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -6.8e+69], x, If[LessEqual[x, 1.35e+68], (-z), N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+69}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+68}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if x < -6.79999999999999973e69Initial program 100.0%
Taylor expanded in x around inf 0
Simplified0
if -6.79999999999999973e69 < x < 1.34999999999999995e68Initial program 99.7%
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in z around inf 0
Simplified0
if 1.34999999999999995e68 < x Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= x -1.4e+69) x (if (<= x 3.2e+68) (- z) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.4e+69) {
tmp = x;
} else if (x <= 3.2e+68) {
tmp = -z;
} else {
tmp = x;
}
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 (x <= (-1.4d+69)) then
tmp = x
else if (x <= 3.2d+68) then
tmp = -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.4e+69) {
tmp = x;
} else if (x <= 3.2e+68) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.4e+69: tmp = x elif x <= 3.2e+68: tmp = -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.4e+69) tmp = x; elseif (x <= 3.2e+68) tmp = Float64(-z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.4e+69) tmp = x; elseif (x <= 3.2e+68) tmp = -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.4e+69], x, If[LessEqual[x, 3.2e+68], (-z), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+69}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+68}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.39999999999999991e69 or 3.19999999999999994e68 < x Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
if -1.39999999999999991e69 < x < 3.19999999999999994e68Initial program 99.7%
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (- x z))
double code(double x, double y, double z) {
return x - 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 - z
end function
public static double code(double x, double y, double z) {
return x - z;
}
def code(x, y, z): return x - z
function code(x, y, z) return Float64(x - z) end
function tmp = code(x, y, z) tmp = x - z; end
code[x_, y_, z_] := N[(x - z), $MachinePrecision]
\begin{array}{l}
\\
x - z
\end{array}
Initial program 99.8%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.8%
Taylor expanded in x around inf 0
Simplified0
(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 2024110
(FPCore (x y z)
:name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
:precision binary64
:alt
(- (- (+ y x) z) (* (+ y 0.5) (log y)))
(- (+ (- x (* (+ y 0.5) (log y))) y) z))