
(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) 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.9%
associate-+l-99.9%
sub-neg99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
unsub-neg99.9%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -1e+126)
t_2
(if (<= t_2 -5.5e-13)
(- (- z) y)
(if (<= t_2 -5e-146) (- (log t) y) (- 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 <= -1e+126) {
tmp = t_2;
} else if (t_2 <= -5.5e-13) {
tmp = -z - y;
} else if (t_2 <= -5e-146) {
tmp = log(t) - 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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-1d+126)) then
tmp = t_2
else if (t_2 <= (-5.5d-13)) then
tmp = -z - y
else if (t_2 <= (-5d-146)) then
tmp = log(t) - 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 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -1e+126) {
tmp = t_2;
} else if (t_2 <= -5.5e-13) {
tmp = -z - y;
} else if (t_2 <= -5e-146) {
tmp = Math.log(t) - y;
} 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 <= -1e+126: tmp = t_2 elif t_2 <= -5.5e-13: tmp = -z - y elif t_2 <= -5e-146: tmp = math.log(t) - y 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 <= -1e+126) tmp = t_2; elseif (t_2 <= -5.5e-13) tmp = Float64(Float64(-z) - y); elseif (t_2 <= -5e-146) tmp = Float64(log(t) - y); 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 <= -1e+126) tmp = t_2; elseif (t_2 <= -5.5e-13) tmp = -z - y; elseif (t_2 <= -5e-146) tmp = log(t) - y; 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, -1e+126], t$95$2, If[LessEqual[t$95$2, -5.5e-13], N[((-z) - y), $MachinePrecision], If[LessEqual[t$95$2, -5e-146], N[(N[Log[t], $MachinePrecision] - y), $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 -1 \cdot 10^{+126}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq -5.5 \cdot 10^{-13}:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-146}:\\
\;\;\;\;\log t - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -9.99999999999999925e125Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 91.4%
if -9.99999999999999925e125 < (-.f64 (*.f64 x (log.f64 y)) y) < -5.49999999999999979e-13Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
unsub-neg99.9%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 98.3%
associate--l+98.3%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around inf 84.3%
neg-mul-184.3%
Simplified84.3%
if -5.49999999999999979e-13 < (-.f64 (*.f64 x (log.f64 y)) y) < -4.99999999999999957e-146Initial program 100.0%
Taylor expanded in z around 0 64.6%
Taylor expanded in x around 0 64.4%
if -4.99999999999999957e-146 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 85.2%
Taylor expanded in y around 0 83.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -1e+126)
t_2
(if (<= t_2 5e-17) (- (- (log t) z) y) (- 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 <= -1e+126) {
tmp = t_2;
} else if (t_2 <= 5e-17) {
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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-1d+126)) then
tmp = t_2
else if (t_2 <= 5d-17) 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 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -1e+126) {
tmp = t_2;
} else if (t_2 <= 5e-17) {
tmp = (Math.log(t) - z) - y;
} 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 <= -1e+126: tmp = t_2 elif t_2 <= 5e-17: tmp = (math.log(t) - z) - y 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 <= -1e+126) tmp = t_2; elseif (t_2 <= 5e-17) 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 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -1e+126) tmp = t_2; elseif (t_2 <= 5e-17) 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[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+126], t$95$2, If[LessEqual[t$95$2, 5e-17], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $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 -1 \cdot 10^{+126}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-17}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -9.99999999999999925e125Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 91.4%
if -9.99999999999999925e125 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.9999999999999999e-17Initial program 99.9%
associate-+l-100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
unsub-neg100.0%
fma-undefine100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 94.7%
if 4.9999999999999999e-17 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 98.5%
Taylor expanded in y around 0 96.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 85.0) (- (+ (log t) t_1) z) (- (- t_1 y) z))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 85.0) {
tmp = (log(t) + t_1) - z;
} else {
tmp = (t_1 - 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (y <= 85.0d0) then
tmp = (log(t) + t_1) - z
else
tmp = (t_1 - y) - 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 tmp;
if (y <= 85.0) {
tmp = (Math.log(t) + t_1) - z;
} else {
tmp = (t_1 - y) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 85.0: tmp = (math.log(t) + t_1) - z else: tmp = (t_1 - y) - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 85.0) tmp = Float64(Float64(log(t) + t_1) - z); else tmp = Float64(Float64(t_1 - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 85.0) tmp = (log(t) + t_1) - z; else tmp = (t_1 - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 85.0], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - z), $MachinePrecision], N[(N[(t$95$1 - y), $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 85:\\
\;\;\;\;\left(\log t + t\_1\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - y\right) - z\\
\end{array}
\end{array}
if y < 85Initial program 99.8%
Taylor expanded in y around 0 99.7%
if 85 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 97.9%
associate--r+97.9%
sub-neg97.9%
Applied egg-rr97.9%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (+ (* x (log y)) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
return (x * log(y)) + ((log(t) - z) - 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 = (x * log(y)) + ((log(t) - z) - y)
end function
public static double code(double x, double y, double z, double t) {
return (x * Math.log(y)) + ((Math.log(t) - z) - y);
}
def code(x, y, z, t): return (x * math.log(y)) + ((math.log(t) - z) - y)
function code(x, y, z, t) return Float64(Float64(x * log(y)) + Float64(Float64(log(t) - z) - y)) end
function tmp = code(x, y, z, t) tmp = (x * log(y)) + ((log(t) - z) - y); end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \log y + \left(\left(\log t - z\right) - y\right)
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((x * log(y)) - y) - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = log(t) + (((x * log(y)) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((x * Math.log(y)) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((x * math.log(y)) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(x * log(y)) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((x * log(y)) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(x \cdot \log y - y\right) - z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -8e+108)
(not
(or (<= x -2.4e+63) (and (not (<= x -190000.0)) (<= x 1.4e+153)))))
(* x (log y))
(- (- z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8e+108) || !((x <= -2.4e+63) || (!(x <= -190000.0) && (x <= 1.4e+153)))) {
tmp = x * log(y);
} else {
tmp = -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 <= (-8d+108)) .or. (.not. (x <= (-2.4d+63)) .or. (.not. (x <= (-190000.0d0))) .and. (x <= 1.4d+153))) then
tmp = x * log(y)
else
tmp = -z - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8e+108) || !((x <= -2.4e+63) || (!(x <= -190000.0) && (x <= 1.4e+153)))) {
tmp = x * Math.log(y);
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -8e+108) or not ((x <= -2.4e+63) or (not (x <= -190000.0) and (x <= 1.4e+153))): tmp = x * math.log(y) else: tmp = -z - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -8e+108) || !((x <= -2.4e+63) || (!(x <= -190000.0) && (x <= 1.4e+153)))) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -8e+108) || ~(((x <= -2.4e+63) || (~((x <= -190000.0)) && (x <= 1.4e+153))))) tmp = x * log(y); else tmp = -z - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8e+108], N[Not[Or[LessEqual[x, -2.4e+63], And[N[Not[LessEqual[x, -190000.0]], $MachinePrecision], LessEqual[x, 1.4e+153]]]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-z) - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+108} \lor \neg \left(x \leq -2.4 \cdot 10^{+63} \lor \neg \left(x \leq -190000\right) \land x \leq 1.4 \cdot 10^{+153}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if x < -8.0000000000000003e108 or -2.4e63 < x < -1.9e5 or 1.39999999999999993e153 < x Initial program 99.6%
Taylor expanded in x around inf 80.1%
if -8.0000000000000003e108 < x < -2.4e63 or -1.9e5 < x < 1.39999999999999993e153Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
unsub-neg100.0%
fma-undefine100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 97.1%
associate--l+97.1%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in z around inf 78.6%
neg-mul-178.6%
Simplified78.6%
Final simplification79.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.85) (not (<= x 1.15))) (- (* x (log y)) (+ z y)) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.85) || !(x <= 1.15)) {
tmp = (x * log(y)) - (z + 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 <= (-2.85d0)) .or. (.not. (x <= 1.15d0))) then
tmp = (x * log(y)) - (z + 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 <= -2.85) || !(x <= 1.15)) {
tmp = (x * Math.log(y)) - (z + y);
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.85) or not (x <= 1.15): tmp = (x * math.log(y)) - (z + y) else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.85) || !(x <= 1.15)) tmp = Float64(Float64(x * log(y)) - Float64(z + 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 <= -2.85) || ~((x <= 1.15))) tmp = (x * log(y)) - (z + y); else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.85], N[Not[LessEqual[x, 1.15]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z + y), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.85 \lor \neg \left(x \leq 1.15\right):\\
\;\;\;\;x \cdot \log y - \left(z + y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -2.85000000000000009 or 1.1499999999999999 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 98.7%
if -2.85000000000000009 < x < 1.1499999999999999Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
unsub-neg100.0%
fma-undefine100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 99.2%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2.9)
(- t_1 (+ z y))
(if (<= x 3.6) (- (- (log t) z) y) (- (- t_1 y) z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -2.9) {
tmp = t_1 - (z + y);
} else if (x <= 3.6) {
tmp = (log(t) - z) - y;
} else {
tmp = (t_1 - 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-2.9d0)) then
tmp = t_1 - (z + y)
else if (x <= 3.6d0) then
tmp = (log(t) - z) - y
else
tmp = (t_1 - y) - 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 tmp;
if (x <= -2.9) {
tmp = t_1 - (z + y);
} else if (x <= 3.6) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = (t_1 - y) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -2.9: tmp = t_1 - (z + y) elif x <= 3.6: tmp = (math.log(t) - z) - y else: tmp = (t_1 - y) - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2.9) tmp = Float64(t_1 - Float64(z + y)); elseif (x <= 3.6) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(Float64(t_1 - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -2.9) tmp = t_1 - (z + y); elseif (x <= 3.6) tmp = (log(t) - z) - y; else tmp = (t_1 - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9], N[(t$95$1 - N[(z + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.6], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(N[(t$95$1 - y), $MachinePrecision] - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2.9:\\
\;\;\;\;t\_1 - \left(z + y\right)\\
\mathbf{elif}\;x \leq 3.6:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - y\right) - z\\
\end{array}
\end{array}
if x < -2.89999999999999991Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 98.9%
if -2.89999999999999991 < x < 3.60000000000000009Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
unsub-neg100.0%
fma-undefine100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 99.2%
if 3.60000000000000009 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 98.6%
associate--r+98.6%
sub-neg98.6%
Applied egg-rr98.6%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.1e+95) (not (<= z 9e+69))) (- (- z) y) (- (* x (log y)) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.1e+95) || !(z <= 9e+69)) {
tmp = -z - y;
} else {
tmp = (x * log(y)) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4.1d+95)) .or. (.not. (z <= 9d+69))) then
tmp = -z - y
else
tmp = (x * log(y)) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.1e+95) || !(z <= 9e+69)) {
tmp = -z - y;
} else {
tmp = (x * Math.log(y)) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.1e+95) or not (z <= 9e+69): tmp = -z - y else: tmp = (x * math.log(y)) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.1e+95) || !(z <= 9e+69)) tmp = Float64(Float64(-z) - y); else tmp = Float64(Float64(x * log(y)) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.1e+95) || ~((z <= 9e+69))) tmp = -z - y; else tmp = (x * log(y)) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.1e+95], N[Not[LessEqual[z, 9e+69]], $MachinePrecision]], N[((-z) - y), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+95} \lor \neg \left(z \leq 9 \cdot 10^{+69}\right):\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - y\\
\end{array}
\end{array}
if z < -4.09999999999999986e95 or 8.9999999999999999e69 < z Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
unsub-neg99.9%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
associate--l+99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 89.1%
neg-mul-189.1%
Simplified89.1%
if -4.09999999999999986e95 < z < 8.9999999999999999e69Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 76.9%
Final simplification81.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.6e+35) (not (<= z 1.12e+43))) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.6e+35) || !(z <= 1.12e+43)) {
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 ((z <= (-2.6d+35)) .or. (.not. (z <= 1.12d+43))) 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 ((z <= -2.6e+35) || !(z <= 1.12e+43)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.6e+35) or not (z <= 1.12e+43): tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.6e+35) || !(z <= 1.12e+43)) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.6e+35) || ~((z <= 1.12e+43))) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.6e+35], N[Not[LessEqual[z, 1.12e+43]], $MachinePrecision]], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+35} \lor \neg \left(z \leq 1.12 \cdot 10^{+43}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -2.60000000000000007e35 or 1.12e43 < z Initial program 99.9%
Taylor expanded in z around inf 64.2%
neg-mul-164.2%
Simplified64.2%
if -2.60000000000000007e35 < z < 1.12e43Initial program 99.8%
Taylor expanded in y around inf 42.7%
neg-mul-142.7%
Simplified42.7%
Final simplification51.9%
(FPCore (x y z t) :precision binary64 (- (- z) y))
double code(double x, double y, double z, double t) {
return -z - 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 = -z - y
end function
public static double code(double x, double y, double z, double t) {
return -z - y;
}
def code(x, y, z, t): return -z - y
function code(x, y, z, t) return Float64(Float64(-z) - y) end
function tmp = code(x, y, z, t) tmp = -z - y; end
code[x_, y_, z_, t_] := N[((-z) - y), $MachinePrecision]
\begin{array}{l}
\\
\left(-z\right) - y
\end{array}
Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
unsub-neg99.9%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 88.4%
associate--l+88.4%
associate-/l*88.4%
Simplified88.4%
Taylor expanded in z around inf 60.0%
neg-mul-160.0%
Simplified60.0%
(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 32.4%
neg-mul-132.4%
Simplified32.4%
herbie shell --seed 2024103
(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)))