
(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+147)
t_2
(if (<= t_2 -2e-11) (- (- (log t) z) y) (- (+ (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 <= -1e+147) {
tmp = t_2;
} else if (t_2 <= -2e-11) {
tmp = (log(t) - z) - y;
} 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 <= (-1d+147)) then
tmp = t_2
else if (t_2 <= (-2d-11)) then
tmp = (log(t) - z) - y
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 <= -1e+147) {
tmp = t_2;
} else if (t_2 <= -2e-11) {
tmp = (Math.log(t) - z) - y;
} 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 <= -1e+147: tmp = t_2 elif t_2 <= -2e-11: tmp = (math.log(t) - z) - y 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 <= -1e+147) tmp = t_2; elseif (t_2 <= -2e-11) tmp = Float64(Float64(log(t) - z) - y); 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 <= -1e+147) tmp = t_2; elseif (t_2 <= -2e-11) tmp = (log(t) - z) - y; 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, -1e+147], t$95$2, If[LessEqual[t$95$2, -2e-11], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $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 -1 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-11}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t + t\_1\right) - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -9.9999999999999998e146Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 88.2%
if -9.9999999999999998e146 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999988e-11Initial program 99.8%
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 x around 0 87.0%
if -1.99999999999999988e-11 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
unsub-neg99.8%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 99.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* x (log y)) y))) (if (or (<= t_1 -1e+41) (not (<= t_1 5e-7))) t_1 (- (log t) z))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if ((t_1 <= -1e+41) || !(t_1 <= 5e-7)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - y
if ((t_1 <= (-1d+41)) .or. (.not. (t_1 <= 5d-7))) then
tmp = t_1
else
tmp = log(t) - 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)) - y;
double tmp;
if ((t_1 <= -1e+41) || !(t_1 <= 5e-7)) {
tmp = t_1;
} else {
tmp = Math.log(t) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if (t_1 <= -1e+41) or not (t_1 <= 5e-7): tmp = t_1 else: tmp = math.log(t) - z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if ((t_1 <= -1e+41) || !(t_1 <= 5e-7)) tmp = t_1; else tmp = Float64(log(t) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; tmp = 0.0; if ((t_1 <= -1e+41) || ~((t_1 <= 5e-7))) tmp = t_1; else tmp = log(t) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+41], N[Not[LessEqual[t$95$1, 5e-7]], $MachinePrecision]], t$95$1, N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+41} \lor \neg \left(t\_1 \leq 5 \cdot 10^{-7}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\log t - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.00000000000000001e41 or 4.99999999999999977e-7 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 83.8%
if -1.00000000000000001e41 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.99999999999999977e-7Initial 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 y around inf 75.3%
fma-define75.3%
log-rec75.3%
mul-1-neg75.3%
associate-/l*75.2%
mul-1-neg75.2%
Simplified75.2%
Taylor expanded in x around 0 74.1%
+-commutative74.1%
associate--r+74.1%
div-sub74.1%
Simplified74.1%
Taylor expanded in y around 0 90.2%
Final simplification85.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -1e+147)
t_2
(if (<= t_2 5e-32) (- (- (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+147) {
tmp = t_2;
} else if (t_2 <= 5e-32) {
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+147)) then
tmp = t_2
else if (t_2 <= 5d-32) 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+147) {
tmp = t_2;
} else if (t_2 <= 5e-32) {
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+147: tmp = t_2 elif t_2 <= 5e-32: 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+147) tmp = t_2; elseif (t_2 <= 5e-32) 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+147) tmp = t_2; elseif (t_2 <= 5e-32) 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+147], t$95$2, If[LessEqual[t$95$2, 5e-32], 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^{+147}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-32}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -9.9999999999999998e146Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 88.2%
if -9.9999999999999998e146 < (-.f64 (*.f64 x (log.f64 y)) y) < 5e-32Initial 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 x around 0 93.4%
if 5e-32 < (-.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 99.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y))) (if (<= t_2 -1e+41) t_2 (if (<= t_2 5e-32) (- (log t) z) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -1e+41) {
tmp = t_2;
} else if (t_2 <= 5e-32) {
tmp = log(t) - z;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-1d+41)) then
tmp = t_2
else if (t_2 <= 5d-32) then
tmp = log(t) - z
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -1e+41) {
tmp = t_2;
} else if (t_2 <= 5e-32) {
tmp = Math.log(t) - z;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -1e+41: tmp = t_2 elif t_2 <= 5e-32: tmp = math.log(t) - z else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -1e+41) tmp = t_2; elseif (t_2 <= 5e-32) tmp = Float64(log(t) - z); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -1e+41) tmp = t_2; elseif (t_2 <= 5e-32) tmp = log(t) - z; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+41], t$95$2, If[LessEqual[t$95$2, 5e-32], N[(N[Log[t], $MachinePrecision] - z), $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^{+41}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-32}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.00000000000000001e41Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 83.9%
if -1.00000000000000001e41 < (-.f64 (*.f64 x (log.f64 y)) y) < 5e-32Initial 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 y around inf 78.1%
fma-define78.1%
log-rec78.1%
mul-1-neg78.1%
associate-/l*78.1%
mul-1-neg78.1%
Simplified78.1%
Taylor expanded in x around 0 76.9%
+-commutative76.9%
associate--r+76.9%
div-sub77.0%
Simplified77.0%
Taylor expanded in y around 0 89.8%
if 5e-32 < (-.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 99.2%
(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(x * log(y)) - Float64(y + Float64(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[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + N[(z - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \log y - \left(y + \left(z - \log t\right)\right)
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
(FPCore (x y z t) :precision binary64 (- (log t) (+ z (- y (* x (log y))))))
double code(double x, double y, double z, double t) {
return log(t) - (z + (y - (x * log(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 = log(t) - (z + (y - (x * log(y))))
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) - (z + (y - (x * Math.log(y))));
}
def code(x, y, z, t): return math.log(t) - (z + (y - (x * math.log(y))))
function code(x, y, z, t) return Float64(log(t) - Float64(z + Float64(y - Float64(x * log(y))))) end
function tmp = code(x, y, z, t) tmp = log(t) - (z + (y - (x * log(y)))); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] - N[(z + N[(y - N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t - \left(z + \left(y - x \cdot \log y\right)\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1.7e+17)
t_1
(if (<= x 9.5e-45)
(- (log t) z)
(if (<= x 2.6e+138) (* x (* z (- (/ -1.0 x) (/ y (* x z))))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.7e+17) {
tmp = t_1;
} else if (x <= 9.5e-45) {
tmp = log(t) - z;
} else if (x <= 2.6e+138) {
tmp = x * (z * ((-1.0 / x) - (y / (x * 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 <= (-1.7d+17)) then
tmp = t_1
else if (x <= 9.5d-45) then
tmp = log(t) - z
else if (x <= 2.6d+138) then
tmp = x * (z * (((-1.0d0) / x) - (y / (x * 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 <= -1.7e+17) {
tmp = t_1;
} else if (x <= 9.5e-45) {
tmp = Math.log(t) - z;
} else if (x <= 2.6e+138) {
tmp = x * (z * ((-1.0 / x) - (y / (x * z))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.7e+17: tmp = t_1 elif x <= 9.5e-45: tmp = math.log(t) - z elif x <= 2.6e+138: tmp = x * (z * ((-1.0 / x) - (y / (x * z)))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.7e+17) tmp = t_1; elseif (x <= 9.5e-45) tmp = Float64(log(t) - z); elseif (x <= 2.6e+138) tmp = Float64(x * Float64(z * Float64(Float64(-1.0 / x) - Float64(y / Float64(x * 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 <= -1.7e+17) tmp = t_1; elseif (x <= 9.5e-45) tmp = log(t) - z; elseif (x <= 2.6e+138) tmp = x * (z * ((-1.0 / x) - (y / (x * 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, -1.7e+17], t$95$1, If[LessEqual[x, 9.5e-45], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 2.6e+138], N[(x * N[(z * N[(N[(-1.0 / x), $MachinePrecision] - N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-45}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+138}:\\
\;\;\;\;x \cdot \left(z \cdot \left(\frac{-1}{x} - \frac{y}{x \cdot z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.7e17 or 2.6000000000000001e138 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
add-cube-cbrt98.6%
fmm-def98.6%
pow298.6%
Applied egg-rr98.6%
Taylor expanded in x around inf 65.0%
if -1.7e17 < x < 9.5000000000000002e-45Initial 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 y around inf 85.1%
fma-define85.1%
log-rec85.1%
mul-1-neg85.1%
associate-/l*85.1%
mul-1-neg85.1%
Simplified85.1%
Taylor expanded in x around 0 84.3%
+-commutative84.3%
associate--r+84.3%
div-sub84.4%
Simplified84.4%
Taylor expanded in y around 0 63.0%
if 9.5000000000000002e-45 < x < 2.6000000000000001e138Initial 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 x around inf 97.2%
associate--l+97.2%
+-commutative97.2%
associate--r+97.2%
div-sub97.2%
div-sub97.2%
associate--l-97.2%
+-commutative97.2%
associate--r+97.2%
Simplified97.2%
Taylor expanded in z around -inf 88.9%
mul-1-neg88.9%
*-commutative88.9%
distribute-rgt-neg-in88.9%
+-commutative88.9%
mul-1-neg88.9%
unsub-neg88.9%
associate--l+88.9%
div-sub88.9%
Simplified88.9%
Taylor expanded in y around inf 64.0%
associate-*r/64.0%
mul-1-neg64.0%
*-commutative64.0%
Simplified64.0%
Final simplification64.0%
(FPCore (x y z t) :precision binary64 (if (<= y 4.8e+70) (* x (log y)) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.8e+70) {
tmp = x * log(y);
} 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.8d+70) then
tmp = x * log(y)
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.8e+70) {
tmp = x * Math.log(y);
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4.8e+70: tmp = x * math.log(y) else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4.8e+70) tmp = Float64(x * log(y)); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 4.8e+70) tmp = x * log(y); else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4.8e+70], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{+70}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 4.79999999999999974e70Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
add-cube-cbrt99.1%
fmm-def99.1%
pow299.1%
Applied egg-rr99.1%
Taylor expanded in x around inf 43.8%
if 4.79999999999999974e70 < y Initial 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 y around inf 70.3%
neg-mul-170.3%
Simplified70.3%
(FPCore (x y z t) :precision binary64 (if (<= y 2.4e+51) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.4e+51) {
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 <= 2.4d+51) 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 <= 2.4e+51) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.4e+51: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.4e+51) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.4e+51) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.4e+51], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{+51}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.3999999999999999e51Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
unsub-neg99.8%
fma-undefine99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 34.0%
neg-mul-134.0%
Simplified34.0%
if 2.3999999999999999e51 < y Initial 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 y around inf 68.9%
neg-mul-168.9%
Simplified68.9%
(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%
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 y around inf 30.2%
neg-mul-130.2%
Simplified30.2%
(FPCore (x y z t) :precision binary64 z)
double code(double x, double y, double z, double t) {
return z;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = z
end function
public static double code(double x, double y, double z, double t) {
return z;
}
def code(x, y, z, t): return z
function code(x, y, z, t) return 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%
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 y around inf 76.3%
fma-define76.3%
log-rec76.3%
mul-1-neg76.3%
associate-/l*76.3%
mul-1-neg76.3%
Simplified76.3%
Taylor expanded in z around inf 17.5%
associate-*r/17.5%
neg-mul-117.5%
Simplified17.5%
clear-num17.4%
inv-pow17.4%
add-sqr-sqrt8.3%
sqrt-unprod4.6%
sqr-neg4.6%
sqrt-unprod0.9%
add-sqr-sqrt2.2%
Applied egg-rr2.2%
unpow-12.2%
Simplified2.2%
Taylor expanded in y around 0 2.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%
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 y around inf 30.2%
neg-mul-130.2%
Simplified30.2%
add-sqr-sqrt0.0%
sqrt-unprod2.1%
sqr-neg2.1%
sqrt-unprod2.2%
add-sqr-sqrt2.2%
*-un-lft-identity2.2%
Applied egg-rr2.2%
*-lft-identity2.2%
Simplified2.2%
herbie shell --seed 2024170
(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)))