
(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 (if (or (<= x -1.25e+16) (not (<= x 7.8e+43))) (- (+ (log t) (* x (log y))) y) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.25e+16) || !(x <= 7.8e+43)) {
tmp = (log(t) + (x * log(y))) - y;
} else {
tmp = (log(t) - 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 ((x <= (-1.25d+16)) .or. (.not. (x <= 7.8d+43))) then
tmp = (log(t) + (x * log(y))) - y
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.25e+16) || !(x <= 7.8e+43)) {
tmp = (Math.log(t) + (x * Math.log(y))) - y;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.25e+16) or not (x <= 7.8e+43): tmp = (math.log(t) + (x * math.log(y))) - y else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.25e+16) || !(x <= 7.8e+43)) tmp = Float64(Float64(log(t) + Float64(x * log(y))) - y); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.25e+16) || ~((x <= 7.8e+43))) tmp = (log(t) + (x * log(y))) - y; else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.25e+16], N[Not[LessEqual[x, 7.8e+43]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+16} \lor \neg \left(x \leq 7.8 \cdot 10^{+43}\right):\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -1.25e16 or 7.8000000000000001e43 < x Initial program 99.7%
Taylor expanded in z around 0 84.3%
if -1.25e16 < x < 7.8000000000000001e43Initial program 100.0%
Taylor expanded in x around 0 98.6%
+-commutative98.6%
associate--r+98.6%
Simplified98.6%
Final simplification92.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (log t) (* x (log y)))))
(if (<= z -1.52e+122)
(- t_1 z)
(if (<= z 1600.0) (- t_1 y) (- (- (log t) z) y)))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) + (x * log(y));
double tmp;
if (z <= -1.52e+122) {
tmp = t_1 - z;
} else if (z <= 1600.0) {
tmp = t_1 - y;
} else {
tmp = (log(t) - 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) :: t_1
real(8) :: tmp
t_1 = log(t) + (x * log(y))
if (z <= (-1.52d+122)) then
tmp = t_1 - z
else if (z <= 1600.0d0) then
tmp = t_1 - y
else
tmp = (log(t) - z) - 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) + (x * Math.log(y));
double tmp;
if (z <= -1.52e+122) {
tmp = t_1 - z;
} else if (z <= 1600.0) {
tmp = t_1 - y;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) + (x * math.log(y)) tmp = 0 if z <= -1.52e+122: tmp = t_1 - z elif z <= 1600.0: tmp = t_1 - y else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) + Float64(x * log(y))) tmp = 0.0 if (z <= -1.52e+122) tmp = Float64(t_1 - z); elseif (z <= 1600.0) tmp = Float64(t_1 - y); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) + (x * log(y)); tmp = 0.0; if (z <= -1.52e+122) tmp = t_1 - z; elseif (z <= 1600.0) tmp = t_1 - y; else tmp = (log(t) - z) - y; 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, -1.52e+122], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[z, 1600.0], N[(t$95$1 - y), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t + x \cdot \log y\\
\mathbf{if}\;z \leq -1.52 \cdot 10^{+122}:\\
\;\;\;\;t_1 - z\\
\mathbf{elif}\;z \leq 1600:\\
\;\;\;\;t_1 - y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if z < -1.52e122Initial program 100.0%
Taylor expanded in y around 0 86.3%
if -1.52e122 < z < 1600Initial program 99.8%
Taylor expanded in z around 0 97.0%
if 1600 < z Initial program 99.9%
Taylor expanded in x around 0 84.7%
+-commutative84.7%
associate--r+84.7%
Simplified84.7%
Final simplification92.9%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -7.2e+148)
(not (or (<= x 6e+63) (and (not (<= x 1.55e+103)) (<= x 2.55e+169)))))
(* x (log y))
(- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.2e+148) || !((x <= 6e+63) || (!(x <= 1.55e+103) && (x <= 2.55e+169)))) {
tmp = x * log(y);
} else {
tmp = (log(t) - 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 ((x <= (-7.2d+148)) .or. (.not. (x <= 6d+63) .or. (.not. (x <= 1.55d+103)) .and. (x <= 2.55d+169))) then
tmp = x * log(y)
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.2e+148) || !((x <= 6e+63) || (!(x <= 1.55e+103) && (x <= 2.55e+169)))) {
tmp = x * Math.log(y);
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.2e+148) or not ((x <= 6e+63) or (not (x <= 1.55e+103) and (x <= 2.55e+169))): tmp = x * math.log(y) else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.2e+148) || !((x <= 6e+63) || (!(x <= 1.55e+103) && (x <= 2.55e+169)))) tmp = Float64(x * log(y)); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7.2e+148) || ~(((x <= 6e+63) || (~((x <= 1.55e+103)) && (x <= 2.55e+169))))) tmp = x * log(y); else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.2e+148], N[Not[Or[LessEqual[x, 6e+63], And[N[Not[LessEqual[x, 1.55e+103]], $MachinePrecision], LessEqual[x, 2.55e+169]]]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+148} \lor \neg \left(x \leq 6 \cdot 10^{+63} \lor \neg \left(x \leq 1.55 \cdot 10^{+103}\right) \land x \leq 2.55 \cdot 10^{+169}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -7.20000000000000013e148 or 5.99999999999999998e63 < x < 1.5500000000000001e103 or 2.55000000000000004e169 < x Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-+r+99.7%
sub-neg99.7%
fma-udef99.7%
add-cbrt-cube16.4%
pow316.5%
Applied egg-rr14.6%
Taylor expanded in x around inf 14.3%
pow-prod-down14.3%
rem-cbrt-cube80.6%
*-commutative80.6%
Applied egg-rr80.6%
if -7.20000000000000013e148 < x < 5.99999999999999998e63 or 1.5500000000000001e103 < x < 2.55000000000000004e169Initial program 99.9%
Taylor expanded in x around 0 88.5%
+-commutative88.5%
associate--r+88.5%
Simplified88.5%
Final simplification86.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (log t) y)))
(if (<= x -9.8e+54)
t_1
(if (<= x -4.7e-253)
t_2
(if (<= x 3.2e-171) (- (log t) z) (if (<= x 4.2e+63) 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) - y;
double tmp;
if (x <= -9.8e+54) {
tmp = t_1;
} else if (x <= -4.7e-253) {
tmp = t_2;
} else if (x <= 3.2e-171) {
tmp = log(t) - z;
} else if (x <= 4.2e+63) {
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) - y
if (x <= (-9.8d+54)) then
tmp = t_1
else if (x <= (-4.7d-253)) then
tmp = t_2
else if (x <= 3.2d-171) then
tmp = log(t) - z
else if (x <= 4.2d+63) 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) - y;
double tmp;
if (x <= -9.8e+54) {
tmp = t_1;
} else if (x <= -4.7e-253) {
tmp = t_2;
} else if (x <= 3.2e-171) {
tmp = Math.log(t) - z;
} else if (x <= 4.2e+63) {
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) - y tmp = 0 if x <= -9.8e+54: tmp = t_1 elif x <= -4.7e-253: tmp = t_2 elif x <= 3.2e-171: tmp = math.log(t) - z elif x <= 4.2e+63: 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) - y) tmp = 0.0 if (x <= -9.8e+54) tmp = t_1; elseif (x <= -4.7e-253) tmp = t_2; elseif (x <= 3.2e-171) tmp = Float64(log(t) - z); elseif (x <= 4.2e+63) 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) - y; tmp = 0.0; if (x <= -9.8e+54) tmp = t_1; elseif (x <= -4.7e-253) tmp = t_2; elseif (x <= 3.2e-171) tmp = log(t) - z; elseif (x <= 4.2e+63) 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] - y), $MachinePrecision]}, If[LessEqual[x, -9.8e+54], t$95$1, If[LessEqual[x, -4.7e-253], t$95$2, If[LessEqual[x, 3.2e-171], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 4.2e+63], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - y\\
\mathbf{if}\;x \leq -9.8 \cdot 10^{+54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.7 \cdot 10^{-253}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-171}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+63}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -9.80000000000000002e54 or 4.2000000000000004e63 < x Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-+r+99.7%
sub-neg99.7%
fma-udef99.7%
add-cbrt-cube17.6%
pow317.7%
Applied egg-rr15.8%
Taylor expanded in x around inf 15.7%
pow-prod-down15.7%
rem-cbrt-cube66.1%
*-commutative66.1%
Applied egg-rr66.1%
if -9.80000000000000002e54 < x < -4.69999999999999981e-253 or 3.2000000000000001e-171 < x < 4.2000000000000004e63Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 69.2%
mul-1-neg69.2%
Simplified69.2%
if -4.69999999999999981e-253 < x < 3.2000000000000001e-171Initial program 100.0%
Taylor expanded in y around 0 68.7%
Taylor expanded in x around 0 68.7%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.4e+15) (not (<= x 4.4e+63))) (* x (log y)) (- (log t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.4e+15) || !(x <= 4.4e+63)) {
tmp = x * log(y);
} else {
tmp = log(t) - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-4.4d+15)) .or. (.not. (x <= 4.4d+63))) then
tmp = x * log(y)
else
tmp = log(t) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.4e+15) || !(x <= 4.4e+63)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.4e+15) or not (x <= 4.4e+63): tmp = x * math.log(y) else: tmp = math.log(t) - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.4e+15) || !(x <= 4.4e+63)) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4.4e+15) || ~((x <= 4.4e+63))) tmp = x * log(y); else tmp = log(t) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.4e+15], N[Not[LessEqual[x, 4.4e+63]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+15} \lor \neg \left(x \leq 4.4 \cdot 10^{+63}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - z\\
\end{array}
\end{array}
if x < -4.4e15 or 4.3999999999999997e63 < x Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-+r+99.7%
sub-neg99.7%
fma-udef99.7%
add-cbrt-cube20.2%
pow320.3%
Applied egg-rr17.4%
Taylor expanded in x around inf 16.7%
pow-prod-down16.7%
rem-cbrt-cube64.1%
*-commutative64.1%
Applied egg-rr64.1%
if -4.4e15 < x < 4.3999999999999997e63Initial program 100.0%
Taylor expanded in y around 0 51.3%
Taylor expanded in x around 0 50.3%
Final simplification56.6%
(FPCore (x y z t) :precision binary64 (if (<= z -1.6e+122) (- z) (if (<= z 1600.0) (* x (log y)) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+122) {
tmp = -z;
} else if (z <= 1600.0) {
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 <= (-1.6d+122)) then
tmp = -z
else if (z <= 1600.0d0) 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 <= -1.6e+122) {
tmp = -z;
} else if (z <= 1600.0) {
tmp = x * Math.log(y);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.6e+122: tmp = -z elif z <= 1600.0: tmp = x * math.log(y) else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.6e+122) tmp = Float64(-z); elseif (z <= 1600.0) 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 <= -1.6e+122) tmp = -z; elseif (z <= 1600.0) tmp = x * log(y); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.6e+122], (-z), If[LessEqual[z, 1600.0], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+122}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 1600:\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1.60000000000000006e122 or 1600 < z Initial program 100.0%
Taylor expanded in z around inf 63.1%
neg-mul-163.1%
Simplified63.1%
if -1.60000000000000006e122 < z < 1600Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-+r+99.8%
sub-neg99.8%
fma-udef99.8%
add-cbrt-cube41.0%
pow341.0%
Applied egg-rr27.4%
Taylor expanded in x around inf 12.7%
pow-prod-down12.7%
rem-cbrt-cube38.6%
*-commutative38.6%
Applied egg-rr38.6%
Final simplification47.2%
(FPCore (x y z t) :precision binary64 (if (<= z -3.5e+32) (- z) (if (<= z 0.44) (log t) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e+32) {
tmp = -z;
} else if (z <= 0.44) {
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 <= (-3.5d+32)) then
tmp = -z
else if (z <= 0.44d0) 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 <= -3.5e+32) {
tmp = -z;
} else if (z <= 0.44) {
tmp = Math.log(t);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.5e+32: tmp = -z elif z <= 0.44: tmp = math.log(t) else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.5e+32) tmp = Float64(-z); elseif (z <= 0.44) tmp = log(t); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.5e+32) tmp = -z; elseif (z <= 0.44) tmp = log(t); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.5e+32], (-z), If[LessEqual[z, 0.44], N[Log[t], $MachinePrecision], (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+32}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 0.44:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -3.5000000000000001e32 or 0.440000000000000002 < z Initial program 99.9%
Taylor expanded in z around inf 55.4%
neg-mul-155.4%
Simplified55.4%
if -3.5000000000000001e32 < z < 0.440000000000000002Initial program 99.8%
Taylor expanded in y around 0 54.7%
Taylor expanded in x around 0 18.6%
Taylor expanded in z around 0 18.1%
Final simplification34.1%
(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%
Taylor expanded in z around inf 25.2%
neg-mul-125.2%
Simplified25.2%
Final simplification25.2%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return y end
function tmp = code(x, y, z, t) tmp = y; end
code[x_, y_, z_, t_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
fma-udef99.9%
add-cbrt-cube32.3%
pow332.3%
Applied egg-rr22.7%
Taylor expanded in y around inf 2.0%
Final simplification2.0%
(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 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%
sub-neg99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
fma-udef99.9%
add-cbrt-cube32.3%
pow332.3%
Applied egg-rr22.7%
Taylor expanded in z around inf 7.5%
mul-1-neg7.5%
cube-neg7.5%
Simplified7.5%
rem-cbrt-cube25.2%
add-sqr-sqrt10.8%
sqrt-unprod4.4%
sqr-neg4.4%
sqrt-prod1.0%
add-sqr-sqrt2.3%
add-log-exp2.1%
*-un-lft-identity2.1%
log-prod2.1%
metadata-eval2.1%
add-log-exp2.3%
Applied egg-rr2.3%
+-lft-identity2.3%
Simplified2.3%
Final simplification2.3%
herbie shell --seed 2023275
(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)))