
(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 12 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 (- (fma x (log y) (- (log t) z)) y))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (log(t) - z)) - y;
}
function code(x, y, z, t) return Float64(fma(x, log(y), Float64(log(t) - z)) - y) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
\end{array}
Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 3e-5) (- (+ (log t) t_1) z) (- (- t_1 y) z))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 3e-5) {
tmp = (log(t) + t_1) - z;
} else {
tmp = (t_1 - 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (y <= 3d-5) then
tmp = (log(t) + t_1) - z
else
tmp = (t_1 - y) - 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 tmp;
if (y <= 3e-5) {
tmp = (Math.log(t) + t_1) - z;
} else {
tmp = (t_1 - y) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 3e-5: tmp = (math.log(t) + t_1) - z else: tmp = (t_1 - y) - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 3e-5) tmp = Float64(Float64(log(t) + t_1) - z); else tmp = Float64(Float64(t_1 - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 3e-5) tmp = (log(t) + t_1) - z; else tmp = (t_1 - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3e-5], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - z), $MachinePrecision], N[(N[(t$95$1 - y), $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 3 \cdot 10^{-5}:\\
\;\;\;\;\left(\log t + t_1\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - y\right) - z\\
\end{array}
\end{array}
if y < 3.00000000000000008e-5Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around 0 99.4%
if 3.00000000000000008e-5 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((x * log(y)) - y) - z);
}
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 = log(t) + (((x * log(y)) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((x * Math.log(y)) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((x * math.log(y)) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(x * log(y)) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((x * log(y)) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(x \cdot \log y - y\right) - z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) y)) (t_2 (* x (log y))) (t_3 (- (- y) z)))
(if (<= x -3.5e+68)
t_2
(if (<= x -1.18e-32)
t_3
(if (<= x -1.3e-152)
t_1
(if (<= x 6.2e-205)
t_3
(if (<= x 5.8e-117) t_1 (if (<= x 6.5e+101) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double t_2 = x * log(y);
double t_3 = -y - z;
double tmp;
if (x <= -3.5e+68) {
tmp = t_2;
} else if (x <= -1.18e-32) {
tmp = t_3;
} else if (x <= -1.3e-152) {
tmp = t_1;
} else if (x <= 6.2e-205) {
tmp = t_3;
} else if (x <= 5.8e-117) {
tmp = t_1;
} else if (x <= 6.5e+101) {
tmp = t_3;
} else {
tmp = t_2;
}
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) :: t_3
real(8) :: tmp
t_1 = log(t) - y
t_2 = x * log(y)
t_3 = -y - z
if (x <= (-3.5d+68)) then
tmp = t_2
else if (x <= (-1.18d-32)) then
tmp = t_3
else if (x <= (-1.3d-152)) then
tmp = t_1
else if (x <= 6.2d-205) then
tmp = t_3
else if (x <= 5.8d-117) then
tmp = t_1
else if (x <= 6.5d+101) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - y;
double t_2 = x * Math.log(y);
double t_3 = -y - z;
double tmp;
if (x <= -3.5e+68) {
tmp = t_2;
} else if (x <= -1.18e-32) {
tmp = t_3;
} else if (x <= -1.3e-152) {
tmp = t_1;
} else if (x <= 6.2e-205) {
tmp = t_3;
} else if (x <= 5.8e-117) {
tmp = t_1;
} else if (x <= 6.5e+101) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - y t_2 = x * math.log(y) t_3 = -y - z tmp = 0 if x <= -3.5e+68: tmp = t_2 elif x <= -1.18e-32: tmp = t_3 elif x <= -1.3e-152: tmp = t_1 elif x <= 6.2e-205: tmp = t_3 elif x <= 5.8e-117: tmp = t_1 elif x <= 6.5e+101: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - y) t_2 = Float64(x * log(y)) t_3 = Float64(Float64(-y) - z) tmp = 0.0 if (x <= -3.5e+68) tmp = t_2; elseif (x <= -1.18e-32) tmp = t_3; elseif (x <= -1.3e-152) tmp = t_1; elseif (x <= 6.2e-205) tmp = t_3; elseif (x <= 5.8e-117) tmp = t_1; elseif (x <= 6.5e+101) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - y; t_2 = x * log(y); t_3 = -y - z; tmp = 0.0; if (x <= -3.5e+68) tmp = t_2; elseif (x <= -1.18e-32) tmp = t_3; elseif (x <= -1.3e-152) tmp = t_1; elseif (x <= 6.2e-205) tmp = t_3; elseif (x <= 5.8e-117) tmp = t_1; elseif (x <= 6.5e+101) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -3.5e+68], t$95$2, If[LessEqual[x, -1.18e-32], t$95$3, If[LessEqual[x, -1.3e-152], t$95$1, If[LessEqual[x, 6.2e-205], t$95$3, If[LessEqual[x, 5.8e-117], t$95$1, If[LessEqual[x, 6.5e+101], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
t_2 := x \cdot \log y\\
t_3 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.18 \cdot 10^{-32}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-205}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-117}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+101}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.49999999999999977e68 or 6.50000000000000016e101 < x Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
add-cbrt-cube12.2%
pow312.2%
associate--l-12.2%
Applied egg-rr12.2%
Taylor expanded in y around 0 12.0%
Taylor expanded in x around inf 74.4%
if -3.49999999999999977e68 < x < -1.17999999999999997e-32 or -1.30000000000000006e-152 < x < 6.19999999999999965e-205 or 5.8000000000000001e-117 < x < 6.50000000000000016e101Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 85.5%
Taylor expanded in x around 0 78.7%
neg-mul-178.7%
Simplified78.7%
if -1.17999999999999997e-32 < x < -1.30000000000000006e-152 or 6.19999999999999965e-205 < x < 5.8000000000000001e-117Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 87.4%
Final simplification78.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (- y) z)))
(if (<= x -2.2e+68)
t_1
(if (<= x -1.35e-32)
t_2
(if (<= x -6e-153)
(- (log t) y)
(if (<= x 9.5e-248)
t_2
(if (<= x 2.2e-119)
(- (log t) z)
(if (<= x 1.1e+103) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = -y - z;
double tmp;
if (x <= -2.2e+68) {
tmp = t_1;
} else if (x <= -1.35e-32) {
tmp = t_2;
} else if (x <= -6e-153) {
tmp = log(t) - y;
} else if (x <= 9.5e-248) {
tmp = t_2;
} else if (x <= 2.2e-119) {
tmp = log(t) - z;
} else if (x <= 1.1e+103) {
tmp = t_2;
} else {
tmp = t_1;
}
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 = -y - z
if (x <= (-2.2d+68)) then
tmp = t_1
else if (x <= (-1.35d-32)) then
tmp = t_2
else if (x <= (-6d-153)) then
tmp = log(t) - y
else if (x <= 9.5d-248) then
tmp = t_2
else if (x <= 2.2d-119) then
tmp = log(t) - z
else if (x <= 1.1d+103) then
tmp = t_2
else
tmp = t_1
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 = -y - z;
double tmp;
if (x <= -2.2e+68) {
tmp = t_1;
} else if (x <= -1.35e-32) {
tmp = t_2;
} else if (x <= -6e-153) {
tmp = Math.log(t) - y;
} else if (x <= 9.5e-248) {
tmp = t_2;
} else if (x <= 2.2e-119) {
tmp = Math.log(t) - z;
} else if (x <= 1.1e+103) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = -y - z tmp = 0 if x <= -2.2e+68: tmp = t_1 elif x <= -1.35e-32: tmp = t_2 elif x <= -6e-153: tmp = math.log(t) - y elif x <= 9.5e-248: tmp = t_2 elif x <= 2.2e-119: tmp = math.log(t) - z elif x <= 1.1e+103: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(-y) - z) tmp = 0.0 if (x <= -2.2e+68) tmp = t_1; elseif (x <= -1.35e-32) tmp = t_2; elseif (x <= -6e-153) tmp = Float64(log(t) - y); elseif (x <= 9.5e-248) tmp = t_2; elseif (x <= 2.2e-119) tmp = Float64(log(t) - z); elseif (x <= 1.1e+103) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = -y - z; tmp = 0.0; if (x <= -2.2e+68) tmp = t_1; elseif (x <= -1.35e-32) tmp = t_2; elseif (x <= -6e-153) tmp = log(t) - y; elseif (x <= 9.5e-248) tmp = t_2; elseif (x <= 2.2e-119) tmp = log(t) - z; elseif (x <= 1.1e+103) tmp = t_2; else tmp = t_1; 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[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -2.2e+68], t$95$1, If[LessEqual[x, -1.35e-32], t$95$2, If[LessEqual[x, -6e-153], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 9.5e-248], t$95$2, If[LessEqual[x, 2.2e-119], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 1.1e+103], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-32}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-153}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-248}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-119}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+103}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.19999999999999987e68 or 1.09999999999999996e103 < x Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
add-cbrt-cube12.2%
pow312.2%
associate--l-12.2%
Applied egg-rr12.2%
Taylor expanded in y around 0 12.0%
Taylor expanded in x around inf 74.4%
if -2.19999999999999987e68 < x < -1.3499999999999999e-32 or -6e-153 < x < 9.49999999999999971e-248 or 2.2000000000000001e-119 < x < 1.09999999999999996e103Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 88.7%
Taylor expanded in x around 0 81.1%
neg-mul-181.1%
Simplified81.1%
if -1.3499999999999999e-32 < x < -6e-153Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 90.3%
if 9.49999999999999971e-248 < x < 2.2000000000000001e-119Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in y around 0 76.3%
+-commutative76.3%
fma-def76.3%
Simplified76.3%
Taylor expanded in x around 0 76.3%
Final simplification78.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -0.76) (not (<= x 2.1e-16))) (- (- (* x (log y)) y) z) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -0.76) || !(x <= 2.1e-16)) {
tmp = ((x * log(y)) - y) - z;
} else {
tmp = (log(t) - z) - 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 ((x <= (-0.76d0)) .or. (.not. (x <= 2.1d-16))) then
tmp = ((x * log(y)) - y) - z
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -0.76) || !(x <= 2.1e-16)) {
tmp = ((x * Math.log(y)) - y) - z;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -0.76) or not (x <= 2.1e-16): tmp = ((x * math.log(y)) - y) - z else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -0.76) || !(x <= 2.1e-16)) tmp = Float64(Float64(Float64(x * log(y)) - y) - z); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -0.76) || ~((x <= 2.1e-16))) tmp = ((x * log(y)) - y) - z; else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -0.76], N[Not[LessEqual[x, 2.1e-16]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.76 \lor \neg \left(x \leq 2.1 \cdot 10^{-16}\right):\\
\;\;\;\;\left(x \cdot \log y - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -0.76000000000000001 or 2.1000000000000001e-16 < x Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 98.4%
if -0.76000000000000001 < x < 2.1000000000000001e-16Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -8.5e+53) (not (<= x 6.9e+40))) (- (* x (log y)) z) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8.5e+53) || !(x <= 6.9e+40)) {
tmp = (x * log(y)) - z;
} else {
tmp = (log(t) - z) - 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 ((x <= (-8.5d+53)) .or. (.not. (x <= 6.9d+40))) then
tmp = (x * log(y)) - z
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8.5e+53) || !(x <= 6.9e+40)) {
tmp = (x * Math.log(y)) - z;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -8.5e+53) or not (x <= 6.9e+40): tmp = (x * math.log(y)) - z else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -8.5e+53) || !(x <= 6.9e+40)) tmp = Float64(Float64(x * log(y)) - z); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -8.5e+53) || ~((x <= 6.9e+40))) tmp = (x * log(y)) - z; else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8.5e+53], N[Not[LessEqual[x, 6.9e+40]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+53} \lor \neg \left(x \leq 6.9 \cdot 10^{+40}\right):\\
\;\;\;\;x \cdot \log y - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -8.5000000000000002e53 or 6.9000000000000003e40 < x Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 87.1%
if -8.5000000000000002e53 < x < 6.9000000000000003e40Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 96.8%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.52e+68) (not (<= x 1.35e+101))) (* x (log y)) (- (- y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.52e+68) || !(x <= 1.35e+101)) {
tmp = x * log(y);
} else {
tmp = -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.52d+68)) .or. (.not. (x <= 1.35d+101))) then
tmp = x * log(y)
else
tmp = -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.52e+68) || !(x <= 1.35e+101)) {
tmp = x * Math.log(y);
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.52e+68) or not (x <= 1.35e+101): tmp = x * math.log(y) else: tmp = -y - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.52e+68) || !(x <= 1.35e+101)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.52e+68) || ~((x <= 1.35e+101))) tmp = x * log(y); else tmp = -y - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.52e+68], N[Not[LessEqual[x, 1.35e+101]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-y) - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.52 \cdot 10^{+68} \lor \neg \left(x \leq 1.35 \cdot 10^{+101}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if x < -1.52000000000000008e68 or 1.35000000000000003e101 < x Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
add-cbrt-cube12.2%
pow312.2%
associate--l-12.2%
Applied egg-rr12.2%
Taylor expanded in y around 0 12.0%
Taylor expanded in x around inf 74.4%
if -1.52000000000000008e68 < x < 1.35000000000000003e101Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in z around inf 79.8%
Taylor expanded in x around 0 74.7%
neg-mul-174.7%
Simplified74.7%
Final simplification74.6%
(FPCore (x y z t) :precision binary64 (if (<= y 2.15e+73) (- (* x (log y)) z) (- (- y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.15e+73) {
tmp = (x * log(y)) - z;
} else {
tmp = -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 <= 2.15d+73) then
tmp = (x * log(y)) - z
else
tmp = -y - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.15e+73) {
tmp = (x * Math.log(y)) - z;
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.15e+73: tmp = (x * math.log(y)) - z else: tmp = -y - z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.15e+73) tmp = Float64(Float64(x * log(y)) - z); else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.15e+73) tmp = (x * log(y)) - z; else tmp = -y - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.15e+73], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[((-y) - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.15 \cdot 10^{+73}:\\
\;\;\;\;x \cdot \log y - z\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if y < 2.15000000000000007e73Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 79.7%
Taylor expanded in x around inf 76.5%
if 2.15000000000000007e73 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in x around 0 90.3%
neg-mul-190.3%
Simplified90.3%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (if (<= y 4.5e+76) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.5e+76) {
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 <= 4.5d+76) 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 <= 4.5e+76) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4.5e+76: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4.5e+76) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 4.5e+76) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4.5e+76], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5 \cdot 10^{+76}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 4.4999999999999997e76Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 35.9%
neg-mul-135.9%
Simplified35.9%
if 4.4999999999999997e76 < y Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 90.2%
Taylor expanded in y around inf 81.1%
mul-1-neg81.1%
Simplified81.1%
Final simplification51.9%
(FPCore (x y z t) :precision binary64 (- (- y) z))
double code(double x, double y, double z, double t) {
return -y - z;
}
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 - z
end function
public static double code(double x, double y, double z, double t) {
return -y - z;
}
def code(x, y, z, t): return -y - z
function code(x, y, z, t) return Float64(Float64(-y) - z) end
function tmp = code(x, y, z, t) tmp = -y - z; end
code[x_, y_, z_, t_] := N[((-y) - z), $MachinePrecision]
\begin{array}{l}
\\
\left(-y\right) - z
\end{array}
Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 87.0%
Taylor expanded in x around 0 57.3%
neg-mul-157.3%
Simplified57.3%
Final simplification57.3%
(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%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 69.5%
Taylor expanded in y around inf 32.6%
mul-1-neg32.6%
Simplified32.6%
Final simplification32.6%
herbie shell --seed 2023321
(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)))