
(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 12 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 z) (* (log y) (+ y 0.5)))))
double code(double x, double y, double z) {
return x + ((y - z) - (log(y) * (y + 0.5)));
}
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 - z) - (log(y) * (y + 0.5d0)))
end function
public static double code(double x, double y, double z) {
return x + ((y - z) - (Math.log(y) * (y + 0.5)));
}
def code(x, y, z): return x + ((y - z) - (math.log(y) * (y + 0.5)))
function code(x, y, z) return Float64(x + Float64(Float64(y - z) - Float64(log(y) * Float64(y + 0.5)))) end
function tmp = code(x, y, z) tmp = x + ((y - z) - (log(y) * (y + 0.5))); end
code[x_, y_, z_] := N[(x + N[(N[(y - z), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - z\right) - \log y \cdot \left(y + 0.5\right)\right)
\end{array}
Initial program 99.9%
associate--l+99.9%
associate-+l-99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- x (* 0.5 (log y)))) (t_1 (+ x (* y (- 1.0 (log y))))))
(if (<= z -5e+53)
(- x z)
(if (<= z -1.05e-57)
t_1
(if (<= z -7.6e-193)
t_0
(if (<= z -1.35e-231)
t_1
(if (<= z -2.2e-261)
(- y (* (log y) (+ y 0.5)))
(if (<= z -8e-282)
t_0
(if (<= z 7.2e+42) (+ x (- y (* y (log y)))) (- x z))))))))))
double code(double x, double y, double z) {
double t_0 = x - (0.5 * log(y));
double t_1 = x + (y * (1.0 - log(y)));
double tmp;
if (z <= -5e+53) {
tmp = x - z;
} else if (z <= -1.05e-57) {
tmp = t_1;
} else if (z <= -7.6e-193) {
tmp = t_0;
} else if (z <= -1.35e-231) {
tmp = t_1;
} else if (z <= -2.2e-261) {
tmp = y - (log(y) * (y + 0.5));
} else if (z <= -8e-282) {
tmp = t_0;
} else if (z <= 7.2e+42) {
tmp = x + (y - (y * 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x - (0.5d0 * log(y))
t_1 = x + (y * (1.0d0 - log(y)))
if (z <= (-5d+53)) then
tmp = x - z
else if (z <= (-1.05d-57)) then
tmp = t_1
else if (z <= (-7.6d-193)) then
tmp = t_0
else if (z <= (-1.35d-231)) then
tmp = t_1
else if (z <= (-2.2d-261)) then
tmp = y - (log(y) * (y + 0.5d0))
else if (z <= (-8d-282)) then
tmp = t_0
else if (z <= 7.2d+42) then
tmp = x + (y - (y * log(y)))
else
tmp = x - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x - (0.5 * Math.log(y));
double t_1 = x + (y * (1.0 - Math.log(y)));
double tmp;
if (z <= -5e+53) {
tmp = x - z;
} else if (z <= -1.05e-57) {
tmp = t_1;
} else if (z <= -7.6e-193) {
tmp = t_0;
} else if (z <= -1.35e-231) {
tmp = t_1;
} else if (z <= -2.2e-261) {
tmp = y - (Math.log(y) * (y + 0.5));
} else if (z <= -8e-282) {
tmp = t_0;
} else if (z <= 7.2e+42) {
tmp = x + (y - (y * Math.log(y)));
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): t_0 = x - (0.5 * math.log(y)) t_1 = x + (y * (1.0 - math.log(y))) tmp = 0 if z <= -5e+53: tmp = x - z elif z <= -1.05e-57: tmp = t_1 elif z <= -7.6e-193: tmp = t_0 elif z <= -1.35e-231: tmp = t_1 elif z <= -2.2e-261: tmp = y - (math.log(y) * (y + 0.5)) elif z <= -8e-282: tmp = t_0 elif z <= 7.2e+42: tmp = x + (y - (y * math.log(y))) else: tmp = x - z return tmp
function code(x, y, z) t_0 = Float64(x - Float64(0.5 * log(y))) t_1 = Float64(x + Float64(y * Float64(1.0 - log(y)))) tmp = 0.0 if (z <= -5e+53) tmp = Float64(x - z); elseif (z <= -1.05e-57) tmp = t_1; elseif (z <= -7.6e-193) tmp = t_0; elseif (z <= -1.35e-231) tmp = t_1; elseif (z <= -2.2e-261) tmp = Float64(y - Float64(log(y) * Float64(y + 0.5))); elseif (z <= -8e-282) tmp = t_0; elseif (z <= 7.2e+42) tmp = Float64(x + Float64(y - Float64(y * log(y)))); else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x - (0.5 * log(y)); t_1 = x + (y * (1.0 - log(y))); tmp = 0.0; if (z <= -5e+53) tmp = x - z; elseif (z <= -1.05e-57) tmp = t_1; elseif (z <= -7.6e-193) tmp = t_0; elseif (z <= -1.35e-231) tmp = t_1; elseif (z <= -2.2e-261) tmp = y - (log(y) * (y + 0.5)); elseif (z <= -8e-282) tmp = t_0; elseif (z <= 7.2e+42) tmp = x + (y - (y * log(y))); else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+53], N[(x - z), $MachinePrecision], If[LessEqual[z, -1.05e-57], t$95$1, If[LessEqual[z, -7.6e-193], t$95$0, If[LessEqual[z, -1.35e-231], t$95$1, If[LessEqual[z, -2.2e-261], N[(y - N[(N[Log[y], $MachinePrecision] * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8e-282], t$95$0, If[LessEqual[z, 7.2e+42], N[(x + N[(y - N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - z), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x - 0.5 \cdot \log y\\
t_1 := x + y \cdot \left(1 - \log y\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{+53}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-193}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-231}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-261}:\\
\;\;\;\;y - \log y \cdot \left(y + 0.5\right)\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-282}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+42}:\\
\;\;\;\;x + \left(y - y \cdot \log y\right)\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -5.0000000000000004e53 or 7.2000000000000002e42 < z Initial program 99.9%
associate--l+99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 83.1%
if -5.0000000000000004e53 < z < -1.05e-57 or -7.60000000000000007e-193 < z < -1.35000000000000011e-231Initial program 99.8%
associate--l+99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around inf 83.2%
sub-neg83.2%
mul-1-neg83.2%
log-rec83.2%
remove-double-neg83.2%
metadata-eval83.2%
Simplified83.2%
if -1.05e-57 < z < -7.60000000000000007e-193 or -2.2000000000000002e-261 < z < -8.0000000000000001e-282Initial program 99.9%
Taylor expanded in y around 0 78.9%
Taylor expanded in z around 0 78.9%
if -1.35000000000000011e-231 < z < -2.2000000000000002e-261Initial program 99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 99.7%
if -8.0000000000000001e-282 < z < 7.2000000000000002e42Initial program 99.8%
associate--l+99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around inf 80.3%
mul-1-neg80.3%
distribute-rgt-neg-in80.3%
log-rec80.3%
remove-double-neg80.3%
Simplified80.3%
Taylor expanded in y around inf 78.9%
sub-neg78.9%
mul-1-neg78.9%
log-rec78.9%
remove-double-neg78.9%
metadata-eval78.9%
distribute-rgt-in79.0%
*-commutative79.0%
neg-mul-179.0%
sub-neg79.0%
Simplified79.0%
Final simplification81.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- x (* 0.5 (log y)))) (t_1 (* y (- 1.0 (log y)))))
(if (<= z -8.5e+52)
(- x z)
(if (<= z -4.8e-33)
t_1
(if (<= z 2.55e-126)
t_0
(if (<= z 3.15e-84)
t_1
(if (<= z 9.5e-37) t_0 (if (<= z 30000000000.0) t_1 (- x z)))))))))
double code(double x, double y, double z) {
double t_0 = x - (0.5 * log(y));
double t_1 = y * (1.0 - log(y));
double tmp;
if (z <= -8.5e+52) {
tmp = x - z;
} else if (z <= -4.8e-33) {
tmp = t_1;
} else if (z <= 2.55e-126) {
tmp = t_0;
} else if (z <= 3.15e-84) {
tmp = t_1;
} else if (z <= 9.5e-37) {
tmp = t_0;
} else if (z <= 30000000000.0) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = x - (0.5d0 * log(y))
t_1 = y * (1.0d0 - log(y))
if (z <= (-8.5d+52)) then
tmp = x - z
else if (z <= (-4.8d-33)) then
tmp = t_1
else if (z <= 2.55d-126) then
tmp = t_0
else if (z <= 3.15d-84) then
tmp = t_1
else if (z <= 9.5d-37) then
tmp = t_0
else if (z <= 30000000000.0d0) then
tmp = t_1
else
tmp = x - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x - (0.5 * Math.log(y));
double t_1 = y * (1.0 - Math.log(y));
double tmp;
if (z <= -8.5e+52) {
tmp = x - z;
} else if (z <= -4.8e-33) {
tmp = t_1;
} else if (z <= 2.55e-126) {
tmp = t_0;
} else if (z <= 3.15e-84) {
tmp = t_1;
} else if (z <= 9.5e-37) {
tmp = t_0;
} else if (z <= 30000000000.0) {
tmp = t_1;
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): t_0 = x - (0.5 * math.log(y)) t_1 = y * (1.0 - math.log(y)) tmp = 0 if z <= -8.5e+52: tmp = x - z elif z <= -4.8e-33: tmp = t_1 elif z <= 2.55e-126: tmp = t_0 elif z <= 3.15e-84: tmp = t_1 elif z <= 9.5e-37: tmp = t_0 elif z <= 30000000000.0: tmp = t_1 else: tmp = x - z return tmp
function code(x, y, z) t_0 = Float64(x - Float64(0.5 * log(y))) t_1 = Float64(y * Float64(1.0 - log(y))) tmp = 0.0 if (z <= -8.5e+52) tmp = Float64(x - z); elseif (z <= -4.8e-33) tmp = t_1; elseif (z <= 2.55e-126) tmp = t_0; elseif (z <= 3.15e-84) tmp = t_1; elseif (z <= 9.5e-37) tmp = t_0; elseif (z <= 30000000000.0) tmp = t_1; else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x - (0.5 * log(y)); t_1 = y * (1.0 - log(y)); tmp = 0.0; if (z <= -8.5e+52) tmp = x - z; elseif (z <= -4.8e-33) tmp = t_1; elseif (z <= 2.55e-126) tmp = t_0; elseif (z <= 3.15e-84) tmp = t_1; elseif (z <= 9.5e-37) tmp = t_0; elseif (z <= 30000000000.0) tmp = t_1; else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+52], N[(x - z), $MachinePrecision], If[LessEqual[z, -4.8e-33], t$95$1, If[LessEqual[z, 2.55e-126], t$95$0, If[LessEqual[z, 3.15e-84], t$95$1, If[LessEqual[z, 9.5e-37], t$95$0, If[LessEqual[z, 30000000000.0], t$95$1, N[(x - z), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x - 0.5 \cdot \log y\\
t_1 := y \cdot \left(1 - \log y\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+52}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-126}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-37}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 30000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -8.49999999999999994e52 or 3e10 < z Initial program 99.9%
associate--l+99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 82.1%
if -8.49999999999999994e52 < z < -4.8e-33 or 2.55000000000000001e-126 < z < 3.1500000000000002e-84 or 9.49999999999999927e-37 < z < 3e10Initial program 99.7%
associate--l+99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in y around inf 84.0%
sub-neg84.0%
mul-1-neg84.0%
log-rec84.0%
remove-double-neg84.0%
metadata-eval84.0%
Simplified84.0%
Taylor expanded in x around 0 72.4%
mul-1-neg72.4%
sub-neg72.4%
metadata-eval72.4%
distribute-rgt-neg-in72.4%
+-commutative72.4%
distribute-neg-in72.4%
metadata-eval72.4%
sub-neg72.4%
Simplified72.4%
if -4.8e-33 < z < 2.55000000000000001e-126 or 3.1500000000000002e-84 < z < 9.49999999999999927e-37Initial program 99.8%
Taylor expanded in y around 0 74.4%
Taylor expanded in z around 0 74.4%
Final simplification77.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* y (- 1.0 (log y))))))
(if (<= z -6.4e+52)
(- x z)
(if (<= z -9.8e-58)
t_0
(if (<= z -3.8e-284)
(- x (* 0.5 (log y)))
(if (<= z 1.6e+43) t_0 (- x z)))))))
double code(double x, double y, double z) {
double t_0 = x + (y * (1.0 - log(y)));
double tmp;
if (z <= -6.4e+52) {
tmp = x - z;
} else if (z <= -9.8e-58) {
tmp = t_0;
} else if (z <= -3.8e-284) {
tmp = x - (0.5 * log(y));
} else if (z <= 1.6e+43) {
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 = x + (y * (1.0d0 - log(y)))
if (z <= (-6.4d+52)) then
tmp = x - z
else if (z <= (-9.8d-58)) then
tmp = t_0
else if (z <= (-3.8d-284)) then
tmp = x - (0.5d0 * log(y))
else if (z <= 1.6d+43) 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 = x + (y * (1.0 - Math.log(y)));
double tmp;
if (z <= -6.4e+52) {
tmp = x - z;
} else if (z <= -9.8e-58) {
tmp = t_0;
} else if (z <= -3.8e-284) {
tmp = x - (0.5 * Math.log(y));
} else if (z <= 1.6e+43) {
tmp = t_0;
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): t_0 = x + (y * (1.0 - math.log(y))) tmp = 0 if z <= -6.4e+52: tmp = x - z elif z <= -9.8e-58: tmp = t_0 elif z <= -3.8e-284: tmp = x - (0.5 * math.log(y)) elif z <= 1.6e+43: tmp = t_0 else: tmp = x - z return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y * Float64(1.0 - log(y)))) tmp = 0.0 if (z <= -6.4e+52) tmp = Float64(x - z); elseif (z <= -9.8e-58) tmp = t_0; elseif (z <= -3.8e-284) tmp = Float64(x - Float64(0.5 * log(y))); elseif (z <= 1.6e+43) tmp = t_0; else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y * (1.0 - log(y))); tmp = 0.0; if (z <= -6.4e+52) tmp = x - z; elseif (z <= -9.8e-58) tmp = t_0; elseif (z <= -3.8e-284) tmp = x - (0.5 * log(y)); elseif (z <= 1.6e+43) tmp = t_0; else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e+52], N[(x - z), $MachinePrecision], If[LessEqual[z, -9.8e-58], t$95$0, If[LessEqual[z, -3.8e-284], N[(x - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+43], t$95$0, N[(x - z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot \left(1 - \log y\right)\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+52}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{-58}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-284}:\\
\;\;\;\;x - 0.5 \cdot \log y\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+43}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -6.4e52 or 1.60000000000000007e43 < z Initial program 99.9%
associate--l+99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 83.1%
if -6.4e52 < z < -9.80000000000000061e-58 or -3.7999999999999999e-284 < z < 1.60000000000000007e43Initial program 99.8%
associate--l+99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around inf 78.8%
sub-neg78.8%
mul-1-neg78.8%
log-rec78.8%
remove-double-neg78.8%
metadata-eval78.8%
Simplified78.8%
if -9.80000000000000061e-58 < z < -3.7999999999999999e-284Initial program 99.8%
Taylor expanded in y around 0 75.9%
Taylor expanded in z around 0 75.9%
Final simplification80.2%
(FPCore (x y z)
:precision binary64
(if (<= z -1.5e+53)
(- x z)
(if (<= z -7.2e-58)
(+ x (* y (- 1.0 (log y))))
(if (<= z -1.5e-281)
(- x (* 0.5 (log y)))
(if (<= z 1.95e+43) (+ x (- y (* y (log y)))) (- x z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.5e+53) {
tmp = x - z;
} else if (z <= -7.2e-58) {
tmp = x + (y * (1.0 - log(y)));
} else if (z <= -1.5e-281) {
tmp = x - (0.5 * log(y));
} else if (z <= 1.95e+43) {
tmp = x + (y - (y * 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 <= (-1.5d+53)) then
tmp = x - z
else if (z <= (-7.2d-58)) then
tmp = x + (y * (1.0d0 - log(y)))
else if (z <= (-1.5d-281)) then
tmp = x - (0.5d0 * log(y))
else if (z <= 1.95d+43) then
tmp = x + (y - (y * 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 <= -1.5e+53) {
tmp = x - z;
} else if (z <= -7.2e-58) {
tmp = x + (y * (1.0 - Math.log(y)));
} else if (z <= -1.5e-281) {
tmp = x - (0.5 * Math.log(y));
} else if (z <= 1.95e+43) {
tmp = x + (y - (y * Math.log(y)));
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.5e+53: tmp = x - z elif z <= -7.2e-58: tmp = x + (y * (1.0 - math.log(y))) elif z <= -1.5e-281: tmp = x - (0.5 * math.log(y)) elif z <= 1.95e+43: tmp = x + (y - (y * math.log(y))) else: tmp = x - z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.5e+53) tmp = Float64(x - z); elseif (z <= -7.2e-58) tmp = Float64(x + Float64(y * Float64(1.0 - log(y)))); elseif (z <= -1.5e-281) tmp = Float64(x - Float64(0.5 * log(y))); elseif (z <= 1.95e+43) tmp = Float64(x + Float64(y - Float64(y * log(y)))); else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.5e+53) tmp = x - z; elseif (z <= -7.2e-58) tmp = x + (y * (1.0 - log(y))); elseif (z <= -1.5e-281) tmp = x - (0.5 * log(y)); elseif (z <= 1.95e+43) tmp = x + (y - (y * log(y))); else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.5e+53], N[(x - z), $MachinePrecision], If[LessEqual[z, -7.2e-58], N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.5e-281], N[(x - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+43], N[(x + N[(y - N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+53}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-58}:\\
\;\;\;\;x + y \cdot \left(1 - \log y\right)\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-281}:\\
\;\;\;\;x - 0.5 \cdot \log y\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+43}:\\
\;\;\;\;x + \left(y - y \cdot \log y\right)\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -1.49999999999999999e53 or 1.95e43 < z Initial program 99.9%
associate--l+99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 83.1%
if -1.49999999999999999e53 < z < -7.20000000000000019e-58Initial program 99.8%
associate--l+99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around inf 78.5%
sub-neg78.5%
mul-1-neg78.5%
log-rec78.5%
remove-double-neg78.5%
metadata-eval78.5%
Simplified78.5%
if -7.20000000000000019e-58 < z < -1.49999999999999987e-281Initial program 99.8%
Taylor expanded in y around 0 75.9%
Taylor expanded in z around 0 75.9%
if -1.49999999999999987e-281 < z < 1.95e43Initial program 99.8%
associate--l+99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around inf 80.3%
mul-1-neg80.3%
distribute-rgt-neg-in80.3%
log-rec80.3%
remove-double-neg80.3%
Simplified80.3%
Taylor expanded in y around inf 78.9%
sub-neg78.9%
mul-1-neg78.9%
log-rec78.9%
remove-double-neg78.9%
metadata-eval78.9%
distribute-rgt-in79.0%
*-commutative79.0%
neg-mul-179.0%
sub-neg79.0%
Simplified79.0%
Final simplification80.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (- x (* 0.5 (log y))) z)))
(if (<= y 9e+42)
t_0
(if (<= y 1.55e+122)
(+ x (- y (* y (log y))))
(if (<= y 6.4e+161) t_0 (+ x (* y (- 1.0 (log y)))))))))
double code(double x, double y, double z) {
double t_0 = (x - (0.5 * log(y))) - z;
double tmp;
if (y <= 9e+42) {
tmp = t_0;
} else if (y <= 1.55e+122) {
tmp = x + (y - (y * log(y)));
} else if (y <= 6.4e+161) {
tmp = t_0;
} else {
tmp = x + (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) :: t_0
real(8) :: tmp
t_0 = (x - (0.5d0 * log(y))) - z
if (y <= 9d+42) then
tmp = t_0
else if (y <= 1.55d+122) then
tmp = x + (y - (y * log(y)))
else if (y <= 6.4d+161) then
tmp = t_0
else
tmp = x + (y * (1.0d0 - log(y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x - (0.5 * Math.log(y))) - z;
double tmp;
if (y <= 9e+42) {
tmp = t_0;
} else if (y <= 1.55e+122) {
tmp = x + (y - (y * Math.log(y)));
} else if (y <= 6.4e+161) {
tmp = t_0;
} else {
tmp = x + (y * (1.0 - Math.log(y)));
}
return tmp;
}
def code(x, y, z): t_0 = (x - (0.5 * math.log(y))) - z tmp = 0 if y <= 9e+42: tmp = t_0 elif y <= 1.55e+122: tmp = x + (y - (y * math.log(y))) elif y <= 6.4e+161: tmp = t_0 else: tmp = x + (y * (1.0 - math.log(y))) return tmp
function code(x, y, z) t_0 = Float64(Float64(x - Float64(0.5 * log(y))) - z) tmp = 0.0 if (y <= 9e+42) tmp = t_0; elseif (y <= 1.55e+122) tmp = Float64(x + Float64(y - Float64(y * log(y)))); elseif (y <= 6.4e+161) tmp = t_0; else tmp = Float64(x + Float64(y * Float64(1.0 - log(y)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x - (0.5 * log(y))) - z; tmp = 0.0; if (y <= 9e+42) tmp = t_0; elseif (y <= 1.55e+122) tmp = x + (y - (y * log(y))); elseif (y <= 6.4e+161) tmp = t_0; else tmp = x + (y * (1.0 - log(y))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[y, 9e+42], t$95$0, If[LessEqual[y, 1.55e+122], N[(x + N[(y - N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e+161], t$95$0, N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x - 0.5 \cdot \log y\right) - z\\
\mathbf{if}\;y \leq 9 \cdot 10^{+42}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+122}:\\
\;\;\;\;x + \left(y - y \cdot \log y\right)\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+161}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \log y\right)\\
\end{array}
\end{array}
if y < 9.00000000000000025e42 or 1.54999999999999999e122 < y < 6.40000000000000004e161Initial program 100.0%
Taylor expanded in y around 0 94.9%
if 9.00000000000000025e42 < y < 1.54999999999999999e122Initial program 99.8%
associate--l+99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in y around inf 99.7%
mul-1-neg99.7%
distribute-rgt-neg-in99.7%
log-rec99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in y around inf 74.4%
sub-neg74.4%
mul-1-neg74.4%
log-rec74.4%
remove-double-neg74.4%
metadata-eval74.4%
distribute-rgt-in74.5%
*-commutative74.5%
neg-mul-174.5%
sub-neg74.5%
Simplified74.5%
if 6.40000000000000004e161 < y Initial program 99.7%
associate--l+99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in y around inf 83.8%
sub-neg83.8%
mul-1-neg83.8%
log-rec83.8%
remove-double-neg83.8%
metadata-eval83.8%
Simplified83.8%
Final simplification89.2%
(FPCore (x y z) :precision binary64 (if (<= y 0.28) (- (- x (* 0.5 (log y))) z) (+ x (- (- y z) (* y (log y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= 0.28) {
tmp = (x - (0.5 * log(y))) - z;
} else {
tmp = x + ((y - z) - (y * 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 <= 0.28d0) then
tmp = (x - (0.5d0 * log(y))) - z
else
tmp = x + ((y - z) - (y * log(y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 0.28) {
tmp = (x - (0.5 * Math.log(y))) - z;
} else {
tmp = x + ((y - z) - (y * Math.log(y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 0.28: tmp = (x - (0.5 * math.log(y))) - z else: tmp = x + ((y - z) - (y * math.log(y))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 0.28) tmp = Float64(Float64(x - Float64(0.5 * log(y))) - z); else tmp = Float64(x + Float64(Float64(y - z) - Float64(y * log(y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 0.28) tmp = (x - (0.5 * log(y))) - z; else tmp = x + ((y - z) - (y * log(y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 0.28], N[(N[(x - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] - N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.28:\\
\;\;\;\;\left(x - 0.5 \cdot \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;x + \left(\left(y - z\right) - y \cdot \log y\right)\\
\end{array}
\end{array}
if y < 0.28000000000000003Initial program 100.0%
Taylor expanded in y around 0 99.1%
if 0.28000000000000003 < y Initial program 99.7%
associate--l+99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in y around inf 98.5%
mul-1-neg98.5%
distribute-rgt-neg-in98.5%
log-rec98.5%
remove-double-neg98.5%
Simplified98.5%
Final simplification98.8%
(FPCore (x y z) :precision binary64 (if (<= y 9.2e+63) (- (- x (* 0.5 (log y))) z) (- (- y (* y (log y))) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= 9.2e+63) {
tmp = (x - (0.5 * log(y))) - z;
} else {
tmp = (y - (y * 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 <= 9.2d+63) then
tmp = (x - (0.5d0 * log(y))) - z
else
tmp = (y - (y * log(y))) - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 9.2e+63) {
tmp = (x - (0.5 * Math.log(y))) - z;
} else {
tmp = (y - (y * Math.log(y))) - z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 9.2e+63: tmp = (x - (0.5 * math.log(y))) - z else: tmp = (y - (y * math.log(y))) - z return tmp
function code(x, y, z) tmp = 0.0 if (y <= 9.2e+63) tmp = Float64(Float64(x - Float64(0.5 * log(y))) - z); else tmp = Float64(Float64(y - Float64(y * log(y))) - z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 9.2e+63) tmp = (x - (0.5 * log(y))) - z; else tmp = (y - (y * log(y))) - z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 9.2e+63], N[(N[(x - N[(0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(y - N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{+63}:\\
\;\;\;\;\left(x - 0.5 \cdot \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(y - y \cdot \log y\right) - z\\
\end{array}
\end{array}
if y < 9.19999999999999973e63Initial program 100.0%
Taylor expanded in y around 0 96.0%
if 9.19999999999999973e63 < y Initial program 99.7%
add-cube-cbrt98.4%
pow398.4%
sub-neg98.4%
associate-+l+98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
+-commutative98.4%
distribute-neg-in98.4%
metadata-eval98.4%
sub-neg98.4%
Applied egg-rr98.4%
Taylor expanded in y around inf 98.4%
log-rec98.4%
unsub-neg98.4%
Simplified98.4%
Taylor expanded in x around 0 82.6%
pow-base-182.6%
*-lft-identity82.6%
distribute-lft-out--82.6%
*-rgt-identity82.6%
Simplified82.6%
Final simplification90.0%
(FPCore (x y z) :precision binary64 (if (<= y 3.4e+166) (- x z) (* y (- 1.0 (log y)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 3.4e+166) {
tmp = x - 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 <= 3.4d+166) then
tmp = x - 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 <= 3.4e+166) {
tmp = x - z;
} else {
tmp = y * (1.0 - Math.log(y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 3.4e+166: tmp = x - z else: tmp = y * (1.0 - math.log(y)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 3.4e+166) tmp = Float64(x - 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 <= 3.4e+166) tmp = x - z; else tmp = y * (1.0 - log(y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 3.4e+166], N[(x - z), $MachinePrecision], N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{+166}:\\
\;\;\;\;x - z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \log y\right)\\
\end{array}
\end{array}
if y < 3.4e166Initial program 99.9%
associate--l+99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 68.9%
if 3.4e166 < y Initial program 99.7%
associate--l+99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in y around inf 84.5%
sub-neg84.5%
mul-1-neg84.5%
log-rec84.5%
remove-double-neg84.5%
metadata-eval84.5%
Simplified84.5%
Taylor expanded in x around 0 75.6%
mul-1-neg75.6%
sub-neg75.6%
metadata-eval75.6%
distribute-rgt-neg-in75.6%
+-commutative75.6%
distribute-neg-in75.6%
metadata-eval75.6%
sub-neg75.6%
Simplified75.6%
Final simplification70.5%
(FPCore (x y z) :precision binary64 (if (<= z -5.6e+21) (- z) (if (<= z 6.8e+140) x (- z))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.6e+21) {
tmp = -z;
} else if (z <= 6.8e+140) {
tmp = x;
} else {
tmp = -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 <= (-5.6d+21)) then
tmp = -z
else if (z <= 6.8d+140) then
tmp = x
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.6e+21) {
tmp = -z;
} else if (z <= 6.8e+140) {
tmp = x;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.6e+21: tmp = -z elif z <= 6.8e+140: tmp = x else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.6e+21) tmp = Float64(-z); elseif (z <= 6.8e+140) tmp = x; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.6e+21) tmp = -z; elseif (z <= 6.8e+140) tmp = x; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.6e+21], (-z), If[LessEqual[z, 6.8e+140], x, (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+21}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+140}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -5.6e21 or 6.8e140 < z Initial program 100.0%
Taylor expanded in y around 0 81.9%
Taylor expanded in z around inf 72.8%
neg-mul-172.8%
Simplified72.8%
if -5.6e21 < z < 6.8e140Initial program 99.8%
Taylor expanded in y around 0 66.1%
Taylor expanded in x around inf 38.4%
Final simplification51.0%
(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.9%
associate--l+99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 58.5%
Final simplification58.5%
(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.9%
Taylor expanded in y around 0 71.9%
Taylor expanded in x around inf 27.9%
Final simplification27.9%
(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 2023275
(FPCore (x y z)
:name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(- (- (+ y x) z) (* (+ y 0.5) (log y)))
(- (+ (- x (* (+ y 0.5) (log y))) y) z))