
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Initial program 99.9%
(FPCore (x y z t) :precision binary64 (if (<= y 3.1e+102) (- (+ (* x (log y)) (log t)) z) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+102) {
tmp = ((x * log(y)) + log(t)) - z;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 3.1d+102) then
tmp = ((x * log(y)) + log(t)) - z
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+102) {
tmp = ((x * Math.log(y)) + Math.log(t)) - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.1e+102: tmp = ((x * math.log(y)) + math.log(t)) - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.1e+102) tmp = Float64(Float64(Float64(x * log(y)) + log(t)) - z); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.1e+102) tmp = ((x * log(y)) + log(t)) - z; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.1e+102], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{+102}:\\
\;\;\;\;\left(x \cdot \log y + \log t\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if y < 3.09999999999999987e102Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around 0 95.5%
if 3.09999999999999987e102 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 87.5%
Final simplification92.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= x -2.4e+119)
t_2
(if (<= x 4.8e+42)
(- (log t) (+ y z))
(if (<= x 2.1e+126) t_2 (- t_1 z))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (x <= -2.4e+119) {
tmp = t_2;
} else if (x <= 4.8e+42) {
tmp = log(t) - (y + z);
} else if (x <= 2.1e+126) {
tmp = t_2;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (x <= (-2.4d+119)) then
tmp = t_2
else if (x <= 4.8d+42) then
tmp = log(t) - (y + z)
else if (x <= 2.1d+126) then
tmp = t_2
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (x <= -2.4e+119) {
tmp = t_2;
} else if (x <= 4.8e+42) {
tmp = Math.log(t) - (y + z);
} else if (x <= 2.1e+126) {
tmp = t_2;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if x <= -2.4e+119: tmp = t_2 elif x <= 4.8e+42: tmp = math.log(t) - (y + z) elif x <= 2.1e+126: tmp = t_2 else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (x <= -2.4e+119) tmp = t_2; elseif (x <= 4.8e+42) tmp = Float64(log(t) - Float64(y + z)); elseif (x <= 2.1e+126) tmp = t_2; else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (x <= -2.4e+119) tmp = t_2; elseif (x <= 4.8e+42) tmp = log(t) - (y + z); elseif (x <= 2.1e+126) tmp = t_2; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[x, -2.4e+119], t$95$2, If[LessEqual[x, 4.8e+42], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e+126], t$95$2, N[(t$95$1 - z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+119}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+42}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+126}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if x < -2.4e119 or 4.7999999999999997e42 < x < 2.0999999999999999e126Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 92.9%
if -2.4e119 < x < 4.7999999999999997e42Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 95.9%
if 2.0999999999999999e126 < x Initial program 99.4%
associate-+l-99.4%
associate--l-99.4%
Simplified99.4%
Taylor expanded in z around inf 95.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -9.5e+119) (not (<= x 1.12e+42))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.5e+119) || !(x <= 1.12e+42)) {
tmp = (x * log(y)) - y;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-9.5d+119)) .or. (.not. (x <= 1.12d+42))) then
tmp = (x * log(y)) - y
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.5e+119) || !(x <= 1.12e+42)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -9.5e+119) or not (x <= 1.12e+42): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -9.5e+119) || !(x <= 1.12e+42)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -9.5e+119) || ~((x <= 1.12e+42))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -9.5e+119], N[Not[LessEqual[x, 1.12e+42]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+119} \lor \neg \left(x \leq 1.12 \cdot 10^{+42}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -9.4999999999999994e119 or 1.12e42 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 88.1%
if -9.4999999999999994e119 < x < 1.12e42Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 95.9%
Final simplification93.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.55e+121) (not (<= x 6e+142))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.55e+121) || !(x <= 6e+142)) {
tmp = x * log(y);
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-3.55d+121)) .or. (.not. (x <= 6d+142))) then
tmp = x * log(y)
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.55e+121) || !(x <= 6e+142)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.55e+121) or not (x <= 6e+142): tmp = x * math.log(y) else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.55e+121) || !(x <= 6e+142)) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.55e+121) || ~((x <= 6e+142))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.55e+121], N[Not[LessEqual[x, 6e+142]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.55 \cdot 10^{+121} \lor \neg \left(x \leq 6 \cdot 10^{+142}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -3.55000000000000012e121 or 5.99999999999999949e142 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 58.3%
associate--l+58.3%
associate-/l*58.3%
Simplified58.3%
Taylor expanded in x around inf 83.5%
if -3.55000000000000012e121 < x < 5.99999999999999949e142Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 91.5%
Final simplification89.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -210.0) (not (<= z 7.2e-9))) (* z (- -1.0 (/ y z))) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -210.0) || !(z <= 7.2e-9)) {
tmp = z * (-1.0 - (y / z));
} else {
tmp = log(t) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-210.0d0)) .or. (.not. (z <= 7.2d-9))) then
tmp = z * ((-1.0d0) - (y / z))
else
tmp = log(t) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -210.0) || !(z <= 7.2e-9)) {
tmp = z * (-1.0 - (y / z));
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -210.0) or not (z <= 7.2e-9): tmp = z * (-1.0 - (y / z)) else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -210.0) || !(z <= 7.2e-9)) tmp = Float64(z * Float64(-1.0 - Float64(y / z))); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -210.0) || ~((z <= 7.2e-9))) tmp = z * (-1.0 - (y / z)); else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -210.0], N[Not[LessEqual[z, 7.2e-9]], $MachinePrecision]], N[(z * N[(-1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -210 \lor \neg \left(z \leq 7.2 \cdot 10^{-9}\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if z < -210 or 7.2e-9 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around inf 66.0%
Taylor expanded in z around -inf 66.2%
mul-1-neg66.2%
*-commutative66.2%
distribute-rgt-neg-in66.2%
+-commutative66.2%
mul-1-neg66.2%
unsub-neg66.2%
associate-+r-66.2%
Simplified66.2%
Taylor expanded in z around -inf 89.0%
associate-*r*89.0%
mul-1-neg89.0%
mul-1-neg89.0%
unsub-neg89.0%
associate--l+89.0%
div-sub89.0%
*-commutative89.0%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in y around inf 84.6%
associate-*r/84.6%
neg-mul-184.6%
Simplified84.6%
if -210 < z < 7.2e-9Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
add-cube-cbrt99.3%
pow399.3%
Applied egg-rr99.3%
Taylor expanded in x around 0 63.7%
associate--r+63.7%
Simplified63.7%
Taylor expanded in z around 0 63.7%
Final simplification74.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.15e+120) (not (<= x 1.5e+92))) (* x (log y)) (* z (- -1.0 (/ y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.15e+120) || !(x <= 1.5e+92)) {
tmp = x * log(y);
} else {
tmp = z * (-1.0 - (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.15d+120)) .or. (.not. (x <= 1.5d+92))) then
tmp = x * log(y)
else
tmp = z * ((-1.0d0) - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.15e+120) || !(x <= 1.5e+92)) {
tmp = x * Math.log(y);
} else {
tmp = z * (-1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.15e+120) or not (x <= 1.5e+92): tmp = x * math.log(y) else: tmp = z * (-1.0 - (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.15e+120) || !(x <= 1.5e+92)) tmp = Float64(x * log(y)); else tmp = Float64(z * Float64(-1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.15e+120) || ~((x <= 1.5e+92))) tmp = x * log(y); else tmp = z * (-1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.15e+120], N[Not[LessEqual[x, 1.5e+92]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(z * N[(-1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+120} \lor \neg \left(x \leq 1.5 \cdot 10^{+92}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if x < -1.14999999999999996e120 or 1.50000000000000007e92 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 55.0%
associate--l+55.0%
associate-/l*54.9%
Simplified54.9%
Taylor expanded in x around inf 75.5%
if -1.14999999999999996e120 < x < 1.50000000000000007e92Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around inf 71.0%
Taylor expanded in z around -inf 49.0%
mul-1-neg49.0%
*-commutative49.0%
distribute-rgt-neg-in49.0%
+-commutative49.0%
mul-1-neg49.0%
unsub-neg49.0%
associate-+r-49.0%
Simplified49.0%
Taylor expanded in z around -inf 79.3%
associate-*r*79.3%
mul-1-neg79.3%
mul-1-neg79.3%
unsub-neg79.3%
associate--l+79.3%
div-sub79.3%
*-commutative79.3%
associate-/l*79.0%
Simplified79.0%
Taylor expanded in y around inf 65.8%
associate-*r/65.8%
neg-mul-165.8%
Simplified65.8%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.05e-48) (not (<= z 5.6e-46))) (* z (- -1.0 (/ y z))) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-48) || !(z <= 5.6e-46)) {
tmp = z * (-1.0 - (y / z));
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.05d-48)) .or. (.not. (z <= 5.6d-46))) then
tmp = z * ((-1.0d0) - (y / z))
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-48) || !(z <= 5.6e-46)) {
tmp = z * (-1.0 - (y / z));
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.05e-48) or not (z <= 5.6e-46): tmp = z * (-1.0 - (y / z)) else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.05e-48) || !(z <= 5.6e-46)) tmp = Float64(z * Float64(-1.0 - Float64(y / z))); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.05e-48) || ~((z <= 5.6e-46))) tmp = z * (-1.0 - (y / z)); else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.05e-48], N[Not[LessEqual[z, 5.6e-46]], $MachinePrecision]], N[(z * N[(-1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-48} \lor \neg \left(z \leq 5.6 \cdot 10^{-46}\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -1.04999999999999994e-48 or 5.5999999999999997e-46 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around inf 68.2%
Taylor expanded in z around -inf 67.7%
mul-1-neg67.7%
*-commutative67.7%
distribute-rgt-neg-in67.7%
+-commutative67.7%
mul-1-neg67.7%
unsub-neg67.7%
associate-+r-67.7%
Simplified67.7%
Taylor expanded in z around -inf 89.0%
associate-*r*89.0%
mul-1-neg89.0%
mul-1-neg89.0%
unsub-neg89.0%
associate--l+89.0%
div-sub89.0%
*-commutative89.0%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in y around inf 82.2%
associate-*r/82.2%
neg-mul-182.2%
Simplified82.2%
if -1.04999999999999994e-48 < z < 5.5999999999999997e-46Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 38.6%
mul-1-neg38.6%
Simplified38.6%
Final simplification61.9%
(FPCore (x y z t) :precision binary64 (if (<= y 2.7e+102) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.7e+102) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.7d+102) then
tmp = -z
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.7e+102) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.7e+102: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.7e+102) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.7e+102) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.7e+102], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{+102}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.7000000000000001e102Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 44.4%
mul-1-neg44.4%
Simplified44.4%
if 2.7000000000000001e102 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 73.0%
mul-1-neg73.0%
Simplified73.0%
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
return -y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -y
end function
public static double code(double x, double y, double z, double t) {
return -y;
}
def code(x, y, z, t): return -y
function code(x, y, z, t) return Float64(-y) end
function tmp = code(x, y, z, t) tmp = -y; end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 29.4%
mul-1-neg29.4%
Simplified29.4%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return y end
function tmp = code(x, y, z, t) tmp = y; end
code[x_, y_, z_, t_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 29.4%
mul-1-neg29.4%
Simplified29.4%
neg-sub029.4%
sub-neg29.4%
add-sqr-sqrt0.0%
sqrt-unprod2.3%
sqr-neg2.3%
sqrt-unprod2.4%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
+-lft-identity2.4%
Simplified2.4%
herbie shell --seed 2024139
(FPCore (x y z t)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (- (* x (log y)) y) z) (log t)))