
(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 10 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%
associate--l-99.9%
+-commutative99.9%
associate--r+99.9%
fma-neg99.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 (<= z -9.2e+97)
(- (- (log t) z) y)
(if (<= z 1.4e+64) (- (+ (log t) t_1) y) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (z <= -9.2e+97) {
tmp = (log(t) - z) - y;
} else if (z <= 1.4e+64) {
tmp = (log(t) + t_1) - y;
} 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) :: tmp
t_1 = x * log(y)
if (z <= (-9.2d+97)) then
tmp = (log(t) - z) - y
else if (z <= 1.4d+64) then
tmp = (log(t) + t_1) - y
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 tmp;
if (z <= -9.2e+97) {
tmp = (Math.log(t) - z) - y;
} else if (z <= 1.4e+64) {
tmp = (Math.log(t) + t_1) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if z <= -9.2e+97: tmp = (math.log(t) - z) - y elif z <= 1.4e+64: tmp = (math.log(t) + t_1) - y else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (z <= -9.2e+97) tmp = Float64(Float64(log(t) - z) - y); elseif (z <= 1.4e+64) tmp = Float64(Float64(log(t) + t_1) - y); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (z <= -9.2e+97) tmp = (log(t) - z) - y; elseif (z <= 1.4e+64) tmp = (log(t) + t_1) - y; 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]}, If[LessEqual[z, -9.2e+97], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[z, 1.4e+64], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+97}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+64}:\\
\;\;\;\;\left(\log t + t_1\right) - y\\
\mathbf{else}:\\
\;\;\;\;t_1 - z\\
\end{array}
\end{array}
if z < -9.20000000000000022e97Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
+-commutative100.0%
associate--r+100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 93.6%
if -9.20000000000000022e97 < z < 1.40000000000000012e64Initial program 99.8%
Taylor expanded in z around 0 94.9%
if 1.40000000000000012e64 < z Initial program 99.9%
Taylor expanded in y around 0 85.2%
+-commutative85.2%
associate-+r-85.2%
fma-def85.2%
Simplified85.2%
fma-udef85.2%
associate-+r-85.2%
Applied egg-rr85.2%
Taylor expanded in x around inf 85.2%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (log t) (* x (log y))))) (if (<= y 3e+48) (- t_1 z) (- t_1 y))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) + (x * log(y));
double tmp;
if (y <= 3e+48) {
tmp = t_1 - z;
} else {
tmp = t_1 - 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) :: t_1
real(8) :: tmp
t_1 = log(t) + (x * log(y))
if (y <= 3d+48) then
tmp = t_1 - z
else
tmp = t_1 - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) + (x * Math.log(y));
double tmp;
if (y <= 3e+48) {
tmp = t_1 - z;
} else {
tmp = t_1 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) + (x * math.log(y)) tmp = 0 if y <= 3e+48: tmp = t_1 - z else: tmp = t_1 - y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) + Float64(x * log(y))) tmp = 0.0 if (y <= 3e+48) tmp = Float64(t_1 - z); else tmp = Float64(t_1 - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) + (x * log(y)); tmp = 0.0; if (y <= 3e+48) tmp = t_1 - z; else tmp = t_1 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3e+48], N[(t$95$1 - z), $MachinePrecision], N[(t$95$1 - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t + x \cdot \log y\\
\mathbf{if}\;y \leq 3 \cdot 10^{+48}:\\
\;\;\;\;t_1 - z\\
\mathbf{else}:\\
\;\;\;\;t_1 - y\\
\end{array}
\end{array}
if y < 3e48Initial program 99.8%
Taylor expanded in y around 0 97.9%
if 3e48 < y Initial program 99.9%
Taylor expanded in z around 0 83.4%
Final simplification91.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) z)) (t_2 (* x (log y))))
(if (<= x -8e+142)
t_2
(if (<= x -1e-272)
(- y)
(if (<= x 2.7e-48)
t_1
(if (<= x 1.25e+29) (- y) (if (<= x 1.54e+85) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - z;
double t_2 = x * log(y);
double tmp;
if (x <= -8e+142) {
tmp = t_2;
} else if (x <= -1e-272) {
tmp = -y;
} else if (x <= 2.7e-48) {
tmp = t_1;
} else if (x <= 1.25e+29) {
tmp = -y;
} else if (x <= 1.54e+85) {
tmp = t_1;
} 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) :: tmp
t_1 = log(t) - z
t_2 = x * log(y)
if (x <= (-8d+142)) then
tmp = t_2
else if (x <= (-1d-272)) then
tmp = -y
else if (x <= 2.7d-48) then
tmp = t_1
else if (x <= 1.25d+29) then
tmp = -y
else if (x <= 1.54d+85) then
tmp = t_1
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) - z;
double t_2 = x * Math.log(y);
double tmp;
if (x <= -8e+142) {
tmp = t_2;
} else if (x <= -1e-272) {
tmp = -y;
} else if (x <= 2.7e-48) {
tmp = t_1;
} else if (x <= 1.25e+29) {
tmp = -y;
} else if (x <= 1.54e+85) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - z t_2 = x * math.log(y) tmp = 0 if x <= -8e+142: tmp = t_2 elif x <= -1e-272: tmp = -y elif x <= 2.7e-48: tmp = t_1 elif x <= 1.25e+29: tmp = -y elif x <= 1.54e+85: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - z) t_2 = Float64(x * log(y)) tmp = 0.0 if (x <= -8e+142) tmp = t_2; elseif (x <= -1e-272) tmp = Float64(-y); elseif (x <= 2.7e-48) tmp = t_1; elseif (x <= 1.25e+29) tmp = Float64(-y); elseif (x <= 1.54e+85) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - z; t_2 = x * log(y); tmp = 0.0; if (x <= -8e+142) tmp = t_2; elseif (x <= -1e-272) tmp = -y; elseif (x <= 2.7e-48) tmp = t_1; elseif (x <= 1.25e+29) tmp = -y; elseif (x <= 1.54e+85) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+142], t$95$2, If[LessEqual[x, -1e-272], (-y), If[LessEqual[x, 2.7e-48], t$95$1, If[LessEqual[x, 1.25e+29], (-y), If[LessEqual[x, 1.54e+85], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - z\\
t_2 := x \cdot \log y\\
\mathbf{if}\;x \leq -8 \cdot 10^{+142}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-272}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+29}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq 1.54 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -8.00000000000000041e142 or 1.5400000000000001e85 < x Initial program 99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r-99.7%
associate--l-99.7%
fma-def99.7%
associate--l-99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 71.1%
if -8.00000000000000041e142 < x < -9.9999999999999993e-273 or 2.70000000000000011e-48 < x < 1.25e29Initial program 100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r-100.0%
associate--l-100.0%
fma-def100.0%
associate--l-100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 54.7%
neg-mul-154.7%
Simplified54.7%
if -9.9999999999999993e-273 < x < 2.70000000000000011e-48 or 1.25e29 < x < 1.5400000000000001e85Initial program 100.0%
Taylor expanded in y around 0 73.7%
+-commutative73.7%
associate-+r-73.7%
fma-def73.7%
Simplified73.7%
Taylor expanded in x around 0 67.9%
Final simplification65.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y 1.05e+69) (and (not (<= y 8.5e+88)) (<= y 1.85e+112))) (- (* x (log y)) z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= 1.05e+69) || (!(y <= 8.5e+88) && (y <= 1.85e+112))) {
tmp = (x * log(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 ((y <= 1.05d+69) .or. (.not. (y <= 8.5d+88)) .and. (y <= 1.85d+112)) then
tmp = (x * log(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 ((y <= 1.05e+69) || (!(y <= 8.5e+88) && (y <= 1.85e+112))) {
tmp = (x * Math.log(y)) - z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= 1.05e+69) or (not (y <= 8.5e+88) and (y <= 1.85e+112)): tmp = (x * math.log(y)) - z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= 1.05e+69) || (!(y <= 8.5e+88) && (y <= 1.85e+112))) tmp = Float64(Float64(x * log(y)) - z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= 1.05e+69) || (~((y <= 8.5e+88)) && (y <= 1.85e+112))) tmp = (x * log(y)) - z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, 1.05e+69], And[N[Not[LessEqual[y, 8.5e+88]], $MachinePrecision], LessEqual[y, 1.85e+112]]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.05 \cdot 10^{+69} \lor \neg \left(y \leq 8.5 \cdot 10^{+88}\right) \land y \leq 1.85 \cdot 10^{+112}:\\
\;\;\;\;x \cdot \log y - z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.05000000000000008e69 or 8.5000000000000005e88 < y < 1.85000000000000002e112Initial program 99.8%
Taylor expanded in y around 0 94.1%
+-commutative94.1%
associate-+r-94.1%
fma-def94.1%
Simplified94.1%
fma-udef94.1%
associate-+r-94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 79.5%
if 1.05000000000000008e69 < y < 8.5000000000000005e88 or 1.85000000000000002e112 < y Initial program 99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r-99.9%
associate--l-99.9%
fma-def99.9%
associate--l-99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 69.9%
neg-mul-169.9%
Simplified69.9%
Final simplification75.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= y 6.2e-162)
t_1
(if (<= y 3.5e-89)
(- z)
(if (<= y 6200000000.0) t_1 (if (<= y 3e+50) (- z) (- y)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 6.2e-162) {
tmp = t_1;
} else if (y <= 3.5e-89) {
tmp = -z;
} else if (y <= 6200000000.0) {
tmp = t_1;
} else if (y <= 3e+50) {
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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (y <= 6.2d-162) then
tmp = t_1
else if (y <= 3.5d-89) then
tmp = -z
else if (y <= 6200000000.0d0) then
tmp = t_1
else if (y <= 3d+50) 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 t_1 = x * Math.log(y);
double tmp;
if (y <= 6.2e-162) {
tmp = t_1;
} else if (y <= 3.5e-89) {
tmp = -z;
} else if (y <= 6200000000.0) {
tmp = t_1;
} else if (y <= 3e+50) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 6.2e-162: tmp = t_1 elif y <= 3.5e-89: tmp = -z elif y <= 6200000000.0: tmp = t_1 elif y <= 3e+50: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 6.2e-162) tmp = t_1; elseif (y <= 3.5e-89) tmp = Float64(-z); elseif (y <= 6200000000.0) tmp = t_1; elseif (y <= 3e+50) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 6.2e-162) tmp = t_1; elseif (y <= 3.5e-89) tmp = -z; elseif (y <= 6200000000.0) tmp = t_1; elseif (y <= 3e+50) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6.2e-162], t$95$1, If[LessEqual[y, 3.5e-89], (-z), If[LessEqual[y, 6200000000.0], t$95$1, If[LessEqual[y, 3e+50], (-z), (-y)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 6.2 \cdot 10^{-162}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-89}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 6200000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+50}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 6.1999999999999997e-162 or 3.4999999999999997e-89 < y < 6.2e9Initial program 99.8%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r-99.8%
associate--l-99.8%
fma-def99.8%
associate--l-99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 50.6%
if 6.1999999999999997e-162 < y < 3.4999999999999997e-89 or 6.2e9 < y < 2.9999999999999998e50Initial program 100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r-100.0%
associate--l-100.0%
fma-def100.0%
associate--l-100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 58.8%
mul-1-neg58.8%
Simplified58.8%
if 2.9999999999999998e50 < y Initial program 99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r-99.9%
associate--l-99.9%
fma-def99.9%
associate--l-99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 64.7%
neg-mul-164.7%
Simplified64.7%
Final simplification58.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.2e+64) (not (<= x 1.45e+29))) (- (* x (log y)) z) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.2e+64) || !(x <= 1.45e+29)) {
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 <= (-2.2d+64)) .or. (.not. (x <= 1.45d+29))) 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 <= -2.2e+64) || !(x <= 1.45e+29)) {
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 <= -2.2e+64) or not (x <= 1.45e+29): 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 <= -2.2e+64) || !(x <= 1.45e+29)) 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 <= -2.2e+64) || ~((x <= 1.45e+29))) 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, -2.2e+64], N[Not[LessEqual[x, 1.45e+29]], $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 -2.2 \cdot 10^{+64} \lor \neg \left(x \leq 1.45 \cdot 10^{+29}\right):\\
\;\;\;\;x \cdot \log y - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -2.20000000000000002e64 or 1.45e29 < x Initial program 99.7%
Taylor expanded in y around 0 84.1%
+-commutative84.1%
associate-+r-84.1%
fma-def84.1%
Simplified84.1%
fma-udef84.1%
associate-+r-84.1%
Applied egg-rr84.1%
Taylor expanded in x around inf 84.1%
if -2.20000000000000002e64 < x < 1.45e29Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
+-commutative100.0%
associate--r+100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 97.3%
Final simplification90.8%
(FPCore (x y z t) :precision binary64 (if (<= y 4.2e+49) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.2e+49) {
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.2d+49) 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.2e+49) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4.2e+49: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4.2e+49) 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.2e+49) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4.2e+49], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{+49}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 4.20000000000000022e49Initial program 99.8%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r-99.8%
associate--l-99.8%
fma-def99.8%
associate--l-99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 37.7%
mul-1-neg37.7%
Simplified37.7%
if 4.20000000000000022e49 < y Initial program 99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r-99.9%
associate--l-99.9%
fma-def99.9%
associate--l-99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 64.7%
neg-mul-164.7%
Simplified64.7%
Final simplification49.8%
(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%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r-99.9%
associate--l-99.9%
fma-def99.9%
associate--l-99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 31.3%
neg-mul-131.3%
Simplified31.3%
Final simplification31.3%
herbie shell --seed 2023293
(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)))