
(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 13 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.8%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r-99.8%
associate--l-99.8%
fma-def99.8%
associate--l-99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (fma x (log y) (- (log t) z)) y))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (log(t) - z)) - y;
}
function code(x, y, z, t) return Float64(fma(x, log(y), Float64(log(t) - z)) - y) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
+-commutative99.8%
associate--r+99.8%
fma-neg99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.5e+36) (not (<= x 2.7e+62))) (- (+ (log t) (* x (log y))) y) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.5e+36) || !(x <= 2.7e+62)) {
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 <= (-5.5d+36)) .or. (.not. (x <= 2.7d+62))) 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 <= -5.5e+36) || !(x <= 2.7e+62)) {
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 <= -5.5e+36) or not (x <= 2.7e+62): 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 <= -5.5e+36) || !(x <= 2.7e+62)) 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 <= -5.5e+36) || ~((x <= 2.7e+62))) 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, -5.5e+36], N[Not[LessEqual[x, 2.7e+62]], $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 -5.5 \cdot 10^{+36} \lor \neg \left(x \leq 2.7 \cdot 10^{+62}\right):\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -5.5000000000000002e36 or 2.7e62 < x Initial program 99.6%
Taylor expanded in z around 0 82.1%
if -5.5000000000000002e36 < x < 2.7e62Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
+-commutative100.0%
associate--r+100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 97.7%
Final simplification90.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (log t) (* x (log y)))))
(if (<= x -3.9e+36)
(- t_1 y)
(if (<= x 1.35e+42) (- (- (log t) z) 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 (x <= -3.9e+36) {
tmp = t_1 - y;
} else if (x <= 1.35e+42) {
tmp = (log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) + (x * log(y))
if (x <= (-3.9d+36)) then
tmp = t_1 - y
else if (x <= 1.35d+42) then
tmp = (log(t) - z) - y
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) + (x * Math.log(y));
double tmp;
if (x <= -3.9e+36) {
tmp = t_1 - y;
} else if (x <= 1.35e+42) {
tmp = (Math.log(t) - z) - 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 x <= -3.9e+36: tmp = t_1 - y elif x <= 1.35e+42: tmp = (math.log(t) - z) - 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 (x <= -3.9e+36) tmp = Float64(t_1 - y); elseif (x <= 1.35e+42) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) + (x * log(y)); tmp = 0.0; if (x <= -3.9e+36) tmp = t_1 - y; elseif (x <= 1.35e+42) tmp = (log(t) - z) - y; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e+36], N[(t$95$1 - y), $MachinePrecision], If[LessEqual[x, 1.35e+42], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t + x \cdot \log y\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{+36}:\\
\;\;\;\;t_1 - y\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+42}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t_1 - z\\
\end{array}
\end{array}
if x < -3.90000000000000021e36Initial program 99.7%
Taylor expanded in z around 0 80.7%
if -3.90000000000000021e36 < x < 1.35e42Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
+-commutative100.0%
associate--r+100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 98.0%
if 1.35e42 < x Initial program 99.6%
Taylor expanded in y around 0 91.5%
Final simplification92.3%
(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.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -3.7e+151)
t_1
(if (<= x -7e+106)
(- y)
(if (<= x -9.2e+30)
t_1
(if (<= x 2.25e-23) (- y) (if (<= x 6.5e+62) (- z) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -3.7e+151) {
tmp = t_1;
} else if (x <= -7e+106) {
tmp = -y;
} else if (x <= -9.2e+30) {
tmp = t_1;
} else if (x <= 2.25e-23) {
tmp = -y;
} else if (x <= 6.5e+62) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-3.7d+151)) then
tmp = t_1
else if (x <= (-7d+106)) then
tmp = -y
else if (x <= (-9.2d+30)) then
tmp = t_1
else if (x <= 2.25d-23) then
tmp = -y
else if (x <= 6.5d+62) then
tmp = -z
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 tmp;
if (x <= -3.7e+151) {
tmp = t_1;
} else if (x <= -7e+106) {
tmp = -y;
} else if (x <= -9.2e+30) {
tmp = t_1;
} else if (x <= 2.25e-23) {
tmp = -y;
} else if (x <= 6.5e+62) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -3.7e+151: tmp = t_1 elif x <= -7e+106: tmp = -y elif x <= -9.2e+30: tmp = t_1 elif x <= 2.25e-23: tmp = -y elif x <= 6.5e+62: tmp = -z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -3.7e+151) tmp = t_1; elseif (x <= -7e+106) tmp = Float64(-y); elseif (x <= -9.2e+30) tmp = t_1; elseif (x <= 2.25e-23) tmp = Float64(-y); elseif (x <= 6.5e+62) tmp = Float64(-z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -3.7e+151) tmp = t_1; elseif (x <= -7e+106) tmp = -y; elseif (x <= -9.2e+30) tmp = t_1; elseif (x <= 2.25e-23) tmp = -y; elseif (x <= 6.5e+62) tmp = -z; 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]}, If[LessEqual[x, -3.7e+151], t$95$1, If[LessEqual[x, -7e+106], (-y), If[LessEqual[x, -9.2e+30], t$95$1, If[LessEqual[x, 2.25e-23], (-y), If[LessEqual[x, 6.5e+62], (-z), t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{+151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -7 \cdot 10^{+106}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq -9.2 \cdot 10^{+30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-23}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+62}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.6999999999999997e151 or -6.99999999999999962e106 < x < -9.2e30 or 6.5000000000000003e62 < x Initial program 99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r-99.6%
associate--l-99.6%
fma-def99.6%
associate--l-99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 67.9%
if -3.6999999999999997e151 < x < -6.99999999999999962e106 or -9.2e30 < x < 2.24999999999999987e-23Initial program 100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r-100.0%
associate--l-100.0%
fma-def100.0%
associate--l-100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 50.7%
neg-mul-150.7%
Simplified50.7%
if 2.24999999999999987e-23 < x < 6.5000000000000003e62Initial program 100.0%
Taylor expanded in z around inf 72.7%
neg-mul-172.7%
Simplified72.7%
Final simplification58.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -3.7e+151)
t_1
(if (<= x 1.5e-22) (- (log t) y) (if (<= x 9.5e+63) (- z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -3.7e+151) {
tmp = t_1;
} else if (x <= 1.5e-22) {
tmp = log(t) - y;
} else if (x <= 9.5e+63) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-3.7d+151)) then
tmp = t_1
else if (x <= 1.5d-22) then
tmp = log(t) - y
else if (x <= 9.5d+63) then
tmp = -z
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 tmp;
if (x <= -3.7e+151) {
tmp = t_1;
} else if (x <= 1.5e-22) {
tmp = Math.log(t) - y;
} else if (x <= 9.5e+63) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -3.7e+151: tmp = t_1 elif x <= 1.5e-22: tmp = math.log(t) - y elif x <= 9.5e+63: tmp = -z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -3.7e+151) tmp = t_1; elseif (x <= 1.5e-22) tmp = Float64(log(t) - y); elseif (x <= 9.5e+63) tmp = Float64(-z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -3.7e+151) tmp = t_1; elseif (x <= 1.5e-22) tmp = log(t) - y; elseif (x <= 9.5e+63) tmp = -z; 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]}, If[LessEqual[x, -3.7e+151], t$95$1, If[LessEqual[x, 1.5e-22], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 9.5e+63], (-z), t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{+151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-22}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+63}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.6999999999999997e151 or 9.5000000000000003e63 < x Initial program 99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r-99.6%
associate--l-99.6%
fma-def99.6%
associate--l-99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 72.3%
if -3.6999999999999997e151 < x < 1.5e-22Initial program 99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r-99.9%
associate--l-99.9%
fma-def99.9%
associate--l-99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 74.9%
Taylor expanded in x around 0 69.0%
if 1.5e-22 < x < 9.5000000000000003e63Initial program 100.0%
Taylor expanded in z around inf 72.7%
neg-mul-172.7%
Simplified72.7%
Final simplification70.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -4.9e+151)
t_1
(if (<= x 2.35e-26)
(- (log t) y)
(if (<= x 9.2e+63) (- (log t) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -4.9e+151) {
tmp = t_1;
} else if (x <= 2.35e-26) {
tmp = log(t) - y;
} else if (x <= 9.2e+63) {
tmp = log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-4.9d+151)) then
tmp = t_1
else if (x <= 2.35d-26) then
tmp = log(t) - y
else if (x <= 9.2d+63) then
tmp = log(t) - z
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 tmp;
if (x <= -4.9e+151) {
tmp = t_1;
} else if (x <= 2.35e-26) {
tmp = Math.log(t) - y;
} else if (x <= 9.2e+63) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -4.9e+151: tmp = t_1 elif x <= 2.35e-26: tmp = math.log(t) - y elif x <= 9.2e+63: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -4.9e+151) tmp = t_1; elseif (x <= 2.35e-26) tmp = Float64(log(t) - y); elseif (x <= 9.2e+63) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -4.9e+151) tmp = t_1; elseif (x <= 2.35e-26) tmp = log(t) - y; elseif (x <= 9.2e+63) tmp = log(t) - z; 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]}, If[LessEqual[x, -4.9e+151], t$95$1, If[LessEqual[x, 2.35e-26], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 9.2e+63], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -4.9 \cdot 10^{+151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{-26}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+63}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -4.8999999999999999e151 or 9.19999999999999973e63 < x Initial program 99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r-99.6%
associate--l-99.6%
fma-def99.6%
associate--l-99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 72.3%
if -4.8999999999999999e151 < x < 2.34999999999999995e-26Initial program 99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r-99.9%
associate--l-99.9%
fma-def99.9%
associate--l-99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 74.9%
Taylor expanded in x around 0 69.0%
if 2.34999999999999995e-26 < x < 9.19999999999999973e63Initial program 100.0%
Taylor expanded in y around 0 89.0%
Taylor expanded in x around 0 73.7%
Final simplification70.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1e+154) (not (<= x 8.5e+69))) (* x (log y)) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1e+154) || !(x <= 8.5e+69)) {
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 <= (-1d+154)) .or. (.not. (x <= 8.5d+69))) 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 <= -1e+154) || !(x <= 8.5e+69)) {
tmp = x * Math.log(y);
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1e+154) or not (x <= 8.5e+69): 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 <= -1e+154) || !(x <= 8.5e+69)) 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 <= -1e+154) || ~((x <= 8.5e+69))) tmp = x * log(y); else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1e+154], N[Not[LessEqual[x, 8.5e+69]], $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 -1 \cdot 10^{+154} \lor \neg \left(x \leq 8.5 \cdot 10^{+69}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -1.00000000000000004e154 or 8.5000000000000002e69 < x Initial program 99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r-99.6%
associate--l-99.6%
fma-def99.6%
associate--l-99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 73.1%
if -1.00000000000000004e154 < x < 8.5000000000000002e69Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
+-commutative99.9%
associate--r+99.9%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 93.6%
Final simplification86.6%
(FPCore (x y z t) :precision binary64 (if (<= y 4.3e+39) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.3e+39) {
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 <= 4.3d+39) 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 <= 4.3e+39) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4.3e+39: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4.3e+39) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 4.3e+39) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4.3e+39], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{+39}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 4.3e39Initial program 99.8%
Taylor expanded in z around inf 35.4%
neg-mul-135.4%
Simplified35.4%
if 4.3e39 < y Initial program 99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r-99.9%
associate--l-99.9%
fma-def99.9%
associate--l-99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 64.4%
neg-mul-164.4%
Simplified64.4%
Final simplification49.8%
(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.8%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r-99.8%
associate--l-99.8%
fma-def99.8%
associate--l-99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 34.5%
neg-mul-134.5%
Simplified34.5%
Final simplification34.5%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return y end
function tmp = code(x, y, z, t) tmp = y; end
code[x_, y_, z_, t_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
+-commutative99.8%
associate--r+99.8%
fma-neg99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
flip--40.7%
clear-num40.7%
+-commutative40.7%
difference-of-squares41.7%
add-sqr-sqrt41.7%
sqrt-unprod41.5%
sqr-neg41.5%
sqrt-unprod0.0%
add-sqr-sqrt32.4%
sub-neg32.4%
pow232.4%
Applied egg-rr32.4%
Taylor expanded in y around inf 2.1%
Final simplification2.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 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.8%
associate-+l-99.8%
associate--l-99.8%
+-commutative99.8%
associate--r+99.8%
fma-neg99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
flip--40.7%
clear-num40.7%
+-commutative40.7%
difference-of-squares41.7%
add-sqr-sqrt41.7%
sqrt-unprod41.5%
sqr-neg41.5%
sqrt-unprod0.0%
add-sqr-sqrt32.4%
sub-neg32.4%
pow232.4%
Applied egg-rr32.4%
Taylor expanded in z around inf 25.3%
add-sqr-sqrt15.6%
sqrt-unprod6.4%
associate-/r/6.4%
metadata-eval6.4%
associate-/r/6.4%
metadata-eval6.4%
swap-sqr6.4%
metadata-eval6.4%
*-un-lft-identity6.4%
sqrt-unprod0.6%
add-sqr-sqrt2.1%
expm1-log1p-u1.6%
expm1-udef1.5%
Applied egg-rr1.5%
expm1-def1.6%
expm1-log1p2.1%
Simplified2.1%
Final simplification2.1%
herbie shell --seed 2023279
(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)))