
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Initial program 99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -5e+206)
t_2
(if (<= t_2 1e-12) (- (log t) (+ y 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 <= -5e+206) {
tmp = t_2;
} else if (t_2 <= 1e-12) {
tmp = log(t) - (y + 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 <= (-5d+206)) then
tmp = t_2
else if (t_2 <= 1d-12) then
tmp = log(t) - (y + 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 <= -5e+206) {
tmp = t_2;
} else if (t_2 <= 1e-12) {
tmp = Math.log(t) - (y + 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 <= -5e+206: tmp = t_2 elif t_2 <= 1e-12: tmp = math.log(t) - (y + 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 <= -5e+206) tmp = t_2; elseif (t_2 <= 1e-12) tmp = Float64(log(t) - Float64(y + 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 <= -5e+206) tmp = t_2; elseif (t_2 <= 1e-12) tmp = log(t) - (y + 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, -5e+206], t$95$2, If[LessEqual[t$95$2, 1e-12], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $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 -5 \cdot 10^{+206}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 10^{-12}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.0000000000000002e206Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 89.2%
if -5.0000000000000002e206 < (-.f64 (*.f64 x (log.f64 y)) y) < 9.9999999999999998e-13Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 87.5%
if 9.9999999999999998e-13 < (-.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.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (* z (- -1.0 (/ y z)))))
(if (<= x -2.55e+171)
t_1
(if (<= x -2.6)
t_2
(if (<= x 6e-76) (- (log t) z) (if (<= x 1.5e+83) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = z * (-1.0 - (y / z));
double tmp;
if (x <= -2.55e+171) {
tmp = t_1;
} else if (x <= -2.6) {
tmp = t_2;
} else if (x <= 6e-76) {
tmp = log(t) - z;
} else if (x <= 1.5e+83) {
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 = z * ((-1.0d0) - (y / z))
if (x <= (-2.55d+171)) then
tmp = t_1
else if (x <= (-2.6d0)) then
tmp = t_2
else if (x <= 6d-76) then
tmp = log(t) - z
else if (x <= 1.5d+83) 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 = z * (-1.0 - (y / z));
double tmp;
if (x <= -2.55e+171) {
tmp = t_1;
} else if (x <= -2.6) {
tmp = t_2;
} else if (x <= 6e-76) {
tmp = Math.log(t) - z;
} else if (x <= 1.5e+83) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = z * (-1.0 - (y / z)) tmp = 0 if x <= -2.55e+171: tmp = t_1 elif x <= -2.6: tmp = t_2 elif x <= 6e-76: tmp = math.log(t) - z elif x <= 1.5e+83: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(z * Float64(-1.0 - Float64(y / z))) tmp = 0.0 if (x <= -2.55e+171) tmp = t_1; elseif (x <= -2.6) tmp = t_2; elseif (x <= 6e-76) tmp = Float64(log(t) - z); elseif (x <= 1.5e+83) 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 = z * (-1.0 - (y / z)); tmp = 0.0; if (x <= -2.55e+171) tmp = t_1; elseif (x <= -2.6) tmp = t_2; elseif (x <= 6e-76) tmp = log(t) - z; elseif (x <= 1.5e+83) 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[(z * N[(-1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.55e+171], t$95$1, If[LessEqual[x, -2.6], t$95$2, If[LessEqual[x, 6e-76], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 1.5e+83], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := z \cdot \left(-1 - \frac{y}{z}\right)\\
\mathbf{if}\;x \leq -2.55 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.6:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-76}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+83}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.55000000000000011e171 or 1.5e83 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
*-commutative99.8%
add-cube-cbrt98.8%
associate-*l*98.7%
fma-neg98.7%
pow298.7%
associate-+r-98.7%
Applied egg-rr98.7%
Taylor expanded in x around inf 68.9%
*-commutative68.9%
Simplified68.9%
if -2.55000000000000011e171 < x < -2.60000000000000009 or 6.00000000000000048e-76 < x < 1.5e83Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 85.2%
Taylor expanded in z around -inf 85.2%
Simplified74.8%
Taylor expanded in y around inf 63.9%
mul-1-neg63.9%
distribute-neg-frac263.9%
Simplified63.9%
if -2.60000000000000009 < x < 6.00000000000000048e-76Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in y around 0 76.2%
Taylor expanded in x around 0 76.2%
Final simplification70.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -12500.0) (not (<= x 1.1e-9))) (* x (- (log y) (+ (/ y x) (/ z x)))) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -12500.0) || !(x <= 1.1e-9)) {
tmp = x * (log(y) - ((y / x) + (z / x)));
} 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 <= (-12500.0d0)) .or. (.not. (x <= 1.1d-9))) then
tmp = x * (log(y) - ((y / x) + (z / x)))
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 <= -12500.0) || !(x <= 1.1e-9)) {
tmp = x * (Math.log(y) - ((y / x) + (z / x)));
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -12500.0) or not (x <= 1.1e-9): tmp = x * (math.log(y) - ((y / x) + (z / x))) else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -12500.0) || !(x <= 1.1e-9)) tmp = Float64(x * Float64(log(y) - Float64(Float64(y / x) + Float64(z / x)))); 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 <= -12500.0) || ~((x <= 1.1e-9))) tmp = x * (log(y) - ((y / x) + (z / x))); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -12500.0], N[Not[LessEqual[x, 1.1e-9]], $MachinePrecision]], N[(x * N[(N[Log[y], $MachinePrecision] - N[(N[(y / x), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -12500 \lor \neg \left(x \leq 1.1 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot \left(\log y - \left(\frac{y}{x} + \frac{z}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -12500 or 1.0999999999999999e-9 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in x around inf 99.6%
Taylor expanded in x around inf 98.7%
if -12500 < x < 1.0999999999999999e-9Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 99.8%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7e+120) (not (<= x 1.05e-5))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7e+120) || !(x <= 1.05e-5)) {
tmp = (x * log(y)) - 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 <= (-7d+120)) .or. (.not. (x <= 1.05d-5))) then
tmp = (x * log(y)) - 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 <= -7e+120) || !(x <= 1.05e-5)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7e+120) or not (x <= 1.05e-5): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7e+120) || !(x <= 1.05e-5)) tmp = Float64(Float64(x * log(y)) - 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 <= -7e+120) || ~((x <= 1.05e-5))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7e+120], N[Not[LessEqual[x, 1.05e-5]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+120} \lor \neg \left(x \leq 1.05 \cdot 10^{-5}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -7.00000000000000015e120 or 1.04999999999999994e-5 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 79.8%
if -7.00000000000000015e120 < x < 1.04999999999999994e-5Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 94.5%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.8e+174) (not (<= x 2.15e+83))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.8e+174) || !(x <= 2.15e+83)) {
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 <= (-5.8d+174)) .or. (.not. (x <= 2.15d+83))) 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 <= -5.8e+174) || !(x <= 2.15e+83)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.8e+174) or not (x <= 2.15e+83): 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 <= -5.8e+174) || !(x <= 2.15e+83)) 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 <= -5.8e+174) || ~((x <= 2.15e+83))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.8e+174], N[Not[LessEqual[x, 2.15e+83]], $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 -5.8 \cdot 10^{+174} \lor \neg \left(x \leq 2.15 \cdot 10^{+83}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -5.7999999999999999e174 or 2.15e83 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
*-commutative99.8%
add-cube-cbrt98.8%
associate-*l*98.7%
fma-neg98.7%
pow298.7%
associate-+r-98.7%
Applied egg-rr98.7%
Taylor expanded in x around inf 70.3%
*-commutative70.3%
Simplified70.3%
if -5.7999999999999999e174 < x < 2.15e83Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 89.2%
Final simplification83.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.55e+171) (not (<= x 1.05e+82))) (* x (log y)) (* z (- -1.0 (/ y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.55e+171) || !(x <= 1.05e+82)) {
tmp = x * log(y);
} else {
tmp = z * (-1.0 - (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 <= (-2.55d+171)) .or. (.not. (x <= 1.05d+82))) then
tmp = x * log(y)
else
tmp = z * ((-1.0d0) - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.55e+171) || !(x <= 1.05e+82)) {
tmp = x * Math.log(y);
} else {
tmp = z * (-1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.55e+171) or not (x <= 1.05e+82): tmp = x * math.log(y) else: tmp = z * (-1.0 - (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.55e+171) || !(x <= 1.05e+82)) tmp = Float64(x * log(y)); else tmp = Float64(z * Float64(-1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.55e+171) || ~((x <= 1.05e+82))) tmp = x * log(y); else tmp = z * (-1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.55e+171], N[Not[LessEqual[x, 1.05e+82]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(z * N[(-1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{+171} \lor \neg \left(x \leq 1.05 \cdot 10^{+82}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if x < -2.55000000000000011e171 or 1.05e82 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
*-commutative99.8%
add-cube-cbrt98.8%
associate-*l*98.7%
fma-neg98.7%
pow298.7%
associate-+r-98.7%
Applied egg-rr98.7%
Taylor expanded in x around inf 68.9%
*-commutative68.9%
Simplified68.9%
if -2.55000000000000011e171 < x < 1.05e82Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 84.6%
Taylor expanded in z around -inf 88.6%
Simplified77.6%
Taylor expanded in y around inf 63.9%
mul-1-neg63.9%
distribute-neg-frac263.9%
Simplified63.9%
Final simplification65.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.8e-59) (not (<= z 7.8e-60))) (* z (- -1.0 (/ y z))) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.8e-59) || !(z <= 7.8e-60)) {
tmp = z * (-1.0 - (y / 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.8d-59)) .or. (.not. (z <= 7.8d-60))) then
tmp = z * ((-1.0d0) - (y / 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.8e-59) || !(z <= 7.8e-60)) {
tmp = z * (-1.0 - (y / z));
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.8e-59) or not (z <= 7.8e-60): tmp = z * (-1.0 - (y / z)) else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.8e-59) || !(z <= 7.8e-60)) tmp = Float64(z * Float64(-1.0 - Float64(y / z))); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.8e-59) || ~((z <= 7.8e-60))) tmp = z * (-1.0 - (y / z)); else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.8e-59], N[Not[LessEqual[z, 7.8e-60]], $MachinePrecision]], N[(z * N[(-1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-59} \lor \neg \left(z \leq 7.8 \cdot 10^{-60}\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -2.79999999999999981e-59 or 7.8000000000000004e-60 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 70.6%
Taylor expanded in z around -inf 84.2%
Simplified84.2%
Taylor expanded in y around inf 68.1%
mul-1-neg68.1%
distribute-neg-frac268.1%
Simplified68.1%
if -2.79999999999999981e-59 < z < 7.8000000000000004e-60Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 35.8%
mul-1-neg35.8%
Simplified35.8%
Final simplification57.0%
(FPCore (x y z t) :precision binary64 (if (<= y 2.42e+64) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.42e+64) {
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.42d+64) 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.42e+64) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.42e+64: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.42e+64) 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.42e+64) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.42e+64], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.42 \cdot 10^{+64}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.41999999999999993e64Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 45.5%
mul-1-neg45.5%
Simplified45.5%
if 2.41999999999999993e64 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 58.5%
mul-1-neg58.5%
Simplified58.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 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%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 23.2%
mul-1-neg23.2%
Simplified23.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%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 78.4%
Taylor expanded in z around inf 24.0%
associate-*r/24.0%
mul-1-neg24.0%
Simplified24.0%
clear-num24.0%
un-div-inv25.4%
add-sqr-sqrt12.8%
sqrt-unprod7.8%
sqr-neg7.8%
sqrt-unprod1.0%
add-sqr-sqrt2.1%
Applied egg-rr2.1%
associate-/r/2.2%
*-inverses2.2%
*-lft-identity2.2%
Simplified2.2%
herbie shell --seed 2024087
(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)))