
(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 15 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
(let* ((t_1 (* x (log y))) (t_2 (- (- t_1 y) z)))
(if (<= t_2 -1000000.0)
(/ 1.0 (/ 1.0 (- t_1 (+ y z))))
(if (<= t_2 50000000.0) (fma x (log y) (log t)) (fma x (log y) (- z))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = (t_1 - y) - z;
double tmp;
if (t_2 <= -1000000.0) {
tmp = 1.0 / (1.0 / (t_1 - (y + z)));
} else if (t_2 <= 50000000.0) {
tmp = fma(x, log(y), log(t));
} else {
tmp = fma(x, log(y), -z);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(t_1 - y) - z) tmp = 0.0 if (t_2 <= -1000000.0) tmp = Float64(1.0 / Float64(1.0 / Float64(t_1 - Float64(y + z)))); elseif (t_2 <= 50000000.0) tmp = fma(x, log(y), log(t)); else tmp = fma(x, log(y), Float64(-z)); end return 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]}, If[LessEqual[t$95$2, -1000000.0], N[(1.0 / N[(1.0 / N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 50000000.0], N[(x * N[Log[y], $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision], N[(x * N[Log[y], $MachinePrecision] + (-z)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(t\_1 - y\right) - z\\
\mathbf{if}\;t\_2 \leq -1000000:\\
\;\;\;\;\frac{1}{\frac{1}{t\_1 - \left(y + z\right)}}\\
\mathbf{elif}\;t\_2 \leq 50000000:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, -z\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -1e6Initial program 99.9%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6498.2
Simplified98.2%
if -1e6 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 5e7Initial program 99.9%
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.8
Simplified99.8%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
log-lowering-log.f6499.8
Simplified99.8%
if 5e7 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial 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.7
Simplified99.7%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6499.7
Simplified99.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (- (* x (log y)) y) z))) (if (<= t_1 -1000000.0) (- (- y) z) (if (<= t_1 4e+28) (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 <= -1000000.0) {
tmp = -y - z;
} else if (t_1 <= 4e+28) {
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 <= (-1000000.0d0)) then
tmp = -y - z
else if (t_1 <= 4d+28) 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 <= -1000000.0) {
tmp = -y - z;
} else if (t_1 <= 4e+28) {
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 <= -1000000.0: tmp = -y - z elif t_1 <= 4e+28: 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 <= -1000000.0) tmp = Float64(Float64(-y) - z); elseif (t_1 <= 4e+28) 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 <= -1000000.0) tmp = -y - z; elseif (t_1 <= 4e+28) 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, -1000000.0], N[((-y) - z), $MachinePrecision], If[LessEqual[t$95$1, 4e+28], 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 -1000000:\\
\;\;\;\;\left(-y\right) - z\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+28}:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -1e6Initial program 99.9%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6498.2
Simplified98.2%
Taylor expanded in x around 0
distribute-lft-inN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6475.1
Simplified75.1%
if -1e6 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 3.99999999999999983e28Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6487.6
Simplified87.6%
Taylor expanded in z around 0
log-lowering-log.f6487.6
Simplified87.6%
if 3.99999999999999983e28 < (-.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.4
Simplified52.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y))) (if (<= t_2 -1500000.0) (- (- y) z) (if (<= t_2 1e+14) (- (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 <= -1500000.0) {
tmp = -y - z;
} else if (t_2 <= 1e+14) {
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 <= (-1500000.0d0)) then
tmp = -y - z
else if (t_2 <= 1d+14) 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 <= -1500000.0) {
tmp = -y - z;
} else if (t_2 <= 1e+14) {
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 <= -1500000.0: tmp = -y - z elif t_2 <= 1e+14: 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 <= -1500000.0) tmp = Float64(Float64(-y) - z); elseif (t_2 <= 1e+14) 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 <= -1500000.0) tmp = -y - z; elseif (t_2 <= 1e+14) 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, -1500000.0], N[((-y) - z), $MachinePrecision], If[LessEqual[t$95$2, 1e+14], 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 -1500000:\\
\;\;\;\;\left(-y\right) - z\\
\mathbf{elif}\;t\_2 \leq 10^{+14}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.5e6Initial program 99.9%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.0
Simplified99.0%
Taylor expanded in x around 0
distribute-lft-inN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6474.9
Simplified74.9%
if -1.5e6 < (-.f64 (*.f64 x (log.f64 y)) y) < 1e14Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6495.5
Simplified95.5%
+-commutativeN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f6495.5
Applied egg-rr95.5%
if 1e14 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6486.9
Simplified86.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.5e+30)
(/ 1.0 (/ 1.0 (- (* x (log y)) (+ y z))))
(if (<= z 2.4e-20)
(fma x (log y) (- (log t) y))
(fma z (/ (fma x (log y) (- y)) z) (- z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e+30) {
tmp = 1.0 / (1.0 / ((x * log(y)) - (y + z)));
} else if (z <= 2.4e-20) {
tmp = fma(x, log(y), (log(t) - y));
} else {
tmp = fma(z, (fma(x, log(y), -y) / z), -z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -5.5e+30) tmp = Float64(1.0 / Float64(1.0 / Float64(Float64(x * log(y)) - Float64(y + z)))); elseif (z <= 2.4e-20) tmp = fma(x, log(y), Float64(log(t) - y)); else tmp = fma(z, Float64(fma(x, log(y), Float64(-y)) / z), Float64(-z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.5e+30], N[(1.0 / N[(1.0 / N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-20], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x * N[Log[y], $MachinePrecision] + (-y)), $MachinePrecision] / z), $MachinePrecision] + (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+30}:\\
\;\;\;\;\frac{1}{\frac{1}{x \cdot \log y - \left(y + z\right)}}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{\mathsf{fma}\left(x, \log y, -y\right)}{z}, -z\right)\\
\end{array}
\end{array}
if z < -5.50000000000000025e30Initial program 99.9%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.8
Simplified99.8%
if -5.50000000000000025e30 < z < 2.39999999999999993e-20Initial 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.8
Simplified99.8%
if 2.39999999999999993e-20 < z Initial program 99.9%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6498.1
Simplified98.1%
Taylor expanded in z around inf
+-commutativeN/A
associate--r+N/A
div-subN/A
sub-negN/A
remove-double-negN/A
distribute-frac-neg2N/A
distribute-neg-frac2N/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
+-commutativeN/A
distribute-lft-inN/A
Simplified98.2%
(FPCore (x y z t) :precision binary64 (if (<= (- (* x (log y)) y) -1500000.0) (- (- y) z) (- (log t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * log(y)) - y) <= -1500000.0) {
tmp = -y - z;
} else {
tmp = log(t) - 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 * log(y)) - y) <= (-1500000.0d0)) then
tmp = -y - z
else
tmp = log(t) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x * Math.log(y)) - y) <= -1500000.0) {
tmp = -y - z;
} else {
tmp = Math.log(t) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * math.log(y)) - y) <= -1500000.0: tmp = -y - z else: tmp = math.log(t) - z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * log(y)) - y) <= -1500000.0) tmp = Float64(Float64(-y) - z); else tmp = Float64(log(t) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * log(y)) - y) <= -1500000.0) tmp = -y - z; else tmp = log(t) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], -1500000.0], N[((-y) - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot \log y - y \leq -1500000:\\
\;\;\;\;\left(-y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.5e6Initial program 99.9%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.0
Simplified99.0%
Taylor expanded in x around 0
distribute-lft-inN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6474.9
Simplified74.9%
if -1.5e6 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6467.6
Simplified67.6%
+-commutativeN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f6467.6
Applied egg-rr67.6%
(FPCore (x y z t) :precision binary64 (if (<= y 1.42e-5) (fma x (log y) (- (log t) z)) (/ 1.0 (/ 1.0 (- (* x (log y)) (+ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.42e-5) {
tmp = fma(x, log(y), (log(t) - z));
} else {
tmp = 1.0 / (1.0 / ((x * log(y)) - (y + z)));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 1.42e-5) tmp = fma(x, log(y), Float64(log(t) - z)); else tmp = Float64(1.0 / Float64(1.0 / Float64(Float64(x * log(y)) - Float64(y + z)))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.42e-5], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.42 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{x \cdot \log y - \left(y + z\right)}}\\
\end{array}
\end{array}
if y < 1.42e-5Initial 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.8
Simplified99.8%
if 1.42e-5 < y Initial program 100.0%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.0
Simplified99.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- (log y) (/ (+ y z) x))))) (if (<= x -41000.0) t_1 (if (<= x 1300000.0) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (log(y) - ((y + z) / x));
double tmp;
if (x <= -41000.0) {
tmp = t_1;
} else if (x <= 1300000.0) {
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) - ((y + z) / x))
if (x <= (-41000.0d0)) then
tmp = t_1
else if (x <= 1300000.0d0) 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) - ((y + z) / x));
double tmp;
if (x <= -41000.0) {
tmp = t_1;
} else if (x <= 1300000.0) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (math.log(y) - ((y + z) / x)) tmp = 0 if x <= -41000.0: tmp = t_1 elif x <= 1300000.0: tmp = math.log(t) - (y + z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(log(y) - Float64(Float64(y + z) / x))) tmp = 0.0 if (x <= -41000.0) tmp = t_1; elseif (x <= 1300000.0) 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) - ((y + z) / x)); tmp = 0.0; if (x <= -41000.0) tmp = t_1; elseif (x <= 1300000.0) 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[(N[Log[y], $MachinePrecision] - N[(N[(y + z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -41000.0], t$95$1, If[LessEqual[x, 1300000.0], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\log y - \frac{y + z}{x}\right)\\
\mathbf{if}\;x \leq -41000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1300000:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -41000 or 1.3e6 < x Initial program 99.7%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.1
Simplified99.1%
Taylor expanded in x around inf
associate-*r/N/A
distribute-lft-inN/A
mul-1-negN/A
sub-negN/A
div-subN/A
associate-*r/N/A
associate--l+N/A
*-lowering-*.f64N/A
associate--l+N/A
associate-*r/N/A
div-subN/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f64N/A
Simplified99.2%
if -41000 < x < 1.3e6Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6498.3
Simplified98.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma x (log y) (- z)))) (if (<= x -3.25e+22) t_1 (if (<= x 1.4e+25) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(x, log(y), -z);
double tmp;
if (x <= -3.25e+22) {
tmp = t_1;
} else if (x <= 1.4e+25) {
tmp = log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(x, log(y), Float64(-z)) tmp = 0.0 if (x <= -3.25e+22) tmp = t_1; elseif (x <= 1.4e+25) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision] + (-z)), $MachinePrecision]}, If[LessEqual[x, -3.25e+22], t$95$1, If[LessEqual[x, 1.4e+25], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \log y, -z\right)\\
\mathbf{if}\;x \leq -3.25 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+25}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.2499999999999999e22 or 1.4000000000000001e25 < 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.f6481.7
Simplified81.7%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6481.7
Simplified81.7%
if -3.2499999999999999e22 < x < 1.4000000000000001e25Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6497.8
Simplified97.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma x (log y) (- y)))) (if (<= x -2.45e+120) t_1 (if (<= x 6.1e+44) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(x, log(y), -y);
double tmp;
if (x <= -2.45e+120) {
tmp = t_1;
} else if (x <= 6.1e+44) {
tmp = log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(x, log(y), Float64(-y)) tmp = 0.0 if (x <= -2.45e+120) tmp = t_1; elseif (x <= 6.1e+44) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision] + (-y)), $MachinePrecision]}, If[LessEqual[x, -2.45e+120], t$95$1, If[LessEqual[x, 6.1e+44], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \log y, -y\right)\\
\mathbf{if}\;x \leq -2.45 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.1 \cdot 10^{+44}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.45000000000000005e120 or 6.09999999999999983e44 < x Initial program 99.7%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6499.6
Simplified99.6%
Taylor expanded in z around 0
sub-negN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
mul-1-negN/A
neg-lowering-neg.f6484.0
Simplified84.0%
if -2.45000000000000005e120 < x < 6.09999999999999983e44Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6494.0
Simplified94.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= x -6e+120) t_1 (if (<= x 9.5e+217) (- (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 <= -6e+120) {
tmp = t_1;
} else if (x <= 9.5e+217) {
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 <= (-6d+120)) then
tmp = t_1
else if (x <= 9.5d+217) 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 <= -6e+120) {
tmp = t_1;
} else if (x <= 9.5e+217) {
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 <= -6e+120: tmp = t_1 elif x <= 9.5e+217: 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 <= -6e+120) tmp = t_1; elseif (x <= 9.5e+217) 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 <= -6e+120) tmp = t_1; elseif (x <= 9.5e+217) 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, -6e+120], t$95$1, If[LessEqual[x, 9.5e+217], 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 -6 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+217}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6e120 or 9.5000000000000003e217 < x Initial program 99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6484.2
Simplified84.2%
if -6e120 < x < 9.5000000000000003e217Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6486.3
Simplified86.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (- y) z))) (if (<= z -1.7e+37) t_1 (if (<= z 4.6e-32) (- (log t) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -y - z;
double tmp;
if (z <= -1.7e+37) {
tmp = t_1;
} else if (z <= 4.6e-32) {
tmp = log(t) - y;
} 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 = -y - z
if (z <= (-1.7d+37)) then
tmp = t_1
else if (z <= 4.6d-32) then
tmp = log(t) - y
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 = -y - z;
double tmp;
if (z <= -1.7e+37) {
tmp = t_1;
} else if (z <= 4.6e-32) {
tmp = Math.log(t) - y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -y - z tmp = 0 if z <= -1.7e+37: tmp = t_1 elif z <= 4.6e-32: tmp = math.log(t) - y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-y) - z) tmp = 0.0 if (z <= -1.7e+37) tmp = t_1; elseif (z <= 4.6e-32) tmp = Float64(log(t) - y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -y - z; tmp = 0.0; if (z <= -1.7e+37) tmp = t_1; elseif (z <= 4.6e-32) tmp = log(t) - y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[z, -1.7e+37], t$95$1, If[LessEqual[z, 4.6e-32], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-y\right) - z\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-32}:\\
\;\;\;\;\log t - y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.70000000000000003e37 or 4.6000000000000001e-32 < z Initial program 99.9%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6498.8
Simplified98.8%
Taylor expanded in x around 0
distribute-lft-inN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6472.7
Simplified72.7%
if -1.70000000000000003e37 < z < 4.6000000000000001e-32Initial program 99.8%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
remove-double-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f6488.6
Simplified88.6%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
associate-/l*N/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
log-lowering-log.f6488.7
Simplified88.7%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6470.9
Simplified70.9%
(FPCore (x y z t) :precision binary64 (if (<= y 1.1e+35) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.1e+35) {
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 <= 1.1d+35) 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 <= 1.1e+35) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.1e+35: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.1e+35) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.1e+35) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.1e+35], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.1 \cdot 10^{+35}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.0999999999999999e35Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6435.5
Simplified35.5%
if 1.0999999999999999e35 < y Initial program 100.0%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6468.5
Simplified68.5%
(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%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6484.5
Simplified84.5%
Taylor expanded in x around 0
distribute-lft-inN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6458.0
Simplified58.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%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6432.4
Simplified32.4%
herbie shell --seed 2024201
(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)))