
(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 11 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
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -6e+155)
t_2
(if (<= t_2 4e-12) (- (log t) (+ y z)) (- t_1 z)))))
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 <= -6e+155) {
tmp = t_2;
} else if (t_2 <= 4e-12) {
tmp = log(t) - (y + z);
} 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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-6d+155)) then
tmp = t_2
else if (t_2 <= 4d-12) then
tmp = log(t) - (y + z)
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 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -6e+155) {
tmp = t_2;
} else if (t_2 <= 4e-12) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -6e+155: tmp = t_2 elif t_2 <= 4e-12: tmp = math.log(t) - (y + z) else: tmp = t_1 - z 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 <= -6e+155) tmp = t_2; elseif (t_2 <= 4e-12) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(t_1 - z); 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 <= -6e+155) tmp = t_2; elseif (t_2 <= 4e-12) tmp = log(t) - (y + z); else tmp = t_1 - z; 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, -6e+155], t$95$2, If[LessEqual[t$95$2, 4e-12], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t_1 - y\\
\mathbf{if}\;t_2 \leq -6 \cdot 10^{+155}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 4 \cdot 10^{-12}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -6.0000000000000003e155Initial program 99.9%
associate-+l-99.9%
fma-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in z around 0 94.0%
if -6.0000000000000003e155 < (-.f64 (*.f64 x (log.f64 y)) y) < 3.99999999999999992e-12Initial program 100.0%
Taylor expanded in x around 0 92.3%
if 3.99999999999999992e-12 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
associate-+l-99.6%
fma-neg99.6%
Simplified99.6%
Taylor expanded in z around inf 98.4%
Taylor expanded in y around 0 95.5%
Final simplification93.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -30500000.0) (not (<= x 4.1e-10))) (- (fma x (log y) (- y)) z) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -30500000.0) || !(x <= 4.1e-10)) {
tmp = fma(x, log(y), -y) - z;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((x <= -30500000.0) || !(x <= 4.1e-10)) tmp = Float64(fma(x, log(y), Float64(-y)) - z); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -30500000.0], N[Not[LessEqual[x, 4.1e-10]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision] + (-y)), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -30500000 \lor \neg \left(x \leq 4.1 \cdot 10^{-10}\right):\\
\;\;\;\;\mathsf{fma}\left(x, \log y, -y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -3.05e7 or 4.0999999999999998e-10 < x Initial program 99.7%
associate-+l-99.7%
fma-neg99.7%
Simplified99.7%
Taylor expanded in z around inf 98.4%
if -3.05e7 < x < 4.0999999999999998e-10Initial program 100.0%
Taylor expanded in x around 0 99.7%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (<= y 1.85e-18) (+ (log t) (- (* x (log y)) z)) (- (fma x (log y) (- y)) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.85e-18) {
tmp = log(t) + ((x * log(y)) - z);
} else {
tmp = fma(x, log(y), -y) - z;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 1.85e-18) tmp = Float64(log(t) + Float64(Float64(x * log(y)) - z)); else tmp = Float64(fma(x, log(y), Float64(-y)) - z); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.85e-18], N[(N[Log[t], $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision] + (-y)), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.85 \cdot 10^{-18}:\\
\;\;\;\;\log t + \left(x \cdot \log y - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, -y\right) - z\\
\end{array}
\end{array}
if y < 1.8500000000000002e-18Initial program 99.8%
Taylor expanded in y around 0 99.8%
if 1.8500000000000002e-18 < y Initial program 99.9%
associate-+l-99.9%
fma-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 97.5%
Final simplification98.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (log t) z)))
(if (<= x -5.4e+106)
t_1
(if (<= x -2e+60)
t_2
(if (<= x -8.6e+25)
t_1
(if (<= x -1.7e-275) (- (log t) y) (if (<= x 8e+47) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = log(t) - z;
double tmp;
if (x <= -5.4e+106) {
tmp = t_1;
} else if (x <= -2e+60) {
tmp = t_2;
} else if (x <= -8.6e+25) {
tmp = t_1;
} else if (x <= -1.7e-275) {
tmp = log(t) - y;
} else if (x <= 8e+47) {
tmp = t_2;
} 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 = log(t) - z
if (x <= (-5.4d+106)) then
tmp = t_1
else if (x <= (-2d+60)) then
tmp = t_2
else if (x <= (-8.6d+25)) then
tmp = t_1
else if (x <= (-1.7d-275)) then
tmp = log(t) - y
else if (x <= 8d+47) then
tmp = t_2
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 = Math.log(t) - z;
double tmp;
if (x <= -5.4e+106) {
tmp = t_1;
} else if (x <= -2e+60) {
tmp = t_2;
} else if (x <= -8.6e+25) {
tmp = t_1;
} else if (x <= -1.7e-275) {
tmp = Math.log(t) - y;
} else if (x <= 8e+47) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = math.log(t) - z tmp = 0 if x <= -5.4e+106: tmp = t_1 elif x <= -2e+60: tmp = t_2 elif x <= -8.6e+25: tmp = t_1 elif x <= -1.7e-275: tmp = math.log(t) - y elif x <= 8e+47: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(log(t) - z) tmp = 0.0 if (x <= -5.4e+106) tmp = t_1; elseif (x <= -2e+60) tmp = t_2; elseif (x <= -8.6e+25) tmp = t_1; elseif (x <= -1.7e-275) tmp = Float64(log(t) - y); elseif (x <= 8e+47) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = log(t) - z; tmp = 0.0; if (x <= -5.4e+106) tmp = t_1; elseif (x <= -2e+60) tmp = t_2; elseif (x <= -8.6e+25) tmp = t_1; elseif (x <= -1.7e-275) tmp = log(t) - y; elseif (x <= 8e+47) tmp = t_2; 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[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -5.4e+106], t$95$1, If[LessEqual[x, -2e+60], t$95$2, If[LessEqual[x, -8.6e+25], t$95$1, If[LessEqual[x, -1.7e-275], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 8e+47], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - z\\
\mathbf{if}\;x \leq -5.4 \cdot 10^{+106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{+60}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -8.6 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-275}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+47}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -5.40000000000000012e106 or -1.9999999999999999e60 < x < -8.59999999999999996e25 or 8.0000000000000004e47 < x Initial program 99.7%
associate-+l-99.7%
fma-neg99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 65.9%
if -5.40000000000000012e106 < x < -1.9999999999999999e60 or -1.69999999999999984e-275 < x < 8.0000000000000004e47Initial program 100.0%
Taylor expanded in z around inf 63.3%
mul-1-neg63.3%
Simplified63.3%
if -8.59999999999999996e25 < x < -1.69999999999999984e-275Initial program 99.9%
Taylor expanded in y around inf 72.4%
mul-1-neg72.4%
Simplified72.4%
Taylor expanded in y around 0 72.4%
Simplified72.4%
Final simplification66.5%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -4.3e+114)
(not
(or (<= x -1.3e+64)
(and (not (<= x -1000000000.0)) (<= x 6.2e+47)))))
(- (* x (log y)) y)
(- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.3e+114) || !((x <= -1.3e+64) || (!(x <= -1000000000.0) && (x <= 6.2e+47)))) {
tmp = (x * log(y)) - 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 <= (-4.3d+114)) .or. (.not. (x <= (-1.3d+64)) .or. (.not. (x <= (-1000000000.0d0))) .and. (x <= 6.2d+47))) then
tmp = (x * log(y)) - 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 <= -4.3e+114) || !((x <= -1.3e+64) || (!(x <= -1000000000.0) && (x <= 6.2e+47)))) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.3e+114) or not ((x <= -1.3e+64) or (not (x <= -1000000000.0) and (x <= 6.2e+47))): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.3e+114) || !((x <= -1.3e+64) || (!(x <= -1000000000.0) && (x <= 6.2e+47)))) tmp = Float64(Float64(x * log(y)) - 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 <= -4.3e+114) || ~(((x <= -1.3e+64) || (~((x <= -1000000000.0)) && (x <= 6.2e+47))))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.3e+114], N[Not[Or[LessEqual[x, -1.3e+64], And[N[Not[LessEqual[x, -1000000000.0]], $MachinePrecision], LessEqual[x, 6.2e+47]]]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{+114} \lor \neg \left(x \leq -1.3 \cdot 10^{+64} \lor \neg \left(x \leq -1000000000\right) \land x \leq 6.2 \cdot 10^{+47}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -4.3000000000000001e114 or -1.29999999999999998e64 < x < -1e9 or 6.2000000000000001e47 < x Initial program 99.7%
associate-+l-99.7%
fma-neg99.7%
Simplified99.7%
Taylor expanded in z around inf 99.0%
Taylor expanded in z around 0 86.4%
if -4.3000000000000001e114 < x < -1.29999999999999998e64 or -1e9 < x < 6.2000000000000001e47Initial program 100.0%
Taylor expanded in x around 0 96.6%
Final simplification92.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) y)))
(if (<= z -2.15e+114)
(- y z)
(if (<= z -8.8e+26)
t_1
(if (<= z -7e-16) (* x (log y)) (if (<= z 1.6e+53) t_1 (- z)))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double tmp;
if (z <= -2.15e+114) {
tmp = y - z;
} else if (z <= -8.8e+26) {
tmp = t_1;
} else if (z <= -7e-16) {
tmp = x * log(y);
} else if (z <= 1.6e+53) {
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 <= (-2.15d+114)) then
tmp = y - z
else if (z <= (-8.8d+26)) then
tmp = t_1
else if (z <= (-7d-16)) then
tmp = x * log(y)
else if (z <= 1.6d+53) 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 <= -2.15e+114) {
tmp = y - z;
} else if (z <= -8.8e+26) {
tmp = t_1;
} else if (z <= -7e-16) {
tmp = x * Math.log(y);
} else if (z <= 1.6e+53) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - y tmp = 0 if z <= -2.15e+114: tmp = y - z elif z <= -8.8e+26: tmp = t_1 elif z <= -7e-16: tmp = x * math.log(y) elif z <= 1.6e+53: 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 <= -2.15e+114) tmp = Float64(y - z); elseif (z <= -8.8e+26) tmp = t_1; elseif (z <= -7e-16) tmp = Float64(x * log(y)); elseif (z <= 1.6e+53) 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 <= -2.15e+114) tmp = y - z; elseif (z <= -8.8e+26) tmp = t_1; elseif (z <= -7e-16) tmp = x * log(y); elseif (z <= 1.6e+53) 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, -2.15e+114], N[(y - z), $MachinePrecision], If[LessEqual[z, -8.8e+26], t$95$1, If[LessEqual[z, -7e-16], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+53], t$95$1, (-z)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{+114}:\\
\;\;\;\;y - z\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-16}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -2.15e114Initial program 99.9%
associate-+l-99.9%
fma-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
fma-neg99.9%
add-cube-cbrt99.3%
pow399.3%
fma-neg99.3%
add-sqr-sqrt0.0%
sqrt-unprod67.2%
sqr-neg67.2%
sqrt-unprod90.8%
add-sqr-sqrt90.8%
Applied egg-rr90.8%
Taylor expanded in x around 0 66.9%
pow-base-166.9%
*-lft-identity66.9%
Simplified66.9%
if -2.15e114 < z < -8.80000000000000028e26 or -7.00000000000000035e-16 < z < 1.6e53Initial program 99.9%
Taylor expanded in y around inf 62.3%
mul-1-neg62.3%
Simplified62.3%
Taylor expanded in y around 0 62.3%
Simplified62.3%
if -8.80000000000000028e26 < z < -7.00000000000000035e-16Initial program 99.7%
associate-+l-99.7%
fma-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 91.1%
Taylor expanded in x around inf 59.1%
if 1.6e53 < z Initial program 99.9%
associate-+l-99.9%
fma-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
fma-neg99.9%
add-cube-cbrt99.4%
pow399.5%
fma-neg99.5%
add-sqr-sqrt0.0%
sqrt-unprod75.2%
sqr-neg75.2%
sqrt-unprod82.5%
add-sqr-sqrt82.5%
Applied egg-rr82.5%
Taylor expanded in y around 0 83.7%
pow-base-183.7%
*-lft-identity83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in x around 0 71.1%
mul-1-neg71.1%
Simplified71.1%
Final simplification64.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.8e+115) (not (<= x 3.3e+154))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.8e+115) || !(x <= 3.3e+154)) {
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 <= (-7.8d+115)) .or. (.not. (x <= 3.3d+154))) 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 <= -7.8e+115) || !(x <= 3.3e+154)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.8e+115) or not (x <= 3.3e+154): 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 <= -7.8e+115) || !(x <= 3.3e+154)) 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 <= -7.8e+115) || ~((x <= 3.3e+154))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.8e+115], N[Not[LessEqual[x, 3.3e+154]], $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 -7.8 \cdot 10^{+115} \lor \neg \left(x \leq 3.3 \cdot 10^{+154}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -7.80000000000000012e115 or 3.3e154 < x Initial program 99.7%
associate-+l-99.7%
fma-neg99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
Taylor expanded in x around inf 75.4%
if -7.80000000000000012e115 < x < 3.3e154Initial program 99.9%
Taylor expanded in x around 0 88.8%
Final simplification85.1%
(FPCore (x y z t) :precision binary64 (if (<= z -2.2e+24) (- y z) (if (<= z 1.32e+43) (* x (log y)) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+24) {
tmp = y - z;
} else if (z <= 1.32e+43) {
tmp = x * log(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.2d+24)) then
tmp = y - z
else if (z <= 1.32d+43) then
tmp = x * log(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.2e+24) {
tmp = y - z;
} else if (z <= 1.32e+43) {
tmp = x * Math.log(y);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.2e+24: tmp = y - z elif z <= 1.32e+43: tmp = x * math.log(y) else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e+24) tmp = Float64(y - z); elseif (z <= 1.32e+43) tmp = Float64(x * log(y)); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.2e+24) tmp = y - z; elseif (z <= 1.32e+43) tmp = x * log(y); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e+24], N[(y - z), $MachinePrecision], If[LessEqual[z, 1.32e+43], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+24}:\\
\;\;\;\;y - z\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+43}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -2.20000000000000002e24Initial program 99.9%
associate-+l-99.9%
fma-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
fma-neg99.9%
add-cube-cbrt99.1%
pow399.2%
fma-neg99.2%
add-sqr-sqrt0.0%
sqrt-unprod57.1%
sqr-neg57.1%
sqrt-unprod73.7%
add-sqr-sqrt73.7%
Applied egg-rr73.7%
Taylor expanded in x around 0 54.9%
pow-base-154.9%
*-lft-identity54.9%
Simplified54.9%
if -2.20000000000000002e24 < z < 1.32e43Initial program 99.8%
associate-+l-99.8%
fma-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 79.0%
Taylor expanded in x around inf 40.3%
if 1.32e43 < z Initial program 99.9%
associate-+l-99.9%
fma-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
fma-neg99.9%
add-cube-cbrt99.3%
pow399.4%
fma-neg99.4%
add-sqr-sqrt0.0%
sqrt-unprod71.6%
sqr-neg71.6%
sqrt-unprod78.5%
add-sqr-sqrt78.5%
Applied egg-rr78.5%
Taylor expanded in y around 0 79.8%
pow-base-179.8%
*-lft-identity79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in x around 0 67.9%
mul-1-neg67.9%
Simplified67.9%
Final simplification50.0%
(FPCore (x y z t) :precision binary64 (if (<= z -185.0) (- y z) (if (<= z 14.5) (log t) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -185.0) {
tmp = y - z;
} else if (z <= 14.5) {
tmp = log(t);
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-185.0d0)) then
tmp = y - z
else if (z <= 14.5d0) then
tmp = log(t)
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -185.0) {
tmp = y - z;
} else if (z <= 14.5) {
tmp = Math.log(t);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -185.0: tmp = y - z elif z <= 14.5: tmp = math.log(t) else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -185.0) tmp = Float64(y - z); elseif (z <= 14.5) tmp = log(t); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -185.0) tmp = y - z; elseif (z <= 14.5) tmp = log(t); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -185.0], N[(y - z), $MachinePrecision], If[LessEqual[z, 14.5], N[Log[t], $MachinePrecision], (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -185:\\
\;\;\;\;y - z\\
\mathbf{elif}\;z \leq 14.5:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -185Initial program 99.9%
associate-+l-99.9%
fma-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 98.7%
fma-neg98.7%
add-cube-cbrt97.7%
pow397.7%
fma-neg97.7%
add-sqr-sqrt0.0%
sqrt-unprod59.0%
sqr-neg59.0%
sqrt-unprod72.9%
add-sqr-sqrt72.9%
Applied egg-rr72.9%
Taylor expanded in x around 0 46.8%
pow-base-146.8%
*-lft-identity46.8%
Simplified46.8%
if -185 < z < 14.5Initial program 99.8%
Taylor expanded in y around inf 61.7%
mul-1-neg61.7%
Simplified61.7%
Taylor expanded in y around 0 22.6%
if 14.5 < z Initial program 99.8%
associate-+l-99.8%
fma-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 99.3%
fma-neg99.3%
add-cube-cbrt98.7%
pow398.7%
fma-neg98.7%
add-sqr-sqrt0.0%
sqrt-unprod68.7%
sqr-neg68.7%
sqrt-unprod76.1%
add-sqr-sqrt76.1%
Applied egg-rr76.1%
Taylor expanded in y around 0 77.5%
pow-base-177.5%
*-lft-identity77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in x around 0 62.2%
mul-1-neg62.2%
Simplified62.2%
Final simplification39.2%
(FPCore (x y z t) :precision binary64 (- z))
double code(double x, double y, double z, double t) {
return -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 = -z
end function
public static double code(double x, double y, double z, double t) {
return -z;
}
def code(x, y, z, t): return -z
function code(x, y, z, t) return Float64(-z) end
function tmp = code(x, y, z, t) tmp = -z; end
code[x_, y_, z_, t_] := (-z)
\begin{array}{l}
\\
-z
\end{array}
Initial program 99.9%
associate-+l-99.8%
fma-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 88.2%
fma-neg88.2%
add-cube-cbrt87.1%
pow387.2%
fma-neg87.2%
add-sqr-sqrt0.0%
sqrt-unprod49.9%
sqr-neg49.9%
sqrt-unprod56.0%
add-sqr-sqrt56.0%
Applied egg-rr56.0%
Taylor expanded in y around 0 57.4%
pow-base-157.4%
*-lft-identity57.4%
*-commutative57.4%
Simplified57.4%
Taylor expanded in x around 0 29.6%
mul-1-neg29.6%
Simplified29.6%
Final simplification29.6%
herbie shell --seed 2023301
(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)))