
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (fma x (log y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (log(t) - (y + z)));
}
function code(x, y, z, t) return fma(x, log(y), Float64(log(t) - Float64(y + z))) end
code[x_, y_, z_, t_] := N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t - \left(y + z\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l-99.9%
associate-+r-99.9%
+-commutative99.9%
associate--l+99.9%
fma-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.4e+55) (not (<= z 6.8e+67))) (- (- (log t) y) z) (- (+ (log t) (* x (log y))) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.4e+55) || !(z <= 6.8e+67)) {
tmp = (log(t) - y) - z;
} else {
tmp = (log(t) + (x * log(y))) - 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 ((z <= (-7.4d+55)) .or. (.not. (z <= 6.8d+67))) then
tmp = (log(t) - y) - z
else
tmp = (log(t) + (x * log(y))) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.4e+55) || !(z <= 6.8e+67)) {
tmp = (Math.log(t) - y) - z;
} else {
tmp = (Math.log(t) + (x * Math.log(y))) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.4e+55) or not (z <= 6.8e+67): tmp = (math.log(t) - y) - z else: tmp = (math.log(t) + (x * math.log(y))) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.4e+55) || !(z <= 6.8e+67)) tmp = Float64(Float64(log(t) - y) - z); else tmp = Float64(Float64(log(t) + Float64(x * log(y))) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.4e+55) || ~((z <= 6.8e+67))) tmp = (log(t) - y) - z; else tmp = (log(t) + (x * log(y))) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.4e+55], N[Not[LessEqual[z, 6.8e+67]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+55} \lor \neg \left(z \leq 6.8 \cdot 10^{+67}\right):\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - y\\
\end{array}
\end{array}
if z < -7.4000000000000004e55 or 6.8000000000000003e67 < z Initial program 99.9%
Taylor expanded in x around 0 87.4%
associate--r+87.4%
Simplified87.4%
if -7.4000000000000004e55 < z < 6.8000000000000003e67Initial program 99.9%
Taylor expanded in z around 0 97.5%
Final simplification93.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (log t) (* x (log y)))))
(if (<= z -3.4e+61)
(- (- (log t) y) z)
(if (<= z 4.2e+37) (- t_1 y) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) + (x * log(y));
double tmp;
if (z <= -3.4e+61) {
tmp = (log(t) - y) - z;
} else if (z <= 4.2e+37) {
tmp = t_1 - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) + (x * log(y))
if (z <= (-3.4d+61)) then
tmp = (log(t) - y) - z
else if (z <= 4.2d+37) then
tmp = t_1 - y
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) + (x * Math.log(y));
double tmp;
if (z <= -3.4e+61) {
tmp = (Math.log(t) - y) - z;
} else if (z <= 4.2e+37) {
tmp = t_1 - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) + (x * math.log(y)) tmp = 0 if z <= -3.4e+61: tmp = (math.log(t) - y) - z elif z <= 4.2e+37: tmp = t_1 - y else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(log(t) + Float64(x * log(y))) tmp = 0.0 if (z <= -3.4e+61) tmp = Float64(Float64(log(t) - y) - z); elseif (z <= 4.2e+37) tmp = Float64(t_1 - y); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) + (x * log(y)); tmp = 0.0; if (z <= -3.4e+61) tmp = (log(t) - y) - z; elseif (z <= 4.2e+37) tmp = t_1 - y; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+61], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[z, 4.2e+37], N[(t$95$1 - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t + x \cdot \log y\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+61}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+37}:\\
\;\;\;\;t_1 - y\\
\mathbf{else}:\\
\;\;\;\;t_1 - z\\
\end{array}
\end{array}
if z < -3.40000000000000026e61Initial program 99.9%
Taylor expanded in x around 0 89.8%
associate--r+89.8%
Simplified89.8%
if -3.40000000000000026e61 < z < 4.2000000000000002e37Initial program 99.9%
Taylor expanded in z around 0 98.0%
if 4.2000000000000002e37 < z Initial program 99.9%
Taylor expanded in y around 0 86.1%
Final simplification93.9%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((x * log(y)) - y) - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = log(t) + (((x * log(y)) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((x * Math.log(y)) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((x * math.log(y)) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(x * log(y)) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((x * log(y)) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(x \cdot \log y - y\right) - z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) y)))
(if (<= z -2e+75)
(- z)
(if (<= z 1.3e-242)
t_1
(if (<= z 6.5e-192) (* x (log y)) (if (<= z 5.8e+38) t_1 (- z)))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double tmp;
if (z <= -2e+75) {
tmp = -z;
} else if (z <= 1.3e-242) {
tmp = t_1;
} else if (z <= 6.5e-192) {
tmp = x * log(y);
} else if (z <= 5.8e+38) {
tmp = t_1;
} 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 = log(t) - y
if (z <= (-2d+75)) then
tmp = -z
else if (z <= 1.3d-242) then
tmp = t_1
else if (z <= 6.5d-192) then
tmp = x * log(y)
else if (z <= 5.8d+38) then
tmp = t_1
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - y;
double tmp;
if (z <= -2e+75) {
tmp = -z;
} else if (z <= 1.3e-242) {
tmp = t_1;
} else if (z <= 6.5e-192) {
tmp = x * Math.log(y);
} else if (z <= 5.8e+38) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - y tmp = 0 if z <= -2e+75: tmp = -z elif z <= 1.3e-242: tmp = t_1 elif z <= 6.5e-192: tmp = x * math.log(y) elif z <= 5.8e+38: tmp = t_1 else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - y) tmp = 0.0 if (z <= -2e+75) tmp = Float64(-z); elseif (z <= 1.3e-242) tmp = t_1; elseif (z <= 6.5e-192) tmp = Float64(x * log(y)); elseif (z <= 5.8e+38) tmp = t_1; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - y; tmp = 0.0; if (z <= -2e+75) tmp = -z; elseif (z <= 1.3e-242) tmp = t_1; elseif (z <= 6.5e-192) tmp = x * log(y); elseif (z <= 5.8e+38) tmp = t_1; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[z, -2e+75], (-z), If[LessEqual[z, 1.3e-242], t$95$1, If[LessEqual[z, 6.5e-192], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+38], t$95$1, (-z)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
\mathbf{if}\;z \leq -2 \cdot 10^{+75}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-242}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-192}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1.99999999999999985e75 or 5.80000000000000013e38 < z Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
*-commutative99.9%
add-cube-cbrt99.8%
associate-*l*99.8%
fma-neg99.8%
pow299.8%
Applied egg-rr99.8%
sub-neg99.8%
log-rec99.8%
distribute-neg-in99.8%
log-rec99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
*-commutative99.8%
associate--r+99.8%
Simplified99.8%
Taylor expanded in z around inf 72.3%
neg-mul-172.3%
Simplified72.3%
if -1.99999999999999985e75 < z < 1.30000000000000009e-242 or 6.49999999999999966e-192 < z < 5.80000000000000013e38Initial program 99.9%
Taylor expanded in z around 0 96.5%
Taylor expanded in x around 0 67.0%
if 1.30000000000000009e-242 < z < 6.49999999999999966e-192Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
*-commutative99.9%
add-cube-cbrt98.8%
associate-*l*99.0%
fma-neg99.0%
pow299.0%
Applied egg-rr99.0%
sub-neg99.0%
log-rec99.0%
distribute-neg-in99.0%
log-rec99.0%
remove-double-neg99.0%
+-commutative99.0%
sub-neg99.0%
*-commutative99.0%
associate--r+99.0%
Simplified99.0%
Taylor expanded in x around inf 67.6%
pow-base-167.6%
*-lft-identity67.6%
Simplified67.6%
Final simplification69.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) z)) (t_2 (* x (log y))))
(if (<= y 3.2e-279)
t_1
(if (<= y 6.5e-275)
t_2
(if (<= y 6.2e+109) t_1 (if (<= y 2.6e+133) t_2 (- y)))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - z;
double t_2 = x * log(y);
double tmp;
if (y <= 3.2e-279) {
tmp = t_1;
} else if (y <= 6.5e-275) {
tmp = t_2;
} else if (y <= 6.2e+109) {
tmp = t_1;
} else if (y <= 2.6e+133) {
tmp = t_2;
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log(t) - z
t_2 = x * log(y)
if (y <= 3.2d-279) then
tmp = t_1
else if (y <= 6.5d-275) then
tmp = t_2
else if (y <= 6.2d+109) then
tmp = t_1
else if (y <= 2.6d+133) then
tmp = t_2
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - z;
double t_2 = x * Math.log(y);
double tmp;
if (y <= 3.2e-279) {
tmp = t_1;
} else if (y <= 6.5e-275) {
tmp = t_2;
} else if (y <= 6.2e+109) {
tmp = t_1;
} else if (y <= 2.6e+133) {
tmp = t_2;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - z t_2 = x * math.log(y) tmp = 0 if y <= 3.2e-279: tmp = t_1 elif y <= 6.5e-275: tmp = t_2 elif y <= 6.2e+109: tmp = t_1 elif y <= 2.6e+133: tmp = t_2 else: tmp = -y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - z) t_2 = Float64(x * log(y)) tmp = 0.0 if (y <= 3.2e-279) tmp = t_1; elseif (y <= 6.5e-275) tmp = t_2; elseif (y <= 6.2e+109) tmp = t_1; elseif (y <= 2.6e+133) tmp = t_2; else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - z; t_2 = x * log(y); tmp = 0.0; if (y <= 3.2e-279) tmp = t_1; elseif (y <= 6.5e-275) tmp = t_2; elseif (y <= 6.2e+109) tmp = t_1; elseif (y <= 2.6e+133) tmp = t_2; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.2e-279], t$95$1, If[LessEqual[y, 6.5e-275], t$95$2, If[LessEqual[y, 6.2e+109], t$95$1, If[LessEqual[y, 2.6e+133], t$95$2, (-y)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - z\\
t_2 := x \cdot \log y\\
\mathbf{if}\;y \leq 3.2 \cdot 10^{-279}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-275}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+133}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 3.1999999999999999e-279 or 6.500000000000001e-275 < y < 6.19999999999999985e109Initial program 99.9%
Taylor expanded in y around 0 92.4%
associate--l+92.4%
fma-def92.4%
Simplified92.4%
Taylor expanded in x around 0 66.0%
if 3.1999999999999999e-279 < y < 6.500000000000001e-275 or 6.19999999999999985e109 < y < 2.5999999999999998e133Initial program 99.7%
associate--l-99.7%
associate-+l-99.7%
*-commutative99.7%
add-cube-cbrt98.6%
associate-*l*98.4%
fma-neg98.4%
pow298.4%
Applied egg-rr98.4%
sub-neg98.4%
log-rec98.4%
distribute-neg-in98.4%
log-rec98.4%
remove-double-neg98.4%
+-commutative98.4%
sub-neg98.4%
*-commutative98.4%
associate--r+98.4%
Simplified98.4%
Taylor expanded in x around inf 75.8%
pow-base-175.8%
*-lft-identity75.8%
Simplified75.8%
if 2.5999999999999998e133 < y Initial program 100.0%
associate--l-100.0%
associate-+l-100.0%
*-commutative100.0%
add-cube-cbrt99.8%
associate-*l*99.8%
fma-neg99.8%
pow299.8%
Applied egg-rr99.8%
sub-neg99.8%
log-rec99.8%
distribute-neg-in99.8%
log-rec99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
*-commutative99.8%
associate--r+99.8%
Simplified99.8%
Taylor expanded in y around inf 82.4%
neg-mul-182.4%
Simplified82.4%
Final simplification71.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.9e+75)
(- z)
(if (<= z -1.85e-270)
(- y)
(if (<= z 1.3e-135) (* x (log y)) (if (<= z 5.4e+38) (- y) (- z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e+75) {
tmp = -z;
} else if (z <= -1.85e-270) {
tmp = -y;
} else if (z <= 1.3e-135) {
tmp = x * log(y);
} else if (z <= 5.4e+38) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.9d+75)) then
tmp = -z
else if (z <= (-1.85d-270)) then
tmp = -y
else if (z <= 1.3d-135) then
tmp = x * log(y)
else if (z <= 5.4d+38) then
tmp = -y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e+75) {
tmp = -z;
} else if (z <= -1.85e-270) {
tmp = -y;
} else if (z <= 1.3e-135) {
tmp = x * Math.log(y);
} else if (z <= 5.4e+38) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.9e+75: tmp = -z elif z <= -1.85e-270: tmp = -y elif z <= 1.3e-135: tmp = x * math.log(y) elif z <= 5.4e+38: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.9e+75) tmp = Float64(-z); elseif (z <= -1.85e-270) tmp = Float64(-y); elseif (z <= 1.3e-135) tmp = Float64(x * log(y)); elseif (z <= 5.4e+38) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.9e+75) tmp = -z; elseif (z <= -1.85e-270) tmp = -y; elseif (z <= 1.3e-135) tmp = x * log(y); elseif (z <= 5.4e+38) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.9e+75], (-z), If[LessEqual[z, -1.85e-270], (-y), If[LessEqual[z, 1.3e-135], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+38], (-y), (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+75}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-270}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-135}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+38}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -2.8999999999999998e75 or 5.39999999999999992e38 < z Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
*-commutative99.9%
add-cube-cbrt99.8%
associate-*l*99.8%
fma-neg99.8%
pow299.8%
Applied egg-rr99.8%
sub-neg99.8%
log-rec99.8%
distribute-neg-in99.8%
log-rec99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
*-commutative99.8%
associate--r+99.8%
Simplified99.8%
Taylor expanded in z around inf 72.3%
neg-mul-172.3%
Simplified72.3%
if -2.8999999999999998e75 < z < -1.8500000000000001e-270 or 1.30000000000000002e-135 < z < 5.39999999999999992e38Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
*-commutative99.9%
add-cube-cbrt99.5%
associate-*l*99.5%
fma-neg99.5%
pow299.5%
Applied egg-rr99.5%
sub-neg99.5%
log-rec99.5%
distribute-neg-in99.5%
log-rec99.5%
remove-double-neg99.5%
+-commutative99.5%
sub-neg99.5%
*-commutative99.5%
associate--r+99.5%
Simplified99.5%
Taylor expanded in y around inf 42.3%
neg-mul-142.3%
Simplified42.3%
if -1.8500000000000001e-270 < z < 1.30000000000000002e-135Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
*-commutative99.9%
add-cube-cbrt99.1%
associate-*l*99.0%
fma-neg99.0%
pow299.0%
Applied egg-rr99.0%
sub-neg99.0%
log-rec99.0%
distribute-neg-in99.0%
log-rec99.0%
remove-double-neg99.0%
+-commutative99.0%
sub-neg99.0%
*-commutative99.0%
associate--r+99.0%
Simplified99.0%
Taylor expanded in x around inf 52.6%
pow-base-152.6%
*-lft-identity52.6%
Simplified52.6%
Final simplification55.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -9.5e+141) (not (<= x 2.4e+149))) (* x (log y)) (- (- (log t) y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.5e+141) || !(x <= 2.4e+149)) {
tmp = x * log(y);
} else {
tmp = (log(t) - y) - 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 <= (-9.5d+141)) .or. (.not. (x <= 2.4d+149))) then
tmp = x * log(y)
else
tmp = (log(t) - y) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.5e+141) || !(x <= 2.4e+149)) {
tmp = x * Math.log(y);
} else {
tmp = (Math.log(t) - y) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -9.5e+141) or not (x <= 2.4e+149): tmp = x * math.log(y) else: tmp = (math.log(t) - y) - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -9.5e+141) || !(x <= 2.4e+149)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(log(t) - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -9.5e+141) || ~((x <= 2.4e+149))) tmp = x * log(y); else tmp = (log(t) - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -9.5e+141], N[Not[LessEqual[x, 2.4e+149]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+141} \lor \neg \left(x \leq 2.4 \cdot 10^{+149}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\end{array}
\end{array}
if x < -9.49999999999999974e141 or 2.40000000000000012e149 < x Initial program 99.7%
associate--l-99.7%
associate-+l-99.7%
*-commutative99.7%
add-cube-cbrt98.5%
associate-*l*98.5%
fma-neg98.5%
pow298.5%
Applied egg-rr98.5%
sub-neg98.5%
log-rec98.5%
distribute-neg-in98.5%
log-rec98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
*-commutative98.5%
associate--r+98.5%
Simplified98.5%
Taylor expanded in x around inf 73.2%
pow-base-173.2%
*-lft-identity73.2%
Simplified73.2%
if -9.49999999999999974e141 < x < 2.40000000000000012e149Initial program 100.0%
Taylor expanded in x around 0 91.2%
associate--r+91.2%
Simplified91.2%
Final simplification86.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2e+75) (- z) (if (<= z 6.6e+38) (- y) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+75) {
tmp = -z;
} else if (z <= 6.6e+38) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2d+75)) then
tmp = -z
else if (z <= 6.6d+38) then
tmp = -y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+75) {
tmp = -z;
} else if (z <= 6.6e+38) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2e+75: tmp = -z elif z <= 6.6e+38: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2e+75) tmp = Float64(-z); elseif (z <= 6.6e+38) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2e+75) tmp = -z; elseif (z <= 6.6e+38) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2e+75], (-z), If[LessEqual[z, 6.6e+38], (-y), (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+75}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+38}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1.99999999999999985e75 or 6.5999999999999998e38 < z Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
*-commutative99.9%
add-cube-cbrt99.8%
associate-*l*99.8%
fma-neg99.8%
pow299.8%
Applied egg-rr99.8%
sub-neg99.8%
log-rec99.8%
distribute-neg-in99.8%
log-rec99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
*-commutative99.8%
associate--r+99.8%
Simplified99.8%
Taylor expanded in z around inf 72.3%
neg-mul-172.3%
Simplified72.3%
if -1.99999999999999985e75 < z < 6.5999999999999998e38Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
*-commutative99.9%
add-cube-cbrt99.4%
associate-*l*99.4%
fma-neg99.4%
pow299.4%
Applied egg-rr99.4%
sub-neg99.4%
log-rec99.4%
distribute-neg-in99.4%
log-rec99.4%
remove-double-neg99.4%
+-commutative99.4%
sub-neg99.4%
*-commutative99.4%
associate--r+99.4%
Simplified99.4%
Taylor expanded in y around inf 37.8%
neg-mul-137.8%
Simplified37.8%
Final simplification51.1%
(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%
associate--l-99.9%
associate-+l-99.9%
*-commutative99.9%
add-cube-cbrt99.5%
associate-*l*99.5%
fma-neg99.5%
pow299.5%
Applied egg-rr99.5%
sub-neg99.5%
log-rec99.5%
distribute-neg-in99.5%
log-rec99.5%
remove-double-neg99.5%
+-commutative99.5%
sub-neg99.5%
*-commutative99.5%
associate--r+99.5%
Simplified99.5%
Taylor expanded in y around inf 29.3%
neg-mul-129.3%
Simplified29.3%
Final simplification29.3%
herbie shell --seed 2023224
(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)))