
(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 (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.9%
associate-+l-99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-+r+99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
unsub-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (- t_1 y) z)))
(if (<= t_2 -5000000000.0)
t_2
(if (<= t_2 1e+18) (+ (log t) t_1) (- 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) - z;
double tmp;
if (t_2 <= -5000000000.0) {
tmp = t_2;
} else if (t_2 <= 1e+18) {
tmp = log(t) + t_1;
} 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) - z
if (t_2 <= (-5000000000.0d0)) then
tmp = t_2
else if (t_2 <= 1d+18) then
tmp = log(t) + t_1
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) - z;
double tmp;
if (t_2 <= -5000000000.0) {
tmp = t_2;
} else if (t_2 <= 1e+18) {
tmp = Math.log(t) + t_1;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = (t_1 - y) - z tmp = 0 if t_2 <= -5000000000.0: tmp = t_2 elif t_2 <= 1e+18: tmp = math.log(t) + t_1 else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(t_1 - y) - z) tmp = 0.0 if (t_2 <= -5000000000.0) tmp = t_2; elseif (t_2 <= 1e+18) tmp = Float64(log(t) + t_1); 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) - z; tmp = 0.0; if (t_2 <= -5000000000.0) tmp = t_2; elseif (t_2 <= 1e+18) tmp = log(t) + t_1; 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[(N[(t$95$1 - y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[t$95$2, -5000000000.0], t$95$2, If[LessEqual[t$95$2, 1e+18], N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(t\_1 - y\right) - z\\
\mathbf{if}\;t\_2 \leq -5000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 10^{+18}:\\
\;\;\;\;\log t + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -5e9Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.5%
if -5e9 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 1e18Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-+r+99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around 0 99.9%
if 1e18 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in x around inf 99.9%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y))) (if (<= t_2 -5000000000.0) (- t_2 z) (- (+ (log t) 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 <= -5000000000.0) {
tmp = t_2 - z;
} else {
tmp = (log(t) + 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 <= (-5000000000.0d0)) then
tmp = t_2 - z
else
tmp = (log(t) + 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 <= -5000000000.0) {
tmp = t_2 - z;
} else {
tmp = (Math.log(t) + 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 <= -5000000000.0: tmp = t_2 - z else: tmp = (math.log(t) + 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 <= -5000000000.0) tmp = Float64(t_2 - z); else tmp = Float64(Float64(log(t) + 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 <= -5000000000.0) tmp = t_2 - z; else tmp = (log(t) + 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, -5000000000.0], N[(t$95$2 - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -5000000000:\\
\;\;\;\;t\_2 - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t + t\_1\right) - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5e9Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.5%
if -5e9 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
Final simplification99.7%
(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
(let* ((t_1 (* x (log y))) (t_2 (- (- y) z)))
(if (<= x -1.1e+69)
t_1
(if (<= x -4.8e-201)
t_2
(if (<= x 1.35e-117) (- (log t) y) (if (<= x 1.5e+153) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = -y - z;
double tmp;
if (x <= -1.1e+69) {
tmp = t_1;
} else if (x <= -4.8e-201) {
tmp = t_2;
} else if (x <= 1.35e-117) {
tmp = log(t) - y;
} else if (x <= 1.5e+153) {
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 = -y - z
if (x <= (-1.1d+69)) then
tmp = t_1
else if (x <= (-4.8d-201)) then
tmp = t_2
else if (x <= 1.35d-117) then
tmp = log(t) - y
else if (x <= 1.5d+153) 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 = -y - z;
double tmp;
if (x <= -1.1e+69) {
tmp = t_1;
} else if (x <= -4.8e-201) {
tmp = t_2;
} else if (x <= 1.35e-117) {
tmp = Math.log(t) - y;
} else if (x <= 1.5e+153) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = -y - z tmp = 0 if x <= -1.1e+69: tmp = t_1 elif x <= -4.8e-201: tmp = t_2 elif x <= 1.35e-117: tmp = math.log(t) - y elif x <= 1.5e+153: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(-y) - z) tmp = 0.0 if (x <= -1.1e+69) tmp = t_1; elseif (x <= -4.8e-201) tmp = t_2; elseif (x <= 1.35e-117) tmp = Float64(log(t) - y); elseif (x <= 1.5e+153) 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 = -y - z; tmp = 0.0; if (x <= -1.1e+69) tmp = t_1; elseif (x <= -4.8e-201) tmp = t_2; elseif (x <= 1.35e-117) tmp = log(t) - y; elseif (x <= 1.5e+153) 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[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -1.1e+69], t$95$1, If[LessEqual[x, -4.8e-201], t$95$2, If[LessEqual[x, 1.35e-117], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.5e+153], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-201}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-117}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+153}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.1000000000000001e69 or 1.50000000000000009e153 < x Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.8%
sub-neg99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 91.4%
Taylor expanded in z around 0 76.4%
Taylor expanded in x around inf 76.4%
if -1.1000000000000001e69 < x < -4.80000000000000018e-201 or 1.35000000000000001e-117 < x < 1.50000000000000009e153Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 92.2%
Taylor expanded in x around 0 78.2%
neg-mul-178.2%
Simplified78.2%
if -4.80000000000000018e-201 < x < 1.35000000000000001e-117Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 82.5%
Final simplification78.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1700000.0) (not (<= x 7.8e-19))) (- (- (* x (log y)) y) z) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1700000.0) || !(x <= 7.8e-19)) {
tmp = ((x * log(y)) - y) - z;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1700000.0d0)) .or. (.not. (x <= 7.8d-19))) then
tmp = ((x * log(y)) - y) - z
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1700000.0) || !(x <= 7.8e-19)) {
tmp = ((x * Math.log(y)) - y) - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1700000.0) or not (x <= 7.8e-19): tmp = ((x * math.log(y)) - y) - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1700000.0) || !(x <= 7.8e-19)) tmp = Float64(Float64(Float64(x * log(y)) - y) - z); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1700000.0) || ~((x <= 7.8e-19))) tmp = ((x * log(y)) - y) - z; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1700000.0], N[Not[LessEqual[x, 7.8e-19]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $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 -1700000 \lor \neg \left(x \leq 7.8 \cdot 10^{-19}\right):\\
\;\;\;\;\left(x \cdot \log y - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.7e6 or 7.7999999999999999e-19 < x Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.3%
if -1.7e6 < x < 7.7999999999999999e-19Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.1e+69) (not (<= x 1.95e+153))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.1e+69) || !(x <= 1.95e+153)) {
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 <= (-1.1d+69)) .or. (.not. (x <= 1.95d+153))) 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 <= -1.1e+69) || !(x <= 1.95e+153)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.1e+69) or not (x <= 1.95e+153): 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 <= -1.1e+69) || !(x <= 1.95e+153)) 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 <= -1.1e+69) || ~((x <= 1.95e+153))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.1e+69], N[Not[LessEqual[x, 1.95e+153]], $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 -1.1 \cdot 10^{+69} \lor \neg \left(x \leq 1.95 \cdot 10^{+153}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.1000000000000001e69 or 1.94999999999999992e153 < x Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.8%
sub-neg99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 91.4%
Taylor expanded in z around 0 76.4%
Taylor expanded in x around inf 76.4%
if -1.1000000000000001e69 < x < 1.94999999999999992e153Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 90.3%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.8e+68) (not (<= x 2100.0))) (- (* x (log y)) z) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.8e+68) || !(x <= 2100.0)) {
tmp = (x * log(y)) - z;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-7.8d+68)) .or. (.not. (x <= 2100.0d0))) then
tmp = (x * log(y)) - z
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.8e+68) || !(x <= 2100.0)) {
tmp = (x * Math.log(y)) - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.8e+68) or not (x <= 2100.0): tmp = (x * math.log(y)) - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.8e+68) || !(x <= 2100.0)) tmp = Float64(Float64(x * log(y)) - z); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7.8e+68) || ~((x <= 2100.0))) tmp = (x * log(y)) - z; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.8e+68], N[Not[LessEqual[x, 2100.0]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $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^{+68} \lor \neg \left(x \leq 2100\right):\\
\;\;\;\;x \cdot \log y - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -7.80000000000000037e68 or 2100 < x Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.3%
Taylor expanded in x around inf 87.4%
if -7.80000000000000037e68 < x < 2100Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 97.3%
Final simplification92.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.26e+69) (not (<= x 2.45e+153))) (* x (log y)) (- (- y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.26e+69) || !(x <= 2.45e+153)) {
tmp = x * log(y);
} else {
tmp = -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 <= (-1.26d+69)) .or. (.not. (x <= 2.45d+153))) then
tmp = x * log(y)
else
tmp = -y - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.26e+69) || !(x <= 2.45e+153)) {
tmp = x * Math.log(y);
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.26e+69) or not (x <= 2.45e+153): tmp = x * math.log(y) else: tmp = -y - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.26e+69) || !(x <= 2.45e+153)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.26e+69) || ~((x <= 2.45e+153))) tmp = x * log(y); else tmp = -y - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.26e+69], N[Not[LessEqual[x, 2.45e+153]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-y) - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.26 \cdot 10^{+69} \lor \neg \left(x \leq 2.45 \cdot 10^{+153}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if x < -1.26000000000000005e69 or 2.45000000000000001e153 < x Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.8%
sub-neg99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 91.4%
Taylor expanded in z around 0 76.4%
Taylor expanded in x around inf 76.4%
if -1.26000000000000005e69 < x < 2.45000000000000001e153Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in z around inf 82.8%
Taylor expanded in x around 0 73.5%
neg-mul-173.5%
Simplified73.5%
Final simplification74.5%
(FPCore (x y z t) :precision binary64 (- (- y) z))
double code(double x, double y, double z, double t) {
return -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 = -y - z
end function
public static double code(double x, double y, double z, double t) {
return -y - z;
}
def code(x, y, z, t): return -y - z
function code(x, y, z, t) return Float64(Float64(-y) - z) end
function tmp = code(x, y, z, t) tmp = -y - z; end
code[x_, y_, z_, t_] := N[((-y) - z), $MachinePrecision]
\begin{array}{l}
\\
\left(-y\right) - z
\end{array}
Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 88.9%
Taylor expanded in x around 0 56.5%
neg-mul-156.5%
Simplified56.5%
Final simplification56.5%
(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.9%
Simplified99.9%
Taylor expanded in z around inf 29.4%
neg-mul-129.4%
Simplified29.4%
Final simplification29.4%
herbie shell --seed 2024039
(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)))