
(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 (+ (- (- (* 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%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.65e+47) (not (<= z 1.25e+149))) (- (log t) (+ y z)) (- (+ (* x (log y)) (log t)) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.65e+47) || !(z <= 1.25e+149)) {
tmp = log(t) - (y + z);
} else {
tmp = ((x * log(y)) + log(t)) - 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 <= (-2.65d+47)) .or. (.not. (z <= 1.25d+149))) then
tmp = log(t) - (y + z)
else
tmp = ((x * log(y)) + log(t)) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.65e+47) || !(z <= 1.25e+149)) {
tmp = Math.log(t) - (y + z);
} else {
tmp = ((x * Math.log(y)) + Math.log(t)) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.65e+47) or not (z <= 1.25e+149): tmp = math.log(t) - (y + z) else: tmp = ((x * math.log(y)) + math.log(t)) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.65e+47) || !(z <= 1.25e+149)) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(Float64(Float64(x * log(y)) + log(t)) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.65e+47) || ~((z <= 1.25e+149))) tmp = log(t) - (y + z); else tmp = ((x * log(y)) + log(t)) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.65e+47], N[Not[LessEqual[z, 1.25e+149]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{+47} \lor \neg \left(z \leq 1.25 \cdot 10^{+149}\right):\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \log y + \log t\right) - y\\
\end{array}
\end{array}
if z < -2.65e47 or 1.24999999999999998e149 < z Initial program 100.0%
Taylor expanded in x around 0 89.1%
if -2.65e47 < z < 1.24999999999999998e149Initial program 99.8%
Taylor expanded in z around 0 96.0%
Final simplification93.6%
(FPCore (x y z t) :precision binary64 (if (<= y 1.9e+27) (- (+ (* x (log y)) (log t)) z) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.9e+27) {
tmp = ((x * log(y)) + log(t)) - z;
} 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 (y <= 1.9d+27) then
tmp = ((x * log(y)) + log(t)) - z
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 (y <= 1.9e+27) {
tmp = ((x * Math.log(y)) + Math.log(t)) - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.9e+27: tmp = ((x * math.log(y)) + math.log(t)) - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.9e+27) tmp = Float64(Float64(Float64(x * log(y)) + log(t)) - z); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.9e+27) tmp = ((x * log(y)) + log(t)) - z; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.9e+27], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{+27}:\\
\;\;\;\;\left(x \cdot \log y + \log t\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if y < 1.90000000000000011e27Initial program 99.8%
Taylor expanded in y around 0 99.2%
if 1.90000000000000011e27 < y Initial program 99.9%
Taylor expanded in x around 0 84.5%
Final simplification92.1%
(FPCore (x y z t)
:precision binary64
(if (<= y 3.3e-298)
(log t)
(if (<= y 2e-94)
(- z)
(if (<= y 1.75e-9) (* x (log y)) (if (<= y 2.3e+44) (- z) (- y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e-298) {
tmp = log(t);
} else if (y <= 2e-94) {
tmp = -z;
} else if (y <= 1.75e-9) {
tmp = x * log(y);
} else if (y <= 2.3e+44) {
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 <= 3.3d-298) then
tmp = log(t)
else if (y <= 2d-94) then
tmp = -z
else if (y <= 1.75d-9) then
tmp = x * log(y)
else if (y <= 2.3d+44) 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 <= 3.3e-298) {
tmp = Math.log(t);
} else if (y <= 2e-94) {
tmp = -z;
} else if (y <= 1.75e-9) {
tmp = x * Math.log(y);
} else if (y <= 2.3e+44) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.3e-298: tmp = math.log(t) elif y <= 2e-94: tmp = -z elif y <= 1.75e-9: tmp = x * math.log(y) elif y <= 2.3e+44: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e-298) tmp = log(t); elseif (y <= 2e-94) tmp = Float64(-z); elseif (y <= 1.75e-9) tmp = Float64(x * log(y)); elseif (y <= 2.3e+44) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.3e-298) tmp = log(t); elseif (y <= 2e-94) tmp = -z; elseif (y <= 1.75e-9) tmp = x * log(y); elseif (y <= 2.3e+44) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e-298], N[Log[t], $MachinePrecision], If[LessEqual[y, 2e-94], (-z), If[LessEqual[y, 1.75e-9], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+44], (-z), (-y)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{-298}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-94}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-9}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+44}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 3.3000000000000002e-298Initial program 99.7%
Taylor expanded in z around inf 99.7%
associate-/l*99.7%
Simplified99.7%
clear-num99.7%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 99.7%
Taylor expanded in x around 0 90.0%
if 3.3000000000000002e-298 < y < 1.9999999999999999e-94 or 1.75e-9 < y < 2.30000000000000004e44Initial program 99.9%
Taylor expanded in z around inf 46.0%
neg-mul-146.0%
Simplified46.0%
if 1.9999999999999999e-94 < y < 1.75e-9Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
associate--l+99.7%
add-cube-cbrt98.9%
associate-*l*98.9%
fma-define98.9%
pow298.9%
Applied egg-rr98.9%
Taylor expanded in x around inf 51.9%
if 2.30000000000000004e44 < y Initial program 99.9%
Taylor expanded in y around inf 70.4%
neg-mul-170.4%
Simplified70.4%
Final simplification58.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) z)))
(if (<= y 6.5e-60)
t_1
(if (<= y 5e-15) (* x (log y)) (if (<= y 3.4e+44) t_1 (- y))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - z;
double tmp;
if (y <= 6.5e-60) {
tmp = t_1;
} else if (y <= 5e-15) {
tmp = x * log(y);
} else if (y <= 3.4e+44) {
tmp = t_1;
} 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) :: tmp
t_1 = log(t) - z
if (y <= 6.5d-60) then
tmp = t_1
else if (y <= 5d-15) then
tmp = x * log(y)
else if (y <= 3.4d+44) then
tmp = t_1
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 tmp;
if (y <= 6.5e-60) {
tmp = t_1;
} else if (y <= 5e-15) {
tmp = x * Math.log(y);
} else if (y <= 3.4e+44) {
tmp = t_1;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - z tmp = 0 if y <= 6.5e-60: tmp = t_1 elif y <= 5e-15: tmp = x * math.log(y) elif y <= 3.4e+44: tmp = t_1 else: tmp = -y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - z) tmp = 0.0 if (y <= 6.5e-60) tmp = t_1; elseif (y <= 5e-15) tmp = Float64(x * log(y)); elseif (y <= 3.4e+44) tmp = t_1; else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - z; tmp = 0.0; if (y <= 6.5e-60) tmp = t_1; elseif (y <= 5e-15) tmp = x * log(y); elseif (y <= 3.4e+44) tmp = t_1; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[y, 6.5e-60], t$95$1, If[LessEqual[y, 5e-15], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+44], t$95$1, (-y)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - z\\
\mathbf{if}\;y \leq 6.5 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 6.49999999999999995e-60 or 4.99999999999999999e-15 < y < 3.4e44Initial program 99.9%
Taylor expanded in y around 0 97.6%
Taylor expanded in x around 0 68.4%
if 6.49999999999999995e-60 < y < 4.99999999999999999e-15Initial program 99.5%
associate-+l-99.5%
sub-neg99.5%
associate--l+99.5%
add-cube-cbrt98.4%
associate-*l*98.5%
fma-define98.5%
pow298.5%
Applied egg-rr98.5%
Taylor expanded in x around inf 65.9%
if 3.4e44 < y Initial program 99.9%
Taylor expanded in y around inf 70.4%
neg-mul-170.4%
Simplified70.4%
Final simplification69.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) z)))
(if (<= y 1.15e-59)
t_1
(if (<= y 5.8e-15) (* x (log y)) (if (<= y 3.4e+44) t_1 (- (log t) y))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - z;
double tmp;
if (y <= 1.15e-59) {
tmp = t_1;
} else if (y <= 5.8e-15) {
tmp = x * log(y);
} else if (y <= 3.4e+44) {
tmp = t_1;
} else {
tmp = log(t) - 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) :: tmp
t_1 = log(t) - z
if (y <= 1.15d-59) then
tmp = t_1
else if (y <= 5.8d-15) then
tmp = x * log(y)
else if (y <= 3.4d+44) then
tmp = t_1
else
tmp = log(t) - 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 tmp;
if (y <= 1.15e-59) {
tmp = t_1;
} else if (y <= 5.8e-15) {
tmp = x * Math.log(y);
} else if (y <= 3.4e+44) {
tmp = t_1;
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - z tmp = 0 if y <= 1.15e-59: tmp = t_1 elif y <= 5.8e-15: tmp = x * math.log(y) elif y <= 3.4e+44: tmp = t_1 else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - z) tmp = 0.0 if (y <= 1.15e-59) tmp = t_1; elseif (y <= 5.8e-15) tmp = Float64(x * log(y)); elseif (y <= 3.4e+44) tmp = t_1; else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - z; tmp = 0.0; if (y <= 1.15e-59) tmp = t_1; elseif (y <= 5.8e-15) tmp = x * log(y); elseif (y <= 3.4e+44) tmp = t_1; else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[y, 1.15e-59], t$95$1, If[LessEqual[y, 5.8e-15], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+44], t$95$1, N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - z\\
\mathbf{if}\;y \leq 1.15 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if y < 1.1499999999999999e-59 or 5.80000000000000037e-15 < y < 3.4e44Initial program 99.9%
Taylor expanded in y around 0 97.6%
Taylor expanded in x around 0 68.4%
if 1.1499999999999999e-59 < y < 5.80000000000000037e-15Initial program 99.5%
associate-+l-99.5%
sub-neg99.5%
associate--l+99.5%
add-cube-cbrt98.4%
associate-*l*98.5%
fma-define98.5%
pow298.5%
Applied egg-rr98.5%
Taylor expanded in x around inf 65.9%
if 3.4e44 < y Initial program 99.9%
Taylor expanded in z around inf 70.5%
associate-/l*70.6%
Simplified70.6%
clear-num70.6%
un-div-inv70.6%
Applied egg-rr70.6%
Taylor expanded in y around inf 70.4%
mul-1-neg70.4%
Simplified70.4%
Final simplification69.2%
(FPCore (x y z t)
:precision binary64
(if (<= y 6e-298)
(log t)
(if (<= y 2.1e-95)
(- z)
(if (<= y 2.4e-46) (log t) (if (<= y 2.5e+44) (- z) (- y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6e-298) {
tmp = log(t);
} else if (y <= 2.1e-95) {
tmp = -z;
} else if (y <= 2.4e-46) {
tmp = log(t);
} else if (y <= 2.5e+44) {
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 <= 6d-298) then
tmp = log(t)
else if (y <= 2.1d-95) then
tmp = -z
else if (y <= 2.4d-46) then
tmp = log(t)
else if (y <= 2.5d+44) 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 <= 6e-298) {
tmp = Math.log(t);
} else if (y <= 2.1e-95) {
tmp = -z;
} else if (y <= 2.4e-46) {
tmp = Math.log(t);
} else if (y <= 2.5e+44) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 6e-298: tmp = math.log(t) elif y <= 2.1e-95: tmp = -z elif y <= 2.4e-46: tmp = math.log(t) elif y <= 2.5e+44: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 6e-298) tmp = log(t); elseif (y <= 2.1e-95) tmp = Float64(-z); elseif (y <= 2.4e-46) tmp = log(t); elseif (y <= 2.5e+44) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 6e-298) tmp = log(t); elseif (y <= 2.1e-95) tmp = -z; elseif (y <= 2.4e-46) tmp = log(t); elseif (y <= 2.5e+44) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 6e-298], N[Log[t], $MachinePrecision], If[LessEqual[y, 2.1e-95], (-z), If[LessEqual[y, 2.4e-46], N[Log[t], $MachinePrecision], If[LessEqual[y, 2.5e+44], (-z), (-y)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{-298}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-95}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-46}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+44}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 5.9999999999999999e-298 or 2.1e-95 < y < 2.40000000000000013e-46Initial program 99.9%
Taylor expanded in z around inf 91.2%
associate-/l*91.0%
Simplified91.0%
clear-num91.0%
un-div-inv91.1%
Applied egg-rr91.1%
Taylor expanded in x around inf 95.3%
Taylor expanded in x around 0 62.7%
if 5.9999999999999999e-298 < y < 2.1e-95 or 2.40000000000000013e-46 < y < 2.4999999999999998e44Initial program 99.8%
Taylor expanded in z around inf 43.8%
neg-mul-143.8%
Simplified43.8%
if 2.4999999999999998e44 < y Initial program 99.9%
Taylor expanded in y around inf 70.4%
neg-mul-170.4%
Simplified70.4%
Final simplification57.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.2e+200) (not (<= x 1.85e+157))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.2e+200) || !(x <= 1.85e+157)) {
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 <= (-5.2d+200)) .or. (.not. (x <= 1.85d+157))) 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 <= -5.2e+200) || !(x <= 1.85e+157)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.2e+200) or not (x <= 1.85e+157): 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 <= -5.2e+200) || !(x <= 1.85e+157)) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.2e+200) || ~((x <= 1.85e+157))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.2e+200], N[Not[LessEqual[x, 1.85e+157]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+200} \lor \neg \left(x \leq 1.85 \cdot 10^{+157}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -5.2000000000000003e200 or 1.8499999999999999e157 < x Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
associate--l+99.6%
add-cube-cbrt98.4%
associate-*l*98.4%
fma-define98.4%
pow298.4%
Applied egg-rr98.4%
Taylor expanded in x around inf 80.1%
if -5.2000000000000003e200 < x < 1.8499999999999999e157Initial program 99.9%
Taylor expanded in x around 0 88.3%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (<= y 2.2e+44) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e+44) {
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 <= 2.2d+44) 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 <= 2.2e+44) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.2e+44: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.2e+44) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.2e+44) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.2e+44], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{+44}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.19999999999999996e44Initial program 99.8%
Taylor expanded in z around inf 38.1%
neg-mul-138.1%
Simplified38.1%
if 2.19999999999999996e44 < y Initial program 99.9%
Taylor expanded in y around inf 70.4%
neg-mul-170.4%
Simplified70.4%
Final simplification52.6%
(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 34.0%
neg-mul-134.0%
Simplified34.0%
Final simplification34.0%
herbie shell --seed 2024096
(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)))