
(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 16 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))
(t_3 (/ 1.0 (/ 1.0 (- t_1 (+ y z))))))
(if (<= t_2 -4000000000000.0)
t_3
(if (<= t_2 1.0) (fma (log y) x (log t)) 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 = 1.0 / (1.0 / (t_1 - (y + z)));
double tmp;
if (t_2 <= -4000000000000.0) {
tmp = t_3;
} else if (t_2 <= 1.0) {
tmp = fma(log(y), x, log(t));
} 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(1.0 / Float64(1.0 / Float64(t_1 - Float64(y + z)))) tmp = 0.0 if (t_2 <= -4000000000000.0) tmp = t_3; elseif (t_2 <= 1.0) tmp = fma(log(y), x, log(t)); else tmp = t_3; 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]}, Block[{t$95$3 = N[(1.0 / N[(1.0 / N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4000000000000.0], t$95$3, If[LessEqual[t$95$2, 1.0], N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $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 := \frac{1}{\frac{1}{t\_1 - \left(y + z\right)}}\\
\mathbf{if}\;t\_2 \leq -4000000000000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 1:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -4e12 or 1 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial 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.f6499.4
Simplified99.4%
if -4e12 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 1Initial program 99.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6498.7
Simplified98.7%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
log-lowering-log.f6498.7
Applied egg-rr98.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (- (* x (log y)) y) z)) (t_2 (- (- z) y))) (if (<= t_1 -4000000000000.0) t_2 (if (<= t_1 1.0) (log t) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = ((x * log(y)) - y) - z;
double t_2 = -z - y;
double tmp;
if (t_1 <= -4000000000000.0) {
tmp = t_2;
} else if (t_1 <= 1.0) {
tmp = log(t);
} 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 = ((x * log(y)) - y) - z
t_2 = -z - y
if (t_1 <= (-4000000000000.0d0)) then
tmp = t_2
else if (t_1 <= 1.0d0) then
tmp = log(t)
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 = ((x * Math.log(y)) - y) - z;
double t_2 = -z - y;
double tmp;
if (t_1 <= -4000000000000.0) {
tmp = t_2;
} else if (t_1 <= 1.0) {
tmp = Math.log(t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x * math.log(y)) - y) - z t_2 = -z - y tmp = 0 if t_1 <= -4000000000000.0: tmp = t_2 elif t_1 <= 1.0: tmp = math.log(t) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x * log(y)) - y) - z) t_2 = Float64(Float64(-z) - y) tmp = 0.0 if (t_1 <= -4000000000000.0) tmp = t_2; elseif (t_1 <= 1.0) tmp = log(t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x * log(y)) - y) - z; t_2 = -z - y; tmp = 0.0; if (t_1 <= -4000000000000.0) tmp = t_2; elseif (t_1 <= 1.0) tmp = log(t); else tmp = t_2; 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]}, Block[{t$95$2 = N[((-z) - y), $MachinePrecision]}, If[LessEqual[t$95$1, -4000000000000.0], t$95$2, If[LessEqual[t$95$1, 1.0], N[Log[t], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \log y - y\right) - z\\
t_2 := \left(-z\right) - y\\
\mathbf{if}\;t\_1 \leq -4000000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -4e12 or 1 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial 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.f6499.4
Simplified99.4%
Taylor expanded in x around 0
mul-1-negN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-lowering-neg.f6463.7
Simplified63.7%
if -4e12 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 1Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6492.6
Simplified92.6%
Taylor expanded in y around 0
log-lowering-log.f6491.5
Simplified91.5%
Final simplification66.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y))) (if (<= t_2 -5e+17) (- (- z) y) (if (<= t_2 5e+47) (- (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 <= -5e+17) {
tmp = -z - y;
} else if (t_2 <= 5e+47) {
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 <= (-5d+17)) then
tmp = -z - y
else if (t_2 <= 5d+47) 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 <= -5e+17) {
tmp = -z - y;
} else if (t_2 <= 5e+47) {
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 <= -5e+17: tmp = -z - y elif t_2 <= 5e+47: 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 <= -5e+17) tmp = Float64(Float64(-z) - y); elseif (t_2 <= 5e+47) 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 <= -5e+17) tmp = -z - y; elseif (t_2 <= 5e+47) 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, -5e+17], N[((-z) - y), $MachinePrecision], If[LessEqual[t$95$2, 5e+47], 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 -5 \cdot 10^{+17}:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+47}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5e17Initial 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.f6499.6
Simplified99.6%
Taylor expanded in x around 0
mul-1-negN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-lowering-neg.f6469.0
Simplified69.0%
if -5e17 < (-.f64 (*.f64 x (log.f64 y)) y) < 5.00000000000000022e47Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6496.7
Simplified96.7%
Taylor expanded in y around 0
--lowering--.f64N/A
log-lowering-log.f6496.2
Simplified96.2%
if 5.00000000000000022e47 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6477.6
Simplified77.6%
Final simplification77.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (/ 1.0 (- (* x (log y)) (+ y z))))))
(if (<= z -8.5e+16)
t_1
(if (<= z 3.2e-13) (fma x (log y) (- (log t) y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (1.0 / ((x * log(y)) - (y + z)));
double tmp;
if (z <= -8.5e+16) {
tmp = t_1;
} else if (z <= 3.2e-13) {
tmp = fma(x, log(y), (log(t) - y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(1.0 / Float64(1.0 / Float64(Float64(x * log(y)) - Float64(y + z)))) tmp = 0.0 if (z <= -8.5e+16) tmp = t_1; elseif (z <= 3.2e-13) 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[(1.0 / N[(1.0 / N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+16], t$95$1, If[LessEqual[z, 3.2e-13], 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 := \frac{1}{\frac{1}{x \cdot \log y - \left(y + z\right)}}\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.5e16 or 3.2e-13 < z 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.4
Simplified99.4%
if -8.5e16 < z < 3.2e-13Initial 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%
(FPCore (x y z t) :precision binary64 (if (<= (- (* x (log y)) y) -5e+17) (- (- z) y) (- (log t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * log(y)) - y) <= -5e+17) {
tmp = -z - y;
} 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) <= (-5d+17)) then
tmp = -z - y
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) <= -5e+17) {
tmp = -z - y;
} else {
tmp = Math.log(t) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * math.log(y)) - y) <= -5e+17: tmp = -z - y else: tmp = math.log(t) - z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * log(y)) - y) <= -5e+17) tmp = Float64(Float64(-z) - y); 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) <= -5e+17) tmp = -z - y; 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], -5e+17], N[((-z) - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot \log y - y \leq -5 \cdot 10^{+17}:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\log t - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5e17Initial 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.f6499.6
Simplified99.6%
Taylor expanded in x around 0
mul-1-negN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-lowering-neg.f6469.0
Simplified69.0%
if -5e17 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6465.4
Simplified65.4%
Taylor expanded in y around 0
--lowering--.f64N/A
log-lowering-log.f6465.2
Simplified65.2%
Final simplification67.2%
(FPCore (x y z t) :precision binary64 (if (<= y 3.2e+15) (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 <= 3.2e+15) {
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 <= 3.2e+15) 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, 3.2e+15], 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 3.2 \cdot 10^{+15}:\\
\;\;\;\;\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 < 3.2e15Initial 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.6
Simplified99.6%
if 3.2e15 < y Initial 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.f6499.6
Simplified99.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ 1.0 (/ 1.0 (- (* x (log y)) (+ y z)))))) (if (<= x -2.6e+51) t_1 (if (<= x 4.7e-7) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (1.0 / ((x * log(y)) - (y + z)));
double tmp;
if (x <= -2.6e+51) {
tmp = t_1;
} else if (x <= 4.7e-7) {
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 = 1.0d0 / (1.0d0 / ((x * log(y)) - (y + z)))
if (x <= (-2.6d+51)) then
tmp = t_1
else if (x <= 4.7d-7) 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 = 1.0 / (1.0 / ((x * Math.log(y)) - (y + z)));
double tmp;
if (x <= -2.6e+51) {
tmp = t_1;
} else if (x <= 4.7e-7) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 / (1.0 / ((x * math.log(y)) - (y + z))) tmp = 0 if x <= -2.6e+51: tmp = t_1 elif x <= 4.7e-7: tmp = math.log(t) - (y + z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 / Float64(1.0 / Float64(Float64(x * log(y)) - Float64(y + z)))) tmp = 0.0 if (x <= -2.6e+51) tmp = t_1; elseif (x <= 4.7e-7) 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 = 1.0 / (1.0 / ((x * log(y)) - (y + z))); tmp = 0.0; if (x <= -2.6e+51) tmp = t_1; elseif (x <= 4.7e-7) tmp = log(t) - (y + z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(1.0 / N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.6e+51], t$95$1, If[LessEqual[x, 4.7e-7], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{1}{x \cdot \log y - \left(y + z\right)}}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-7}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.6000000000000001e51 or 4.7e-7 < x Initial program 99.8%
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.3
Simplified99.3%
if -2.6000000000000001e51 < x < 4.7e-7Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6498.9
Simplified98.9%
(FPCore (x y z t) :precision binary64 (if (<= x -4.4e+52) (fma x (log y) (- z)) (if (<= x 1.35e+29) (- (log t) (+ y z)) (fma x (log y) (- y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.4e+52) {
tmp = fma(x, log(y), -z);
} else if (x <= 1.35e+29) {
tmp = log(t) - (y + z);
} else {
tmp = fma(x, log(y), -y);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -4.4e+52) tmp = fma(x, log(y), Float64(-z)); elseif (x <= 1.35e+29) tmp = Float64(log(t) - Float64(y + z)); else tmp = fma(x, log(y), Float64(-y)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.4e+52], N[(x * N[Log[y], $MachinePrecision] + (-z)), $MachinePrecision], If[LessEqual[x, 1.35e+29], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(x * N[Log[y], $MachinePrecision] + (-y)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, -z\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+29}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, -y\right)\\
\end{array}
\end{array}
if x < -4.4e52Initial program 99.8%
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 y around 0
sub-negN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f6489.1
Simplified89.1%
if -4.4e52 < x < 1.35e29Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6497.7
Simplified97.7%
if 1.35e29 < x Initial program 99.8%
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
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f6482.8
Simplified82.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma x (log y) (- y)))) (if (<= x -7e+52) t_1 (if (<= x 9e+28) (- (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 <= -7e+52) {
tmp = t_1;
} else if (x <= 9e+28) {
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 <= -7e+52) tmp = t_1; elseif (x <= 9e+28) 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, -7e+52], t$95$1, If[LessEqual[x, 9e+28], 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 -7 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+28}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7e52 or 8.9999999999999994e28 < x Initial program 99.8%
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
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f6481.0
Simplified81.0%
if -7e52 < x < 8.9999999999999994e28Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6497.7
Simplified97.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= x -2.3e+90) t_1 (if (<= x 1.8e+224) (- (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 <= -2.3e+90) {
tmp = t_1;
} else if (x <= 1.8e+224) {
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 <= (-2.3d+90)) then
tmp = t_1
else if (x <= 1.8d+224) 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 <= -2.3e+90) {
tmp = t_1;
} else if (x <= 1.8e+224) {
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 <= -2.3e+90: tmp = t_1 elif x <= 1.8e+224: 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 <= -2.3e+90) tmp = t_1; elseif (x <= 1.8e+224) 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 <= -2.3e+90) tmp = t_1; elseif (x <= 1.8e+224) 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, -2.3e+90], t$95$1, If[LessEqual[x, 1.8e+224], 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 -2.3 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+224}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.3e90 or 1.8e224 < x Initial program 99.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6477.2
Simplified77.2%
if -2.3e90 < x < 1.8e224Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6484.4
Simplified84.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (- z) y))) (if (<= z -8.5e+16) t_1 (if (<= z 400.0) (- (log t) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -z - y;
double tmp;
if (z <= -8.5e+16) {
tmp = t_1;
} else if (z <= 400.0) {
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 = -z - y
if (z <= (-8.5d+16)) then
tmp = t_1
else if (z <= 400.0d0) 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 = -z - y;
double tmp;
if (z <= -8.5e+16) {
tmp = t_1;
} else if (z <= 400.0) {
tmp = Math.log(t) - y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -z - y tmp = 0 if z <= -8.5e+16: tmp = t_1 elif z <= 400.0: tmp = math.log(t) - y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-z) - y) tmp = 0.0 if (z <= -8.5e+16) tmp = t_1; elseif (z <= 400.0) tmp = Float64(log(t) - y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -z - y; tmp = 0.0; if (z <= -8.5e+16) tmp = t_1; elseif (z <= 400.0) tmp = log(t) - y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-z) - y), $MachinePrecision]}, If[LessEqual[z, -8.5e+16], t$95$1, If[LessEqual[z, 400.0], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-z\right) - y\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 400:\\
\;\;\;\;\log t - y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.5e16 or 400 < z Initial program 100.0%
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.4
Simplified99.4%
Taylor expanded in x around 0
mul-1-negN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-lowering-neg.f6477.9
Simplified77.9%
if -8.5e16 < z < 400Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6456.9
Simplified56.9%
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6456.9
Applied egg-rr56.9%
Final simplification67.2%
(FPCore (x y z t) :precision binary64 (if (<= y 9.2e+46) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.2e+46) {
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 <= 9.2d+46) 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 <= 9.2e+46) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 9.2e+46: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 9.2e+46) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 9.2e+46) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 9.2e+46], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{+46}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 9.2000000000000002e46Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6437.7
Simplified37.7%
if 9.2000000000000002e46 < y Initial program 100.0%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6467.8
Simplified67.8%
(FPCore (x y z t) :precision binary64 (- (- z) y))
double code(double x, double y, double z, double t) {
return -z - 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 = -z - y
end function
public static double code(double x, double y, double z, double t) {
return -z - y;
}
def code(x, y, z, t): return -z - y
function code(x, y, z, t) return Float64(Float64(-z) - y) end
function tmp = code(x, y, z, t) tmp = -z - y; end
code[x_, y_, z_, t_] := N[((-z) - y), $MachinePrecision]
\begin{array}{l}
\\
\left(-z\right) - y
\end{array}
Initial 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.f6488.5
Simplified88.5%
Taylor expanded in x around 0
mul-1-negN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-lowering-neg.f6456.7
Simplified56.7%
Final simplification56.7%
(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.f6430.5
Simplified30.5%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return y end
function tmp = code(x, y, z, t) tmp = y; end
code[x_, y_, z_, t_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-lowering-neg.f6430.5
Simplified30.5%
neg-sub0N/A
sub-negN/A
flip3-+N/A
/-lowering-/.f64N/A
metadata-evalN/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
pow-prod-downN/A
sqr-powN/A
+-lowering-+.f64N/A
cube-multN/A
sqr-negN/A
*-lowering-*.f64N/A
sqr-negN/A
*-lowering-*.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqr-negN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
neg-lowering-neg.f641.2
Applied egg-rr1.2%
+-lft-identityN/A
cube-unmultN/A
+-lft-identityN/A
mul0-lftN/A
--rgt-identityN/A
pow2N/A
pow-divN/A
metadata-evalN/A
unpow12.1
Applied egg-rr2.1%
herbie shell --seed 2024198
(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)))