
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (fma (log y) x (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
return fma(log(y), x, ((log(t) - z) - y));
}
function code(x, y, z, t) return fma(log(y), x, Float64(Float64(log(t) - z) - y)) end
code[x_, y_, z_, t_] := N[(N[Log[y], $MachinePrecision] * x + N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log y, x, \left(\log t - z\right) - y\right)
\end{array}
Initial program 99.8%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.8%
Simplified99.8%
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6499.8%
Applied egg-rr99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) z)) (t_2 (* (log y) x)))
(if (<= x -1.6e+53)
(- t_2 y)
(if (<= x 3700000000000.0) (- t_1 y) (+ t_1 t_2)))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - z;
double t_2 = log(y) * x;
double tmp;
if (x <= -1.6e+53) {
tmp = t_2 - y;
} else if (x <= 3700000000000.0) {
tmp = t_1 - y;
} else {
tmp = t_1 + t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log(t) - z
t_2 = log(y) * x
if (x <= (-1.6d+53)) then
tmp = t_2 - y
else if (x <= 3700000000000.0d0) then
tmp = t_1 - y
else
tmp = t_1 + t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - z;
double t_2 = Math.log(y) * x;
double tmp;
if (x <= -1.6e+53) {
tmp = t_2 - y;
} else if (x <= 3700000000000.0) {
tmp = t_1 - y;
} else {
tmp = t_1 + t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - z t_2 = math.log(y) * x tmp = 0 if x <= -1.6e+53: tmp = t_2 - y elif x <= 3700000000000.0: tmp = t_1 - y else: tmp = t_1 + t_2 return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - z) t_2 = Float64(log(y) * x) tmp = 0.0 if (x <= -1.6e+53) tmp = Float64(t_2 - y); elseif (x <= 3700000000000.0) tmp = Float64(t_1 - y); else tmp = Float64(t_1 + t_2); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - z; t_2 = log(y) * x; tmp = 0.0; if (x <= -1.6e+53) tmp = t_2 - y; elseif (x <= 3700000000000.0) tmp = t_1 - y; else tmp = t_1 + t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.6e+53], N[(t$95$2 - y), $MachinePrecision], If[LessEqual[x, 3700000000000.0], N[(t$95$1 - y), $MachinePrecision], N[(t$95$1 + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - z\\
t_2 := \log y \cdot x\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+53}:\\
\;\;\;\;t\_2 - y\\
\mathbf{elif}\;x \leq 3700000000000:\\
\;\;\;\;t\_1 - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 + t\_2\\
\end{array}
\end{array}
if x < -1.6e53Initial program 99.7%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.7%
Simplified99.7%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6493.7%
Simplified93.7%
sub0-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6493.7%
Applied egg-rr93.7%
if -1.6e53 < x < 3.7e12Initial program 100.0%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6496.5%
Simplified96.5%
if 3.7e12 < x Initial program 99.6%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.6%
Simplified99.6%
Taylor expanded in y around 0
--lowering--.f64N/A
log-lowering-log.f6485.6%
Simplified85.6%
Final simplification93.6%
(FPCore (x y z t) :precision binary64 (if (<= x -2.95e+51) (- (* (log y) x) y) (if (<= x 3800000000000.0) (- (- (log t) z) y) (fma (log y) x (- 0.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.95e+51) {
tmp = (log(y) * x) - y;
} else if (x <= 3800000000000.0) {
tmp = (log(t) - z) - y;
} else {
tmp = fma(log(y), x, (0.0 - z));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -2.95e+51) tmp = Float64(Float64(log(y) * x) - y); elseif (x <= 3800000000000.0) tmp = Float64(Float64(log(t) - z) - y); else tmp = fma(log(y), x, Float64(0.0 - z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.95e+51], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 3800000000000.0], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + N[(0.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.95 \cdot 10^{+51}:\\
\;\;\;\;\log y \cdot x - y\\
\mathbf{elif}\;x \leq 3800000000000:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, 0 - z\right)\\
\end{array}
\end{array}
if x < -2.94999999999999991e51Initial program 99.7%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.7%
Simplified99.7%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6493.7%
Simplified93.7%
sub0-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6493.7%
Applied egg-rr93.7%
if -2.94999999999999991e51 < x < 3.8e12Initial program 100.0%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6496.5%
Simplified96.5%
if 3.8e12 < x Initial program 99.6%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.6%
Simplified99.6%
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6499.6%
Applied egg-rr99.6%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6485.2%
Simplified85.2%
sub0-negN/A
+-lft-identityN/A
flip3-+N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
sub0-negN/A
sub0-negN/A
pow-prod-downN/A
sqr-powN/A
metadata-evalN/A
sub0-negN/A
cube-negN/A
sub-negN/A
mul0-lftN/A
fmm-defN/A
metadata-evalN/A
mul0-lftN/A
fma-defineN/A
metadata-evalN/A
flip3--N/A
Applied egg-rr85.2%
Final simplification93.5%
(FPCore (x y z t) :precision binary64 (+ (- (- (log t) z) y) (* (log y) x)))
double code(double x, double y, double z, double t) {
return ((log(t) - z) - y) + (log(y) * x);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(t) - z) - y) + (log(y) * x)
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(t) - z) - y) + (Math.log(y) * x);
}
def code(x, y, z, t): return ((math.log(t) - z) - y) + (math.log(y) * x)
function code(x, y, z, t) return Float64(Float64(Float64(log(t) - z) - y) + Float64(log(y) * x)) end
function tmp = code(x, y, z, t) tmp = ((log(t) - z) - y) + (log(y) * x); end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log t - z\right) - y\right) + \log y \cdot x
\end{array}
Initial program 99.8%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= x -2e+47)
(- t_1 y)
(if (<= x 3800000000000.0) (- (- (log t) z) y) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -2e+47) {
tmp = t_1 - y;
} else if (x <= 3800000000000.0) {
tmp = (log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = log(y) * x
if (x <= (-2d+47)) then
tmp = t_1 - y
else if (x <= 3800000000000.0d0) then
tmp = (log(t) - z) - y
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(y) * x;
double tmp;
if (x <= -2e+47) {
tmp = t_1 - y;
} else if (x <= 3800000000000.0) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -2e+47: tmp = t_1 - y elif x <= 3800000000000.0: tmp = (math.log(t) - z) - y else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -2e+47) tmp = Float64(t_1 - y); elseif (x <= 3800000000000.0) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; tmp = 0.0; if (x <= -2e+47) tmp = t_1 - y; elseif (x <= 3800000000000.0) tmp = (log(t) - z) - y; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -2e+47], N[(t$95$1 - y), $MachinePrecision], If[LessEqual[x, 3800000000000.0], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -2 \cdot 10^{+47}:\\
\;\;\;\;t\_1 - y\\
\mathbf{elif}\;x \leq 3800000000000:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if x < -2.0000000000000001e47Initial program 99.7%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.7%
Simplified99.7%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6493.7%
Simplified93.7%
sub0-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6493.7%
Applied egg-rr93.7%
if -2.0000000000000001e47 < x < 3.8e12Initial program 100.0%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6496.5%
Simplified96.5%
if 3.8e12 < x Initial program 99.6%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.6%
Simplified99.6%
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6499.6%
Applied egg-rr99.6%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6485.2%
Simplified85.2%
sub0-negN/A
+-lft-identityN/A
flip3-+N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
sub0-negN/A
sub0-negN/A
pow-prod-downN/A
sqr-powN/A
metadata-evalN/A
sub0-negN/A
cube-negN/A
sub-negN/A
mul0-lftN/A
fmm-defN/A
metadata-evalN/A
mul0-lftN/A
fma-defineN/A
metadata-evalN/A
Applied egg-rr85.2%
Final simplification93.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= x -1.5e+51)
(- t_1 y)
(if (<= x 3700000000000.0) (- (- 0.0 z) y) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -1.5e+51) {
tmp = t_1 - y;
} else if (x <= 3700000000000.0) {
tmp = (0.0 - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = log(y) * x
if (x <= (-1.5d+51)) then
tmp = t_1 - y
else if (x <= 3700000000000.0d0) then
tmp = (0.0d0 - z) - y
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(y) * x;
double tmp;
if (x <= -1.5e+51) {
tmp = t_1 - y;
} else if (x <= 3700000000000.0) {
tmp = (0.0 - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -1.5e+51: tmp = t_1 - y elif x <= 3700000000000.0: tmp = (0.0 - z) - y else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -1.5e+51) tmp = Float64(t_1 - y); elseif (x <= 3700000000000.0) tmp = Float64(Float64(0.0 - z) - y); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; tmp = 0.0; if (x <= -1.5e+51) tmp = t_1 - y; elseif (x <= 3700000000000.0) tmp = (0.0 - z) - y; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.5e+51], N[(t$95$1 - y), $MachinePrecision], If[LessEqual[x, 3700000000000.0], N[(N[(0.0 - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{+51}:\\
\;\;\;\;t\_1 - y\\
\mathbf{elif}\;x \leq 3700000000000:\\
\;\;\;\;\left(0 - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if x < -1.5e51Initial program 99.7%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.7%
Simplified99.7%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6493.7%
Simplified93.7%
sub0-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6493.7%
Applied egg-rr93.7%
if -1.5e51 < x < 3.7e12Initial program 100.0%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6496.5%
Simplified96.5%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6473.0%
Simplified73.0%
if 3.7e12 < x Initial program 99.6%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.6%
Simplified99.6%
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6499.6%
Applied egg-rr99.6%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6485.2%
Simplified85.2%
sub0-negN/A
+-lft-identityN/A
flip3-+N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
sub0-negN/A
sub0-negN/A
pow-prod-downN/A
sqr-powN/A
metadata-evalN/A
sub0-negN/A
cube-negN/A
sub-negN/A
mul0-lftN/A
fmm-defN/A
metadata-evalN/A
mul0-lftN/A
fma-defineN/A
metadata-evalN/A
Applied egg-rr85.2%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (<= y 2.95e-220) (- (log t) z) (if (<= y 9e+122) (- (* (log y) x) z) (- (- 0.0 z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.95e-220) {
tmp = log(t) - z;
} else if (y <= 9e+122) {
tmp = (log(y) * x) - z;
} else {
tmp = (0.0 - z) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.95d-220) then
tmp = log(t) - z
else if (y <= 9d+122) then
tmp = (log(y) * x) - z
else
tmp = (0.0d0 - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.95e-220) {
tmp = Math.log(t) - z;
} else if (y <= 9e+122) {
tmp = (Math.log(y) * x) - z;
} else {
tmp = (0.0 - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.95e-220: tmp = math.log(t) - z elif y <= 9e+122: tmp = (math.log(y) * x) - z else: tmp = (0.0 - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.95e-220) tmp = Float64(log(t) - z); elseif (y <= 9e+122) tmp = Float64(Float64(log(y) * x) - z); else tmp = Float64(Float64(0.0 - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.95e-220) tmp = log(t) - z; elseif (y <= 9e+122) tmp = (log(y) * x) - z; else tmp = (0.0 - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.95e-220], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 9e+122], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - z), $MachinePrecision], N[(N[(0.0 - z), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.95 \cdot 10^{-220}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+122}:\\
\;\;\;\;\log y \cdot x - z\\
\mathbf{else}:\\
\;\;\;\;\left(0 - z\right) - y\\
\end{array}
\end{array}
if y < 2.9499999999999998e-220Initial program 99.7%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.7%
Simplified99.7%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6467.7%
Simplified67.7%
Taylor expanded in y around 0
--lowering--.f64N/A
log-lowering-log.f6467.7%
Simplified67.7%
if 2.9499999999999998e-220 < y < 8.99999999999999995e122Initial program 99.8%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.8%
Simplified99.8%
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6499.8%
Applied egg-rr99.8%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6474.3%
Simplified74.3%
sub0-negN/A
+-lft-identityN/A
flip3-+N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
sub0-negN/A
sub0-negN/A
pow-prod-downN/A
sqr-powN/A
metadata-evalN/A
sub0-negN/A
cube-negN/A
sub-negN/A
mul0-lftN/A
fmm-defN/A
metadata-evalN/A
mul0-lftN/A
fma-defineN/A
metadata-evalN/A
Applied egg-rr74.3%
if 8.99999999999999995e122 < y Initial program 99.9%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.9%
Simplified99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6487.3%
Simplified87.3%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6487.3%
Simplified87.3%
Final simplification77.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (log y) x))) (if (<= x -4.8e+169) t_1 (if (<= x 1.25e+129) (- (- 0.0 z) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -4.8e+169) {
tmp = t_1;
} else if (x <= 1.25e+129) {
tmp = (0.0 - z) - 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 = log(y) * x
if (x <= (-4.8d+169)) then
tmp = t_1
else if (x <= 1.25d+129) then
tmp = (0.0d0 - z) - 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 = Math.log(y) * x;
double tmp;
if (x <= -4.8e+169) {
tmp = t_1;
} else if (x <= 1.25e+129) {
tmp = (0.0 - z) - y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -4.8e+169: tmp = t_1 elif x <= 1.25e+129: tmp = (0.0 - z) - y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -4.8e+169) tmp = t_1; elseif (x <= 1.25e+129) tmp = Float64(Float64(0.0 - z) - y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; tmp = 0.0; if (x <= -4.8e+169) tmp = t_1; elseif (x <= 1.25e+129) tmp = (0.0 - z) - y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -4.8e+169], t$95$1, If[LessEqual[x, 1.25e+129], N[(N[(0.0 - z), $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+129}:\\
\;\;\;\;\left(0 - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.7999999999999997e169 or 1.2500000000000001e129 < x Initial program 99.6%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.6%
Simplified99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6477.5%
Simplified77.5%
if -4.7999999999999997e169 < x < 1.2500000000000001e129Initial program 99.9%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.9%
Simplified99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6490.4%
Simplified90.4%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6471.1%
Simplified71.1%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (if (<= y 9.6e+101) (- 0.0 z) (- 0.0 y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.6e+101) {
tmp = 0.0 - z;
} else {
tmp = 0.0 - 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.6d+101) then
tmp = 0.0d0 - z
else
tmp = 0.0d0 - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.6e+101) {
tmp = 0.0 - z;
} else {
tmp = 0.0 - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 9.6e+101: tmp = 0.0 - z else: tmp = 0.0 - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 9.6e+101) tmp = Float64(0.0 - z); else tmp = Float64(0.0 - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 9.6e+101) tmp = 0.0 - z; else tmp = 0.0 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 9.6e+101], N[(0.0 - z), $MachinePrecision], N[(0.0 - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.6 \cdot 10^{+101}:\\
\;\;\;\;0 - z\\
\mathbf{else}:\\
\;\;\;\;0 - y\\
\end{array}
\end{array}
if y < 9.59999999999999953e101Initial program 99.8%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.8%
Simplified99.8%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6436.6%
Simplified36.6%
if 9.59999999999999953e101 < y Initial program 99.9%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.9%
Simplified99.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6469.6%
Simplified69.6%
sub0-negN/A
neg-lowering-neg.f6469.6%
Applied egg-rr69.6%
Final simplification48.6%
(FPCore (x y z t) :precision binary64 (- (- 0.0 z) y))
double code(double x, double y, double z, double t) {
return (0.0 - 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 = (0.0d0 - z) - y
end function
public static double code(double x, double y, double z, double t) {
return (0.0 - z) - y;
}
def code(x, y, z, t): return (0.0 - z) - y
function code(x, y, z, t) return Float64(Float64(0.0 - z) - y) end
function tmp = code(x, y, z, t) tmp = (0.0 - z) - y; end
code[x_, y_, z_, t_] := N[(N[(0.0 - z), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\left(0 - z\right) - y
\end{array}
Initial program 99.8%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
log-lowering-log.f6471.2%
Simplified71.2%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6457.1%
Simplified57.1%
(FPCore (x y z t) :precision binary64 (- 0.0 y))
double code(double x, double y, double z, double t) {
return 0.0 - 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 = 0.0d0 - y
end function
public static double code(double x, double y, double z, double t) {
return 0.0 - y;
}
def code(x, y, z, t): return 0.0 - y
function code(x, y, z, t) return Float64(0.0 - y) end
function tmp = code(x, y, z, t) tmp = 0.0 - y; end
code[x_, y_, z_, t_] := N[(0.0 - y), $MachinePrecision]
\begin{array}{l}
\\
0 - y
\end{array}
Initial program 99.8%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.8%
Simplified99.8%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6431.0%
Simplified31.0%
sub0-negN/A
neg-lowering-neg.f6431.0%
Applied egg-rr31.0%
Final simplification31.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 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.8%
associate-+l-N/A
associate--l-N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6499.8%
Simplified99.8%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6431.0%
Simplified31.0%
flip3--N/A
metadata-evalN/A
sub-negN/A
metadata-evalN/A
cube-negN/A
sub0-negN/A
sqr-powN/A
pow-prod-downN/A
sub0-negN/A
sub0-negN/A
sqr-negN/A
pow-prod-downN/A
sqr-powN/A
fma-defineN/A
mul0-lftN/A
metadata-evalN/A
fmm-defN/A
mul0-lftN/A
flip3-+N/A
+-lft-identity2.2%
Applied egg-rr2.2%
herbie shell --seed 2024152
(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)))