
(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 13 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)) (+ y z)))
double code(double x, double y, double z, double t) {
return fma(x, log(y), log(t)) - (y + z);
}
function code(x, y, z, t) return Float64(fma(x, log(y), log(t)) - Float64(y + z)) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t\right) - \left(y + z\right)
\end{array}
Initial program 99.9%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (- (* x (log y)) y) z)))
(if (<= t_1 -5e+279)
(- y)
(if (<= t_1 -1e+229)
(- z)
(if (<= t_1 -4000000000000.0)
(- y)
(if (<= t_1 1e-5) (log t) (- z)))))))
double code(double x, double y, double z, double t) {
double t_1 = ((x * log(y)) - y) - z;
double tmp;
if (t_1 <= -5e+279) {
tmp = -y;
} else if (t_1 <= -1e+229) {
tmp = -z;
} else if (t_1 <= -4000000000000.0) {
tmp = -y;
} else if (t_1 <= 1e-5) {
tmp = log(t);
} else {
tmp = -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)) - y) - z
if (t_1 <= (-5d+279)) then
tmp = -y
else if (t_1 <= (-1d+229)) then
tmp = -z
else if (t_1 <= (-4000000000000.0d0)) then
tmp = -y
else if (t_1 <= 1d-5) then
tmp = log(t)
else
tmp = -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)) - y) - z;
double tmp;
if (t_1 <= -5e+279) {
tmp = -y;
} else if (t_1 <= -1e+229) {
tmp = -z;
} else if (t_1 <= -4000000000000.0) {
tmp = -y;
} else if (t_1 <= 1e-5) {
tmp = Math.log(t);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x * math.log(y)) - y) - z tmp = 0 if t_1 <= -5e+279: tmp = -y elif t_1 <= -1e+229: tmp = -z elif t_1 <= -4000000000000.0: tmp = -y elif t_1 <= 1e-5: tmp = math.log(t) else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x * log(y)) - y) - z) tmp = 0.0 if (t_1 <= -5e+279) tmp = Float64(-y); elseif (t_1 <= -1e+229) tmp = Float64(-z); elseif (t_1 <= -4000000000000.0) tmp = Float64(-y); elseif (t_1 <= 1e-5) tmp = log(t); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x * log(y)) - y) - z; tmp = 0.0; if (t_1 <= -5e+279) tmp = -y; elseif (t_1 <= -1e+229) tmp = -z; elseif (t_1 <= -4000000000000.0) tmp = -y; elseif (t_1 <= 1e-5) tmp = log(t); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+279], (-y), If[LessEqual[t$95$1, -1e+229], (-z), If[LessEqual[t$95$1, -4000000000000.0], (-y), If[LessEqual[t$95$1, 1e-5], N[Log[t], $MachinePrecision], (-z)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \log y - y\right) - z\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+279}:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+229}:\\
\;\;\;\;-z\\
\mathbf{elif}\;t\_1 \leq -4000000000000:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_1 \leq 10^{-5}:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -5.0000000000000002e279 or -9.9999999999999999e228 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -4e12Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6447.1
Simplified47.1%
if -5.0000000000000002e279 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -9.9999999999999999e228 or 1.00000000000000008e-5 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6452.6
Simplified52.6%
if -4e12 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 1.00000000000000008e-5Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6494.9
Simplified94.9%
Taylor expanded in z around 0
log-lowering-log.f6494.4
Simplified94.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -1e+286)
(- (log t) y)
(if (<= t_2 -2e+253)
t_1
(if (<= t_2 -2e+84) (- y) (if (<= t_2 1e-5) (- (log t) z) t_1))))))
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 (t_2 <= -1e+286) {
tmp = log(t) - y;
} else if (t_2 <= -2e+253) {
tmp = t_1;
} else if (t_2 <= -2e+84) {
tmp = -y;
} else if (t_2 <= 1e-5) {
tmp = log(t) - z;
} 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 = t_1 - y
if (t_2 <= (-1d+286)) then
tmp = log(t) - y
else if (t_2 <= (-2d+253)) then
tmp = t_1
else if (t_2 <= (-2d+84)) then
tmp = -y
else if (t_2 <= 1d-5) then
tmp = log(t) - z
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 = t_1 - y;
double tmp;
if (t_2 <= -1e+286) {
tmp = Math.log(t) - y;
} else if (t_2 <= -2e+253) {
tmp = t_1;
} else if (t_2 <= -2e+84) {
tmp = -y;
} else if (t_2 <= 1e-5) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -1e+286: tmp = math.log(t) - y elif t_2 <= -2e+253: tmp = t_1 elif t_2 <= -2e+84: tmp = -y elif t_2 <= 1e-5: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -1e+286) tmp = Float64(log(t) - y); elseif (t_2 <= -2e+253) tmp = t_1; elseif (t_2 <= -2e+84) tmp = Float64(-y); elseif (t_2 <= 1e-5) tmp = Float64(log(t) - z); else tmp = t_1; 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 (t_2 <= -1e+286) tmp = log(t) - y; elseif (t_2 <= -2e+253) tmp = t_1; elseif (t_2 <= -2e+84) tmp = -y; elseif (t_2 <= 1e-5) tmp = log(t) - z; 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[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+286], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[t$95$2, -2e+253], t$95$1, If[LessEqual[t$95$2, -2e+84], (-y), If[LessEqual[t$95$2, 1e-5], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+286}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+253}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+84}:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_2 \leq 10^{-5}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.00000000000000003e286Initial program 99.7%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6465.7
Simplified65.7%
if -1.00000000000000003e286 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.9999999999999999e253 or 1.00000000000000008e-5 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6483.1
Simplified83.1%
if -1.9999999999999999e253 < (-.f64 (*.f64 x (log.f64 y)) y) < -2.00000000000000012e84Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6451.5
Simplified51.5%
if -2.00000000000000012e84 < (-.f64 (*.f64 x (log.f64 y)) y) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6483.6
Simplified83.6%
+-commutativeN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f6483.6
Applied egg-rr83.6%
Final simplification73.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -1e+286)
(- y)
(if (<= t_2 -2e+253)
t_1
(if (<= t_2 -2e+84) (- y) (if (<= t_2 1e-5) (- (log t) z) t_1))))))
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 (t_2 <= -1e+286) {
tmp = -y;
} else if (t_2 <= -2e+253) {
tmp = t_1;
} else if (t_2 <= -2e+84) {
tmp = -y;
} else if (t_2 <= 1e-5) {
tmp = log(t) - z;
} 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 = t_1 - y
if (t_2 <= (-1d+286)) then
tmp = -y
else if (t_2 <= (-2d+253)) then
tmp = t_1
else if (t_2 <= (-2d+84)) then
tmp = -y
else if (t_2 <= 1d-5) then
tmp = log(t) - z
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 = t_1 - y;
double tmp;
if (t_2 <= -1e+286) {
tmp = -y;
} else if (t_2 <= -2e+253) {
tmp = t_1;
} else if (t_2 <= -2e+84) {
tmp = -y;
} else if (t_2 <= 1e-5) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -1e+286: tmp = -y elif t_2 <= -2e+253: tmp = t_1 elif t_2 <= -2e+84: tmp = -y elif t_2 <= 1e-5: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -1e+286) tmp = Float64(-y); elseif (t_2 <= -2e+253) tmp = t_1; elseif (t_2 <= -2e+84) tmp = Float64(-y); elseif (t_2 <= 1e-5) tmp = Float64(log(t) - z); else tmp = t_1; 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 (t_2 <= -1e+286) tmp = -y; elseif (t_2 <= -2e+253) tmp = t_1; elseif (t_2 <= -2e+84) tmp = -y; elseif (t_2 <= 1e-5) tmp = log(t) - z; 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[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+286], (-y), If[LessEqual[t$95$2, -2e+253], t$95$1, If[LessEqual[t$95$2, -2e+84], (-y), If[LessEqual[t$95$2, 1e-5], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+286}:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+253}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+84}:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_2 \leq 10^{-5}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.00000000000000003e286 or -1.9999999999999999e253 < (-.f64 (*.f64 x (log.f64 y)) y) < -2.00000000000000012e84Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6453.7
Simplified53.7%
if -1.00000000000000003e286 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.9999999999999999e253 or 1.00000000000000008e-5 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6483.1
Simplified83.1%
if -2.00000000000000012e84 < (-.f64 (*.f64 x (log.f64 y)) y) < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6483.6
Simplified83.6%
+-commutativeN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f6483.6
Applied egg-rr83.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (- t_1 y) z)) (t_3 (- t_1 (+ y z))))
(if (<= t_2 -5000000000000.0)
t_3
(if (<= t_2 5000000000000.0) (- (log t) (+ y z)) t_3))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = (t_1 - y) - z;
double t_3 = t_1 - (y + z);
double tmp;
if (t_2 <= -5000000000000.0) {
tmp = t_3;
} else if (t_2 <= 5000000000000.0) {
tmp = log(t) - (y + z);
} else {
tmp = t_3;
}
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 = x * log(y)
t_2 = (t_1 - y) - z
t_3 = t_1 - (y + z)
if (t_2 <= (-5000000000000.0d0)) then
tmp = t_3
else if (t_2 <= 5000000000000.0d0) then
tmp = log(t) - (y + z)
else
tmp = t_3
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) - z;
double t_3 = t_1 - (y + z);
double tmp;
if (t_2 <= -5000000000000.0) {
tmp = t_3;
} else if (t_2 <= 5000000000000.0) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = (t_1 - y) - z t_3 = t_1 - (y + z) tmp = 0 if t_2 <= -5000000000000.0: tmp = t_3 elif t_2 <= 5000000000000.0: tmp = math.log(t) - (y + z) else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(t_1 - y) - z) t_3 = Float64(t_1 - Float64(y + z)) tmp = 0.0 if (t_2 <= -5000000000000.0) tmp = t_3; elseif (t_2 <= 5000000000000.0) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = (t_1 - y) - z; t_3 = t_1 - (y + z); tmp = 0.0; if (t_2 <= -5000000000000.0) tmp = t_3; elseif (t_2 <= 5000000000000.0) tmp = log(t) - (y + z); else tmp = t_3; 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[(N[(t$95$1 - y), $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5000000000000.0], t$95$3, If[LessEqual[t$95$2, 5000000000000.0], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(t\_1 - y\right) - z\\
t_3 := t\_1 - \left(y + z\right)\\
\mathbf{if}\;t\_2 \leq -5000000000000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5000000000000:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -5e12 or 5e12 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial program 99.8%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.5
Simplified99.5%
if -5e12 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 5e12Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6496.9
Simplified96.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) (+ y z))))
(if (<= z -245.0)
t_1
(if (<= z 1.7e-5) (fma x (log y) (- (log t) y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - (y + z);
double tmp;
if (z <= -245.0) {
tmp = t_1;
} else if (z <= 1.7e-5) {
tmp = fma(x, log(y), (log(t) - y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - Float64(y + z)) tmp = 0.0 if (z <= -245.0) tmp = t_1; elseif (z <= 1.7e-5) tmp = fma(x, log(y), Float64(log(t) - y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -245.0], t$95$1, If[LessEqual[z, 1.7e-5], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - \left(y + z\right)\\
\mathbf{if}\;z \leq -245:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -245 or 1.7e-5 < z Initial program 99.9%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.1
Simplified99.1%
if -245 < z < 1.7e-5Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
log-lowering-log.f6499.7
Simplified99.7%
(FPCore (x y z t) :precision binary64 (if (<= y 420.0) (fma x (log y) (- (log t) z)) (- (* x (log y)) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 420.0) {
tmp = fma(x, log(y), (log(t) - z));
} else {
tmp = (x * log(y)) - (y + z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 420.0) tmp = fma(x, log(y), Float64(log(t) - z)); else tmp = Float64(Float64(x * log(y)) - Float64(y + z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 420.0], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 420:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - \left(y + z\right)\\
\end{array}
\end{array}
if y < 420Initial program 99.8%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.5
Simplified99.5%
if 420 < y Initial program 99.9%
+-commutativeN/A
associate--l-N/A
associate-+r-N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.6
Simplified99.6%
(FPCore (x y z t) :precision binary64 (if (<= x -7.6e+120) (- (* x (log y)) z) (if (<= x 4.2e+42) (- (log t) (+ y z)) (fma x (log y) (- z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.6e+120) {
tmp = (x * log(y)) - z;
} else if (x <= 4.2e+42) {
tmp = log(t) - (y + z);
} else {
tmp = fma(x, log(y), -z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -7.6e+120) tmp = Float64(Float64(x * log(y)) - z); elseif (x <= 4.2e+42) tmp = Float64(log(t) - Float64(y + z)); else tmp = fma(x, log(y), Float64(-z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -7.6e+120], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 4.2e+42], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(x * N[Log[y], $MachinePrecision] + (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{+120}:\\
\;\;\;\;x \cdot \log y - z\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+42}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, -z\right)\\
\end{array}
\end{array}
if x < -7.5999999999999995e120Initial program 99.6%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6489.2
Simplified89.2%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6489.2
Simplified89.2%
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6489.3
Applied egg-rr89.3%
if -7.5999999999999995e120 < x < 4.19999999999999991e42Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6493.5
Simplified93.5%
if 4.19999999999999991e42 < x Initial program 99.7%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6492.5
Simplified92.5%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6492.5
Simplified92.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* x (log y)) z))) (if (<= x -7.6e+120) t_1 (if (<= x 1.55e+43) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - z;
double tmp;
if (x <= -7.6e+120) {
tmp = t_1;
} else if (x <= 1.55e+43) {
tmp = log(t) - (y + z);
} 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) :: tmp
t_1 = (x * log(y)) - z
if (x <= (-7.6d+120)) then
tmp = t_1
else if (x <= 1.55d+43) then
tmp = log(t) - (y + z)
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)) - z;
double tmp;
if (x <= -7.6e+120) {
tmp = t_1;
} else if (x <= 1.55e+43) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - z tmp = 0 if x <= -7.6e+120: tmp = t_1 elif x <= 1.55e+43: tmp = math.log(t) - (y + z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - z) tmp = 0.0 if (x <= -7.6e+120) tmp = t_1; elseif (x <= 1.55e+43) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - z; tmp = 0.0; if (x <= -7.6e+120) tmp = t_1; elseif (x <= 1.55e+43) tmp = log(t) - (y + z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -7.6e+120], t$95$1, If[LessEqual[x, 1.55e+43], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - z\\
\mathbf{if}\;x \leq -7.6 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+43}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.5999999999999995e120 or 1.5500000000000001e43 < x Initial program 99.7%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6491.2
Simplified91.2%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6491.2
Simplified91.2%
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6491.2
Applied egg-rr91.2%
if -7.5999999999999995e120 < x < 1.5500000000000001e43Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6493.5
Simplified93.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= x -1.75e+147) t_1 (if (<= x 1.45e+91) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.75e+147) {
tmp = t_1;
} else if (x <= 1.45e+91) {
tmp = log(t) - (y + z);
} 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) :: tmp
t_1 = x * log(y)
if (x <= (-1.75d+147)) then
tmp = t_1
else if (x <= 1.45d+91) then
tmp = log(t) - (y + z)
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 tmp;
if (x <= -1.75e+147) {
tmp = t_1;
} else if (x <= 1.45e+91) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.75e+147: tmp = t_1 elif x <= 1.45e+91: tmp = math.log(t) - (y + z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.75e+147) tmp = t_1; elseif (x <= 1.45e+91) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -1.75e+147) tmp = t_1; elseif (x <= 1.45e+91) tmp = log(t) - (y + z); 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]}, If[LessEqual[x, -1.75e+147], t$95$1, If[LessEqual[x, 1.45e+91], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+91}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.74999999999999987e147 or 1.45000000000000007e91 < x Initial program 99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6481.4
Simplified81.4%
if -1.74999999999999987e147 < x < 1.45000000000000007e91Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6490.8
Simplified90.8%
(FPCore (x y z t) :precision binary64 (if (<= y 1.9e+38) (- (log t) z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.9e+38) {
tmp = log(t) - 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.9d+38) then
tmp = log(t) - 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.9e+38) {
tmp = Math.log(t) - z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.9e+38: tmp = math.log(t) - z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.9e+38) tmp = Float64(log(t) - z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.9e+38) tmp = log(t) - z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.9e+38], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{+38}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.8999999999999999e38Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6462.7
Simplified62.7%
+-commutativeN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f6462.7
Applied egg-rr62.7%
if 1.8999999999999999e38 < y Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6455.5
Simplified55.5%
(FPCore (x y z t) :precision binary64 (if (<= z -1900.0) (- z) (if (<= z 6.4e+17) (- y) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1900.0) {
tmp = -z;
} else if (z <= 6.4e+17) {
tmp = -y;
} else {
tmp = -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 (z <= (-1900.0d0)) then
tmp = -z
else if (z <= 6.4d+17) then
tmp = -y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1900.0) {
tmp = -z;
} else if (z <= 6.4e+17) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1900.0: tmp = -z elif z <= 6.4e+17: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1900.0) tmp = Float64(-z); elseif (z <= 6.4e+17) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1900.0) tmp = -z; elseif (z <= 6.4e+17) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1900.0], (-z), If[LessEqual[z, 6.4e+17], (-y), (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1900:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+17}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1900 or 6.4e17 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6464.9
Simplified64.9%
if -1900 < z < 6.4e17Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6435.3
Simplified35.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%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6424.8
Simplified24.8%
herbie shell --seed 2024204
(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)))